WP Event Webhook Manager
Configure outgoing event webhooks with async delivery, retries, replay, and delivery logs.
by Oneth Dias · github.com/onethdias07/simple-webhook-plugin-for-wordpress · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/onethdias07/simple-webhook-plugin-for-wordpress/archive/refs/heads/main.zipWP Event Webhook Manager is a production-oriented plugin for managing signed outgoing webhooks from core WordPress events.
Features
- Multiple webhook endpoints per event
- Supported events:
user_registerpublish_postcomment_approved
- Asynchronous delivery:
- Action Scheduler (if available)
- Fallback to WordPress Cron (
wp_schedule_single_event)
- HMAC SHA256 request signing
- Retry policy: up to 3 retries, 60-second delay
- Delivery logging in custom DB table (
{prefix}wem_logs) - Replay failed deliveries from the Logs tab
- Delete disabled webhooks from the Webhooks tab
- Delete individual logs or filtered log sets from the Logs tab
- Export logs (all/success/failed filter scope) to CSV
Plugin Structure
wp-event-webhook-manager/
├── wp-event-webhook-manager.php
├── README.md
├── assets/
│ ├── css/admin.css
│ └── js/admin.js
└── includes/
├── class-wem-activator.php
├── class-wem-admin.php
├── class-wem-logger.php
├── class-wem-sender.php
└── class-wem-webhook-manager.php
Architecture
WEM_Plugin(bootstrap): loads and wires services.WEM_Activator: runs activation tasks and creates thewem_logstable.WEM_Webhook_Manager: stores webhook definitions and maps WordPress events into queueable payloads.WEM_Sender: queues async jobs, sends requests, handles retry logic, and replays failed logs.WEM_Logger: writes and reads delivery logs.WEM_Admin: renders admin UI and handles nonce-protected actions.
Security Model
- Direct file access is blocked (
ABSPATHchecks). - Admin actions require
manage_optionscapability. - Nonces are enforced for save/toggle/replay operations.
- Destructive actions (delete webhook/delete logs) require nonce-protected POST actions.
- Input is sanitized (
sanitize_key,sanitize_text_field,esc_url_raw,absint). - Output is escaped (
esc_html,esc_attr,esc_url). - Signature comparisons use
hash_equals()for timing-safe checks.
Async Delivery & Retry
- Event handler captures context and builds event payload data.
- Delivery is queued immediately using Action Scheduler or WP-Cron.
- Sender signs payload with:
hash_hmac('sha256', $payload, $secret)
- Request headers include:
Content-Type: application/jsonX-Webhook-SignatureX-Webhook-TimestampX-Webhook-Version: v1
- Failed deliveries are retried up to 3 times with a 60s delay.
Logging System
Table: {prefix}wem_logs
Required fields captured:
idwebhook_ideventpayloadresponse_coderesponse_bodylatencyretriesstatuscreated_at
Additional metadata:
urlrequest_headerssource_log_id(for replay lineage)
Replay Behavior
- Replay is available for failed entries in the Logs tab.
- Replay uses the original payload from the selected log.
- Retry counter is incremented for replay attempts.
- Signature logic is preserved and checked against stored signature values.
Installation
- Copy folder
wp-event-webhook-managerintowp-content/plugins/. - Activate WP Event Webhook Manager in Plugins.
- Go to Tools → WP Event Webhooks.
- Add webhook endpoints and monitor logs.