== Changelog ==

= 1.0.0 — 2026-08-20 =
Initial release.

Connection & security
* OAuth 2.0 authentication with Azure AD (client-credentials / server-to-server)
* Automatic token caching, refresh, and expiry handling
* Connection test and token-status display in settings

Sync (WooCommerce -> Business Central)
* Products and variations create/update Business Central items
* Per-variant inventory / stock sync
* Customers synced from orders and accounts, with billing-detail preference, duplicate detection, and payment term/method mapping
* Orders pushed as Business Central sales orders, then posted to a linked Invoice + Shipment
* Order notes synced into the Business Central order comments

Automation
* Automatic Product Sync with selectable frequency (15 minutes / hourly / twice daily / daily)
* Bulk sync with per-product selection

Setup & configuration
* Bundled Techmarbles API-setup Business Central extension with a first-run install banner
* One-click creation of Business Central Configuration Templates, with posting groups and units of measure loaded live from Business Central

Admin experience
* WooCommerce System Status Report panel (never exposes the client secret or access token)
* Shopify-style save bar: Save appears only on edit, Discard reverts, "saved" confirmation
* Clearer labels and tooltips across settings

Platform
* Comprehensive logging
* WooCommerce HPOS (High-Performance Order Storage) compatible
* Requires WordPress 6.2 or later and PHP 7.4 or later; tested up to WordPress 7.1

Standards & security
* WordPress Plugin Check compliant: all output escaped, every database query prepared with
  identifier placeholders, and nonce/capability checks documented on every admin action
* Debug logging is gated behind WP_DEBUG instead of always writing to the error log
* File reads go through WP_Filesystem, and URL/JSON/date handling uses the WordPress APIs

Fixes
* Webhook notifications from Business Central were discarded if the API client was
  unavailable when the queue was processed. The queue is now retained, the operator is
  warned, and processing is retried instead of the batch being dropped.
* Duplicate sales orders could be created in Business Central when an order was retried
  after a posting-group failure, because the retry flag disabled duplicate protection for
  five minutes. Only the scheduled retry now bypasses the guard.
* Uninstall raised a PHP 8 ArgumentCountError while writing its completion log entry.
* A connection failure while retrying a request after a token refresh was reported with the
  stale 401 status, so dropped connections appeared as authorization errors and inflated the
  dashboard's sync-error count. Transport failures are now recorded as network interruptions.
* Importing stock levels from Business Central immediately exported the same quantity back,
  because the loop guard was set after the product was saved rather than before it.
* The webhook validation endpoint is unauthenticated by necessity. It now refuses to reflect
  the validation token unless it can be served as text/plain with nosniff, and rejects
  non-scalar input instead of echoing it.
