=== bAInquet Connector ===
Contributors: bainquet
Tags: ai, ingestion, content, woocommerce, seo
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Stream your WordPress content (posts, pages, and WooCommerce products) to the bAInquet ingestion API, signed with HMAC and delivered as idempotent batches.

== Description ==

The bAInquet Connector hooks WordPress content events and maps each post, page, and WooCommerce product to the canonical bAInquet IngestItem shape, then signs every request with HMAC-SHA256 and POSTs it to your bAInquet ingestion endpoint.

Features:

* Maps posts, pages, and WooCommerce products to the bAInquet IngestItem contract.
* Signs every request with HMAC-SHA256 over a canonical string (method, path, body hash, timestamp, nonce, website id), mirroring the server verifier exactly.
* Sends incremental updates on publish/update and tombstones on trash/delete.
* "Sync all content now" backfill runs in chunks via WP-Cron to avoid timeouts.
* WooCommerce support: typed price (value, unit, currency), SKU, stock, attributes, variations.
* Reads Yoast and RankMath SEO meta where present.
* Detects post language via WPML or Polylang, falling back to the site locale.
* Deterministic: no AI runs inside the plugin; an unchanged post produces an unchanged checksum so the server safely skips duplicates.

== Installation ==

1. Upload the plugin zip via Plugins, Add New, Upload Plugin, or drop the bainquet-connector folder into wp-content/plugins.
2. Activate "bAInquet Connector".
3. Go to Settings, bAInquet.
4. Paste the connector token (connectorId.secret) shown once on your bAInquet dashboard connector page, enter the Website ID, confirm the Site domain and API base URL, then Save settings.
5. Click "Test connection" to send a heartbeat and confirm the credentials work.
6. Click "Sync all content now" to backfill existing content.

== Frequently Asked Questions ==

= Where do I get the connector token? =

From the bAInquet dashboard. Open your website, create a WordPress connector, and copy the token. It is shown once; paste it into the plugin settings immediately.

= Does it support WooCommerce? =

Yes. When WooCommerce is active, products are mapped to the "product" source type with typed price (value, unit, currency), SKU, stock status and quantity, attributes, categories, and variations.

= Is my content sent to an AI? =

Not by this plugin. Extraction is deterministic. The plugin only maps and forwards content to your bAInquet ingestion endpoint.

= What happens when I delete a post? =

The plugin sends a tombstone (delete) request with the item's stable id so the corresponding entry is removed from bAInquet.

== Changelog ==

= 1.0.0 =
* Initial release: HMAC signing, batch and single-item delivery, delete tombstones, heartbeat, WooCommerce mapping, Yoast/RankMath SEO meta, WPML/Polylang language, chunked backfill.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
