Cronjob not working as expected – issue with hook?

Unfortunately the WordPress cron jobs are only triggered when your site is visited (see Codex): The action will trigger when someone visits your WordPress site, if the scheduled time has passed. I believe this to get around the fact that many on shared hosting aren’t normally allowed to set up cron jobs (at least, not … Read more

Cron jobs for deactivated plugins

This might be because the plugins you were using didnt deregister the crons it setup. To remove the crons use the following code in your functions file: add_action(“init”, “clear_crons_left”); function clear_crons_left() { wp_clear_scheduled_hook(“cron_name”); } Once thats run once you can safely remove it

How to make wp cron job not fire immediately?

As described in wp_schedule_event first parameter is $timestamp – the first time that you want the event to occur. So just add interval to $timestamp. I think it should be like wp_schedule_event( time() + $delay, ‘interval1’, ‘my_cron_hook’ ); And set $delay as miliseconds before hook starts.

Recurring scheduled task help

You have to schedule your event in a hook, for example in after_setup_theme or wp actions: add_filter(‘cron_schedules’,’my_cron_definer’); function my_cron_definer($schedules){ $schedules[‘twomin’] = array( ‘interval’=> 120, ‘display’=> __(‘Once Every 2 Minutes’) ); return $schedules; } add_action(‘my_periodic_action’,’my_periodic_function’); function my_periodic_function(){ mail(’[email protected]’,’Test!’, ‘Test Message’); } add_action( ‘wp’, ‘wpse8170_setup_events’ ); // or add_action( ‘after_setup_theme’, ‘wpse8170_setup_events’ ); function wpse8170_setup_events() { if ( … Read more

run a cron task without obstructing page load?

Cron tasks don’t directly affect page load besides the 0.01s timeout (of course, they do affect server load, so they can impact page load indirectly). My hunch is that your PHP config is the issue. The cron tasks run like any other web request, and they’re subject to PHP’s max_execution_time INI setting. If this is … Read more

When does next Cron Job run (time from now)?

Edit: wp_next_scheduled() returns the timestamp of the next scheduled job of a specified wp-cron job-arguments pair. Please note that this differs slightly in functionality to the answer below, in that you have to provide the arguments passed to cron job’s callback (if it has any). The original answer would provide the time of the next … Read more

wp-cron.php – How are WP’s Cron transients removed?

Transients expire on their own. No need to unset them. And to call wp-cron manually is simple. Just define DISABLE_WP_CRON to true in the wp-config file to disable the normal cron spawning process. Then make your cron system hit wp-cron.php manually every so often to process pending jobs. There is no other special trick that … Read more

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