=== AgentMySite ===
Contributors: agentmysite
Tags: chatbot, ai, customer support, woocommerce, 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

AI assistant that answers from your own pages with citations, and from your WooCommerce products, kept in sync. No API keys.

== Description ==

AgentMySite adds an AI assistant to your site that answers only from your own content. It is not a scripted chatbot and not a generic AI that guesses: answers are grounded in your pages or your products and cite the source, and when it cannot help it can hand the visitor to a person.

What sets it apart:

* **Answers from your own site, with citations.** The assistant reads your pages and cites the page each answer came from, so visitors can check it and you can trust it.
* **Your WooCommerce catalog, automatically.** On a WooCommerce store it indexes your products from WooCommerce's built-in, read-only Store API, including prices, sale prices, stock, attributes and variations, and re-syncs a minute after you change a product. No export, no CSV, no WooCommerce API keys.
* **Nothing sensitive stored in WordPress.** Connecting is one click with a verified ownership check. WordPress keeps only a public site key: no passwords, tokens or API keys.
* **A person when it matters.** When the assistant cannot answer, it can offer to raise a support ticket for your team, once you connect your help desk in AgentMySite.

How it works:

1. Install and activate the plugin.
2. Open Settings, AgentMySite and click Connect.
3. Sign in to (or create) your AgentMySite account, choose the site, and confirm.
4. You are returned to WordPress with the widget switched on. Your sitemap is registered so your pages can be learned.

On a WooCommerce store, step 4 is different: the assistant learns your products directly from your store's public product feed (the WooCommerce Store API) instead of crawling pages. It knows names, prices, sale prices, stock, categories, attributes and variations, links shoppers to the right product page, and stays in sync automatically when you add, edit or remove products.

What the plugin does in WordPress:

* Stores only a public site key and your display preferences. No password, token or secret is kept in WordPress.
* Shows the widget on your public pages only, never in the dashboard, login page, feeds or REST responses.
* Lets you hide the widget on chosen paths, for example `/cart` or `/account/*`.
* On WooCommerce, tells AgentMySite when products change so the product index stays current. Only your public site key is sent; AgentMySite re-reads the public product feed itself.
* Disconnects locally at any time, without contacting AgentMySite.

AgentMySite is a service with its own account, plans and limits. Plans and billing are managed on the AgentMySite website, not in this plugin; the plugin works with whatever your account allows.

== External services ==

This plugin connects your site to the AgentMySite service, which requires an AgentMySite account (you can create one during Connect). Before you click Connect, nothing is sent to AgentMySite: the plugin makes no request on activation and does not track you.

When you click Connect, your browser is sent to the AgentMySite admin at https://app.agentmysite.com together with your site address, your site title, the address of your sitemap if one is found, and a one-way hash of a random value created by the plugin. After you confirm, your server contacts the AgentMySite API at https://api.agentmysite.com once to exchange a single-use code for your public site key.

Once connected, the chat widget is loaded on your public pages from https://widget.agentmysite.com. When a visitor uses the chat, their messages are sent to https://api.agentmysite.com so the assistant can reply. AgentMySite may also read your sitemap and pages to learn your content.

If WooCommerce is active, Connect also offers the address of your store's public, read-only Store API (wc/store/v1/products) so AgentMySite can index your products and answer product questions. To keep that index current, about a minute after a product is created, updated, trashed or deleted your server sends a short request to https://api.agentmysite.com/integrations/wordpress/catalog-ping containing only your public site key; AgentMySite then re-reads the products from the Store API. No product data is sent by the plugin itself, and no request is made when products are unchanged.

* Service: AgentMySite, https://agentmysite.com
* Terms of service: https://agentmysite.com/terms
* Privacy policy: https://agentmysite.com/privacy

== Installation ==

1. Upload the `agentmysite` folder to `/wp-content/plugins/`, or install the plugin from the Plugins screen.
2. Activate the plugin.
3. Go to Settings, AgentMySite and click Connect to AgentMySite.
4. If the one-click connection is not possible on your host, use Enter a site key manually and paste the site key from your AgentMySite dashboard.

== Frequently Asked Questions ==

= Which sitemaps are detected? =

The sitemap from Yoast SEO, Rank Math or All in One SEO when one of them is active, otherwise the WordPress core sitemap or the one listed in your robots.txt.

= Is anything sent before I connect? =

No. Installing and activating the plugin makes no request to AgentMySite.

= What is stored in WordPress? =

A public site key, the site name, and your widget preferences. No password, API token or secret is stored.

= Do I need an AgentMySite account? =

Yes. You can create one during the Connect step.

= Does the plugin limit what I can do on a free plan? =

No. Plan limits are enforced by the AgentMySite service, never by the plugin.

= How do I remove it? =

Use Disconnect in Settings, AgentMySite, then deactivate and delete the plugin. Uninstalling removes everything the plugin stored.

= Does it work with WooCommerce? =

Yes. When WooCommerce is active, Connect indexes your products from the WooCommerce Store API, which is built into WooCommerce and read-only. Shoppers can ask about products, prices, stock and variations and get a link to the product page. Your plan on AgentMySite sets how many products are indexed.

= Does it read my orders or customers? =

No. Only public product information from the Store API is read. Orders, customers and private data are never accessed.

= How quickly do product changes show up? =

About a minute after you save a product, the plugin asks AgentMySite to refresh the product index.

= The widget does not appear. =

Check that the plugin shows Connected, that Show the chat widget is ticked, and that the page is not matched by a hide pattern.

== Screenshots ==

1. The Connect screen with what gets shared.
2. The Connected screen with widget settings.

== Changelog ==

= 1.0.0 =
* First public release: one-click connect, widget on public pages, hide-on-paths setting, local disconnect.
* WooCommerce: products indexed from the Store API and kept in sync after product changes.
* Sitemap detection for Yoast SEO, Rank Math and All in One SEO.
* A one-time, dismissible notice after activation that points to Connect.

== Upgrade Notice ==

= 1.0.0 =
First public release.
