Email Digest
Scheduled email summary of plugin activity. Daily, weekly, or monthly. Perfect for knowing "how much is this plugin doing" without opening the dashboard.
Settings: Notifications tab → Email Digest
Option key: wkcft_email_digest
What the Email Contains
Each digest has:
- Period — e.g., "Last 7 days"
- Total checks — passes + failures
- Pass rate — percentage
- Total blocks — how many bots were stopped
- Top 5 forms — ranked by volume
- Top 5 blocked IPs — with block counts
- Week-over-week comparison — vs the prior period
Rendered as HTML email with Cloudflare-orange accents.
Configuration
Enabled
- Key:
enabled(insidewkcft_email_digest) - Default:
no
Tick to start scheduling digests.
Frequency
- Key:
frequency - Values:
daily·weekly·monthly - Default:
weekly
| Frequency | Cron hook schedule |
|---|---|
daily | WordPress daily |
weekly | Custom wkcft_weekly (every 7 days) |
monthly | Custom wkcft_monthly (every 30 days) |
Recipient Email
- Key:
recipient_email - Default: empty
Any valid email address. Usually your own or a security@ group inbox.
Last Sent Timestamp
- Key:
last_sent_ts - Type: Unix timestamp
Read-only — the plugin updates this when each digest sends. Shown on the settings page as "Last sent: X hours ago".
Send Test Digest
Click Send Test Digest on the settings tab.
- Uses the currently configured recipient
- Fires the real digest immediately using the last 7 days of data
- Does not update
last_sent_ts(scheduled runs still fire on their normal cadence) - Uses WordPress's
wp_mail()— if that works elsewhere on your site, this will too
Unsubscribe Link
Every digest has an unsubscribe footer. Clicking it:
- Visits URL:
https://yoursite.com/?wkcft_unsub=TOKEN - Plugin validates token (same timing-safe comparison as Recovery URL)
- On match: sets
wkcft_email_digest.enabledtono - User sees confirmation page
Useful when the admin email changes ownership and the new owner does not want these emails.
Cron Schedule
The email digest runs on WP-Cron.
| Hook | Fired At |
|---|---|
wkcft_send_digest | Scheduled on activation; runs on the frequency cadence |
First send: 1 hour after activation (if enabled). Next sends: per cadence after that.
Custom Cron Schedules
The plugin adds these custom schedules to WordPress:
| Schedule slug | Interval |
|---|---|
wkcft_weekly | 604800 seconds (7 days) |
wkcft_monthly | 2592000 seconds (30 days) |
You can see them via WP-CLI:
wp cron schedule list
Server-Level Cron (Recommended)
WP-Cron only fires when someone visits your site. On low-traffic sites, your weekly digest may skip if no one visits on Monday at 9am.
Fix: set up a real cron at the server level to hit wp-cron.php.
# crontab -e — run every 5 minutes
*/5 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
Then disable WP-Cron auto-triggering in wp-config.php:
define('DISABLE_WP_CRON', true);
See Troubleshooting → WP-Cron.
Email Delivery Notes
Uses wp_mail()
The plugin hands off to WordPress's native mail function. On most servers this uses PHP's built-in mail() — which gets flagged as spam on Gmail.
Recommended: install an SMTP plugin (WP Mail SMTP, Post SMTP) and route through SendGrid, Mailgun, SES, or Gmail API. Your digests will actually land in the inbox.
From Address
Emails send from the site admin's email by default (WordPress wp_mail default). To change the sender globally, use the standard WordPress filters wp_mail_from and wp_mail_from_name:
add_filter('wp_mail_from', function($email) {
return '[email protected]';
});
add_filter('wp_mail_from_name', function($name) {
return 'Security Team';
});
HTML Content Type
Emails are rendered as HTML with Content-Type: text/html; charset=UTF-8 headers. Other transactional emails on your site are not affected.
Sample Email Preview
Subject: Turnstile CAPTCHA Weekly Report — yourstore.com
Hi!
Here is your Cloudflare Turnstile summary for the last 7 days.
CHECKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Total: 12,450
Passed: 11,200 (89.9%)
Blocked: 1,250 (10.1%)
CHANGE FROM LAST WEEK
Checks: ↑ 12%
Blocks: ↑ 48% (bot activity trending up)
TOP 5 FORMS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Checkout 4,200 checks (95% pass)
2. Login 3,100 checks (82% pass)
3. Register 1,800 checks (78% pass)
4. CF7 Contact 1,400 checks (91% pass)
5. Lost Password 950 checks (76% pass)
TOP 5 BLOCKED IPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. 203.0.113.10 241 blocks
2. 198.51.100.5 178 blocks
3. 192.0.2.250 122 blocks
4. 203.0.113.42 95 blocks
5. 198.51.100.77 67 blocks
View full analytics → https://yoursite.com/wp-admin/admin.php?page=wkcft-analytics
Unsubscribe → https://yoursite.com/?wkcft_unsub=...
Filter Reference
The Email Digest class does not expose custom filters for the email body or args. Use the standard WordPress wp_mail_from, wp_mail_from_name, and wp_mail_content_type filters to tweak delivery. See Filters & Hooks for the plugin's own filters.
Troubleshooting
| Problem | Fix |
|---|---|
| Test digest button does nothing | Check PHP mail config or install SMTP plugin |
| Test digest arrives but scheduled never do | WP-Cron not firing — set up server cron |
| Digest arrives in spam | Install SMTP plugin with proper SPF/DKIM |
| Digest numbers look wrong | Open Analytics page to cross-check — same data source |
| "last_sent_ts" never updates | Cron did not run. Check wp cron event list for the wkcft_send_digest hook |
Related Pages
- Notifications — Parent tab
- Webhooks — Real-time alerts
- Analytics — Same data, in-dashboard
- Troubleshooting — Fix cron and email issues
