Wp cron event is set but the function isn’t getting fired

I’m a WP cron beginner trying to make some test function. So i have a test page with this code: if ( ! wp_next_scheduled( ‘do_this_in_an_hour’ ) ) { wp_schedule_single_event( time() + 40, ‘do_this_in_an_hour’ ); } And for the testing: echo wp_next_scheduled( ‘do_this_in_an_hour’ ); echo ‘<pre>’; $cron_jobs = get_option( ‘cron’ ); var_dump($cron_jobs); echo ‘</pre>’; And in … Read more

Why would wp_schedule_single_event get delayed start?

I’m using wp_schedule_single_event to run a function in the background immediately when a logged in user visits the dashboard page. The problem I’m having is that the time between triggering and the function actually running varies between a few seconds and 5 minutes. I’m debugging by emailing myself as soon as I call wp_schedule_single_event, and … Read more

Why cron doesn’t work to me?

I’m on centOS 7 and I have a WordPress site. Due to some problems with the WordPress default wp-cron settings, I have chosen to do the cron tasks with my server instead. I have used this command: wget http://www.example.com/wp-cron.php?doing_wp_cron=1 > /dev/null 2>&1 to run every 10 minutes. This works, every ten minutes it try to … Read more

Too many wp-cron requests even when disabled

We have a webserver with a number of WordPress instances. Most, if not all of them have disabled wp-cron.php using the wp-config.php line: define(‘DISABLE_WP_CRON’,true); Despite this, there are more than a thousand requests a day that are made using wp-cron, and a typical logged request looks like this: example.com:80 my.ip.add.res – – [19/Nov/2015:10:38:10 +0000] “POST … Read more

WordPress wp-cron not working

Cron is not working as expected. If i schedule post or Event Manager event it never get published if the site is accessed after published time. If i go to http://somedomain.tld/wp-cron.php?doing_wp_cron it’s empty instead debugging is set on. Should it be empty or should it display some errors if there is any? Error log is … Read more

Temporary .htaccess blocking is disabling WP Crons from running?

I’m currently working on a production site where htaccess is blocking users that do not have my IP from accessing the site: RewriteEngine On RewriteCond %{REMOTE_ADDR} !^11.22.33.44 RewriteCond %{REQUEST_URI} !^/brb/(.)*$ [NC] RewriteRule ^(.*)$ /brb/index.html [R=307,L] Maintenance mode, basically. I’ve now realized, WP Crons are not running. And I’m trying to force them to run (WP … Read more

Getting Error “invalid secret string” by running wp-cron.php manually

I am trying to run the wp-cron.php manually by calling it that way: http://mysite.com/wp-cron.php?doing_wp_cron Disabling the auto cron function with : define(‘DISABLE_WP_CRON’, TRUE); produces the same error. What could be the issue? 3 Answers 3 If you’re launching wp-cron manually you don’t need the “doing_wp_cron” parameter. The fact that you have it and haven’t given … Read more

wp_get_schedule and wp_next_scheduled don’t find my scheduled wp-cron job

I have tried the following two approaches, each resulting that the cronjob gets added over and over again, until I remove the code. I literally had it scheduled hundreds of times… if(!wp_next_scheduled(‘send_order_surveys’)){ wp_schedule_event(time(), ’30min’, ‘send_order_surveys’); } if(!wp_get_schedule(‘send_order_surveys’)){ wp_schedule_event(time(), ’30min’, ‘send_order_surveys’); } What am I doing wrong? 1 Answer 1 Well, I found the answer in … Read more