How Promodata Sync Works (and Fixing WP-Cron Delays)
To keep your WooCommerce store’s promotional product catalogue up to date, our plugin connects to the Promodata API during a scheduled nightly Sync.
Understanding how this process works—and how your server triggers it—ensures your store’s data stays fresh without performance hitches.
What Triggers the Nightly Sync?
The sync relies on a background timer called a Cron Job. Think of a Cron Job as an automated alarm clock built into your website. When the clock hits a set time (usually midnight), it automatically wakes up the plugin to run the API sync.
By default, WordPress handles this using its built-in system called WP-Cron.
The “WP-Cron” Issue: Why Your Sync Might Be Delayed
Unlike a standard alarm clock, WP-Cron only checks the time when someone visits your website.
- If your site gets regular night traffic: A visitor lands on your site at 2:05 AM, triggers WP-Cron, and your nightly sync runs smoothly.
- If your site has low traffic at night: If no one visits your site between midnight and 8:00 AM, the sync will not run until the first visitor arrives at 8:01 AM.
This can cause product updates to be delayed or place heavy loading demands on the first customer who visits your store in the morning.
Suggested Solution: Set Up a True Server Cron
To ensure your Promodata sync runs reliably every night at the exact same time—regardless of website traffic—we strongly recommend setting up a True Server Cron Job through your hosting control panel (e.g., SiteGround, cPanel, Plesk, or Cloudways).
Step 1: Disable Default WP-Cron
Open your website’s wp-config.php file using a File Manager or FTP, scroll near the bottom, and add this line above/* That's all, stop editing! Happy publishing. */:
PHP
define('DISABLE_WP_CRON', true);
Step 2: Add a Server Cron Job
Log into your hosting account’s Cron Jobs menu and create a task running Twice Per Hour (or every 30 minutes).
Option A: WP-CLI Method (Recommended)
This is the fastest and most stable method for API syncs because it executes directly on the server without web timeouts:
Bash
cd /home/customer/www/yourdomain.com/public_html; wp cron event run --due-now >/dev/null 2>&1
(Be sure to replace /home/customer/www/[yourdomain.com/public_html](https://yourdomain.com/public_html) with your site’s actual server file path).
Option B: Standard URL Method
If your host does not support WP-CLI, use a standard web command instead (replace yourdomain.com with your actual domain):
Bash
wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Need Assistance? If you are uncomfortable editing files or managing server settings, mention this document to your web host or site developer—they will be able to configure this for you!
“Sync Now” Fallback
If your site hasn’t synced with Promodata within 24 hours, a Sync Now button will activate on the plugin admin page. Clicking this forces a data exchange.
Please note:
- The Sync Now button is inactive if a sync is currently running, or if your website has synced with Promodata within the last 24 hours.
- Yes, Sync Now can used for your initial data sync
