Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using a plugin to send emails to a relatively large email list. Because we have a low per-hour email threshold from our host we have to use a setting in the plugin to throttle the emails down to only a certain number every hour. I am assuming that the plugin uses wp-cron to accomplish this. I have tried finding documentation on wp-cron but the only substantial information I have been able to find is that it requires a page view to run.

Questions:

  1. Is an RSS feed being pinged enough to trigger a "page view" and therefore wp-cron?
  2. How long after a page view will wp-cron run? (e.g. if last page view is at 6:59p.m. will cron scheduled for 7pm run?)
  3. What happens if a cron job is missed?(No one visits website all day until 7:03 p.m. Is 7p.m. cron job run?)
share|improve this question
    
Ad 3) No - cron job won't run. –  kaiser Aug 30 '12 at 1:04
1  
Check out my answer here: wordpress.stackexchange.com/questions/62623/… –  Brian Fegter Aug 30 '12 at 4:09
add comment

1 Answer

up vote 2 down vote accepted
  1. Yes.

  2. No, because the scheduled job hasn't reached the time yet.

  3. Yes, but not until 7:03pm.

Basically, any hit to the site after the scheduled time will cause the queued job to run. The WP_Cron is a "best effort" system, not an exact timer. This is generally good enough though, since if nobody's visiting the site, then it doesn't need to run and do anything for the most part.

share|improve this answer
    
Thanks for clarifying #3. +1 Question: Will all jobs run, when the time was missed, or just the last one? –  kaiser Aug 30 '12 at 17:03
1  
All jobs run, but not necessarily at once. PHP on websites typically has a 30 second timeout, if the total job queue takes longer than that, it may get deferred to the next hit. –  Otto Aug 30 '12 at 17:55
    
@Otto So if I have stuff running in the wp-cron I can be assured that it will run eventually? –  fdsa Sep 1 '12 at 2:13
    
No, because nobody might visit your site. :) It will probably run. That's the best anybody can say. If you need guarantees, use a real cron job instead. –  Otto Sep 1 '12 at 4:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.