=== SellViaApp for WooCommerce ===
Contributors: sellviaapp
Tags: woocommerce, mobile app, catalogue, orders, synchronization
Requires at least: 5.7
Tested up to: 7.1
Requires PHP: 7.2
Requires Plugins: woocommerce
Stable tag: 1.2.9
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your WooCommerce store to your SellViaApp mobile commerce app.

== Description ==

The plugin sends WooCommerce categories, subcategories, products, variations, images, prices, promotions, taxes, stock, visibility settings, and customer accounts to SellViaApp. It imports SellViaApp orders into WooCommerce with duplicate protection. Customer synchronization never sends an email.

Main features:

* Manual first synchronization processed in small batches.
* Automatic catalogue, price, and stock updates.
* Manual or automatic SellViaApp order imports.
* Order acknowledgements and unique identifiers that prevent duplicates.
* HMAC-signed webhook notifications.
* Local technical logs that never contain access credentials.
* WooCommerce HPOS compatibility.
* Initial and automatic customer account synchronization without email delivery.

The plugin does not include analytics, advertising, user tracking, profiling, or telemetry. It communicates only with the SellViaApp service to provide the synchronization features described below. No catalogue or customer data is sent merely by activating the plugin. The first synchronization is started manually by a WooCommerce administrator after the store has been connected.

== External services ==

This plugin connects to the SellViaApp API at `https://api.sellviaapp.com/`. This service is required to connect the WooCommerce store to the merchant's SellViaApp mobile commerce app, synchronize store data, and import orders placed through SellViaApp.

When a WooCommerce administrator saves SellViaApp credentials or tests the connection, the plugin sends the SellViaApp API key and supplier integration token in HTTPS request headers. The credentials identify and authorize the merchant's SellViaApp account. They are encrypted before being stored in the WordPress database and are never included in technical logs.

When the administrator starts a synchronization, or later enables automatic synchronization, the plugin can send:

* Store information required to register the signed webhook endpoint, including the WordPress REST endpoint URL.
* Category and subcategory identifiers, names, parent relationships, display order, active state, and HTTPS image URLs.
* Product and variation identifiers, parent relationships, type, SKU, name, description, prices, promotion dates, tax rate, stock, category relationships, HTTPS image URLs, attributes, barcode, publication status, catalogue visibility, and display order.
* WooCommerce customer account identifiers, username, email address, first and last name, display name, company, phone number, VAT number, account type, language, billing and shipping addresses, roles, registration date, order count, and total spent. Customer data is sent only as part of the merchant-requested catalogue/customer synchronization or an enabled automatic update. SellViaApp is instructed not to send an invitation email for these synchronized records.

When order import is started manually or enabled automatically, the plugin requests SellViaApp orders assigned to the connected merchant account. Order identifiers, customer and delivery details, product lines, quantities, prices, taxes, delivery method, totals, notes, and status can be received and used to create the corresponding WooCommerce order. The plugin then sends the SellViaApp order identifier, WooCommerce order identifier, import status, and any import error needed for acknowledgement and duplicate prevention.

The plugin can also send a signed-webhook registration request and request API health or synchronization-log information when an administrator explicitly uses the related connection or diagnostic actions. Incoming webhook requests contain an event identifier, timestamp, signature, and event body; their HMAC signature is verified before an order import can be queued.

SellViaApp service information: https://sellviaapp.com/plugin-woocommerce-app-mobile

SellViaApp terms of use: https://sellviaapp.com/terms-of-use

SellViaApp privacy policy: https://sellviaapp.com/privacy-policy

== Installation ==

1. Upload and activate the plugin in WordPress.
2. Open the SellViaApp menu in the WordPress administration area.
3. Enter the app API key and supplier integration token generated in SellViaApp Dashboard > API.
4. Test the connection.
5. Start the first catalogue and customer synchronization.

== Frequently Asked Questions ==

= Does synchronization start automatically after activation? =

No. The first complete synchronization must be started explicitly from the WooCommerce administration area.

