=== AISmart Content Chat ===
Contributors: aismartcontent
Tags: live chat, lead capture, customer support
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to an AISmart Content workspace with native chat, lead capture, and automation links.

== Description ==

AISmart Content Chat connects your WordPress site to an AISmart Content workspace and adds a native website chat widget, lead capture entry points, and automation links.

Key features:

* One shared storefront chat widget per WordPress site.
* Page visibility targeting (all supported pages or selected page types such as Homepage, Products, Cart, Pages, Posts, and Search).
* Appearance customization including title, greeting, accent color, and launcher position.
* Native visitor name and optional email capture before messages enter the workspace inbox.
* Optional compatibility bridge with supported AISmart Content commerce extensions and AISmart Content Studio.

== External Services ==

This plugin connects to the AISmartContent Chat Service (`https://telewhats.com`) operated by AISmartContent.co,ltd to provide live chat, inbox routing, and workspace configuration:

1. **Workspace Connection & Settings Sync** (`https://telewhats.com/api/integrations/webchat/wordpress/*`):
   When a site administrator connects the plugin, refreshes settings, saves widget preferences, or disconnects the installation, WordPress sends the site URL, site title, authorization code or bearer installation token, and widget appearance/visibility preferences to the service.
2. **Storefront Chat Widget** (`https://telewhats.com/telewhats-webchat-widget.js`):
   When the widget is connected and enabled on public pages, visitors' browsers load the widget script from `https://telewhats.com` and communicate with the service to display the chat interface, maintain a signed visitor-session token, and submit visitor-supplied name, optional email address, and chat messages to the site's connected workspace inbox.
3. **Operator Preview** (`https://telewhats.com/api/webchat/widget/{widget key}/config`):
   When an administrator opens the AISmart Content Chat settings screen, WordPress requests the same public widget configuration that visitors' browsers load, to show which team members (name, online status, profile photo) visitors will meet. The request carries only the public widget key and the site's own address (as the `Origin` header, which the service requires and which a browser would send for the storefront widget). The result is cached for a few minutes. No visitor data is involved.

* AISmartContent Chat Service: https://telewhats.com
* Service Privacy Policy: https://telewhats.com/privacy
* AISmartContent Privacy Policy: https://aismartcontent.co/privacy-policy
* Terms of Service: https://aismartcontent.co/terms

== Installation ==

1. Upload the `aismart-content-chat` folder to `/wp-content/plugins/` or install the plugin ZIP through the WordPress admin.
2. Activate **AISmart Content Chat** in the **Plugins** menu.
3. Open **Settings > AISmart Content Chat** and click **Connect AISmart Content Chat** to authorize your workspace.
4. Configure widget appearance, launcher position, and page visibility, then click **Save widget settings**.

== Frequently Asked Questions ==

= Does this plugin load anything on the frontend before I connect a workspace? =

No. The storefront script is only enqueued after an administrator connects an AISmart Content workspace and enables the widget.

= Does it create multiple widgets if I also use an AISmart Content commerce extension? =

No. AISmart Content Chat owns the single storefront widget, and a compatible commerce extension reuses that connection.

== Changelog ==

= 1.2.1 =
* Rename the plugin to AISmart Content Chat and request the matching directory slug.
* Move all plugin screens under Settings to follow the WordPress admin hierarchy.

= 1.2.0 =
* New AI Chat Hub admin design: aurora header, page navigation, glass cards, toggle switch, colour presets and a live preview that mirrors the real chat box (chat and launcher views, left or right placement).
* The operators visitors can meet are shown in the admin, each in a green (online) or amber (away) ring with their profile photo.
* The chat box itself has a modern look with an operator card, a welcome message, light and dark themes and a mobile layout.

= 1.1.0 =
* Load the commerce-enabled chat runtime with an installation-local WooCommerce cart bridge when the add-on is active.
* Product cards support available options, quantities, native cart updates, and checkout links.
* Document external chat service endpoints, data handling, and privacy policies.