=== AddSynapse Store Assistant ===
Contributors: sakkoulas
Tags: woocommerce, bulk edit, products, store management, assistant
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 8.0
WC tested up to: 11.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ask in plain words for store and site changes in wp-admin. Every change is a preview you approve, with Undo. Free AI plan for questions.

== Description ==

**AddSynapse Store Assistant** adds a chat to wp-admin (**AddSynapse → Store Assistant**) where site and shop
managers ask, in plain words and in their own language, for the work they would otherwise click through screen by
screen: "lower the price of all red mugs by 10% until Sunday", "which products are out of stock?", "add a Sale item
to the main menu", "write SEO titles for these five products".

The AI of the assistant runs on the hosted **AddSynapse** service. **Click **Connect to AddSynapse**, sign in or create
a free account, and a 5-day free trial with every tool starts — no card (no account yet? "Try it without signing up"
starts the same trial without one). After the trial the AI stays free for questions (search, reports, orders — a number
of questions every month); AI-prepared changes need a paid plan.** Everything that runs on your site is free and works
without a connection: slash commands (for example `/report low_stock` or `/price`), the previews, Approve, Undo, voice
input and **Show me**. Plans and prices are on addsynapse.com; the service counts only questions to the AI (bulk changes:
10 products = 1 question), and approving or undoing a change is never charged.

= What it can do =

* **Find and report:** search products (by name, SKU, category, tag, brand, attribute, price, stock), low stock,
  out of stock, missing images/descriptions/prices, best sellers, sales by day/week/month, recent orders, top
  customers (as references only — no names or emails leave your site).
* **Change products:** prices and sale prices with dates, stock, categories, tags, brands, attributes,
  variations, product details and images, allowed custom fields (you choose which ones).
* **Run the store:** draft new orders (for phone orders) and coupons.
* **Bulk update from CSV:** prices and stock by SKU from a spreadsheet you upload in the chat.
* **Site work (also without WooCommerce):** menus, page texts and new sections (Gutenberg and Elementor), SEO titles
  and descriptions (Rank Math, Yoast).

= Every change is a preview a person approves =

The assistant only reads data and prepares drafts. Nothing on your site changes until a person clicks **Approve** on
the preview — a logged-in user with the right permissions in wp-admin, or, only if an administrator allowed it, an
owner or admin of your AddSynapse account in the dashboard — and every approved change can be undone (**Undo**) as
long as nothing else changed the same data since. The assistant never creates, edits or deletes user accounts, never changes
passwords and never runs code or SQL: it can only ask the plugin for a fixed set of checked operations.

= How it works =

The chat, the tools and your data stay in WordPress. The AddSynapse service decides which tool to use next and writes
the answers; the tools themselves run on your server, with the permissions of the logged-in user. Answers from the
service are signed, and the plugin refuses any answer that is not.

You can also chat with the same assistant from your AddSynapse dashboard (app.addsynapse.com). Changes prepared there
are approved here in wp-admin by default; an administrator can choose (with their WordPress password) to allow
approvals in the dashboard too.

= Subscription and free trial =

* **Free trial:** 5 days, no card. Click **Connect to AddSynapse** in the plugin's Settings and sign in (or create a
  free account): the trial starts when the site is connected. No account yet? The small link **No account? Try it
  without signing up** under the button starts the trial without sign-up (public websites only). One trial per website.
* **After the trial** the site moves to the **Free** plan of the service: the AI keeps answering questions with its
  read-only tools (search, reports, orders), a number of questions every month, no card. Paid plans add AI-prepared
  changes (prices, stock, products, menus, imports and more; SEO and pages on the bigger plans).
* **Bulk changes: 10 products = 1 question.** When the AI prepares a preview for many products, every 10 products count
  as one question of your plan (40 products = 4 questions), counted when the AI prepares it. The preview card says so.
  Approve, Reject and Undo never use questions.
* When the questions included in your plan for the month are used up, the assistant answers with a short message and
  an **Upgrade plan** button. A task that is already running finishes normally. Nothing on your site is removed: your
  conversations and change history stay, and Undo keeps working.
* **What needs a plan of the service:** only the AI — its answers in the chat and in your AddSynapse dashboard, with
  the tools of your plan.
* **What works for everyone, connected or not, for free:** slash commands (type `/help`; they run the same tools on
  your site without the AI and prepare the same previews), Approve, Undo and Repeat of a preview, voice input (if a
  manager turns it on in Settings) and **Show me** (pick an element on a page). Nothing is charged per change.
* Plans and prices: https://addsynapse.com/store-assistant

AddSynapse is operated by WebOrange (Ioannis Sakkoulas).

== External services ==

This plugin is a client of the hosted AddSynapse service: without it the AI cannot answer (slash commands, previews,
Approve and Undo run on your site and need no service). **Nothing is sent anywhere until an administrator clicks
"Connect to AddSynapse" (or "Try it without signing up")** in AddSynapse → Store Assistant → Settings, next to a text that
lists what is sent. Before that, the plugin makes no outgoing requests and schedules no recurring background tasks
(only local one-off work that you start yourself: applying a large approved change, or removing an image you
uploaded in the chat and never used).

