=== SiteWhisper - AI Chat Widget Trained On Your Own Content ===
Contributors: sitewhisper
Tags: chatbot, ai chatbot, live chat, customer support, faq
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.2
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add an AI chat widget that answers visitor questions from your own pages, not from generic training data. Paste one API key and it is live.

== Description ==

SiteWhisper reads the pages you index in your SiteWhisper account and answers visitor questions from that content. If the answer is on your site, the widget gives it. If it is not, the widget says so and points the visitor at you, instead of inventing something.

This plugin is the WordPress installer for that widget. It adds one settings screen, stores your API key, and loads the widget script on the front end. There is nothing else to configure in WordPress — appearance, welcome message, suggested questions, languages and lead capture all live in your SiteWhisper dashboard, so changing them does not mean touching your site.

**What it is good at**

* Answering the same pre-sale questions your visitors ask over and over
* Deflecting support tickets that are already answered in your docs, help pages or FAQ
* Handling visitors in their own language — 50+ supported, auto-detected from the browser
* Capturing a lead when the visitor wants a human

**How it works**

1. Create a free account at sitewhisper.online and add your site's URL.
2. SiteWhisper crawls the pages you point it at and builds an index.
3. Copy the site API key into this plugin's settings screen.
4. The widget appears on your front end. Re-crawl whenever your content changes.

**Good to know**

* The widget loads asynchronously in the footer and does not block page rendering.
* The API key is a public identifier for your site. It grants no access to your SiteWhisper account, which is why it is safe to have in page source.
* The widget is enqueued through the normal WordPress script API, so caching and optimisation plugins can see it and you can dequeue the `sitewhisper-widget` handle if you need to.
* Deleting the plugin removes every option it created.

== External services ==

This plugin relies on SiteWhisper, a third-party service, to load and run the chat widget. The plugin is only the installer; the widget itself is served and answered by SiteWhisper.

**What is loaded**

The plugin adds a script tag pointing at `https://sitewhisper.online/widget.js` on your public pages, whenever an API key is set. This happens on every front-end page load, for every visitor, whether or not they open the chat.

**What is sent, and when**

* On page load, the widget requests its configuration from `https://sitewhisper.online/api/site-public` using your site API key. This tells it your widget colour, welcome message and language settings. No visitor data is sent at this point beyond the ordinary contents of an HTTP request (IP address and user agent), which SiteWhisper uses for rate limiting.
* When, and only when, a visitor sends a message, the widget posts that message to `https://sitewhisper.online/api/chat`, along with your site API key and an anonymous conversation identifier so replies stay in order. The message is answered using an AI model and the content indexed from your site.
* If you have enabled lead capture in your SiteWhisper dashboard, any details a visitor voluntarily submits in that form are sent to SiteWhisper and shown to you in your dashboard.

Nothing is sent about visitors who never open the chat, beyond the script request itself.

**Terms**

* Service: https://sitewhisper.online
* Terms of service: https://sitewhisper.online/terms
* Privacy policy: https://sitewhisper.online/privacy

If you operate in a jurisdiction with consent requirements, treat the widget as a third-party service in your own cookie and privacy notices, and disclose it accordingly.

== Installation ==

**From your WordPress admin**

1. Go to Plugins → Add New and search for "SiteWhisper".
2. Install and activate.
3. Go to Settings → SiteWhisper and paste your site API key.

**Manually**

1. Upload the `sitewhisper` folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen.
3. Go to Settings → SiteWhisper and paste your site API key.

The widget appears on your front end as soon as a valid key is saved. Clearing the key removes it.

== Frequently Asked Questions ==

= Where do I get an API key? =

Sign up at https://sitewhisper.online , add your site, and copy the key from Sites → Embed in the dashboard.

= Is the API key a secret? =

No. It identifies your site to the widget in the same way a public analytics ID does, and it grants no access to your account. SiteWhisper also restricts which domains may use a key, so it is not useful to anyone who copies it out of your page source.

= Do I need a paid plan? =

No. There is a free tier. Paid plans raise the monthly message limit and remove SiteWhisper branding from the widget.

= Will it slow my site down? =

The script is loaded asynchronously in the footer, so it does not block rendering or affect your Largest Contentful Paint.

= How do I change the colour, position or welcome message? =

In your SiteWhisper dashboard, not in WordPress. Changes reach live sites within about a minute, with no plugin update and no cache clear.

= The widget is not appearing. What should I check? =

First, confirm an API key is saved in Settings → SiteWhisper. Then confirm the site's domain is listed under allowed origins in your SiteWhisper dashboard — the widget refuses to load on domains you have not authorised. Aggressive caching plugins may also need a cache flush after the key is first saved.

= Can I use it with a self-hosted SiteWhisper instance? =

Yes. Change the Script host setting to your own origin. Only http and https URLs are accepted.

= Does it work in languages other than English? =

Yes, 50+ languages, detected from the visitor's browser by default. You can pin one language in the settings if you would rather not auto-detect.

= What happens when I delete the plugin? =

Every option it stored is removed, including the API key. Your SiteWhisper account and indexed content are untouched.

== Changelog ==

= 1.1.0 =
* The widget is now registered through `wp_enqueue_script` instead of being printed directly into the footer, so caching and optimisation plugins can see it and it can be dequeued by handle.
* Added full disclosure of the external service the widget depends on, in both the readme and the settings screen.
* Script host is validated as an http or https origin before it is saved, rather than being trusted as typed.
* Language codes are validated, and region variants such as `pt-BR` are now accepted.
* Added a Settings link to the plugin row.
* Added an uninstall routine that removes all stored options, including on multisite.
* Added a warning on the settings screen when no API key has been entered.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.1.0 =
Recommended for everyone. Enqueues the widget properly so caching plugins handle it correctly, validates the script host, and documents exactly what data leaves your site.
