=== Mitte Partners for WooCommerce ===
Contributors: mitte
Requires at least: 6.3
Requires PHP: 8.0
Requires Plugins: woocommerce
Stable tag: 0.1.0

Connect native WooCommerce search, cart and checkout to your free Mitte partner profile.

This plugin uses the existing WooCommerce checkout and installed native payment gateways. It does not register a new WooCommerce Stripe/Connect gateway. Managed Mitte payments use the separately scoped @mitte/partners/payments server SDK and a tested digital-entitlement reference worker; catalog/analytics keys do not authorize payments. A native Woo gateway needs a merchant adapter that freezes an existing Woo order's authoritative total/currency, stores the canonical Mitte order ID, reconciles confirmed provider payment into Woo payment status, performs actual native fulfillment, and only then acknowledges the leased job. A paid/processing Woo order is not proof of completed delivery. No untested native gateway is enabled here; validate such an adapter with PHP/WooCommerce on staging before adoption. Zero Mitte platform fees do not remove Stripe processing fees.

== Installation ==
1. Back up your store and try the plugin on a staging storefront.
2. Upload mitte-woocommerce-0.1.0.zip through Plugins > Add New > Upload Plugin; activate it with WooCommerce active.
3. Register at your Mitte partner portal, attach the exact HTTPS origin of your store and complete DNS verification.
4. Open Settings > Mitte Partners, paste the site ID and portal origin, then save.
5. Enable the desired controls in the portal. Search starts enabled; cart and checkout are opt-in.
6. Optional: generate a site catalog key in the portal, save it in WordPress and click Sync published products to populate your custom app.

== Behavior ==
Products are read from WooCommerce. Simple products and explicit variations are supported; grouped/external products are omitted. Native cart operations use the WooCommerce Store API and a fresh nonce. Checkout opens your existing checkout page; the customer completes payment there. Agents cannot bypass the SDK's local confirmation by passing an approval flag.

The current manifest is fetched before every SDK operation and again after confirmation. A paused, unverified or unreachable partner connection fails closed. Native storefront shopping remains available as normal.

Catalog sync is manual and atomically replaces up to 1,000 catalog items. Use the server SDK for a curated selection from larger stores. The catalog key is site-scoped and never output into page scripts. Prices and stock in the custom app reflect the last sync, and the merchant checkout remains authoritative.

The existing site API key also permits attributed analytics ingestion, but cannot read reports, change controls or administer the account. Automatic order analytics is not enabled by activating this plugin. The examples/analytics-hooks.php file is an opt-in merchant server recipe: it captures payment completion, completed-order fulfillment and successful gateway refunds, persists immutable event payloads, and signs delivery to your own Next.js receiver. Adopt it only after configuring @mitte/partners/webhooks createMerchantWebhookHandler, a server-owned verified order/referral lookup, a reliable cron runner and delivery monitoring. Its timestamped HMAC bridge is explicitly separate from WooCommerce's native webhook endpoint. No raw search text, customer names, emails or addresses are included. Do not use browser/cart attributes as attribution proof. The SDK README gives receiver setup and event contracts.

AWP 0.2 discovery is /agent.json; W2A 1.0 discovery is /.well-known/agents.json. /.well-known/agent.json is an AWP compatibility alias. Pretty permalinks are required for rewrites. With plain permalinks or WordPress in a subdirectory, configure your web server to route the domain-root paths to /wp-json/mitte/v1/agent and /wp-json/mitte/v1/agents. This plugin's browser integration requires the normal path-based /wp-json/ REST API; enable pretty permalinks before connecting.

Public discovery advertises search only. Cart tools remain in the customer's browser so confirmation and merchant session stay together. WebMCP availability depends on the browser; the browser SDK still works without WebMCP.

== Privacy ==
The default plugin fetches public controls and sends listed product fields only when catalog sync is requested. It does not send customer accounts, payment details, cart cookies or order data to Mitte. The separate opt-in analytics recipe can send verified attributed order IDs, amounts, currencies and timestamps through your own authenticated receiver after adoption; it excludes names, emails and addresses. The plugin adds no billing and collects no payment card data.

== Release status ==
Downloadable local plugin, not a WordPress.org listing. Automated tests exercise the JavaScript adapters and controlled platform fixtures. Validate the PHP plugin and WooCommerce/theme compatibility on your own staging store before production.
