WordPress Cron

Understanding how WordPress Cron handles background processing for imports and exports

Overview

PrimeLink uses WordPress Cron (WP-Cron) to process imports and exports in the background. This allows long-running operations to complete without timing out or blocking your browser session.

WordPress Cron is WordPress's built-in task scheduler that runs scheduled tasks when your site receives a page request. PrimeLink leverages this system to process imports and exports in iterations, ensuring reliable completion even for large datasets.

How WordPress Cron Works

Pseudo-Cron System

WordPress Cron is a "pseudo-cron" system:

  • Triggered by Visits: Runs when someone visits your site
  • Not Real-Time: Tasks may be delayed if site has no visitors
  • Automatic: No server configuration needed
  • Built-in: Works out of the box with WordPress

How PrimeLink Uses It

When you start an import or export with iterative processing:

  1. PrimeLink processes the first batch of records
  2. Schedules the next iteration via WordPress Cron
  3. WordPress Cron triggers the next iteration when a page is loaded
  4. Process continues until all records are processed

Iterative Processing

How It Works

PrimeLink breaks large imports/exports into smaller iterations:

  • Batch Size: Processes a configurable number of records per iteration
  • Automatic Scheduling: Each iteration schedules the next one
  • Progress Tracking: Tracks progress across iterations
  • Resumable: Can resume if interrupted

Benefits

  • No browser timeouts
  • Can close browser and let process continue
  • Handles large datasets reliably
  • Progress visible in admin

Enabling Background Processing

For Imports

Enable iterative processing in Step 6 of the import wizard:

  1. Navigate to Step 6: Options & Scheduling
  2. Find "Advanced Options" section
  3. Enable "Iterative, Piece-by-Piece Processing"
  4. Set "Records per iteration" (default: 20)
  5. Continue with import setup

For Exports

Background processing is automatically enabled for large exports, or can be configured in export options.

Monitoring Progress

Import Progress

Monitor import progress:

  • Go to PrimeLink → Imports → Manage Imports
  • View status column (Running, Completed, Error)
  • Check progress indicators
  • View detailed logs

Export Progress

Monitor export progress:

  • Go to PrimeLink → Exports → Manage Exports
  • View status and progress
  • Check completion status
  • Download completed exports

WordPress Cron Limitations

Potential Issues

  • Requires Site Traffic: Needs page visits to trigger
  • Delayed Execution: Tasks may be delayed if site has no visitors
  • Not Real-Time: Not as precise as system cron
  • Resource Dependent: Depends on site traffic patterns

When to Use External Cron

Consider using External Cron if:

  • Your site has low traffic
  • You need more reliable scheduling
  • You need faster execution
  • You have server access to configure cron
💡 Tip: For most sites with regular traffic, WordPress Cron works well. For high-traffic sites or when you need more reliability, consider External Cron.

Troubleshooting

Jobs Not Processing

  • Check Site Traffic: WordPress Cron needs page visits to trigger
  • Visit Your Site: Manually visit your site to trigger cron
  • Check Cron Status: Use a plugin to check if WordPress Cron is working
  • Check Server Logs: Look for errors in server logs

Slow Processing

  • Reduce Iteration Size: Process fewer records per iteration
  • Increase Site Traffic: More visits = more frequent cron execution
  • Check Server Performance: Ensure server has adequate resources
  • Consider External Cron: For more reliable execution

Jobs Stuck

  • Check Status: Verify job status in Manage Imports/Exports
  • Clear Cron Events: Clear stuck cron events if needed
  • Restart Job: Pause and resume, or restart the job
  • Check Logs: Review error logs for issues

Best Practices

  • Use for Large Jobs: Enable iterative processing for large imports/exports
  • Set Appropriate Batch Size: Balance speed with reliability (20-50 records)
  • Monitor Progress: Regularly check job status
  • Ensure Site Traffic: Make sure your site receives regular visits
  • Test First: Test with small batches before large imports
  • Keep Browser Open: For initial start, keep browser open until first iteration completes
  • Check Regularly: Monitor jobs to ensure they're progressing

Next Steps

⚙️ External Cron

Learn about using external cron for more reliable processing

Learn More →
⚡ Performance & Optimization

Optimize import and export performance

Learn More →
📥 Creating Imports

Complete guide to creating imports

Learn More →