=== addsynapse Connector ===
Contributors: addsynapse
Tags: woocommerce, ai, assistant, catalog, bulk edit
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.9.0
License: GPLv2 or later

Connects your WordPress / WooCommerce site to the addsynapse AI assistant. Chat in the addsynapse dashboard; every change is prepared as a preview that you approve (and can undo) in wp-admin.

== Description ==

The addsynapse Connector runs the assistant's tools on YOUR server, as the administrator who connected the site. The tools only read data or prepare drafts: nothing on the site changes until the preview is approved — by a logged-in administrator in wp-admin (default) or, if you choose so under Approvals, by an owner/admin of your addsynapse account in the addsynapse portal. Users, passwords and code are never touched.

== Getting started (3 steps) ==

1. **Install** — Plugins → Add New → Upload Plugin → `addsynapse-connector-<version>.zip` → Activate.
2. **Click «Connect to addsynapse»** — AddSynapse → Connector. Sign in (or create a free account), confirm «Connect <your domain>» and you are back in wp-admin, connected. No keys to copy: the site receives them automatically (stored encrypted).
3. **Chat** — «Open the assistant in addsynapse» and ask, e.g. «which products are low on stock?».

The settings page shows one line: «Connected ✓ · Push: OK» (addsynapse reaches your site instantly) or «Push: Fallback» (your site checks for work on its own). «Test connection» re-checks; «Disconnect» revokes the keys on addsynapse and removes them here.

== How jobs reach your site (nothing to configure) ==

* Push: addsynapse sends a signed «wake» to your site — answers in seconds.
* Fallback (firewalls, local networks): WP-Cron checks every minute, and while you use the assistant any visit to the site (front or admin) triggers a quick, non-blocking check at most every 20 seconds.
* Optional, for sites with very few visitors: a system cron that calls `https://<your-site>/wp-cron.php?doing_wp_cron` every minute. The assistant shows the exact line if it is ever needed.

== Advanced ==

AddSynapse → Connector → Advanced: manual setup with the site key and signing secret from your addsynapse dashboard, or define `AIOPS_SITE_KEY` / `AIOPS_SIGNING_SECRET` (and optionally `AIOPS_HUB_URL`) in wp-config.php. «Check for jobs now» runs one check immediately.

== Approvals: where changes are approved ==

AddSynapse → Connector → Approvals (administrators only):

* **Approve in the shop admin (wp-admin) — recommended, the default.** The Approve and Undo buttons in addsynapse open a one-time link to your wp-admin, where a logged-in administrator confirms the change.
* **Approve in the addsynapse portal.** The Approve / Approve selected / Undo buttons in addsynapse apply the change on your site directly, without a confirmation screen in wp-admin. Switching to this needs your WordPress password again. Warning: changes proposed by the assistant can then be applied from the addsynapse portal by the members of your addsynapse account who have approval rights (owners and admins); if your addsynapse account were compromised, changes could be applied without anyone visiting your site — they remain undoable and logged.

Only an administrator on this site can change this setting (addsynapse cannot). Every change of it is logged on the settings page; each change set records who approved it («approved via portal by …»). Disconnect puts the site back to «Approve in the shop admin».

== Updates ==

The Connector updates itself from addsynapse.com, like a plugin from wordpress.org: new versions appear in Dashboard → Updates and on the Plugins screen («View details» shows the changelog), and you can turn on automatic updates there. The update check sends no data about your site or users (only the plugin and WordPress versions). Packages are only accepted over HTTPS from addsynapse.com and are installed only if their SHA-256 checksum matches the one published by addsynapse.

Do not activate together with the «AddSynapse Store Assistant» plugin from wordpress.org: while both are active, the Connector pauses itself (it does not receive or run jobs) and its page (AddSynapse → Connector) asks you to deactivate one of them.

Do not activate together with the «AI Shop Assistant» (shopWorker) plugin — they share the same code; the second one stays inactive.

== Changelog ==

= 0.9.0 =
* Automatic updates from addsynapse.com: Dashboard → Updates, «View details» with the changelog, and WordPress auto-updates. Packages are verified (HTTPS from addsynapse.com + SHA-256 checksum) before they are installed; the check sends no site or user data.
* Approve in Claude: «Allow approval from Claude / addSynapse» lets owners and admins of your addsynapse account approve and undo drafts from the portal or from the draft card in Claude (default unchanged: approval in this admin).
* More robust wake verification: instant delivery works on hosts whose firewall or proxy alters the request, and a refused wake reports why.
* If the AddSynapse Store Assistant (wordpress.org) is active at the same time, the Connector pauses itself so the two never handle the same jobs, and explains it on its settings page.

= 0.8.2 =
* Instant delivery (push) works on more hosts: the addsynapse wake request is verified even when the host's firewall or proxy drops/rewrites the request body or moves the signature headers. Same signature and time checks as before.
* A refused wake now says why (missing headers, wrong site key, clock difference, invalid signature, replay), so the addsynapse portal can show you the cause.

= 0.8.1 =
* Approval setting «Allow approval from Claude / addSynapse» (formerly approval in the addsynapse portal): owners and admins of your addsynapse account can approve and undo draft changes from the portal or from the draft card in Claude. The default is unchanged: changes are approved in this admin.

= 0.8.0 =
* The settings page moved to the shared AddSynapse menu (AddSynapse → Connector) with an Overview of the AddSynapse plugins on this site. Old links (Settings → addsynapse) redirect to the new page.

= 0.7.0 =
* Sales summary: adds a compact sales series per day, week or month (revenue, orders, items) so the portal can draw a chart; nothing else leaves the site.

= 0.6.0 =
* Top customers report (by total spent or number of orders) — only customer references leave the site, never names or contact details.
* Coupons: create, change or disable WooCommerce coupons as drafts approved on the site (never deleted, usage counts never changed).
* Report and search filters: category, tag, brand, global attribute value, product ids; best sellers roll variations up to their product.

= 0.5.0 =
* New orders (phone / manual orders) as drafts approved on the site (guest or existing customer, never a new account, no payment).

= 0.4.0 =
* Approval mode chosen by the site administrator: approve in wp-admin (default) or in the addsynapse portal (password confirmation, warning, local log; the site re-checks the mode on every portal approval and refuses it otherwise).

= 0.3.1 =
* Partial approval selects typed units (product / variation) — ids of different types are never confused; older links keep working for products.
* «Remember this?» answers can be saved from the portal (the site checks the target exists).

= 0.3.0 =
* Portal parity: approve only the products ticked in the portal (partial approval links), Reject and Repeat from the portal, slash commands (/help, /search…) and CSV / image attachments sent from the portal.

= 0.2.0 =
* One-click «Connect to addsynapse» (no key copy/paste), Disconnect, one-line status with push check.
* Zero-config job delivery: push reachability + traffic pulse while the assistant is in use.

= 0.1.0 =
* First release: headless executor, approval screen, signed job channel.
