=== ZadKeys – License Key Delivery for WooCommerce ===
Tags: woocommerce, license keys, digital products, supplier, license delivery
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 5.0
WC tested up to: 11.1
Stable tag: 0.3.3
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync supplier products into WooCommerce and deliver supplier-allocated license keys, with retries, admin recovery, logging and HPOS support.

== Description ==

ZadKeys – License Key Delivery for WooCommerce connects your WooCommerce store to a supplier that allocates digital license keys.

* Manual product sync (Sync products button) from the supplier's WooCommerce REST API, with three modes: create only, update imported products, or update price and stock only.
* Automatic license key delivery for paid orders, with keys stored encrypted.
* Automatic retries and manual admin recovery for failed deliveries.
* Global markup percentage (automatic pricing) or manual WooCommerce pricing.
* Operational logging.
* Compatible with WooCommerce High-Performance Order Storage (HPOS).

= Free version and ZadKeys Pro =

* This free plugin imports up to 3 supplier products. Products that are already imported keep updating. Every other feature is fully available.
* ZadKeys Pro is a separate premium plugin, sold and delivered through Freemius, with unlimited imported products. It includes a 30-day free trial (no credit card required). Upgrade from WooCommerce > ZadKeys > Upgrade.
* Product sync is manual (Sync products button) in both versions. There is no automatic or scheduled sync.


= Interface languages =

Bundled translations: Arabic, German and Turkish. English is the default. The admin interface follows the WordPress user language; other messages follow the current site/request language. Any other language uses English for ZadKeys messages. Regional variants without a matching translation catalog also fall back to English. Freemius screens use their own SDK translations.

== Installation ==

1. Install and activate WooCommerce.
2. Upload and activate ZadKeys – License Key Delivery for WooCommerce.
3. Go to WooCommerce > ZadKeys and enter the supplier API URL, Consumer Key and Consumer Secret.
4. Click Test Connection, then run a product sync.

== Frequently Asked Questions ==

= Does it require WooCommerce? =

Yes, WooCommerce 5.0 or newer.

= What happens when the free product limit is reached? =

New supplier products are skipped and an admin notice explains why. Products that are already imported keep syncing. To import more products, upgrade to ZadKeys Pro, the separate premium plugin.

== External services ==

This plugin connects to the following external services.

= Supplier API (configured by the store owner) =

Product sync and license key delivery call the WooCommerce REST API of the supplier store whose URL, Consumer Key and Consumer Secret you enter under WooCommerce > ZadKeys. Product sync requests the supplier's product list. When an order that contains synced products is paid, the plugin sends the order ID and order item ID, the product and supplier SKU and the quantity, and receives the allocated license keys. Nothing is sent until you configure the supplier and sync products or receive such orders. The supplier's own terms and privacy policy apply.

= Freemius =

The plugin includes the Freemius SDK (https://freemius.com), used for the optional opt-in, licensing, updates of ZadKeys Pro, and the in-dashboard pricing and checkout pages.

* Opt-in: only if you click "Allow & Continue", the admin's name and email, the site URL, WordPress and PHP versions, site language and plugin version, and (optional) the list of active plugins and themes are sent to Freemius. You can skip the opt-in or opt out at any time. Optional deactivation feedback is sent only if you give it.
* Pricing, checkout and account: loaded from Freemius when you open WooCommerce > ZadKeys > Upgrade or Account.
* ZadKeys Pro: license activation and update checks are sent to Freemius (api.freemius.com).

Freemius terms: https://freemius.com/terms/ and privacy policy: https://freemius.com/privacy/

== Changelog ==

= 0.3.3 =
* Fix: supplier Consumer Key/Secret sanitize no longer nests ciphertext when an already-encrypted value is passed through the Settings API sanitize filter (e.g. update_option after register_setting).
* Fix: re-saving when a double-encrypted value's inner ciphertext layer is re-posted heals to a single ciphertext layer.
* Fix: Consumer Key field does not echo nested ciphertext after a corrupted store.
* Fix: failed credential encryption keeps the previous good stored value (never stores plaintext, never wipes a good secret).

= 0.3.2 =
* Fix settings, AJAX and JavaScript messages following the WordPress language.
* Bundle Arabic, German and Turkish translations; use English for unsupported languages.
* Improve Arabic spacing, alignment and narrow-screen settings layout.
* Preserve current product sync, pricing, delivery and retry behavior.

= 0.3.1 =
* Changed: The free plugin contains no license or trial check. The Pro unlock exists only in ZadKeys Pro.
* Removed: The old ZadKeys License Manager (the WooCommerce > License page and its daily check against zadkeys.com). Licensing now runs only through Freemius, and automatic delivery no longer depends on a license check. On update, the old license key, its status and its daily check are deleted. If the old check paused any orders, an admin notice lists them so you can deliver them with Retry now.

= 0.3.0 =
* New: Freemius SDK for the optional opt-in and the in-dashboard upgrade to ZadKeys Pro.
* New: ZadKeys Pro, a separate premium plugin with unlimited imported products and a 30-day free trial, no credit card required.
* New: The free plugin imports up to 3 supplier products.
* Fix: No opt-in redirect when WooCommerce is inactive.
* Fix: Uninstall also removes the pricing options and the free limit notice.

= 0.2.1 =
* New: Global markup percentage and automatic/manual pricing modes.

== Upgrade Notice ==

= 0.3.3 =
Hardens supplier credential save against nested encryption. Update in place; do not uninstall. Re-enter Consumer Key/Secret from WooCommerce > ZadKeys if Test Connection fails after a prior double-encrypted store.

= 0.3.2 =
Language and interface maintenance update. Update the existing plugin in place; do not delete/uninstall it, as uninstall removes settings. No database migration.

= 0.3.1 =
Removes the old WooCommerce > License page and its daily check against zadkeys.com. Orders it paused are listed in an admin notice for delivery with Retry now.

= 0.3.0 =
Adds the Freemius SDK and ZadKeys Pro (separate premium plugin, 30-day free trial). The free plugin imports up to 3 supplier products.
