=== AI Salesman Chat Pro ===
Contributors: winalttechnologies
Tags: ai chatbot, woocommerce, shopping assistant, product search, sales
Requires at least: 6.0
Tested up to: 6.9
Stable tag: 1.0.0
Requires PHP: 7.4
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered shopping assistant chatbot for WooCommerce that helps customers find products, answers questions, and boosts your sales.

== Description ==

**AI Salesman Chat Pro** adds a beautiful, fast AI-powered chat widget to your WooCommerce store. The intelligent assistant helps customers browse your catalogue, answers common questions about shipping and returns, and — when a product is out of stock — can suggest relevant Amazon affiliate alternatives to keep the sale within reach.

= Key Features =

* **Dual AI Modes** — Use your own API key from Groq (free, fastest), OpenAI GPT-4, Anthropic Claude, or Google Gemini for full conversational AI. No API key? The built-in *Basic AI* mode works entirely on your server with zero external calls.
* **Smart Product Search** — Semantic search across your WooCommerce catalogue with intent detection, so shoppers find what they mean, not just what they type.
* **Conversation Memory** — The assistant remembers context within a session so follow-up questions ("which one comes in blue?") work naturally.
* **Amazon Affiliate Fallback** — When a product is unavailable, optionally surface an Amazon affiliate link so you still earn a commission.
* **Lead Capture** — If the Amazon fallback is disabled, the chat can collect the customer's name and email as a product-interest lead.
* **Analytics Dashboard** — Track chat opens, messages, product clicks, cart visits, checkout visits, and revenue attribution — all from a single admin screen.
* **Weekly Email Reports** — Get an automated weekly summary of your chat analytics delivered to your inbox.
* **Fully Brandable** — Customise colours, fonts, icons, welcome message, and header text to match your store.
* **Mobile-Optimised** — Designed for a smooth experience on all screen sizes.
* **Privacy Friendly** — Tracking is opt-in and disabled by default. All data is stored in your own database.

= Requirements =

* WordPress 6.0 or later
* WooCommerce 7.0 or later (must be installed and active)
* PHP 7.4 or later
* An API key from Groq, OpenAI, Anthropic, or Google (optional — Basic AI mode requires no key)

== Installation ==

1. Upload the `ai-salesman-chat-pro` folder to `/wp-content/plugins/`, or install via the WordPress Plugins screen directly.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Make sure **WooCommerce** is installed and active — this plugin requires it.
4. Navigate to **AI Salesman** in the WordPress admin sidebar.
5. On the **Settings** tab, choose your preferred AI provider and enter your API key (or leave blank to use Basic AI mode).
6. Optionally enter your Amazon Associate tag if you want the affiliate fallback feature.
7. Customise the chat appearance on the **Branding** tab.
8. The chat widget will now appear on the front end of your store for all visitors.

= Getting a Free API Key =

* **Groq** (recommended — fast and free): [console.groq.com](https://console.groq.com)
* **OpenAI**: [platform.openai.com](https://platform.openai.com)
* **Anthropic Claude**: [console.anthropic.com](https://console.anthropic.com)
* **Google Gemini**: [aistudio.google.com](https://aistudio.google.com)

== Frequently Asked Questions ==

= Do I need an AI API key? =

No. The plugin ships with a **Basic AI** mode that runs entirely on your server using WooCommerce product data and a customisable knowledge base. You only need an API key if you want the full conversational AI experience.

= Which AI provider do you recommend? =

Groq is recommended for most stores. It is free to use, extremely fast, and supports the Llama 3 family of models. OpenAI GPT-4 gives the most natural conversations but has usage costs.

= Does the plugin store customer messages? =

Conversation messages are processed in memory and not stored permanently. Session context (used for follow-up questions) is stored temporarily in your database and associated only with an anonymous session ID. No personally-identifiable information is written to the database unless a customer voluntarily submits a product-interest lead form.

= Will the plugin slow down my site? =

No. All JavaScript is loaded in the footer, stylesheets are versioned for browser caching, and the chat widget is not rendered until a visitor interacts with the chat icon.

= How does analytics tracking work? =

Tracking is **disabled by default**. You must explicitly enable it in the plugin settings. When enabled, anonymous events (chat open, product click, etc.) are stored in a custom database table on your own server.

= How do I remove all plugin data on uninstall? =

Go to **AI Salesman → Settings** and enable the **Remove data on uninstall** toggle before deleting the plugin. By default, data is preserved to prevent accidental loss.

= Does it work with my theme? =

Yes. The chat widget is injected into the page footer and uses its own scoped CSS so it does not conflict with theme styles.

== External Services ==

This plugin can connect to the following third-party services. All connections are initiated from your server, not from our servers.

**AI Providers (optional — only when an API key is configured)**

Customer messages are sent to the AI provider you select in order to generate responses. No data is sent if you are using the built-in Basic AI mode.

* **Groq** — [groq.com](https://groq.com) | [Privacy Policy](https://groq.com/privacy-policy/) | [Terms of Service](https://groq.com/terms-of-service/)
* **OpenAI** — [openai.com](https://openai.com) | [Privacy Policy](https://openai.com/policies/privacy-policy/) | [Terms of Use](https://openai.com/policies/usage-policies/)
* **Anthropic Claude** — [anthropic.com](https://anthropic.com) | [Privacy Policy](https://www.anthropic.com/privacy) | [Terms of Service](https://www.anthropic.com/legal/consumer-terms)
* **Google Gemini** — [ai.google.dev](https://ai.google.dev) | [Privacy Policy](https://policies.google.com/privacy) | [Terms of Service](https://policies.google.com/terms)

**Amazon Associate Program (optional — only when an Amazon tag is configured)**

When the Amazon fallback is enabled and a matching product is not found in your store, the plugin generates an Amazon search link that includes your Associate tag. No customer data is transmitted to Amazon by the plugin itself; the link simply directs the customer's browser to Amazon.

* **Amazon** — [amazon.com](https://www.amazon.com) | [Privacy Notice](https://www.amazon.com/gp/help/customer/display.html?nodeId=GX7NJQ4ZB8MHFRNJ)

**Premium License Verification (optional — only for premium licence holders)**

If you have a premium licence key entered, the plugin contacts our licence server to verify its validity. No customer data or site content is transmitted — only the licence key and your site URL.

* Service URL: `https://aisalesmanchatpro.com/api/`
* [Privacy Policy](https://aisalesmanchatpro.com/privacy-policy/)

== Changelog ==

= 1.0.0 =
* Improved conversation memory persistence across follow-up questions.
* Added product-interest lead capture when Amazon fallback is disabled.
* Weekly analytics email reports now respect the site timezone.
* Fixed duplicate nonce on uninstall confirmation modal.
* Security: added nonce verification to all public-facing AJAX endpoints.
* Removed internal debug helper files from release package for WordPress.org compliance.
* Added release packaging rules to exclude internal markdown docs and log files from distributed archives.
* Removed tracked runtime log files from repository.
* Removed legacy internal markdown docs from repository to prepare for a single consolidated internal document.

= 1.1.0 =
* Introduced Basic AI mode — full product search with no external API required.
* Added semantic search and intent detection modules.
* Added Amazon affiliate fallback with customisable button text.
* Branding panel: upload a custom chat icon image.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Documentation cleanup update — removed legacy markdown docs from the repository.

== Screenshots ==

1. The chat widget on a WooCommerce product page.
2. Admin Settings — AI provider and API key configuration.
3. Admin Analytics Dashboard — funnel and revenue overview.
4. Admin Branding — colours, fonts, and icon customisation.
