=== SaleSense - AI Sales Chatbot ===
Contributors: elionop
Tags: ai chatbot, chatbot, woocommerce, live chat, customer support
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI sales chatbot for WordPress and WooCommerce. Answers shopper questions, recommends products from your catalog and tracks orders.

== Description ==

SaleSense adds an AI-powered sales assistant to your store. It talks to your shoppers in natural language, recommends products from your own catalog, answers pre-sale questions and helps customers track their orders.

**What it does**

* AI chat widget that matches your brand (colors, position, bot name, tone)
* Product recommendations from your WooCommerce catalog
* Order tracking directly in the chat
* Multilingual: automatically answers in the shopper's language
* Lead capture and conversation analytics in the SaleSense dashboard

**How it works**

This plugin is a lightweight connector for [SaleSense](https://salesense.co), a hosted AI sales assistant service. The plugin stores your account API key and loads the chat widget on your site. Everything else (widget design, AI behavior, product sync, analytics, billing) is managed in your SaleSense dashboard.

A free Starter plan is available. Paid plans unlock more conversations and features; see [pricing](https://salesense.co/pricing).

**WooCommerce**

WooCommerce is supported but not required. With WooCommerce connected (via the SaleSense dashboard), the assistant can recommend your real products and look up order status for your customers.

== External Services ==

This plugin relies on SaleSense, a third-party hosted service, to provide the chatbot. No data is sent anywhere until you save your SaleSense API key on the settings page.

Once connected, the plugin communicates with salesense.co as follows:

1. **Widget delivery (your site's visitors).** The plugin loads the chat widget script from `https://salesense.co/embed.js` on your public pages. When a visitor uses the chat, their messages are processed by the SaleSense service to generate answers.
2. **Status check (wp-admin only).** The settings page sends your API key and your site URL to `https://salesense.co/api/wordpress/status` to verify the connection and show its health.
3. **Daily heartbeat.** Once a day (and on activation/deactivation/uninstall) the plugin sends your API key, site URL and version numbers (plugin, WordPress, WooCommerce) to `https://salesense.co/api/wordpress/heartbeat` so your SaleSense dashboard reflects whether this site is connected.
4. **WooCommerce product sync (optional, admin-initiated).** If you click "Sync my WooCommerce products", you are taken through WooCommerce's own authorization screen; on approval, WooCommerce sends read-only API keys directly to SaleSense so your catalog can sync. No keys are ever displayed or copied manually.

Service provider: SaleSense.
Terms of service: https://salesense.co/terms
Privacy policy: https://salesense.co/privacy

Disconnecting (or deleting the plugin) removes the widget and stops all communication with the service.

== Installation ==

1. Install and activate the plugin.
2. Go to Settings > SaleSense.
3. Create a free account at [salesense.co/register](https://salesense.co/register) if you do not have one.
4. Copy your API key from the dashboard's API Key page and paste it into the settings page.
5. Save. The chatbot appears on your site immediately.

== Frequently Asked Questions ==

= Do I need a SaleSense account? =

Yes. The chatbot is powered by the SaleSense service. A free Starter plan is available.

= Does it work without WooCommerce? =

Yes. The chat widget works on any WordPress site. WooCommerce adds product recommendations and order tracking.

= Where is my data stored? =

The plugin itself stores only your API key in your WordPress database. Chat conversations and analytics are stored by the SaleSense service; see the privacy policy linked above.

= Can I hide the chatbot on specific pages? =

Yes, developers can use the `salesense_load_widget` filter:

`add_filter( 'salesense_load_widget', function ( $load ) { return ! is_checkout(); } );`

== Screenshots ==

1. The chat widget on a storefront.
2. Settings page in wp-admin.
3. The SaleSense dashboard.

== Changelog ==

= 0.2.0 =
* One-click WooCommerce product sync via the built-in wc-auth authorization flow (no manual API keys).
* Connection heartbeat so your SaleSense dashboard shows this site's status.
* Product sync status on the settings page.

= 0.1.0 =
* Initial release: connect with an API key, load the chat widget, connection status in wp-admin.

== Upgrade Notice ==

= 0.2.0 =
Adds one-click WooCommerce product sync.

= 0.1.0 =
Initial release.
