Cron & Scheduled Tasks Setup
WordPress by default uses “WP-Cron”, a virtual pseudo-cron that only triggers when someone visits your website. If traffic is low or pages are aggressively cached, scheduled tasks (such as countdown closings and ticket hold releases) may be delayed.
Recommended: Disable WP-Cron & Configure Server Crontab
Section titled “Recommended: Disable WP-Cron & Configure Server Crontab”Step 1: Disable Default WP-Cron
Section titled “Step 1: Disable Default WP-Cron”Add this line to your wp-config.php file, just before /* That's all, stop editing! Happy publishing. */:
define( 'DISABLE_WP_CRON', true );Step 2: Add Real Server Cron (Every Minute)
Section titled “Step 2: Add Real Server Cron (Every Minute)”Log into your hosting control panel (cPanel, Plesk, Cloudways, CyberPanel) or connect via SSH, and add a cron job running every 1 minute:
Option A: Using wget (Standard)
Section titled “Option A: Using wget (Standard)”* * * * * wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1Option B: Using curl
Section titled “Option B: Using curl”* * * * * curl -s https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1Option C: Using WP-CLI (Fastest & Most Reliable)
Section titled “Option C: Using WP-CLI (Fastest & Most Reliable)”* * * * * /usr/local/bin/wp cron event run --due-now --path=/var/www/html >/dev/null 2>&1Option D: Third-Party Webcron (EasyCron / Cron-Job.org)
Section titled “Option D: Third-Party Webcron (EasyCron / Cron-Job.org)”If your shared hosting provider does not provide access to crontab or SSH:
- Sign up for an external webcron service such as EasyCron or cron-job.org.
- Create a new cron job with the URL:
https://yourdomain.com/wp-cron.php?doing_wp_cron
- Set the execution interval to Every 1 minute (or every 5 minutes depending on your plan).
- Set HTTP Method to
GET.
Direct Plugin Cron Endpoints (Recommended)
Section titled “Direct Plugin Cron Endpoints (Recommended)”In addition to the standard WordPress cron, Quantum Competitions provides two dedicated direct endpoints that bypass pseudo-cron scheduling entirely for sub-minute accuracy:
1. Finished Competition Checker (?competition-cron=check)
Section titled “1. Finished Competition Checker (?competition-cron=check)”Executes simple_lottery_cron() to evaluate closing dates and draw winners:
* * * * * wget -q -O - "https://yourdomain.com/?competition-cron=check" >/dev/null 2>&1- Internal Loop: Runs 3 cycles per execution with 20-second sleep intervals, ensuring closing accuracy within 20 seconds.
- Auto-Dismiss: Pinging this URL automatically clears the admin dashboard setup warning.
2. Automated Relister (?competition-relist=true)
Section titled “2. Automated Relister (?competition-relist=true)”Executes qcw_pn_cron() to republish expired competitions configured with automatic relisting:
0 * * * * wget -q -O - "https://yourdomain.com/?competition-relist=true" >/dev/null 2>&1Verifying Cron Status
Section titled “Verifying Cron Status”Navigate to Competitions > Settings > Tools to view the status of registered cron events:
qcw_check_ended_competitions: Scans for competitions whose end date has passed.qcw_cleanup_cart_reservations: Releases unpurchased ticket reservations whose hold time expired.- In WP Admin header notices, check whether the cron notice has cleared.