Cannot delete cron job
-
I stumbled upon an issue with your plugin. I tried to delete a cron job, but got a popup message “wrong_nonce” instead and it didn’t delete it. It happened over and over.
I found a message in the log file.
Warning: Attempt to read property ‘hash’ on bool in …\advanced-cron-manager\inc\Cron\EventsActions.php on line 166.
I got this in my test environment — Local (by Flywheel) Ver 6.1.8, running WordPress 5.8.2 on nginx with MySQL 8.0.16 and PHP 8.0.0.
My workaround was to use wp_unschedule_event() to delete the jobs. But it would have been nicer if your plugin had worked.
I have a theory. I’m working on a plugin of my own. As such I’m scheduling my own cron job and testing it, which gives me numerous chances to delete created jobs before re-running my code (where it creates the job.) In testing, I created a new schedule for 15 seconds and set my job to execute every 15 seconds.
When looking at the list of jobs in your plugin, my job shows ‘In Queue’ instead of the time that it’s supposed to run next. Is it possible that when the job is loaded and ready to run that that somehow stops the job deletion from working correctly in your plugin?
Anyway, I like your plugin and will keep using it. I was able to delete other cron jobs that weren’t ‘in queue’.
- The topic ‘Cannot delete cron job’ is closed to new replies.