Cron and WP Super Cache in Preload Mode

Will they wait until the next hit to wp-cron.php (+8 hours)? Yes. That’s why it’s important to keep this duration shorter. I usually keep it to every 5 minutes. PS: I know it’s an old question. But, wanted to answer it anyway, if someone else has the same question in the future.

Can a scheduler be set on submit of a form in wordpress?

It’s wrong to execute wp_schedule_event in plugin activation and cronjob tag. The correct tag to hook is wp. WordPress internal cron system works by “request-response” method, it checks for scheduled events immediately after any request to the whole system, after checking the scheduled events, it loads next parts of the system. So, hooking scheduling to … Read more

How to use a class within a cron job function

You’re calling a function with variables that are not defined and are required for the function to work correctly. function hourly_function() { $newClass = new newClass(); $var1 = ‘this should’; $var2 = ‘work with’; $var3 = ‘some content’; $newClass->newClass_function($var1, $var2, $var3); } You might want to move those variable to a __construct if ( ! … Read more

Cron schedule not updating after run

You can use wp-cli to execute schedules without the detour via http request. Add in crontab -e. */30 * * * * wp cron event run –path=/path/to/wp-docroot By this you wont run into maximum execution time problems which could be the reason why you schedule execution got stuck.

External cron job firing too many times

You might be calling wp-cron.php every 15 minutes, but your cron task is set to happen every 5 minutes! $schedules[“5min”] = array( ‘interval’ => 5*60, ‘display’ => __(‘Once every 5 minutes’)); … wp_schedule_event( time(), ‘5min’, ‘isa_add_every_five_minutes’ ); Change it instead to every 15 minutes

Wp Maintenance mode and external cron job

You can use the wp_doing_cron() method to determine if the request comes from a cron request or not. if( defined( ‘IN_MAINTENANCE’ ) && IN_MAINTENANCE && $pagenow !== ‘wp-login.php’ && ! is_user_logged_in() && ! wp_doing_cron() ) {

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)