=== ASE - AI Support Engineer ===
Contributors: kobizeka
Tags: chatbot, ai chat, live chat, woocommerce, customer support
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI support chat for WordPress and WooCommerce: answers product, order, shipping and policy questions in the visitor's language, 24/7.

== Description ==

ASE (AI Support Engineer) adds an AI support chat to your WordPress site or WooCommerce store. You train the agent in the ASE panel (knowledge base, quick answers, tone); this plugin puts the chat widget on every page and, on WooCommerce stores, gives the agent live data from your shop so it never invents products or order statuses.

**On every WordPress site**

* Chat widget on every page, no theme edits. Installed with `wp_enqueue_script`, rendered in its own Shadow DOM, so it never clashes with your theme or page builder.
* The agent knows the page title and type (home, page, post, archive…).
* Answers in the visitor's language.

**On WooCommerce stores**

* **Product questions:** for every message ASE extracts search terms and searches your catalogue (title, SKU, tags). The agent sees name, price (incl. tax, sale price), stock, attributes, category, link and a short description for up to *Search results limit* products.
* **Page and cart awareness:** the agent knows which product the visitor is looking at and what is in the cart.
* **Logged-in customers (rich mode):** greeted by name; the last 5 orders with status, total, shipping method and tracking number (WooCommerce Shipment Tracking, AfterShip and similar plugins) are available to the agent.
* **Guests (rich mode):** order lookup with order number + billing e-mail, limited to 10 attempts per client per hour.
* Compatible with High-Performance Order Storage (HPOS).

Rich mode can be switched off in the settings; product search and cart context keep working.

Knowledge base, quick answers, callback requests, themes, chat history and live visitors are managed in the ASE panel at [app.ase.support](https://app.ase.support/). A free plan is available.

= Setup =

1. Create a free account at [app.ase.support](https://app.ase.support/).
2. Add your site's domain under *Settings → Domains* and create a widget key under *Keys & Embed*.
3. In WordPress go to *Settings → ASE Support*, paste the widget key and save.

Step-by-step guide with screenshots: [ase.support/docs/install/wordpress](https://ase.support/docs/install/wordpress/) and [ase.support/docs/install/woocommerce](https://ase.support/docs/install/woocommerce/).

= External service =

This plugin relies on the ASE service (https://app.ase.support), a third-party SaaS operated by KobiZeka Technology, Software, E-Commerce and Consulting Services. It is required for the plugin to work: the chat widget script (`https://app.ase.support/widget/ase.js`) is loaded from that service on every front-end page, and visitors' chat messages are answered by it.

Data sent to the service from the visitor's browser:

* chat messages typed by the visitor and the chat session id;
* page context: site name, language, page title, URL and page type;
* on WooCommerce stores: the product being viewed, the cart contents and, for product questions, the search results from your catalogue;
* in rich mode: the logged-in customer's name, e-mail and last 5 orders (status, total, date, shipping method, tracking number), and the result of a guest order lookup.

Nothing is sent from your server; all requests are made by the visitor's browser to the ASE service. The data is stored with the chat session in your ASE workspace according to the storage policy you choose there.

* Terms of service: https://ase.support/legal/terms/
* Privacy policy: https://ase.support/legal/privacy/

= Endpoints added to your site =

On WooCommerce stores the plugin registers two public, read-only REST endpoints used by the chat widget on your own pages:

* `POST /wp-json/ase-support/v1/search` returns catalogue data that is already public on your storefront.
* `POST /wp-json/ase-support/v1/order` returns the status of one order when order number and billing e-mail both match (rich mode only, 10 attempts per client per hour).

= Developers =

* `ase_support_show_widget` (bool): return false to hide the widget on a request.
* `ase_support_context` (array): change the context printed as `window.__aseWordPress`.
* `ase_support_order_tracking` (string, WC_Order): supply the tracking number for an order.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/ase-support/` or install it from *Plugins → Add New*.
2. Activate it.
3. Go to *Settings → ASE Support*, paste the widget key from your ASE panel (*Keys & Embed*) and save.
4. Open your site in a private window: the chat bubble appears in the corner configured in your agent settings.

== Frequently Asked Questions ==

= Do I need an ASE account? =

Yes. The widget, the AI answers and the knowledge base live in the ASE service. The free plan covers one domain and one agent.

= Does it work without WooCommerce? =

Yes. On a plain WordPress site the agent gets the page title and type; everything else comes from your knowledge base in the ASE panel.

= Can the agent see my customers' orders? =

Only in rich mode (on by default, can be switched off). Logged-in customers' last 5 orders are shared with the agent; guests can look up one order with order number + billing e-mail.

= Does it change my theme or database? =

No. The widget is enqueued like any other script and the plugin stores a single option. Uninstalling removes it.

= Does it work with caching plugins? =

Yes. The widget talks to ASE directly from the browser. Cart and customer data are printed per page, and caching plugins already bypass the cache for visitors with a cart or a login.

= Which languages does the agent speak? =

It answers in the language the visitor writes in. The plugin's settings screen is in English and translatable.

== Screenshots ==

1. The agent answers a product question from the live catalogue (WooCommerce).
2. Guest order lookup with order number and e-mail.
3. Settings → ASE Support.
4. Logged-in customer: last orders with status and tracking number.
5. The widget on a plain WordPress page (page context).

== Changelog ==

= 1.1.0 =
* Settings page and admin notices translated into Turkish, German, French, Spanish, Italian, Dutch, Polish and Brazilian Portuguese.

= 1.0.0 =
* First release: widget via wp_enqueue_script, settings page, WooCommerce product search, page/cart/customer context, logged-in orders, guest order lookup, HPOS compatibility.

== Upgrade Notice ==

= 1.1.0 =
Adds eight admin languages.

= 1.0.0 =
First release.
