---
title: "WP-Cron Jobs Reference"
description: "DMSI Webhooks registers the following recurring WP-Cron jobs on plugin activation. ## Registered Cron Hooks | Hook | Frequency | Handler | Purpose | | --- | --- | --- | --- | | `dmsi_webhooks_daily_cleanup` | Daily | `LogCleanup` |…"
url: "https://dmsi.gr/docs/dmsi-webhooks/wh-developer-reference/wh-cron-reference/"
updated: "2026-03-23"
category: DMSI Webhooks / Developer Reference
---

# WP-Cron Jobs Reference

DMSI Webhooks registers the following recurring WP-Cron jobs on plugin activation.

## Registered Cron Hooks

| Hook | Frequency | Handler | Purpose |
| --- | --- | --- | --- |
| `dmsi_webhooks_daily_cleanup` | Daily | `LogCleanup` | Prune old logs, clear debug entries, clear expired rotation secrets |
| `dmsi_webhooks_daily_digest` | Daily | `NotificationManager` | Send daily failure digest email (if mode = `daily`) |
| `dmsi_webhooks_rotation_cleanup` | Daily | `NotificationManager` | Additional rotation secret cleanup |
| `dmsi_webhooks_license_validation` | Daily | `LicenseManager` | Validate license with `developer.dmsi.gr` |

## Cron Job Details

### `dmsi_webhooks_daily_cleanup`

Runs daily. Performs:

- Deletes log entries older than `log_retention_days` (default: 30)
- Deletes `is_debug = 1` log entries older than 24 hours
- Clears `signing_secret_old` for endpoints where rotation was more than 24 hours ago
- Stores cleanup report in `dmsi_webhooks_cleanup_report` option

### `dmsi_webhooks_daily_digest`

Runs daily. Performs:

- Collects all permanent delivery failures from the past 24 hours
- Sends summary email to `notification_email` setting
- Skips `is_test = 1` entries

Only active when notification frequency is set to `daily`.

### `dmsi_webhooks_license_validation`

Runs daily. Performs:

- Sends activation check to `https://dmsi.gr/dmsilm/v1/licenses/activate`
- Updates `dmsi_webhooks_license_status` option
- Starts 3-day grace period on first failure (if status was previously `active`)

## Verifying Crons Are Running

1. Install a WP-Cron management plugin (e.g., WP Crontrol)
2. Go to **Tools > Cron Events**
3. Verify all four `dmsi_webhooks_*` hooks appear in the list with a next run time

## Manual Trigger for Testing

For development, you can trigger cron hooks manually:

```php
// Trigger log cleanup manually
do_action('dmsi_webhooks_daily_cleanup');

// Trigger license validation manually
do_action('dmsi_webhooks_license_validation');
```

## Related Topics

- Log Retention
- Failure Notifications
- License Key
