Manage scheduled background tasks in WordPress Download Manager. Access these settings from Downloads > Settings > Cron Jobs.
Overview
WPDM uses WordPress cron to handle scheduled tasks such as:
Active Cron Jobs
View and manage all WPDM scheduled tasks.
Default Cron Jobs
| Job Name | Schedule | Description |
|---|---|---|
| wpdm_activity_report | Daily/Weekly | Send activity email reports |
| wpdm_cleanup_expired | Hourly | Remove expired download links |
| wpdm_stats_aggregation | Daily | Aggregate download statistics |
| wpdm_email_queue | Every 5 min | Process email queue |
| wpdm_license_check | Weekly | Validate licenses |
| wpdm_cache_cleanup | Daily | Clean expired cache files |
Job Status
| Status | Description |
|---|---|
| Active | Job is scheduled and running |
| Paused | Temporarily disabled |
| Failed | Last run encountered error |
| Pending | Waiting for next run |
Managing Cron Jobs
View Jobs
The cron jobs table shows:
| Column | Description |
|---|---|
| Job Name | Identifier for the job |
| Next Run | When job will run next |
| Last Run | When job last completed |
| Interval | How often it runs |
| Status | Current status |
| Actions | Edit, Run Now, Delete |
Run Job Now
Execute a job immediately:
Pause/Resume Job
Temporarily disable a job:
Delete Job
Remove a custom job:
Note: Default WPDM jobs cannot be deleted.
Creating Custom Cron Jobs
Add New Job
| Field | Description |
|---|---|
| Job Name | Unique identifier |
| Hook | WordPress action hook |
| Schedule | Frequency (hourly, daily, etc.) |
| First Run | When to start |
| Arguments | Optional parameters |
Available Schedules
| Schedule | Interval |
|---|---|
| Every Minute | 1 minute |
| Every 5 Minutes | 5 minutes |
| Every 15 Minutes | 15 minutes |
| Hourly | 1 hour |
| Twice Daily | 12 hours |
| Daily | 24 hours |
| Weekly | 7 days |
| Monthly | 30 days |
Custom Intervals
Add custom intervals via code:
add_filter('cron_schedules', function($schedules) {
$schedules['every_three_hours'] = [
'interval' => 10800,
'display' => 'Every 3 Hours'
];
return $schedules;
});
Cron Configuration
WordPress Cron Settings
| Setting | Description | Default |
|---|---|---|
| Enable WP-Cron | Use WordPress cron system | Enabled |
| Alternate Cron | Use alternate cron method | Disabled |
| Cron Lock | Prevent simultaneous runs | Enabled |
Server Cron
For high-traffic sites, use server cron instead:
define('DISABLE_WP_CRON', true);
# Run every minute * * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
Or with WP-CLI:
* * * * * cd /path/to/wordpress && wp cron event run --due-now > /dev/null 2>&1
Job Monitoring
Job History
View execution history for each job:
| Field | Description |
|---|---|
| Run Time | When job executed |
| Duration | How long it took |
| Status | Success/Failed |
| Output | Job output/logs |
| Memory | Memory usage |
Performance Metrics
| Metric | Description |
|---|---|
| Avg Duration | Average execution time |
| Success Rate | Percentage successful |
| Failed Count | Number of failures |
| Last Error | Most recent error |
Error Handling
Failure Notifications
| Setting | Description | Default |
|---|---|---|
| Email on Failure | Send email when job fails | Enabled |
| Failure Threshold | Failures before alert | 3 |
| Admin Email | Where to send alerts | Site admin |
Retry Settings
| Setting | Description | Default |
|---|---|---|
| Auto Retry | Retry failed jobs | Enabled |
| Max Retries | Number of retry attempts | 3 |
| Retry Delay | Wait between retries | 5 minutes |
| Exponential Backoff | Increase delay each retry | Enabled |
Common Errors
| Error | Cause | Solution |
|---|---|---|
| Timeout | Job takes too long | Increase timeout or optimize |
| Memory | Exceeded memory limit | Increase limit or batch process |
| Lock | Another instance running | Wait or clear locks |
| Missing Hook | Action not registered | Check plugin activation |
Debugging
Debug Mode
Enable detailed logging:
Log Location
Cron logs are stored in:
/wp-content/uploads/wpdm-cache/logs/cron-{date}.log
WP-CLI Commands
# List all cron events wp cron event list # Run specific event wp cron event run wpdm_activity_report # Run all due events wp cron event run --due-now # Delete an event wp cron event delete wpdm_custom_job
Performance Tips
Optimization
| Tip | Description |
|---|---|
| Batch Processing | Process large datasets in chunks |
| Off-Peak Scheduling | Run heavy jobs at low-traffic times |
| Use Server Cron | More reliable than WP-Cron |
| Monitor Memory | Watch for memory leaks |
Resource Limits
| Setting | Description | Default |
|---|---|---|
| Max Execution Time | Seconds before timeout | 300 |
| Memory Limit | Maximum memory usage | 256M |
| Concurrent Jobs | Max simultaneous jobs | 2 |
Security
Job Access
| Setting | Description |
|---|---|
| Nonce Verification | Verify job authenticity |
| Capability Check | Required user capability |
| IP Whitelist | Allowed trigger IPs |
Audit Log
Track who manages cron jobs:
| Event | Logged Data |
|---|---|
| Job Created | User, time, job details |
| Job Modified | User, changes made |
| Job Deleted | User, job that was deleted |
| Manual Run | User, job executed |