= 1. AddSynapse API — api.addsynapse.com =

Runs the assistant, the subscription and the trial. Every request after the connection is signed with your site's
keys (the request carries the site key, a time stamp, a random nonce and a signature); the signing secret is stored
encrypted in your WordPress database. Every call, with what it sends and when:

* **Start the trial without sign-up** — `assistant/trial`, when an administrator clicks **No account? Try it without
  signing up**: your site's address and name, the admin language, the platform (WordPress/WooCommerce), the plugin
  version, a pseudonymous id of this installation (a hash, used against repeated trials), a one-time challenge and the
  address of a one-time REST route. AddSynapse then calls that route on your site once to confirm the request came
  from this website, and receives the site's keys.
* **Connect** — `connect/info` and `connect/token`, when an administrator clicks **Connect to AddSynapse**: first a
  request with no data for the address of the sign-in page; after you approve there, the one-time code, its PKCE
  verifier, the callback address and your site's address, in exchange for the keys.
* **Chat** — `ops/turn`, each time someone sends a message to the AI (and once more for each set of tool results
  while the assistant works on it; slash commands are never sent): the message, the results of the tools the
  assistant used to answer it (product, category, page, menu, SEO, coupon and order data of your site — customers
  only as anonymous references, never names, emails, phone numbers or addresses), the ids of products you ticked or of a page element you picked (with its type, label,
  a short excerpt and the page title), a summary of your site structure (active plugins and their versions, theme,
  product taxonomies and attributes, currency, time zone, menu locations — sent when it changes), the admin and site
  language, the site address and the plugin version.
* **Files and images in the chat** — CSV files stay on your site; only their id is sent. For an image only its id, file
  name, size, dimensions and type are sent. The image itself (resized to at most 1,024 pixels) is sent only if an
  administrator turns on "The AI sees the images you upload" in Settings (off by default).
* **Status** — `ops/status`, when the chat or Settings opens (at most every 10 minutes) or an administrator clicks
  **Test connection**: no data; the answer is your plan, the questions left and the trial state.
* **Connector status** — `executor/status`, right after connecting or starting the trial, on **Test connection** and
  when an administrator changes the approval mode: the plugin version, the names of its tools, the addresses of its
  wake-up route, approval page and WP-Cron, the platform, the approval mode, a hash of the site structure and the
  site language.
* **Dashboard jobs** — `executor/jobs/claim` and `executor/jobs/{id}/result`, about every minute while connected
  (WP-Cron or Action Scheduler; more often for two minutes after someone used your AddSynapse dashboard): your site
  asks whether someone wrote to the assistant from your dashboard (at the start of each check with the same connector
  details as **Connector status**), runs the same read-only or draft tools as the chat
  (as the administrator who connected the site; Reject and Repeat of a draft too, Approve and Undo only if an
  administrator allowed approvals in the dashboard) and returns their results — the same kind of data as in **Chat**. A
  file someone attached in the dashboard is downloaded with `executor/files/chunk`. AddSynapse may also send a signed
  "wake up" request to your site so that a job starts sooner; while the dashboard is in use your site may also send
  that request to itself.
* **Approval links** — `executor/approvals/verify` and `executor/approvals/consume`, when someone opens an approval
  link from the dashboard in wp-admin and clicks Approve, Reject or Undo: the one-time token, the change id, the
  action and the decision.
* **Subscribe** — `assistant/subscribe-link`, when an administrator clicks **Subscribe** or **Upgrade plan**: no data;
  the answer is a one-time link to the subscription page.
* **Disconnect** — `connect/disconnect`, when an administrator clicks **Disconnect**: no data; AddSynapse revokes the
  keys.

Terms of Service: https://addsynapse.com/terms
Privacy Policy: https://addsynapse.com/privacy

= 2. AddSynapse dashboard — app.addsynapse.com =

Opened in your browser, never called by your server: **Connect to AddSynapse** opens the sign-in page with your
site's address and name, the platform and the plugin version; **Subscribe** opens the one-time subscription page
(sign in or create an account, link the site, choose a plan); "Open the assistant in addsynapse" opens your dashboard.
Payments happen there, not in the plugin. Same Terms and Privacy Policy as above.

= 3. AI provider of AddSynapse — Anthropic =

AddSynapse uses Anthropic's models to write the answers. Your site never contacts Anthropic: AddSynapse forwards the
chat data of section 1 as a processor, under its own agreement with Anthropic.

* Anthropic commercial terms: https://www.anthropic.com/legal/commercial-terms
* Anthropic privacy policy: https://www.anthropic.com/legal/privacy

= 4. Browser speech recognition — voice input (optional, off by default) =

Only if a manager turns on **Voice input** in Settings. The plugin sends nothing for this feature: it asks the
manager's browser to recognize speech (the browser's Web Speech API) after the microphone button is pressed.
Depending on the browser, the audio may be sent to the browser vendor for recognition (Chrome: Google, Edge:
Microsoft, Safari: Apple or on the device), under the vendor's own terms:

