=== Goppa Agentic Commerce ===
Contributors: goppa
Tags: woocommerce, ai, mcp, llms-txt, structured-data
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Make your WooCommerce catalogue readable and searchable by AI shopping agents — UCP manifest, MCP server and llms.txt on your own domain.

== Description ==

AI assistants already research and compare products for their users. For
your store to show up in those answers, it has to speak the protocols the
agents use. Shopify stores got this built in. Everyone else did not.

Goppa serves four things on your own domain, with no configuration:

* **/.well-known/ucp** — a UCP discovery manifest conforming to the
  published specification, so an agent can find out what your store
  offers.
* **/llms.txt** — a plain-text description of your store, categories and
  products for AI models.
* **/mcp** — a live MCP server (JSON-RPC 2.0, protocol 2025-06-18) with
  three tools: `search_products`, `get_product` and `get_store_info`.
* **/goppa/catalog** — your catalogue as schema.org/Product JSON.

Products, prices, stock status, categories and attributes are read
directly from WooCommerce and cached for ten minutes.

= What this does, and what it does not =

This plugin makes your catalogue **findable, readable and searchable** by
AI agents. Search ignores accents, so "tenis" finds "Tênis" and
"fussball" finds "Fußball".

It does **not** process carts, checkout or payments, and the manifest does
not claim otherwise — it declares catalogue search and lookup, nothing
else. An agent that reads it will send the shopper to your store to buy.
Announcing a checkout that does not exist would make agents try to
transact and fail.

= Optional: see what the agents actually do =

Paste a token from a Goppa account and the plugin reports agent
activity — which endpoint was called, what was searched, which product
was returned. Never visitor data. This is off until you configure it; see
"External services" below.

= External services =

**With no token configured, this plugin makes no external connection.**
Everything above is served from your own site and nothing leaves it.

If you enter a Goppa store token in Settings → Goppa, the plugin sends
agent activity to the Goppa service at `https://trygoppa.com`
(endpoint `/api/ingest`). This is what is sent, and only when an AI agent
requests one of the four endpoints above:

* which endpoint was requested (for example `mcp`);
* the User-Agent string sent by the agent, which the service classifies
  into a known agent name;
* which MCP tool was called (for example `search_products`);
* the search term or product identifier the agent asked for;
* the name of the product returned first.

Records are queued and sent after the response to the agent has already
been delivered, so the service being slow or unreachable never delays
your store. Nothing is sent about your human visitors: no IP addresses,
no customer or order data, no personal information. Clearing the token
stops it immediately.

