Time limit on long cron job?

Further research has resulted in mixed information and no clear solution. Our solution is to use a separate file and execute the script using CRON via the command-line, rather than relying on the WordPress cron system. This has the added bonus of max_execution_time=0 as well. PHP Max execution time Stripe’s API seems to take about … Read more

WP Cron scheduling doesn’t work reliably on hosted server

Most hosts modify how the default cron works and I’ve specifically had issues with GoDaddy managed hosting as they 100% take control and you can’t do anything about it. If it works locally, I would contact the hosting company and ask about how crons are setup to run. If its Managed GoDaddy there isn’t anything … Read more

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