=== Logicrays AI Form Builder ===
Contributors: logicrays, priteshm
Tags: form builder, contact form, registration form, quiz form, survey
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate forms using AI-assisted prompts and manage submissions from the WordPress dashboard.

== Description ==

Logicrays AI Form Builder transforms the way you create forms in WordPress. Using advanced AI technology, the plugin automatically generates fully functional forms based on simple text prompts, helping you save time and improve productivity.

Create contact forms, registration forms, feedback forms, support forms, surveys, and more within seconds using AI-powered generation.

= Key Features =

* **AI-Powered Form Generation**: Automatically create forms using AI prompts
* **Dynamic Form Fields**: Supports text, email, textarea, dropdown, checkbox, radio, file upload, and more
* **Shortcode Support**: Easily embed forms anywhere using generated shortcodes
* **Email Notifications**: Send admin notifications and user confirmation emails
* **Database Entry Storage**: Save all form submissions securely in WordPress database
* **Validation Support**: Field validation rules for accurate form submissions
* **AJAX Form Submission**: Smooth submission without page reload
* **Responsive Design**: Fully optimized for desktop, tablet, and mobile devices
* **Custom Thank You Messages**: Display success messages after submission
* **reCAPTCHA Support**: Spam protection for secure submissions

= Supported Form Fields =

* Text Input
* Email Field
* Phone Number
* Textarea
* Dropdown Select
* Radio Buttons
* Checkboxes
* File Upload
* Date Picker
* Number Field
* Password Field
* URL Field

= Use Cases =

* **Contact Forms**: Simple website inquiry forms
* **Registration Forms**: User signup and registration forms
* **Feedback Forms**: Customer feedback collection
* **Support Forms**: Helpdesk and support requests
* **Survey Forms**: Collect opinions and responses
* **Lead Generation Forms**: Capture customer information
* **Job Application Forms**: Resume and candidate submissions
* **Booking Forms**: Appointment and reservation requests

= Easy Integration =

Simply generate a form using AI and place the generated shortcode into any page or post.

Example shortcode:

`[lraifb_form id="123"]`

The form will automatically render on the frontend with validation and submission handling.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/logicrays-ai-form-builder` directory, or install the plugin through the WordPress admin screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to 'Logicrays AI Form Builder' in the WordPress admin menu.
4. Create a form using AI prompts.
5. Copy the generated shortcode and place it in any page or post.

== External Services ==

This plugin relies on external/third-party services to provide form generation and spam protection features.

**1. WordPress AI Client (AI Form Generation)**
* **Service Name:** WordPress AI Client
* **What the service is and what it is used for:** This plugin uses the WordPress AI Client (a native WordPress feature) to generate form structures based on text prompts entered by the administrator. The WordPress AI Client routes the request to whichever AI provider the site administrator has configured under Settings > Connectors (e.g., Google Gemini, OpenAI, Anthropic, or another supported provider). This plugin does not call any AI provider directly and does not manage or store API keys for these providers.
* **What data is sent and when:** When the administrator clicks "Generate Form", only the text prompt entered (e.g., "Job application form") is passed to the WordPress AI Client, which forwards it to the configured provider. No other form or site data is transmitted.
* **Terms of Service & Privacy Policy:** Because the actual AI provider is chosen and configured by the site administrator (not by this plugin), the applicable terms and privacy policy depend on that provider. Administrators should review the terms of whichever provider they configure under Settings > Connectors. For reference, commonly configured providers include:
  * Google Gemini: [Terms of Service](https://policies.google.com/terms) | [Privacy Policy](https://policies.google.com/privacy)
  * OpenAI: [Terms of Service](https://openai.com/policies/terms-of-use) | [Privacy Policy](https://openai.com/policies/privacy-policy)
  * (or whichever provider is configured on the site)

**2. Google reCAPTCHA (Spam Protection)**
* **Service Name:** Google reCAPTCHA
* **What the service is and what it is used for:** This service is used to protect forms from spam submissions and automated abuse.
* **What data is sent and when:**
  * When a visitor views a form with reCAPTCHA enabled, the reCAPTCHA widget script is loaded from `https://www.google.com/recaptcha/api.js`.
  * When a visitor submits the form, their browser-generated CAPTCHA challenge response token and IP address are sent to `https://www.google.com/recaptcha/api/siteverify` to verify the submission is not spam.
