=== WP Sales Copilot ===
Contributors: aimanix
Tags: woocommerce, ai, product search, sales assistant, semantic search
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 8.2
Stable tag: 0.4.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

An AI sales assistant for WooCommerce that helps shoppers find the right product — and says so honestly when it cannot.

== Description ==

WP Sales Copilot adds a storefront assistant that understands what a shopper is asking for and points them at products from your own catalog.

It is built around one rule: never promise what it cannot do. When nothing in your catalog matches, it says so and sends the shopper to your full catalog rather than inventing a recommendation or padding the results with near-misses.

**What it does**

* Indexes your published simple products so they can be searched by meaning, not just keywords
* Adds a storefront widget where shoppers describe what they need in their own words
* Returns matching products with price, stock status and a link
* Tells the shopper plainly when there is no good match

**What it deliberately does not do**

* It does not store shopper questions, answers, or any visitor profile. Nothing a customer types is written to your database or sent anywhere for analytics.
* It does not add products to the cart or take checkout actions on a shopper's behalf.
* It does not invent products, prices, stock levels or order information.

**Requirements**

WooCommerce, and a connection to the Aimanix platform for AI processing. You can either use the platform's managed AI or supply your own provider key.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` and activate it, or install it through **Plugins → Add New**.
2. WordPress opens the Setup Wizard once, immediately after activation.
3. Connect to Aimanix.
4. Index your products.
5. Publish the widget to your storefront.

**WooCommerce → WP Sales Copilot** shows the current state of all four steps at any time.

== Frequently Asked Questions ==

= Does this store what my customers type? =

No. Shopper questions and responses are never written to your database, and no visitor profile or conversation history is kept. The only per-visitor state is a short-lived rate-limit counter that holds a salted hash, never an address.

= What happens when a shopper searches for something I do not sell? =

They are told there is no match and pointed to your full catalog. The plugin does not fall back to loosely related products, because a shopper shown the wrong item trusts the next answer less.

= My store is behind Cloudflare or a load balancer. Will rate limiting work? =

Not without configuration. By default every visitor behind a proxy appears to share one address, which would throttle your whole store together. Declare your proxy so the real visitor can be identified:

`add_filter( 'aimanix_wscp_trusted_proxies', fn() => array( '173.245.48.0/20' ) );`

Both individual addresses and CIDR ranges are accepted. Forwarding headers are ignored unless the request actually arrived from a proxy you listed, because an unvalidated header can be forged by anyone.

= Indexing stopped partway through. Do I have to start over? =

No. Indexing records each product as it completes and skips whatever is already stored, so running it again continues from where it stopped rather than repeating work you have already paid for.

= Can I use my own AI provider key? =

Yes. **Manage AI Provider** in the Setup Wizard hands off to Aimanix to store your key. Requests then bill to your own provider account and are exempt from the platform allowance.

= What happens when I delete the plugin? =

Everything it created is removed: its options, its transients, and its product embedding table. Deleting the plugin does not touch your products, orders or any WooCommerce data.

== Changelog ==

= 0.4.1 =
* Setup no longer reports a failed AI test as a completed step
* Products added after the first index are detected and can be indexed
* Search guidance describes product-name search, which is what is verified
* Shoppers are no longer told to retry a failure that retrying cannot fix
* Every merchant- and shopper-facing string is translatable, enforced by test
* Removed a connection state that could never resolve
* Removed a setup step counter that implied an order the steps do not have

= 0.4.0 =
* Storefront widget with keyboard support and a live region for results
* Semantic product search over indexed products, with an honest no-match response
* Merchant Overview screen reporting connection, catalog, widget and AI state
* Indexing resumes rather than restarting after an interruption
* Configurable trusted proxies for correct rate limiting behind a CDN
* Vendor rate limiting reported distinctly from an exhausted allowance
* Complete removal of all plugin data on uninstall

== Upgrade Notice ==

= 0.4.1 =
Corrects several screens that reported success they could not substantiate. After upgrading, the
setup wizard may show "Test a question" as incomplete until you run it again - the previous version
recorded that a question was asked, not that it was answered.

= 0.4.0 =
First beta release.
