• Resolved Harry Milatz

    (@harry-milatz)


    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 372

    Is there a known bug or a solution for this?

    Best regards,
    Harry

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi Harry,

    wp_doing_cron() is a core WP function, as documented here:

    https://developer.www.ads-software.com/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 7 years, 3 months ago by Jeff Starr. Reason: code highlight
    • This reply was modified 7 years, 3 months ago by Jeff Starr. Reason: clarification
    Thread Starter Harry Milatz

    (@harry-milatz)

    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.

    Plugin Author Jeff Starr

    (@specialk)

    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_CRON before calling wp_doing_cron(). Should do the trick.

    Thread Starter Harry Milatz

    (@harry-milatz)

    At the moment there is no error with DISABLE_WP_CRON i am using such in my case.
    Maybe it was just the wrong stored .js file.
    Maybe this helps you for your checks;)

    Plugin Author Jeff Starr

    (@specialk)

    Thanks. So just to be clear, you are not able to trigger any fatal error, using any method (e.g., the DISABLE_WP_CRON constant)..? Knowing if there is an actual issue here or not will help save some time for the next update ??

    Thread Starter Harry Milatz

    (@harry-milatz)

    Yes, that’s right, there is no fatal error anymore;)
    If i get one, i will tell it here;)

    Plugin Author Jeff Starr

    (@specialk)

    Thank you, Harry:)

    Matt Weeden

    (@mattweedendesign)

    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_CRON flag in the wp-config. Looks like the wp_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 before wp_doing_cron() is called?

    P.S. Love this and the BBQ plugin! ??

    Plugin Author Jeff Starr

    (@specialk)

    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! ??

    Matt Weeden

    (@mattweedendesign)

    It seems like the function is mostly just a wrapper for checking if DOING_CRON is defined. Best guess, I’d try substituting if( defined('DOING_CRON') ) for <4.8 – probably not as solid as the new wp_doing_cron() function, but it should do the job for older versions.

    Plugin Author Jeff Starr

    (@specialk)

    Nice, thanks for that information. Will verify, test, and implement for the next update.

    Plugin Author Jeff Starr

    (@specialk)

    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.

    Thread Starter Harry Milatz

    (@harry-milatz)

    perfect:)

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Fatal error’ is closed to new replies.