=== Asellio for WooCommerce ===
Contributors: grzegorzk
Tags: woocommerce, ai, chatbot, live chat, customer support
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI shopping assistant for WooCommerce: answers product questions from your catalog, adds a storefront chat and a contact form.

== Description ==

Asellio is an AI support and selling assistant for specialty e-commerce. It learns your WooCommerce catalog and answers shoppers' product questions in a storefront chat.

This plugin connects your store to an Asellio account and lets you:

* Connect the store in one click with a connection token from the Asellio panel (the plugin creates the WooCommerce REST API key for you)
* Add the Asellio chat widget to the storefront
* Add an "Ask about this product" button under the add-to-cart button (or anywhere with the `[asellio_product_chat]` shortcode) that opens the chat about that product; turn it on or off and change its label in the Asellio panel
* Add the Asellio contact form with the `[asellio_contact_form]` shortcode, the "Asellio contact form" block, or a generated Contact page
* Test the connection, disconnect, and open the Asellio operator panel
* Optional AI discovery (off by default): publish `/llms.txt` and add a missing brand or GTIN to your products' structured data, so AI assistants and search engines read your catalog correctly

An Asellio account is required. Catalog synchronization is available on every Asellio plan, including Free. Growth adds order lookup in chat and realtime catalog webhooks; Pro adds order actions. Plans and prices: https://asellio.eu/pricing

The plugin does not store the WooCommerce REST consumer secret in WordPress options. The key is created by WooCommerce, sent to Asellio once during Connect, and revoked on Disconnect or uninstall.

After connecting, open the Asellio panel → Integrations, select your WooCommerce store and start catalog synchronization. Wait for it to finish before testing product answers. Installing the plugin and signing in do not complete setup.

== External services ==