* **Terms of Service & Privacy Policy:**
  * This service is provided by Google.
  * Google Terms of Service: [Terms of Service](https://policies.google.com/terms)
  * Google Privacy Policy: [Privacy Policy](https://policies.google.com/privacy)

== Frequently Asked Questions ==

= How do I generate a form using AI? =
Navigate to the Logicrays AI Form Builder menu in your WordPress admin dashboard, type a description of the form you want to create (e.g., "Job application form with a resume upload field and phone number") in the prompt input field, and click "Generate Form". The plugin will automatically construct the form structure and provide a shortcode.

= Do I need an API key to use this plugin? =
No, you do not need to enter an API key directly in this plugin. This plugin utilizes the native WordPress AI Client. You only need to configure an AI provider at the site level by navigating to Settings > Connectors in your WordPress admin menu.

= Where are the form submissions stored? =
All form submissions are stored securely in your local WordPress database in a custom table (`wp_lraifb_entries`). You can view, manage, and filter all entries in your WordPress admin panel under Logicrays AI Form Builder > All Form Entries, and export them directly to CSV.

= Does the plugin support file uploads and validation? =
Yes! When generating a form with AI, you can ask for file upload fields (e.g., for PDF or DOCX files). The plugin also supports specific field types like date selectors, phone numbers, and emails with built-in validation rules (e.g., min/max character lengths, custom validation patterns).

= How do I protect my forms from spam submissions? =
Logicrays AI Form Builder includes built-in Google reCAPTCHA protection. To set it up, get your Site Key and Secret Key from the Google reCAPTCHA admin console, enter them in Logicrays AI Form Builder > Settings, and toggle the reCAPTCHA option for any form.

== Screenshots ==

1. Logicrays AI Form Builder dashboard
2. Logicrays AI Form Builder generation interface
3. Generated form preview
4. Frontend contact form display
5. Form entries list in admin panel
6. Email notification settings
7. Form field configuration panel

== Changelog ==

= 1.0.3 =
* Updated external/third-party services documentation under the "External Services" section to comply with WordPress.org guidelines, adding detailed descriptions of what is sent, when, and direct links to terms of service and privacy policies.
* Bumped plugin version to 1.0.3.

= 1.0.2 =
* Removed leftover Google Gemini-specific options and database cleanup tasks on plugin uninstall/deactivation
* Removed unused Gemini sanitization helper methods from the admin panel class
* Renamed internal AI settings section and callbacks to use generic AI terms instead of provider-specific names
* Bumped plugin version and updated POT translation template to 1.0.2

= 1.0.1 =
* Renamed plugin (display name, slug, and text domain) from "FormLogic" to "Logicrays AI Form Builder" to avoid trademark/naming confusion
* Prefixed all function names, classes, globals, hooks, shortcodes, and stored option/meta keys with `lraifb_` / `LRAIFB_` to prevent naming collisions
* Improved sanitization of posted form field data, including nested field option arrays, before saving
* Removed unnecessary `load_plugin_textdomain()` call (WordPress.org loads translations automatically since 4.6)
* Removed inline `<style>` output in favor of properly enqueued styles
* Fixed plugin version constant to match the plugin header version

= 1.0.0 =
* Initial release
* AI-powered form generation
* Dynamic form fields support
* Shortcode functionality
* Email notifications
* Database entry storage
* AJAX form submission
* Validation support
* Responsive frontend design
* reCAPTCHA integration

== Upgrade Notice ==

= 1.0.0 =
Initial release of Logicrays AI Form Builder.

== Privacy & Security ==

* API keys are stored securely in the WordPress database
* Form submission data is stored locally in your WordPress database
* No user submission data is shared with third parties except selected AI providers
* Supports secure AJAX requests with nonce validation
* GDPR-friendly data handling
* Spam protection with reCAPTCHA support

== Credits ==

Developed by Logicrays - Your trusted WordPress development partner.

== License ==

This plugin is licensed under the GPL v2 or later.

== Technical Requirements ==

* WordPress 7.0 or higher
* PHP 7.4 or higher
* MySQL 5.6 or higher
* Modern web browser
* HTTPS recommended for API requests