Service provided by Goppa — [Terms of Service](https://trygoppa.com/terms),
[Privacy Policy](https://trygoppa.com/privacy).

== Installation ==

1. Upload the plugin ZIP via Plugins → Add New → Upload, or unzip into
   `/wp-content/plugins/`.
2. Activate it. The four endpoints are live immediately.
3. Optional: Settings → Goppa for the store description, policy URLs and
   the Goppa token.

Requires WooCommerce. If your permalinks are set to "Plain", switch to any
other setting so the endpoints resolve.

== Frequently Asked Questions ==

= Does it slow my store down? =

No. The catalogue is cached and the routing exits on the first check for
anything that is not one of the four endpoints, so ordinary page loads
never reach this code.

= Does it expose private data? =

No. Only published products, and only the fields already public on your
store: name, description, price, stock status, categories, attributes,
image and link.

= Will AI assistants recommend my store now? =

Serving these protocols is what makes your catalogue readable by an agent
at all — it is a precondition, not a guarantee. Whether an assistant
recommends your store also depends on your products, your market and your
competitors. Anyone promising a specific outcome here is guessing.

= Do I need a Goppa account? =

No. Every endpoint works without one. An account only adds reporting of
what agents did on your store.

= What happens if the Goppa service is down? =

Your endpoints keep working. Pending reports stay queued on your site and
are sent when the service is reachable again.

= Does it work with High-Performance Order Storage (HPOS)? =

Yes. The plugin declares compatibility and does not touch orders at all.

= How do I remove everything? =

Deactivate to stop the plugin and its scheduled task. Delete it to erase
every option it created, including the token.

== Changelog ==

= 0.5.0 =
* New: the plugin now **applies the fixes by itself**. Once an hour it
  asks Goppa whether your latest diagnosis found anything it can repair,
  and repairs it: serving llms.txt, allowing AI crawlers and declaring
  the sitemap in robots.txt, and filling in structured-data fields your
  products were missing. Before this you had to copy and paste them.
* **It will never touch what you wrote.** Titles, descriptions, prices
  and policies are refused by the plugin itself, not only by the server
  — so even a bug or a breach on our side cannot change how your store
  looks to a shopper. Only data that AI agents read is ever modified.
* Settings now show exactly what was applied and when, and the plugin
  does nothing at all until your store is connected.

= 0.4.0 =
* New: **IndexNow**. Your product URLs are submitted to Bing and Yandex
  whenever a product is added, updated or removed. This matters more than
  it sounds: ChatGPT and Copilot answer shopping questions from Bing's
  index, so a product that is not in that index cannot be recommended,
  however good its structured data is. IndexNow cuts the wait from weeks
  to hours. The verification key is generated and served automatically —
  nothing to configure. Turn it off under Settings if another plugin
  already submits your URLs.
* Fixed: uninstalling did not remove the `goppa_schema` option, so a
  setting from 0.3.0 survived the plugin being deleted.


= 0.2.1 =
* Fixed: on stores running the stable WooCommerce release, every endpoint
  served an **empty catalogue**. The plugin routed on `init` at priority
  0, the same priority WooCommerce uses, and loaded first — so
  `wc_get_products()` ran before WooCommerce had registered the `product`
  post type. Routing now runs at priority 20.
* Fixed: an empty catalogue was cached for ten minutes. If the first
  request happened before products existed, products added afterwards
  stayed invisible to agents. Only a non-empty catalogue is cached now.
* Fixed: search ignored accents. "tenis de corrida" ranked a t-shirt
  above a running shoe, because "tenis" did not match "Tênis". Accents
  are folded on both sides now, covering the Latin alphabet (including
  ß, ø, æ, ł, ğ).
* Fixed: a match in the product name now outranks a match in the
  description.
* Fixed: `get_product` also matches without accents, so a lookup cannot
  fail where the search succeeded.
* Fixed: deactivating left the hourly reporting task scheduled forever.
* Fixed: uninstalling did not remove the store token or the telemetry
  options, leaving a secret in the site database.
* Changed: text domain is now `goppa-agentic-commerce`, matching the plugin
  slug, so translations resolve.

= 0.2.0 =
* Rewrote the UCP manifest to conform to the published specification,
  checked against a live Shopify manifest. The previous version used
  fields that do not exist in the spec.
* The manifest now declares only what the plugin does — catalogue search
  and lookup. No checkout, cart or payment handlers.
* Corrected llms.txt and the plugin description, which claimed the store
  was transactable by agents. It is not; purchase happens on the store.
* Hardened the MCP server against malformed input. Batches, `null`, bare
  numbers, parameters sent as strings and arguments of the wrong type
  used to raise errors — which would surface as HTTP 500 on the
  merchant's site. All of them now return proper JSON-RPC errors, and
  batch size is capped.
* Added optional reporting of agent activity.

= 0.1.0 =
* First release: UCP manifest, llms.txt, MCP server, schema.org catalogue
  endpoint, settings page, catalogue cache.

== Upgrade Notice ==

= 0.2.1 =
Important. On the stable WooCommerce release every endpoint served an
empty catalogue because of a hook ordering bug. Also fixes search on
accented product names and removes the store token on uninstall. Upgrade.

= 0.2.0 =
The UCP manifest was not conformant and the plugin claimed your store was
transactable by agents. Both corrected. Upgrade recommended.
