Fatal error
-
Hi,
i got the followin message:
Fatal error: Call to undefined function wp_doing_cron() in …/all4hardware4u.de/htdocs/wp-content/plugins/blackhole-bad-bots/inc/blackhole-core.php on line 372Is there a known bug or a solution for this?
Best regards,
Harry
-
Hi Harry,
wp_doing_cron()is a core WP function, as documented here:https://developer.ww.wp.xz.cn/reference/functions/wp_doing_cron/
So the error is saying that the function is not defined, which means there could be an issue with your WordPress installation.
Two questions that may help:
1) Which version of the plugin are you using?
2) How/where is the error triggered on your site? Knowing that would enable me to reproduce the issue and investigate.
Thank you for reporting.
-
This reply was modified 8 years, 10 months ago by
Jeff Starr. Reason: code highlight
-
This reply was modified 8 years, 10 months ago by
Jeff Starr. Reason: clarification
Hi Jeff,
i think i got it, i am using in my wp-config
if ( 0 < (time() % 2) ) { define('DISABLE_WP_CRON', TRUE); }and i got another error in a .js file, which was stored wrong.
So the error should be away now. It was triggered in my debug.log and i am using the last version.Glad you got it sorted, and thanks for letting me know. I will add this to the to-do list for the next update, will refactor things to check for
DISABLE_WP_CRONbefore callingwp_doing_cron(). Should do the trick.At the moment there is no error with
DISABLE_WP_CRONi am using such in my case.
Maybe it was just the wrong stored .js file.
Maybe this helps you for your checks;)Thanks. So just to be clear, you are not able to trigger any fatal error, using any method (e.g., the
DISABLE_WP_CRONconstant)..? Knowing if there is an actual issue here or not will help save some time for the next update 🙂Yes, that’s right, there is no fatal error anymore;)
If i get one, i will tell it here;)Thank you, Harry:)
Just to add my two cents here: I got the same error message on a site that’s still on 4.7.5, after updating to plugin v1.7. No
DISABLE_WP_CRONflag in the wp-config. Looks like thewp_doing_cron()function was introduced in 4.8, so that could explain it. Especially if there’s not a version check in the plugin code beforewp_doing_cron()is called?P.S. Love this and the BBQ plugin! 🙂
Ah yes that explains it.. my mistake was assuming that
wp_doing_cron()had been around longer than 4.8.. for some reason it seems like it was introduced way before then. Do you know if there is an alternate way to check if cron is running (that works on WP < 4.8)?In any case, I’ll get this fixed up in the next update, which should be relatively soon.
Thanks for the insightful feedback! 🙂
It seems like the function is mostly just a wrapper for checking if
DOING_CRONis defined. Best guess, I’d try substitutingif( defined('DOING_CRON') )for <4.8 – probably not as solid as the newwp_doing_cron()function, but it should do the job for older versions.Nice, thanks for that information. Will verify, test, and implement for the next update.
Just to follow up with this, the reported issue is resolved in Blackhole version 1.7.1, available in a few minutes. Thanks for the helpful feedback.
perfect:)
-
This reply was modified 8 years, 10 months ago by
The topic ‘Fatal error’ is closed to new replies.