=== Kauthar AI ===
Contributors: geotechkauthar
Tags: ai chatbot, live chat, customer service, woocommerce, seo
Requires at least: 6.3
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 customer-service chat for WordPress and WooCommerce, plus consent-based SEO fixes from Kauthar Visibility.

== Description ==

**Kauthar AI** is an AI assistant that answers your customers around the clock. This plugin connects your WordPress site to your [Kauthar AI](https://kautharai.com) account:

* **Chat bubble on your site** — Kauthar's chat appears on every page, or only on the pages you choose, on the side you choose. No code to copy.
* **Answers from your real WooCommerce catalog** — names, prices, stock and options, with product cards that link to the product page.
* **"Where is my order?"** — Kauthar gives the status, date and tracking only after the customer provides the order number together with the phone or email on the order. It never reveals addresses.
* **No keys to copy** — "Connect WooCommerce" opens WooCommerce's own approval screen; the access keys are sent by WooCommerce straight to Kauthar.
* **Fresh products** — when you edit a product, Kauthar is told to sync again within about a minute, and re-checks the whole catalog daily.
* **Orders from the chat (optional)** — switch it on in Kauthar and Kauthar can create cash-on-delivery orders priced by WooCommerce.
* **Every channel** — the same assistant also answers on your chat link, QR code, WhatsApp, Messenger and Instagram (set up in Kauthar).
* **Multilingual** — Kauthar replies in the language each customer writes in (Arabic, English, French and more).

* **Kauthar SEO (optional, off by default)** — with the Kauthar Visibility service, Kauthar can fix technical SEO on your site: titles and meta descriptions, canonical URLs and robots tags, structured data (JSON-LD), image alt text, redirects for broken URLs, an llms.txt file and an IndexNow key, and it can publish the posts you approve. You tick each kind of change in **Settings → Kauthar AI → Kauthar SEO**, choose the user Kauthar acts as, and see the last 50 changes there; every change can be undone from Kauthar. If you use Yoast SEO, Rank Math, SEOPress or All in One SEO, Kauthar writes into that plugin's fields.

Without WooCommerce, the plugin adds the chat bubble and Kauthar answers from the files and website pages you give it in your Kauthar dashboard.

The plugin is free. Kauthar AI is a subscription service with a free trial for new businesses — see [plans and prices](https://kautharai.com/en/#pricing).

= How it works =

1. Install and activate the plugin.
2. Go to **Settings → Kauthar AI** and press **Connect to Kauthar** (or paste a connection code from your Kauthar dashboard).
3. Using WooCommerce? Press **Connect WooCommerce** and approve.

== External services ==

This plugin connects to **Kauthar AI** (https://kautharai.com), the service that provides the AI assistant. It does not work without a Kauthar AI account. Nothing is sent before you press "Connect to Kauthar" or submit a connection code.

What is sent, when, and why:

* **When you connect** (button or code): the connection code, this site's address (home URL) and title, and the plugin, WordPress and WooCommerce version numbers — to link the site to your Kauthar account. Kauthar returns a site token stored in your WordPress options.
* **When the Kauthar AI settings page is opened or "Refresh status" is pressed**: the site token and the same version numbers — to show your account, assistant and store status.
* **When you press "Connect WooCommerce"**: the site token and the address of this settings page. WooCommerce then shows its own approval screen and, if you approve, WooCommerce itself sends a read/write REST API key to `https://kautharai.com/api/wp/v1/woo/keys`. Kauthar uses it to read products and order status and, only if you switch it on in Kauthar, to create orders from the chat.
* **When a product is created, edited, deleted or its stock changes** (WooCommerce connected only): a notice with the site token, at most once a minute, so Kauthar syncs again. No product data is sent; Kauthar reads products from your store's public Store API.
* **When a post or page is created, edited, trashed or deleted**: a notice with the site token and the post ids only, at most once a minute, so Kauthar Visibility knows what to look at again. No content is sent in the notice.
* **When you press "Disconnect" or delete the plugin**: the site token, so Kauthar revokes it.
* **Kauthar SEO (the write channel, plugin 1.1)**: when you connect, and whenever the settings page or "Refresh status" is used, the plugin also sends a second secret it generated itself, the address of its own REST namespace (`/wp-json/kauthar-ai/v1`), which SEO plugin is active, which kinds of changes you allowed, and a count of visits by known AI crawlers (user-agent name and count only — no IP addresses, no pages). Kauthar then signs every request it makes **to your site** with that secret; the plugin refuses unsigned, expired or replayed requests, anything you did not tick, and anything the acting user may not do. Nothing is written until you tick a category and choose the acting user.
* **On your public pages** (while the chat bubble is enabled): visitors' browsers load the chat script from `https://kautharai.com/widget.js` and the chat window from kautharai.com. The service receives the usual technical data of a web request (IP address, browser, the page address) and the messages the visitor types, to answer them. The chat window may set a cookie and use browser storage on kautharai.com to keep the conversation.

Kauthar AI writes replies with a cloud AI model from Google (Gemini) on Kauthar's own account; data is stored on Kauthar's servers in Frankfurt, Germany.

* Terms of service: https://kautharai.com/en/terms
* Privacy policy: https://kautharai.com/en/privacy
* Security: https://kautharai.com/en/security

The plugin does not track you or your visitors, shows no ads, and sends no analytics.

== Installation ==

1. In WordPress go to **Plugins → Add New**, search for "Kauthar AI", then **Install Now** and **Activate** — or upload `kauthar-ai.zip` in **Plugins → Add New → Upload Plugin**.
2. Open **Settings → Kauthar AI**.
3. Press **Connect to Kauthar**, sign in to Kauthar (or create an account) and confirm.
4. WooCommerce stores: press **Connect WooCommerce** and approve. Your store must use https.
5. Choose where the chat bubble appears and save.

== Frequently Asked Questions ==

= Do I need a Kauthar AI account? =

Yes. The plugin connects your site to Kauthar AI, where you set up your assistant, its knowledge and its channels. New businesses get a free trial.

= Do I need WooCommerce? =

No. On any WordPress site the plugin adds the chat bubble. With WooCommerce, Kauthar also answers from your products and order status.

= Do I have to copy API keys? =

No. "Connect WooCommerce" uses WooCommerce's standard approval screen and WooCommerce sends the keys to Kauthar directly. You can revoke them any time in WooCommerce → Settings → Advanced → REST API, or by pressing "Disconnect".

= Will Kauthar change my store? =

Only if you ask it to. By default it reads products and order status. Orders from the chat stay off until you switch them on in Kauthar → Connect your store.

= Does it slow down my site? =

The chat script loads asynchronously in the footer and its interface is drawn in an isolated Shadow DOM, so it does not block your pages or clash with your theme.

= Can I show the chat only on some pages? =

Yes: every page, only selected pages, or every page except selected ones. On WooCommerce stores you can also hide it on the cart and checkout.

= Can I add a chat link inside a page? =

Yes, with the shortcode `[kauthar_chat_link text="Chat with us"]`.

= Will Kauthar change my site's SEO without asking? =

No. Everything in the "Kauthar SEO" card is off by default. Kauthar can only change what you tick, as the editor or administrator you choose, and only through requests signed with a secret this plugin generated. The last 50 changes are listed in the card, and each one can be undone from your Kauthar dashboard. Tick "Stop all Kauthar writes" to pause at any time.

= I use Yoast / Rank Math / SEOPress / All in One SEO — will they clash? =

No. Kauthar writes titles, descriptions, canonicals and robots settings into your SEO plugin's own fields, so you keep seeing and editing every value there. Structured data Kauthar adds skips the types your SEO plugin already prints. Without an SEO plugin, Kauthar prints those tags itself on the pages it changed.

= Does the write channel need the REST API? =

Yes. Kauthar talks to `/wp-json/kauthar-ai/v1`. If a security plugin blocks the REST API for visitors, allow that namespace (requests are signed; nothing on it is readable without the secret).

= What happens when I delete the plugin? =

Its settings, the write log, llms.txt, the IndexNow key, the redirects table and the SEO fields stored under the plugin's own keys are deleted, the WooCommerce keys created for Kauthar are deleted, and Kauthar is asked to revoke the site token. Posts Kauthar published stay (they are your content now), values written into Yoast / Rank Math / SEOPress / AIOSEO stay in those plugins, and the products already synced stay in your Kauthar account until you remove the store there.

== Screenshots ==

1. Settings → Kauthar AI: connect your Kauthar account with one button.
2. Connected: account, assistant and WooCommerce status, and where the chat bubble appears.
3. The Kauthar chat bubble on your website.
4. Your store in the Kauthar dashboard — products synced from WooCommerce.
5. Kauthar SEO: tick what Kauthar may change, choose the acting user, see the last changes.

== Changelog ==

= 1.1.0 =
* Kauthar SEO (optional, off by default): a signed write channel for the Kauthar Visibility service — titles and meta descriptions, canonical URLs and robots tags, structured data, image alt text, redirects for broken URLs, llms.txt and an IndexNow key, and posts you approve in Kauthar. Consent per kind of change, acting user (editor or administrator), pause switch and a visible log of the last 50 changes in Settings → Kauthar AI.
* Writes go into Yoast SEO, Rank Math, SEOPress or All in One SEO fields when one of them is active.
* Post / page change notices (ids only) and an AI-crawler visit counter reported to Kauthar.

= 1.0.0 =
* First release: connect with a button or a connection code, the Kauthar chat bubble with position, language and page rules, WooCommerce connection through WooCommerce's approval screen, product-change notices, `[kauthar_chat_link]` shortcode, clean uninstall.

== Upgrade Notice ==

= 1.1.0 =
Adds the optional Kauthar SEO write channel. Nothing changes on your site until you tick the kinds of changes you allow in Settings → Kauthar AI.

= 1.0.0 =
First release.