= Can the same order be imported twice? =

No. The plugin uses the unique SellViaApp identifier, WooCommerce order metadata, and an API acknowledgement to prevent duplicates.

= Where are the API credentials stored? =

The integration token and webhook secret are encrypted with the security keys of the WordPress installation. Credentials are never written to the technical log.

== Changelog ==

= 1.2.9 =
* Replaced every short internal PHP, WordPress option, hook, AJAX, script, and style prefix with the unique `sellviaapp_wc` prefix required by the WordPress.org Plugin Review Team.
* Added a backward-compatible migration that preserves credentials, synchronization settings, order cursors, and existing connection state during the update.
* Removed obsolete scheduled actions created by versions using the former internal prefix.

= 1.2.8 =
* Declared WooCommerce as a required plugin dependency.
* Documented the SellViaApp external service, transferred data, transfer conditions, terms, and privacy policy.
* Replaced the public REST permission callback with HMAC signature and timestamp authorization while preserving replay protection.
* Confirmed that all declarations, WordPress hooks, stored options, transients, metadata, cache keys, and database tables use SellViaApp-specific prefixes.

= 1.2.7 =
* Added explicit direct-access protection to the uninstall script and prefixed its global loop variable.
* Replaced direct schema creation queries with the official WordPress `dbDelta()` process.
* Prepared dynamic SQL values directly inside each database call for Plugin Check security compliance.

= 1.2.6 =
* Added a beginner-friendly step-by-step guide for finding the X-API-Key and supplier integration Bearer token.
* Added a direct secure link to the API credentials page in the SellViaApp dashboard.
* Clarified where to copy and paste each credential and how to test the connection.

= 1.2.5 =
* Added a clear choice between connecting an existing SellViaApp account and creating a new app.
* Added a prominent free app creation action linking to the secure SellViaApp onboarding page.
* Improved responsive layout and accessibility for the connection configuration panel.

= 1.2.4 =
* Renamed the official plugin slug to `sellviaapp-for-woocommerce` to comply with the WooCommerce trademark requirements.
* Aligned the plugin directory, main file, text domain, and download package with the approved slug.

= 1.2.3 =
* Prepared and documented all direct database queries required by the dedicated log and mapping tables.
* Added caching and cache invalidation for log and mapping reads.
* Strengthened input sanitization and nonce verification in the administration interface.
* Removed the discouraged manual translation loader and converted the public readme to standard English.

= 1.2.2 =
* Fixed WordPress translation checks for strings containing placeholders.
* Explicitly escaped exception messages and displayed values.
* Added the translation directory declared in the plugin header.

= 1.2.1 =
* Added support for PHP 7.2, 7.3, and 7.4 while retaining PHP 8.x support.
* Replaced syntax and functions limited to PHP 7.4 or PHP 8 with compatible equivalents.

= 1.2.0 =
* Added a dedicated SellViaApp administration menu and icon.
* Added direct submenus for full synchronization and new order imports.
* Isolated the plugin header from notices generated by WordPress, WooCommerce, or other plugins.

= 1.1.1 =
* Added immediate batched customer synchronization after a WooCommerce profile is saved.
* Added synchronization when the customer role is assigned later, without email delivery.

= 1.1.0 =
* Added WooCommerce customer synchronization with SellViaApp.
* Preserved the exact WooCommerce username in the customer login field.
* Added automatic SellViaApp profile updates after WooCommerce customer changes.
* Prevented email delivery during synchronized customer creation and updates.

= 1.0.2 =
* Repaired deleted categories when they are synchronized again.
* Improved product links to the most precise category and subcategory.
* Added automatic synchronization after WooCommerce category creation or updates.
* Fixed order imports on recent PHP versions.

= 1.0.1 =
* Verified compatibility with WordPress 5.7 through 7.0 and WooCommerce 5.2 through 11.0.
* Deferred Action Scheduler registration on recent WooCommerce versions.
* Verified HPOS and WooCommerce CRUD API compatibility.

= 1.0.0 =
* First complete release.