* Google privacy policy: https://policies.google.com/privacy
* Microsoft privacy statement: https://privacy.microsoft.com/privacystatement
* Apple privacy policy: https://www.apple.com/legal/privacy/

== Installation ==

1. Install the plugin from Plugins → Add New, or upload the ZIP, and activate it. WooCommerce is optional: without it
   the assistant works on pages, menus and SEO.
2. Go to **AddSynapse → Store Assistant → Settings**.
3. Read what is sent, then click **Connect to AddSynapse**: sign in or create a free account, approve, and you are
   back here, connected (with the 5-day free trial). No account yet? Click **No account? Try it without signing up**
   under the button instead (public websites).
4. Open the **Chat** tab and ask something about your site.

== Frequently Asked Questions ==

= How can I test the plugin without paying? =

Settings → **Connect to AddSynapse** (a free account; the 5-day trial starts with it), then ask in the Chat tab, for example "which products
are low on stock?" or "lower the price of product X by 10%". Open the preview card, click **Approve**, check the
product, then click **Undo**. To try it without an account, click **No account? Try it without signing up** under the
button instead: the same 5-day trial, no sign-up and no card (public websites only — on a local or development site,
AddSynapse cannot reach the site to confirm it, so use **Connect to AddSynapse**). Without connecting, the plugin makes no outgoing requests: the AI asks you to connect first, while
slash commands already work — for example `/report low_stock`, or `/price id=123 -10%` followed by **Approve** and
**Undo** on its preview.

= Is there a free plan? =

Yes. Every website starts with a 5-day free trial with every tool, no card (with a free AddSynapse account, or without
sign-up from the link under the button). After it the site stays on the **Free** plan of the service: the AI answers a
number of questions every month with its read-only tools (search, reports, orders). AI-prepared changes need a paid
plan. Everything that runs on your site is free and needs no account: slash commands, previews, Approve, Undo, voice
input and **Show me**. Plans and prices: https://addsynapse.com/store-assistant

= How are bulk changes counted? =

Bulk changes: 10 products = 1 question. A preview the AI prepares for 40 products counts as 4 questions of your plan
(the message itself is one of them), when the AI prepares it. Approving, rejecting or undoing a change never uses
questions, and slash-command previews (no AI) never count.

= What happens when the trial ends or the month's questions are used up? =

When the trial ends the site moves to the Free plan (read-only questions). When the month's questions are used up, the
next question gets a short message with an **Upgrade plan** button; a task that is already running finishes normally.
Nothing on your site is removed or locked: conversations, change history, slash commands, Approve and Undo keep
working.

= Can the assistant change my site without asking? =

No. Its tools only read data or prepare a draft. A person has to click **Approve** on the preview: a logged-in user
with the right permissions here in wp-admin (the default), or — only if an administrator turned this on with their
WordPress password — an owner or admin of your AddSynapse account in the dashboard. Approved changes can be undone.
Approving or undoing a change is never charged and does not use up questions.

= What can AddSynapse do on my site while it is connected? =

Only what the chat can do: about once a minute your site asks AddSynapse whether someone used the assistant from
your AddSynapse dashboard, and if so runs the same read-only or draft tools, as the administrator who connected the
site. It never receives code or SQL to run, and it cannot create or change users or passwords. Applying a
draft from the dashboard is off by default: it needs an administrator to choose it in Settings and confirm with their
WordPress password; otherwise every change is approved here in wp-admin. **Disconnect** stops all of it at once.

= Does it touch users, passwords or code? =

No. It cannot create, edit or delete users, change passwords, or run code or SQL.

= Does it work without WooCommerce? =

Yes, on pages, menus and SEO. Product and order features appear when WooCommerce is active.

= Which page builders and SEO plugins are supported? =

Pages: the block editor (Gutenberg/FSE) and Elementor. SEO: Rank Math and Yoast SEO. Pages built with other builders
are listed in Settings as "needs a human" — the assistant does not guess.

= Who can use the chat? =

Users who can manage WooCommerce (or, without WooCommerce, edit the theme options). Connecting, subscribing and the
approval mode are for administrators only.

= What is deleted when I delete the plugin? =

Deleting the plugin from the Plugins screen removes its tables (conversations, change history), its settings and its
scheduled tasks, and images uploaded in the chat that were never used. Changes already applied to your products and
pages stay. Deactivating the plugin removes nothing.

= Where is the source code of the JavaScript? =

The readable source of the admin app is in the `src/` folder of the plugin, with `package.json` and
`package-lock.json` (exact versions). Build it with `npm ci && npm run build` (output in `build/`).

== Changelog ==

= 1.0.0 =
* First release on WordPress.org: chat in wp-admin, read tools, previews with Approve and Undo for prices, stock,
  categories, attributes, variations, product details, menus, pages, SEO, orders and coupons, CSV import, 5-day free
  trial without sign-up, then a free read-only plan; Subscribe from the plugin. Bulk previews show how many questions
  they count (10 products = 1 question). Slash commands, previews, Approve, Undo, voice input and Show me work for
  everyone, without a connection or subscription.

== Upgrade Notice ==

= 1.0.0 =
First release.
