=== Matter Chat — AI Support Widget ===
Contributors: mbmatter
Tags: chat, chatbot, ai, support, live chat
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds the Matter Chat AI support widget to every page of your site. Paste your bot's public key once, and that is the whole setup.

== Description ==

[Matter Chat](https://matterchat.co) is an AI support widget that answers visitors from your own content and hands off to you when it should. This plugin puts it on a WordPress site without touching your theme.

What it does:

* Adds the widget's script tag to every front-end page, pinned to an exact version with a Subresource Integrity hash, so the browser only ever runs the bytes this release was built against.
* Gives you a **Verify** button that checks the key and tells you whether this site is on the bot's list of allowed domains.

What it does not do:

* No tables, no cron jobs, no tracking, no data collected by the plugin. It stores one option (your public key) and one cached Verify result.
* Nothing about the widget is configured here. Its look, hours, knowledge and allowed domains live in your Matter Chat dashboard, so a WordPress admin never has to be kept in step with it.

== External services ==

This plugin connects to **Matter Chat** (app.matterchat.co), the service that runs the widget. You need a Matter Chat account for the widget to do anything. It is used in three ways:

1. **Widget script** — every front-end page loads the widget loader from `https://app.matterchat.co/widget/<version>.js` in the visitor's browser. The request carries the visitor's normal browser headers; the script tag is pinned with a Subresource Integrity hash.
2. **Conversations** — when a visitor opens the widget and chats, their messages, the page URL and the bot's public key are sent to app.matterchat.co so the assistant can answer. Nothing is sent for visitors who never open the widget.
3. **Verify button** (admin only) — pressing Verify on Settings → Matter Chat sends your bot's public key and this site's address to `https://app.matterchat.co/api/wordpress/verify` to check that the key exists and the site is on the bot's allowed domains. The result is cached for ten minutes. This is the only request the plugin itself makes from your server.

The plugin sends no analytics or telemetry of its own, anywhere.

* Service: https://matterchat.co
* Terms of service: https://matterchat.co/terms
* Privacy policy: https://matterchat.co/privacy

== Installation ==

1. Upload the plugin through **Plugins → Add New → Upload Plugin**, or install it from the WordPress.org directory, and activate it.
2. In your Matter Chat dashboard, open **Setup** and copy the bot's public key (it starts with `bot_`).
3. In WordPress, go to **Settings → Matter Chat**, paste the key, and save.
4. Press **Verify**. If it says the site is not in the bot's allowed domains yet, add it under **Access & limits** in the dashboard.

== Frequently Asked Questions ==

= Do I need a Matter Chat account? =

Yes. The plugin only places the widget; the bot, its knowledge and its conversations live at matterchat.co.

= Does it slow my site down? =

The widget script is loaded `async` from a CDN and does not block rendering. The plugin adds nothing on the server side beyond one option read.

= Can I keep pasting the snippet instead? =

Yes. The snippet from the dashboard still works through WPCode or your theme's footer. The plugin exists because a theme update can erase that paste; a plugin survives it.

= Where do I turn the widget off? =

Clear the key under Settings → Matter Chat, or deactivate the plugin. Deleting the plugin removes the option too.

== Changelog ==

= 1.0.0 =
* First release: public key setting, Verify, pinned loader on every page.
