=== Nabz ===
Contributors: nabz
Tags: woocommerce, sms, otp, marketing, abandoned cart
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.10
License: Proprietary

Automated SMS for WooCommerce — payment journey, marketing, OTP login. Backed
by the Nabz FastAPI service.

== Description ==

* Sends SMS for order events, abandoned carts, marketing campaigns, OTP login
  and product/inventory triggers. The backend database owns message structure;
  WordPress sends only the event type, recipient and event parameters.
* Custom job runner with its own table, atomic Gill-style claim, retry+backoff,
  and a circuit breaker around all backend calls. Your store keeps working when
  the backend is down.
* SMS-based login shortcode `[nbz_login]`.
* A per-install Ed25519 identity, canonical-domain binding and one active
  installation per license. The raw license key is erased after binding.
* Plugin updates surfaced through `wp-admin → Plugins → Updates`; every package
  is checked against a pinned Ed25519 key and SHA-256 before WordPress sees it.

== Installation ==

1. Upload the `nabz` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Open **Nabz → License**, paste the license key received from nabz.business,
   then choose **Check and activate license**.
4. Open **Nabz → Messages** and enable the message types you want.

== Worker ==

A custom worker drains the `wp_nbz_jobs` table. It's ticked by
WP-Cron (1-minute heartbeat that issues a non-blocking loopback to
`admin-ajax.php?action=nbz_tick`), by the admin-page JS heartbeat while
you're configuring, and by a public REST endpoint
`/wp-json/nabz/v1/tick` that you can hit from server cron or wp-cli.

== Changelog ==

= 1.1.9 =
* Kept linking, verification and routing fail-closed whenever either messenger catalogue or account state is unavailable.
* Clarified per-number minute and daily delivery limits in the messenger manager.
* Updated queue regression harnesses for account-aware channel delivery.

= 1.1.8 =
* Added centralized messenger account linking and management with local platform logos.
* Added delivery routing from the store's own connected messenger account.
* Kept license credentials out of query strings and added connection health checks.

= 1.1.7 =
* Replaced relative Recency quintiles with an adaptive shop/customer repurchase cycle.
* Kept one-time buyers at F=1 and made equal Frequency/Monetary ranks deterministic.
* Fixed segment priority for overdue high-value buyers and excluded refunded value from RFM.

= 1.1.6 =
* Campaign sending is now always available and no longer has a separate event switch.
* Completed queue jobs now retain and display the final server-rendered SMS text.
* Backend SMS logs now show the actual billed cost in toman and the provider message ID.

= 1.1.5 =
* Added exact support for Persian and space-containing Digits Meta Keys across discovery, registration, audience counts and campaign targeting.
* Added safe internal form identifiers for non-ASCII Meta Keys without changing the stored WordPress user-meta key.
* Clarified that renaming a Digits Meta Key does not migrate existing user data.

= 1.1.4 =
* Added targeted campaign sending with audience selection, manual numbers or CSV recipients, personalization variables and incomplete-row reporting.
* Added reusable campaign message templates with edit, delete and reload support.
* Added discovery and selective import of existing user-meta values when configuring a custom field Meta Key.
* Fixed the custom-field modal save action so the edited field and the main settings form persist together.
* Fixed all settings switches so their active/inactive text updates immediately when toggled.
* Added accessible live labels and consistent on/off metadata for every switch control.
* Hardened OTP request and verification rate limits and replaced personal data in security logs with irreversible fingerprints.
* Lowered the minimum supported PHP version to 7.4 and aligned the release validation matrix.

= 1.1.3 =
* Increased the WordPress queue dispatch rate from 20 to 60 requests per minute.
* Each Cron tick can now dispatch up to 25 queued messages within its safe 25-second budget.
* Added a database-backed worker lock so Cron, admin heartbeat and the central watchdog cannot drain the queue concurrently.
* Fixed registration and self-healing of the one-minute WordPress Cron event.
* Existing installations automatically migrate to the new dispatch rate.

= 1.1.2 =
* Added an optional/required setting for each custom registration field.
* Enforced required custom fields in both the registration interface and server-side validation.
* Kept custom fields created by older versions optional for backward compatibility.

= 1.1.1 =
* Fixed tenfold RFM totals when historical rial orders are shown in a toman store.
* Normalized each order from its own saved currency before customer totals and monetary scores are calculated.
* Added a one-time background RFM rebuild so existing incorrect totals are repaired after updating.

= 1.1.0 =
* Added one-shot order tracking SMS with carrier/method and tracking-link detection for WooCommerce Shipment Tracking, AST, Tapin/Iran Post, Tipax, Chapar and Mahex.
* Added an HPOS-compatible manual tracking metabox and automatic queueing when supported shipping plugins save a tracking record.
* Opened the smart campaign suggestions section by default on the customer CRM page.
* Centered the license-entry screen and sized it to its content while preserving responsive width limits.
* Removed customer marketing-consent fields and server synchronization from the plugin.
* Customer messages enabled by the store administrator now queue and dispatch without a consent gate.
* Requeued recent jobs that had failed only because of the retired marketing_consent_required rule.
* Added select-based custom registration fields stored in WordPress user meta.
* Added a modal custom-field editor with Enter-to-add options and per-option edit/delete controls.
* Added Nabzak, a draggable animated admin companion with live daily summaries and a seven-day store activity feed.
* Added direct Digits compatibility through shared custom-field meta keys and common Digits phone fields.
* Added campaign targeting by custom registration responses with live option counts.
* Added per-product SMS audiences for stock and product notifications.
* Excluded staff accounts and deduplicated normalized mobile numbers in targeted sends.

= 1.0.2 =
* Added WordPress media selection and complete centered previews for login branding images.
* Made first name, last name and email optional; mobile remains the only required login identity.
* Added polished previews and dependent-state locking for checkout and login CTA settings.
* Added a copy button for the authenticated customer's generated discount code.
* Added reliable OTP checkout support for both classic checkout and Checkout Block.
* Checkout Block now resumes through WooCommerce's checkout store, assigns the order and signs the customer in after order creation.
* Prevented permanent redirect overlays with checkout lifecycle handling and a safe timeout.
* Added the complete Nabz security architecture document.

= 1.0.1 =
* Added contextual help links to every major plugin admin section.
* Help articles open safely in a new tab with accessible labels and keyboard focus styles.
* Added a reproducible, validated release package and automated GitHub/Nabz publishing pipeline.
* Aligned the declared PHP requirement with the supported and tested PHP 8.1+ release matrix.

= 1.0.0 =
* Initial release.
