=== StockEven – Square Inventory Sync for WooCommerce ===
Contributors: stockeven
Tags: square, inventory, stock sync, pos, woocommerce
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 0.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Two-way stock sync between Square POS and WooCommerce. A sale in the shop or online updates the other side within seconds.

== Description ==

StockEven keeps stock levels equal in Square and WooCommerce. A sale at the Square POS lowers stock online; an online order lowers stock in Square. Refunds, restocks and manual corrections move across too.

**How it works**

* Products are matched by SKU. Products with the same stock on both sides start syncing right away.
* Products with different stock wait for a single decision: keep the Square number or the WooCommerce number.
* Every change is sent once. Changes made by StockEven are never sent back again, so there is no echo between the systems.
* If Square or the store is unreachable for a while, changes wait in a queue and are delivered when the connection returns. Nothing is lost.
* An hourly check compares both sides and corrects any difference according to the chosen source.

**What the panel shows**

* A clear status in the WordPress top bar: all in sync, needs attention, or sync paused.
* Products that need a decision and products that cannot sync, with the reason and how to fix it.
* A log of recent stock changes and where they came from.
* Email alerts when sync is paused or products need attention (one summary a day at most).

**Plans**

The plugin is free. Syncing up to 50 products is free. Larger catalogs need a paid StockEven plan (from $19 a month), bought in the plugin under Plan & billing. All features are available on every plan.

Pricing: https://stockeven.com/#pricing

== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. Open WooCommerce → StockEven.
3. Connect the Square account (Square asks for permission to read items and inventory and to update inventory).
4. Pick the Square location that holds the online stock.
5. Review matched products and confirm.

== Frequently Asked Questions ==

= Which products are synced? =

WooCommerce products and variations with "Manage stock" turned on, matched with Square item variations by SKU.

= What happens when the stock differs on both sides? =

The product waits until a choice is made: Square's number or WooCommerce's number. Nothing changes before that.

= Does it change prices, names or images? =

No. Only stock quantities are synced.

= What happens when the plugin is deactivated? =

Changes from Square wait in the StockEven queue and are delivered when the plugin is active again.

= What happens on disconnect or uninstall? =

StockEven stops syncing the store. Uninstalling also removes the plugin's tables and settings from WordPress.

== External services ==

This plugin connects to services outside WordPress. Syncing does not work without them.

**StockEven service (app.stockeven.com)**
Runs the sync between Square and WooCommerce.
* When connecting: the store address and a one-time connection code.
* For email alerts: the alert email address (by default the site admin email; can be changed or turned off).
* While syncing: product IDs, SKUs, product names and stock quantities of products with managed stock, and stock change events (quantity change, reason such as sale or refund, order number). Customer data is not sent.
* Requests are signed with a secret unique to the store.
Terms: https://stockeven.com/terms — Privacy policy: https://stockeven.com/privacy

**Square (squareup.com)**
The Square account is connected through Square's authorization page. StockEven reads Square items and inventory and writes inventory changes on behalf of the connected account. No Square credentials are stored in WordPress.
Terms: https://squareup.com/legal/general/ua — Privacy: https://squareup.com/legal/general/privacy

**Stripe (stripe.com) and Link (link.com)**
Paid plans are bought on a Stripe Checkout page opened from Plan & billing. Link, a Stripe company, is the merchant of record. The plugin itself sends no payment data; the StockEven service creates the checkout session with the store's StockEven ID and plan. Card and billing details are entered on Stripe's page only.
Stripe terms: https://stripe.com/legal/ssa — Stripe privacy: https://stripe.com/privacy — Link terms: https://link.com/terms

== Screenshots ==

1. Guided setup: connect Square, pick a location, match products.
2. Home: sync status and today's changes.
3. Products that need a decision.
4. A product that cannot sync, with the fix.
5. Activity log.
6. Plan & billing: current plan, products in use, upgrade or cancel.

== Changelog ==

= 0.5.0 =
* Plan & billing screen: current plan, product usage, upgrade, cancel and resume, invoices.
* Products above the plan limit are listed and resume syncing after an upgrade.

= 0.4.5 =
* Square production and sandbox accounts supported side by side.

= 0.4.4 =
* Email alerts: one summary a day at most, only when something needs attention.

= 0.4.3 =
* Plugin Check fixes: prepared SQL identifiers, escaped exceptions, safe redirect to the StockEven service.

= 0.4.2 =
* Disconnect and uninstall stop syncing in the StockEven service.
* No stock events are collected while the store is disconnected.

= 0.4.1 =
* Bulk stock corrections: matching 300 products takes seconds.

= 0.4.0 =
* New panel: guided setup, product decisions, activity log, status in the top bar.
