=== LogicDigger AI Feedback Assistant for WooCommerce ===
Contributors: logicdigger
Tags: woocommerce, feedback, ai, customer survey, email
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires Plugins: woocommerce

Collect post-purchase customer feedback via AI chat and customizable forms. AI summarizes responses in a WooCommerce admin dashboard.

== Description ==

**LogicDigger AI Feedback Assistant for WooCommerce** helps store owners collect meaningful customer feedback after purchase and turn it into actionable insights.

After an order is completed, the plugin can email customers a secure feedback link. Customers respond through:

* **AI Chat** — a guided conversation powered by your chosen AI provider
* **Quick Form** — a customizable star-rating and field-based form

All responses are summarized with sentiment, rating, tags, and insights in **WooCommerce → LogicDigger AI Feedback**.

= Features =

* Post-purchase email outreach with configurable delay
* AI chat and quick form feedback channels
* OpenAI, Anthropic, or custom OpenAI-compatible API support
* Encrypted API key storage
* Admin dashboard with response rate, sentiment, and ratings
* CSV export
* Product-aware AI prompts (digital vs physical)
* HPOS (Custom Order Tables) compatible
* Configurable data retention and uninstall cleanup

= Setup =

1. Install and activate the plugin (WooCommerce required).
2. Create two WordPress pages and add the shortcodes `[ldafaw_chat]` and `[ldafaw_form]`.
3. Select those pages under **WooCommerce → LogicDigger AI Feedback Settings → Pages**.
4. Configure your AI provider API key and test the connection.
5. Complete a test order to verify the email and feedback flow.

= External Services =

This plugin sends customer feedback data to third-party AI services **only when configured by the site administrator** and **only to process feedback summaries and chat replies**.

Depending on your settings, data may be sent to:

* **OpenAI** — [Terms](https://openai.com/policies/terms-of-use) | [Privacy Policy](https://openai.com/policies/privacy-policy)
* **Anthropic** — [Terms](https://www.anthropic.com/legal/terms) | [Privacy Policy](https://www.anthropic.com/privacy)
* **Custom OpenAI-compatible API** — your configured endpoint (e.g. Azure OpenAI, Groq, local LLM gateway)

Data that may be transmitted includes customer feedback text, product names from the order, order status context, and optional form field values. API keys are stored encrypted on your server.

**You are responsible for:**

* Obtaining your own API keys and complying with provider terms
* Updating your store privacy policy to disclose AI processing of customer feedback
* Ensuring your use complies with applicable privacy laws (GDPR, CCPA, etc.)

The plugin does not include AI services — it connects to services you configure.

== Installation ==

1. Upload the `logicdigger-ai-feedback-assistant-for-woocommerce` folder to `/wp-content/plugins/` or install via the WordPress plugins screen.
2. Activate **LogicDigger AI Feedback Assistant for WooCommerce**.
3. Go to **WooCommerce → LogicDigger AI Feedback Settings**.
4. Configure your AI provider, pages, and email settings.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes. WooCommerce must be installed and active.

= Do I need an AI API key? =

Yes. You must supply your own OpenAI, Anthropic, or compatible API key. The plugin does not include bundled AI access.

= What shortcodes should I use? =

* `[ldafaw_chat]` — AI chat feedback page
* `[ldafaw_form]` — quick feedback form page

Email links append a secure token parameter automatically.

= Is customer data sent to third parties? =

Yes, when AI features are enabled, feedback content is sent to the AI provider you configure so the plugin can generate chat replies and summaries. See the External Services section above.

= Can I delete plugin data on uninstall? =

Yes. Enable **Delete all plugin data when the plugin is uninstalled** under **Privacy & Data** settings before uninstalling.

== Screenshots ==

1. Feedback dashboard with response rate, sentiment, and recent submissions
2. AI Setup — choose OpenAI, Anthropic, or a custom OpenAI-compatible API
3. Feedback Pages — map chat, form, and thank-you pages with shortcodes
4. Email templates — pick a style and brand color for outreach emails
5. Live email preview with refresh and send-test actions
6. Feedback Channels — enable AI Chat and Quick Form, set max chat turns
7. Quick Form builder — fields, widths, required rules, and preview
8. AI Chat questions — openers and topics by order status
9. Privacy & Data — notice text, retention period, and uninstall cleanup

== Changelog ==

= 1.1.3 =
* Form and chat submissions no longer fail when the AI summary request errors
* Fallback summary is saved from the customer's raw feedback when AI is unavailable

= 1.1.2 =
* Hardened nonce, capability, and input sanitization for WordPress.org review
* Signed email star-rating links and centralized public GET handling

= 1.1.1 =
* Updated plugin slug and text domain for WordPress.org

= 1.1.0 =
* Initial WordPress.org release
* AI chat and quick form feedback channels
* OpenAI, Anthropic, and custom API support
* Admin dashboard, CSV export, and email templates
* Data retention cleanup and uninstall data deletion option

== Upgrade Notice ==

= 1.1.1 =
Updated plugin slug and text domain

= 1.1.0 =
Initial release. Requires WooCommerce and a configured AI API key.
