=== Paymob Wizard Connector ===
Contributors: paymob
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.4.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Standalone WordPress helper for Store Doctor, WooCommerce readiness, and guided Paymob setup.

== Description ==

Paymob Wizard Connector can be installed before WooCommerce or Paymob. It checks the WordPress environment, orders the missing setup steps, guides explicit plugin installation or activation, and connects the store to Paymob Store Doctor.

The helper is not a checkout plugin. Official Paymob for WooCommerce continues to own payment settings and process checkout.

= Prerequisites =
* WordPress 5.6+ (Application Passwords)
* PHP 7.4+

WooCommerce 7.0+ and official Paymob for WooCommerce are guided setup steps, not activation requirements.

= Data use =
Store Doctor holds a revocable Application Password for the WordPress user who connected. That password inherits the user's capabilities. The optional native bridge uses an encrypted local HMAC key for signed server-to-server requests. Secrets and Paymob keys are never exposed to the wp-admin page.

Disconnect from Store Doctor in WordPress to revoke the tracked credential and remove the native bridge key. Other WordPress Application Passwords and official Paymob settings are not changed.

This package defaults to Live: Wizard https://wizard.paymob.com/wizard/, Store Doctor https://wizard.paymob.com/store-doctor/. Switch to Staging (Wizard https://tools-staging.paymob.com/wizard/, Store Doctor https://tools-staging.paymob.com/store-doctor/) from the Live/Staging card on the Store Health screen, or define PAYMOB_WIZARD_URL in wp-config.php (that constant wins and is shown as locked). The paymob_wizard_connector_wizard_url filter still runs last and must resolve to an allowlisted host. On hosted Paymob, Store Doctor is always origin /store-doctor/, not a path under /wizard/, so Live and Staging always resolve to two different Store Doctor destinations. Do not point a production install at localhost or Docker.

= Support =
https://community.paymob.com/

== Changelog ==

= 2.4.0 =
* Added Checkout monitoring: twice-daily background checks that email only when checkout stops working or starts working again. Off by default.
* Added Explain an order: enter a WooCommerce order number to see why it was not paid, using the store's own order record and matching Paymob log lines.
* Added a structured support bundle, downloadable as JSON or sendable to Paymob support in exchange for a reference code.
* Redesigned the Store Health screen around the Paymob brand palette, with setup progress, a clearer first step, and loading states.
* Fixed: deactivating the plugin now drops the /llms.txt rewrite rule instead of leaving that address serving the site homepage.
* Fixed: link-styled secondary buttons lost their border.

= 2.3.1 =
* Replaced blank static brand assets with the official Paymob artwork.
* Show Paymob settings only while the official Paymob for WooCommerce plugin is active.
* Removed the engineer-only diagnostics panel from the customer Store Health screen.
* Made the connected Store Doctor conversation available directly inside Store Health, with clear reconnect guidance for older connections.

= 2.3.0 =
* Redesigned Store Health as a responsive operations dashboard with clear readiness metrics, setup progress, prioritized findings, and a compact Store Doctor workspace inspired by the referenced dashboard UI kit.
* Added visible loading and disabled states to health checks, plugin setup actions, and Store Doctor scans.
* Added a version-aware release builder that verifies every plugin source file is present in the installable ZIP.

= 2.2.0 =
* Renamed the admin screen to "Store Health" (Paymob Store Health UI): status + next action, ordered needs-attention findings, setup checklist, capacity/worker/background-job cards with an engineer-detail panel, and a collapsed connection-settings card.
* Added "Ask Store Doctor", a real AI chat backed by a nonce-protected, install-and-account-bound conversation and a signed HMAC connector bridge to a new Store Doctor connector chat API. Chat is disabled when Store Doctor is disconnected or revoked, on either side.
* Live now defaults to https://wizard.paymob.com/ and Staging to https://tools-staging.paymob.com/, each resolving to its own distinct Store Doctor destination (previously both could show the staging URL).
* Added an explicit "Verify Paymob checkout" action distinct from "Check public storefront"; fixed a missing REST route registration for chat/native-tool capability detection.

= 2.1.1 =
* Allow Store Doctor to call POST plugin-action with an Application Password (same as diagnostics). wp-admin still uses the REST nonce. Journey and doctor routes stay nonce-only.
* Staging uses https://tools-staging.paymob.com/store-doctor/ (not /wizard/store-doctor/). The Live/Staging switch is on the main Store Doctor screen.

= 2.1.0 =
* Default Store Doctor to live tools-staging.paymob.com/wizard/, with an admin Live/Staging switch and the existing PAYMOB_WIZARD_URL override.
* Send a redacted store snapshot (name, URL, plugins, versions) on connect and on GET diagnostics.

= 2.0.2 =
* Track and revoke every connector-created Application Password, including manual setup, and keep tracking if revocation fails.
* Store one-time handoffs in the options table with claim-once consume so persistent object caches and duplicate requests cannot drop or revoke the winning credential.
* Redact JSON, Authorization, and nested secrets; pin signed bridge identity fields; honor per-user Application Password policy; run ordinary plugin activation hooks.

= 2.0.1 =
* Set the default Wizard URL to the hosted staging service so connection checks no longer reject the Docker-only package default.

= 2.0.0 =
* Removed the WooCommerce activation dependency so the helper can run first.
* Added a native wp-admin onboarding journey for missing, inactive, outdated, account, and readiness states.
* Added explicit, capability-checked WordPress core actions for installing, activating, or updating WooCommerce and Paymob.
* Added a secure signed Store Doctor bridge contract with feature detection and external fallback; no iframe or browser secrets.

= 1.2.0 =
* Added a guided one-click setup screen with readiness checks and a scan-only fallback.
* Added pending credential cleanup so abandoned handoffs do not leave application passwords behind.
* Added activation guidance, accessible status feedback, duplicate-submit protection, and exact credential revocation on uninstall.

= 1.1.0 =
* Production ZIP URL check, UUID-scoped credentials, transactional Paymob key write-back, honest TEST pay stages, bounded redaction.
