=== AIEL Smart Assistant (智能秘書) ===
Contributors: aielapp
Tags: chat, chatbot, customer support, ai, live chat
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 2.3.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add the AIEL AI customer-service chat bubble to your WordPress site. Paste one connection key — no code, no subdomain to configure.

== Description ==

This plugin connects your WordPress site to the AIEL platform's "Smart Assistant" (智能秘書) — an AI customer-service chat bubble that answers visitor questions from your own knowledge base, in the visitor's language.

* Paste a single connection key to link your site to your AIEL workspace. The service URL is configured automatically.
* The chat bubble loads on every front-end page once enabled.
* Update your FAQ / documents on the AIEL platform and the bubble picks them up immediately — no reinstall, no re-paste.
* Multilingual replies (Traditional Chinese, English, Japanese, Korean, Vietnamese, Indonesian, Thai, and optional German / Hindi / Russian), optional neural text-to-speech playback, and full conversation logs in your AIEL dashboard.
* Optional in-app-browser notice: visitors opening your site inside the LINE / Facebook / Instagram in-app browser are prompted to switch to Chrome / Safari, where social logins work reliably. This runs entirely in the visitor's browser, sends no data anywhere, and can be turned off in settings.

= Account and free tier =

The plugin needs a free AIEL workspace, which you create at https://saas.aiel.app/wordpress — no payment details are asked for. A new workspace includes **60 days of service**, counted in calendar days from the day it is created, not in days of use. When those days run out the workspace pauses and the chat bubble stops appearing on your site until you add credits; nothing is charged automatically, and your FAQ and conversation logs stay in your workspace. The plugin itself is free software under GPLv2 and stays installed either way.

The front-end loads a single script tag (injected via `wp_enqueue_script`):

    https://saas.aiel.app/embed/<your-subdomain>.js

= External Services =

This plugin relies on the AIEL platform (saas.aiel.app), operated by AIEL (NetSmart Intelligent Technology Co., Ltd., Taiwan). It communicates with the platform as follows:

1. **When you connect or disconnect (admin only):** your WordPress server sends the connection key you pasted via POST to `https://saas.aiel.app/api/embed-chat/connect` to resolve your workspace's service URL. The key travels server-to-server only and never appears in your site's front-end source.
2. **On every front-end page load (only after you connect and enable the bubble):** the visitor's browser loads the embed script and chat iframe from `https://saas.aiel.app`. Visitor conversations with the assistant (question text, chosen reply language, timestamps) are sent to the AIEL platform to generate replies and are stored as conversation logs. If a visitor signs in with a social account or voluntarily shares their location, that data is likewise processed by the AIEL platform.
3. **The in-app-browser notice** is a purely client-side user-agent check. It sends nothing to any external service and can be disabled in the settings page.

Terms of Service: https://saas.aiel.app/terms
Privacy Policy: https://saas.aiel.app/privacy

No communication with external services happens before you connect a key and enable the bubble.

== Installation ==

1. In your WordPress admin, go to Plugins → Add New → Upload Plugin, choose `aiel-smart-assistant.zip`, install and activate.
2. Go to Settings → Smart Assistant (智能秘書).
3. Paste your connection key (starts with `aieck_`) and click Connect. The service URL is configured automatically.
4. Tick "Show the chat bubble on the front end" to go live.
5. To edit your FAQ / documents, use the "Manage FAQ / documents" link to the AIEL dashboard.

Don't have a key yet? Create a free workspace at https://saas.aiel.app/wordpress — it includes 60 days of service and asks for no payment details. Or contact service@aiel.app.

== Frequently Asked Questions ==

= Do I need to reinstall after updating my FAQ? =

No. The bubble reads the latest content on every load, so changes on the AIEL platform take effect immediately.

= How long is the free tier, and what happens when it ends? =

A new workspace includes 60 days of service. Those are calendar days from the day the workspace is created — one day is used up each day whether or not anyone chats with the assistant. You can see the remaining days in your AIEL dashboard at any time.

When they run out, the workspace pauses: the chat bubble stops appearing on your site, and the settings page will show the workspace as paused. Nothing is charged automatically and nothing is deleted — your FAQ, documents and conversation logs stay in your workspace, and adding credits resumes the bubble immediately. The plugin can stay installed and connected throughout.

= My site sends a Content-Security-Policy header =

Allow the following sources:

    script-src   https://saas.aiel.app
    frame-src    https://<your-subdomain>.aiel.app
    img-src      https://storage.googleapis.com

= How do I hide the bubble temporarily? =

Untick "Show the chat bubble" on the settings page and save. No need to deactivate the plugin.

= Is the admin interface available in English? =

The plugin's settings page and the AIEL dashboard are currently in Traditional Chinese. The chat bubble itself replies to visitors in their own language.

== Screenshots ==

1. Settings → Smart Assistant: paste your connection key. The service URL configures itself — no subdomain to look up.
2. Connected state: the linked workspace and its service URL, a switch for the front-end chat bubble, and an optional in-app-browser notice.
3. The chat bubble loads automatically on every front-end page once enabled.
4. Visitors open the assistant and ask in their own language; replies come from your knowledge base on the AIEL platform.

== Changelog ==

= 2.3.2 =
* In-app-browser notice now loads as a properly enqueued script (assets/inapp-warning.js) instead of an inline `<script>` block; its text still passes through translation functions via wp_localize_script.
* Admin settings page spacing now loads as a properly enqueued stylesheet (assets/admin.css), only on this plugin's own settings screen, instead of inline `style=""` attributes.
* readme now states the free tier plainly: 60 days of service per new workspace, counted in calendar days, and what happens when they run out.

= 2.3.1 =
* Renamed plugin folder/text domain to match the assigned wordpress.org slug (aiel-smart-assistant).

= 2.3.0 =
* Front-end embed script now loads via wp_enqueue_script (async strategy on WP 6.3+).
* readme rewritten in English per WordPress.org guidelines.

= 2.2.1 =
* Self-serve onboarding page: get a free connection key at saas.aiel.app/wordpress.

= 2.2.0 =
* In-app-browser notice can now be disabled (Settings → Smart Assistant; default on).
* Added External Services disclosure with Terms of Service / Privacy Policy links.
* Tested up to WordPress 7.0.

= 2.1.0 =
* New: in-app-browser detection (LINE / Facebook / Instagram) prompting visitors to open the site in Chrome / Safari, preventing broken social logins. Independent of the chat connection.

= 2.0.1 =
* Unconnected state now shows activation guidance.

= 2.0.0 =
* Key-based connection: paste one key and the service URL configures itself.

= 1.0.0 =
* First release: settings page + footer script injection.
