How can I prove if wp cron is running my task if I have DISABLE_WP_CRON set to true

I always found that logging cron job execution to a file is very helpful. Otherwise you have no idea if it’s working right. Just have your code open a file, write a timestamp, and close. Something simple like: $logfile = $_SERVER[‘DOCUMENT_ROOT’].’/CRON.txt’; $handle = fopen($logfile , ‘a’) or die(‘Cannot open file: ‘.$logfile ); $data=”cron task called … Read more

Hook/Cron Problem

And what do you think it should do? Either you posted here only part of your code or it can’t do anything that makes sense. The only thing this function does is assigning a value to a variable. This SQL query is never executed, because you don’t execute it anywhere in your code. I guess … Read more

How do i set cron job for my WordPress site?

You can also use one of the web cron services. If you don’t have access to a web server or are on a big host that doesn’t give you access to a Control Panel then these are great. Actually, I might recommend using them in place of the cron on your server anyway since their … Read more

WP-Cron function not firing

Looking at your function: function my_task_function() { $test_score update_field(‘score’, $test_score ); } $test_score is not defined here, it should be $test_score=”something”; Left the way you have it now will generate php warnings. Also the update_field function used in this context (in a cron) will require you to pass a third argument specifying which post/page contains … Read more

what effective ways are there to debug cron

I would create a simple plugin that spits the data out into a private admin page, you basically want to use: $cron = _get_cron_array(); $schedules = wp_get_schedules(); $tranny = get_transient(‘doing_cron’); //var_dump or loop over these There are several plugins that do this that style the output to make it easier to read and organize, also … Read more

my wp schedule event is not working

WP cron tasks execute in completely separate process from page load. Nothing from the task’s output will be ever seen by users. That’s the purpose of them, to run scheduled task without interfering with site itself. If you want to output to the page periodically you will have to build it in other way. You … Read more

WP-Cron system broken

For what it’s worth, I was running into the issue of the same message within WP-Cron Events but instead with a 404 “not found” code…it’s hunting for the file http://yourdomain.com/wp-cron.php. My issue turned out to be an improper file permission on my wp-cron.php file (644 instead of 666) which caused the wp-cron.php file to give … Read more

WordPress Cron job, 302 response

The problem here is a mistake regarding how to schedule a cron event, lets begin with: wp_schedule_event(time(), ‘hourly’, ‘my_schedule_hook’, $args); wp_schedule_event(time(), ‘hourly’, ‘update_user_hours’); Here you are telling WordPress to fire the update_user_hours action/event on an hourly basis. You then hook into this to fire a callback: add_action(‘update_user_hours’, ‘do_this_hourly’); But then, instead of declaring do_this_hourly, for … Read more

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