WP-Cron tasks scheduled but not running

First can you please confirm that you don’t have any caching plugins enabled? Caching plugins can interfere with cron jobs because your visitors are not served a live page but a cached version of your page. If you have a caching plugin enabled, you can choose one of your pages, add an exclusion to your … Read more

WordPress cron running twice

I tried WP Crontrol instead and it turned out that two cron jobs were being created for generate_send_csv. To fix this, I created the crons within activation hooks and deactivation hooks as follows: register_activation_hook( __FILE__, ‘my_activation’ ); add_action( ‘generate_send_csv’, ‘generate_and_send_csv’ ); function my_activation() { wp_schedule_event(‘1488979800’, ‘daily’, ‘generate_send_csv’); } register_deactivation_hook( __FILE__, ‘my_deactivation’ ); function my_deactivation() { … Read more

Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?

There is no reason for your design, but the core of your problem is that (I assume) people are trying to use a free tier of the API instead of properly paying for its use and removing the ridiculous restrictions. Anyway, the solution is fairly simple, run your cron every half an hour, allocate to … Read more

How to use wp-ajax in wp-cron

First of all, think about using the new REST API instead of Admin-AJAX in your environment where JavaScript is available. Now to answer your question: JavaScript isn’t available for wp-cron, as these requested solely run on the server and not on some interpreted HTML/JavaScript. So what can you do? Well, just schedule another event if … Read more

Cron Job not working in plugin

The cron event needs to be registered on the plugin activation hook like so: register_activation_hook( __FILE__, ‘activate_cron’ ); function activate_cron() { wp_schedule_event( current_time( ‘timestamp’ ), ‘hourly’, ‘the_function_to_run’ ); } The the_function_to_run defined in the wp_schedule_event needs to be your function that you want to run at the time interval. Note: When you say something is … Read more

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