This plugin connects to Asellio (https://asellio.eu), an AI assistant service operated by Inference Works Spółka z ograniczoną odpowiedzialnością The plugin does nothing useful without it.

**Asellio API (api.asellio.eu) — store connection**

* When you click "Connect to Asellio": sends the connection token, your shop URL, your site name, and the WooCommerce REST API consumer key and secret. Asellio uses the key to read your product catalog (and, on plans that include it, orders) and to register catalog webhooks.
* When you click "Test connection": sends the connection token.
* When you click "Disconnect from Asellio" or uninstall the plugin: sends the connection token so Asellio can remove the store connection and its webhooks.

**Asellio chat widget (api.asellio.eu) — storefront**

* When the widget is enabled, every storefront page loads a script from your Asellio API URL (default `https://api.asellio.eu/embed/reef-sentinel-widget.js`) with your Asellio tenant ID and store language.
* The visitor's browser then connects to Asellio. Chat messages, the page URL, IP address, and browser information are sent to Asellio to answer questions.
* Your WordPress server reads the widget colour and the "Ask about this product" settings from Asellio (sends your Asellio tenant ID and your site's host name) and caches them for 5 minutes. Visitors' browsers make no extra request for this.
* When the shopper clicks "Ask about this product", the widget sends the product ID, variation ID, SKU and page URL. Asellio then reads the product's name, price and stock from your WooCommerce REST API.

**Asellio contact form (asellio.eu) — storefront**

* When the contact form is enabled and placed on a page, the page embeds the hosted form from asellio.eu in an iframe. Data the visitor types into the form (such as name, e-mail, and message) is sent to Asellio.

**AI discovery (optional, off by default)**

* Runs entirely on your site and makes no requests to Asellio. When you enable it, the plugin serves `/llms.txt` (store, product categories, brands, terms and privacy pages), lists the WordPress sitemap in the virtual robots.txt, and adds a brand and/or GTIN to Product structured data only where your store already has that data and the schema lacks it.

Terms of service: https://asellio.eu/terms
Privacy policy: https://asellio.eu/privacy

The plugin also adds a suggested text to Settings → Privacy → Policy Guide that you can copy into your store's privacy policy.

== Installation ==

1. Install the plugin from Plugins → Add New (or upload the plugin folder to `/wp-content/plugins/`) and activate it. WooCommerce must be active.
2. In Asellio (https://asellio.eu) go to Integrations → WooCommerce → Generate plugin token.
3. In WooCommerce → Asellio paste the token and click "Save Asellio settings" (button at the bottom).
4. Click "Connect to Asellio". The plugin creates the WooCommerce REST API key automatically.
5. Optional: click "Test connection" and confirm the Connected status in Asellio Integrations.

Installing the plugin alone does not connect the store. You must complete the token and Connect steps.

Full guide: https://asellio.eu/support

== Frequently Asked Questions ==

= Do I need an Asellio account? =
Yes. The plugin connects your store to Asellio. You can start on the Free plan at https://asellio.eu.

= Do I need to copy the consumer key and secret from WooCommerce → Settings → Advanced → REST API? =
No. Click "Connect to Asellio" and the plugin creates a Read/Write key named "Asellio" for you.

= Do you store my WooCommerce API secret in plugin options? =
No. The key lives in WooCommerce's API keys table and is only sent to Asellio during Connect.

= What happens on Disconnect or uninstall? =
The plugin asks Asellio to disconnect the store (best-effort), revokes the "Asellio" REST API key, and on uninstall deletes its settings. A Contact page created by the plugin stays and can be deleted in Pages.

= What does "AI discovery" change on my store? =
Nothing until you enable it. Then it adds a brand (from WooCommerce Brands, a brand plugin, or a brand taxonomy or attribute such as "Brand" or "Marka") and a valid GTIN to the product schema when they are missing, and publishes `/llms.txt`. Existing schema values are never replaced and products are never edited. An existing page or file at `/llms.txt` takes precedence. It works with the WooCommerce schema and with Yoast WooCommerce SEO and Rank Math product schema. It does not guarantee that AI assistants will recommend your store.

= Where is my data processed? =
See the "External services" section above and https://asellio.eu/privacy.

== Screenshots ==

1. WooCommerce → Asellio settings with the store connected.
2. The Asellio chat widget answering a product question on the storefront.
3. The assistant recommending products from the synced catalog.
4. Asellio panel → Integrations with the WooCommerce store connected and the catalog indexed.
5. The Asellio contact form embedded on the store's Contact page.

== Changelog ==

= 0.5.0 =
* New: "Ask about this product" button under the add-to-cart button, plus the `[asellio_product_chat]` shortcode (optional `id` attribute) for themes with a custom layout; it opens the Asellio chat about that product. On/off, label and placement are set in the Asellio panel
* The chat widget now uses the colour set in the Asellio panel
* German stores get the German chat interface

= 0.4.0 =
* New: AI discovery (off by default) in WooCommerce → Asellio
* Adds a missing brand to Product structured data from WooCommerce Brands, popular brand plugins, or a custom brand taxonomy or attribute; choose the source or leave it automatic
* Adds a missing, checksum-valid GTIN from the product's GTIN/EAN field
* Also enriches the product schema of Yoast WooCommerce SEO and Rank Math
* Serves `/llms.txt` with the store, top product categories, brands and policy pages (cached for one hour); never overrides an existing page or file
* Lists the WordPress sitemap in the virtual robots.txt when it is missing

= 0.3.0 =
* Disconnect and uninstall now revoke the "Asellio" WooCommerce REST API key
* Widget script loaded with wp_enqueue_script (async)
* Privacy policy suggestion in Settings → Privacy
* Settings page: all actions in one row; Disconnect highlighted in red
* Contact form iframe always uses the embed view (form only, without the Asellio site header) and resizes to fit the form — no second scrollbar
* Declares the WooCommerce dependency (Requires Plugins); requires WordPress 6.5+
* Text domain changed to asellio-for-woocommerce
* Tested with WordPress 7.1 and WooCommerce 11.1

= 0.2.7 =
* Contact form: enable checkbox, `[asellio_contact_form]` shortcode, and Create Contact page
* Connect/Test now store the hosted form URL from Asellio

= 0.2.6 =
* Connection status badge persists after Connect (tenant_id / last connect), not only after Test

= 0.2.5 =
* Widget embed passes WordPress locale (`data-conversation-language`) so Polish stores show Polish chrome

= 0.2.4 =
* Test connection requires real JSON tenant_id (no false OK on HTML/proxy responses)
* Connect success requires status=connected; show API detail on failure

= 0.2.3 =
* Fix auto REST key creation (use truncated_key column like WooCommerce core)
* Show DB/error detail under failed Connect notices

= 0.2.2 =
* Auto-create WooCommerce REST API key on Connect (no copy-paste)
* Settings Save button at bottom; clearer setup checklist
* HPOS / Cart & Checkout blocks compatibility declaration

= 0.2.1 =
* Uninstall cleanup + disconnect action
* Explicit note: REST secrets not stored in WP options
* Health/status fields from Asellio API

= 0.2.0 =
* Connect + status API against Asellio public plugin endpoints
* Admin UX for REST key connect and connection test

= 0.1.0 =
* Scaffold: settings screen + optional widget inject

== Upgrade Notice ==

= 0.5.0 =
Adds the "Ask about this product" button (controlled in the Asellio panel). The chat widget now uses your panel colour.

= 0.4.0 =
Adds optional AI discovery (llms.txt, brand and GTIN in product schema). Off by default; nothing changes until you enable it.

= 0.3.0 =
Disconnect and uninstall now revoke the Asellio REST API key. Requires WordPress 6.5+.

= 0.2.7 =
Adds an option to place the Asellio contact form on a WooCommerce page (not only the chat widget).
