=== PRBLEM Webhook Doctor for WooCommerce ===
Contributors: prblem
Tags: woocommerce, webhook, diagnostics, action scheduler, troubleshooting
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later

Diagnose WooCommerce webhook configuration, delivery failures, incidents and likely causes without replaying webhook payloads.

== Description ==

PRBLEM Webhook Doctor provides a local-first diagnostic console for WooCommerce webhooks.

It highlights disabled webhooks, consecutive delivery failures, invalid destinations/topics, missing webhook owners, Action Scheduler queue signals and the WooCommerce automatic-disable threshold. Destination probes only run when an administrator explicitly requests them.

The plugin never replays payloads and never stores webhook payloads. It keeps a bounded, local metadata-only outcome history (time, HTTP/network result and duration) so administrators can confirm failure and recovery without parsing payload logs. Optional state-change alerts use the site's own WordPress mail transport and are disabled by default. Incident Intelligence correlates related failures, automatic disable, diagnosis, re-enable and real delivery recovery into bounded local incident chains.

== Installation ==

1. Install and activate WooCommerce.
2. Upload this plugin ZIP from Plugins > Add Plugin > Upload Plugin.
3. Open WooCommerce > Webhook Doctor.

== Changelog ==

= 1.0.0 =
* Production release of the live-verified Webhook Doctor diagnostic, delivery, incident, guidance, monitoring-rule, alert and Safe re-enable stack.
* Adds a compact PRBLEM.COM link beside the build badge in the Admin console header; it opens only after an administrator clicks it and carries no tracking parameters.
* Controlled Queue Stale Self-Test passed live with the same queue-age classifier used by production monitoring.
* Recommended production defaults remain 2 minutes queue stale / 15 minutes incident escalation / 3000 ms slow delivery.
* No webhook replay, automatic destination probing, automatic re-enable, external monitoring API, payload storage or direct SQL writes.

= 0.9.1 =
* Adds a Controlled Queue Stale Self-Test that exercises the exact production queue-age classifier with synthetic ages only.
* The self-test never creates, delays, runs, edits or deletes Action Scheduler jobs.
* Refactors live queue-stale classification to use the same shared classifier tested by the QA control.
* Adds an explicit Restore recommended defaults control for Monitoring Rules (2 min / 15 min / 3000 ms).
* Clarifies that Slow delivery uses 100 ms input increments and that 0 disables the rule.
* Preserves the feature-complete 0.9.0 delivery, incident, guidance, alert and Safe re-enable behavior.

= 0.9.0 =
* Feature-complete release candidate combining Delivery Intelligence, State Change Alerts and Incident Intelligence with Root Cause Hints and Local Monitoring Rules.
* Adds 04 / GUIDANCE with deterministic likely-cause and next-action hints derived from safe configuration, queue and retained HTTP metadata only.
* Classifies common HTTP/network failures including 400/401/403/404/405/408/409/410/413/422/429/5xx and network failures.
* Adds 05 / RULES with configurable queue-stale, incident-escalation and slow-delivery thresholds; 0 disables a rule.
* Monitoring rules only affect local classification; they do not add background probes or replay webhooks.
* Active incidents can become Escalated/Critical after the configured age.
* Successful but slow real deliveries can create a local performance warning.
* Root-cause hints are shown in incident history and disable-alert emails when evidence is available.
* Support Report includes sanitized rule state and root-cause category/evidence without payload content.
* Preserves equal-width Actions controls, safe re-enable gating, Test Lab, bounded incident/delivery retention and local-only alerting.

= 0.5.0 =
* Adds bounded Incident Intelligence that correlates webhook failure-to-recovery chains.
* Adds local incident IDs, active/recovered counts, mean recovery time, longest recovery and most-unstable-webhook context.
* New 03 / INCIDENTS console panel shows failure, disable, diagnosis, re-enable and recovered-delivery signals in order.
* Incident records contain safe metadata only; no payloads, headers, secrets, destination URLs, response bodies or resource/order IDs.
* Local state-change alerts include the incident ID when available.
* Keeps the equal-width Actions controls from 0.4.0 and preserves existing recovery safety semantics.

= 0.4.0 =
* Adds opt-in local email alerts for automatic webhook disable and real delivery recovery events.
* Alerting is disabled by default and uses WordPress wp_mail(); no external PRBLEM monitoring service is contacted.
* Adds a Local Alert Channel panel with recipient, two alert rules and an explicit test-email action.
* Alert emails contain only safe metadata such as webhook name/ID/topic, event, time and last HTTP result/duration.
* Alert emails never include payloads, headers, secrets, destination URLs or resource data.
* Makes Diagnose / Verify / Re-enable / Logs controls equal width in the Actions column.
* Existing delivery tracking, diagnosis, queue interpretation, Test Lab and Safe re-enable semantics remain unchanged.

= 0.3.0 =
* Adds bounded privacy-minimized delivery outcome tracking from real WooCommerce deliveries.
* New Delivery column with last result, age, duration and recent success ratio.
* New Delivery Channel summary and recent delivery/recovery timeline.
* Tracks automatic disable and administrator-approved re-enable events without storing payloads.
* Keeps only 12 events per webhook and cleans tracked history when a webhook is deleted or the plugin is uninstalled.
* Existing WooCommerce logs are not imported or parsed.
* Existing diagnosis, queue and Safe re-enable semantics remain unchanged.

= 0.2.2 =
* Isolates WordPress notices above the console header.
* Larger arcade scoreboard numerals and darker inventory separators.
* Square Active / Disabled / Paused status chips.
* Clearer recovery guidance and visually secondary Logs actions.
* Tighter Test Lab URL rows while preserving Copy controls.
* No change to the live-verified diagnostic and recovery engine.

= 0.2.1 =
* Compact arcade/service-terminal header and tighter status scoreboard.
* Rebalanced inventory columns and cleaner two-line action bay.
* Disabled recovery now stages Verify endpoint -> Re-enable webhook, with unhealthy destinations visibly blocked.
* Added one-click Copy buttons to Safe Test Lab URLs.
* Added numbered 04 / SUPPORT panel for minimized diagnostic export.
* Preserves the live-verified webhook, queue and recovery engine.

= 0.2.0 =
* Arcade/vintage diagnostic-console Admin UI.
* Diagnosis-aware Verify & re-enable / Safe re-enable / Re-enable blocked states.
* More explicit HTTP-aware re-enable rejection messages.
* Fresh initial webhook pings no longer create a warning by themselves.
* Preserves the verified 0.1.2 queue-state and failure-threshold fixes.
