Deerek11
asked on
WordPress site down Fatal error: Call to undefined function wp_doing_cron()
Hello, I have a WordPress site that is giving me an error ( Fatal error: Call to undefined function wp_doing_cron() in on line 126) I tried to login to wp-admin and get the same error. Any suggestions on a direction to fix this?
There might be some disturbances in the PHP code of your wordpress site. That's why the error is occurring.
The function you mention lives in wp-includes/load.php so to debug.
1) Check wp-includes/load.php to ensure you find the line...
If not, your site has been corrupted. Likely not a hack, as hackers don't normally break sites, they inject backdoors to access sites.
If you're missing this function, then do a manual reinstall, per...
https://codex.wordpress.or g/Upgradin g_WordPres s which will have your unzip/untar the latest WordPress install into your WordPress install directory, overwriting any corrupted files. Then visit the link...
http://your-site-name.com/ wordpress/ wp-admin/u pgrade.php to upgrade your database, if required.
This will fix any corruption problems.
2) You didn't mention what occurred on the site (likely a plugin you installed or custom code you installed via SFTP), so the likely reason for this is your WordPress core files are okay, you've just made the mistake of installing some broken code on your site. If broken code attempts to run wp_doing_cron() before all WordPress core files have loaded first, then you'll see this error.
If you know what was installed, you'll have to do a manual uninstall.
You'll do this by appending some string to the end of the theme or plugin directory causing the problem.
Like rename plugins/foo to plugins/foo-aside which will deactivate the plugin temporarily.
3) You can also enable WP_DEBUG + look at your debug log. You'll likely find the exact file + line number where problem occurred, along with a full stack trace showing entire calling tree.
Just having the message you posted above is insufficient for debugging, as there's no context (stack trace).
1) Check wp-includes/load.php to ensure you find the line...
function wp_doing_cron() {
If not, your site has been corrupted. Likely not a hack, as hackers don't normally break sites, they inject backdoors to access sites.
If you're missing this function, then do a manual reinstall, per...
https://codex.wordpress.or
http://your-site-name.com/
This will fix any corruption problems.
2) You didn't mention what occurred on the site (likely a plugin you installed or custom code you installed via SFTP), so the likely reason for this is your WordPress core files are okay, you've just made the mistake of installing some broken code on your site. If broken code attempts to run wp_doing_cron() before all WordPress core files have loaded first, then you'll see this error.
If you know what was installed, you'll have to do a manual uninstall.
You'll do this by appending some string to the end of the theme or plugin directory causing the problem.
Like rename plugins/foo to plugins/foo-aside which will deactivate the plugin temporarily.
3) You can also enable WP_DEBUG + look at your debug log. You'll likely find the exact file + line number where problem occurred, along with a full stack trace showing entire calling tree.
Just having the message you posted above is insufficient for debugging, as there's no context (stack trace).
ASKER
I can give more details, the problem is I didn't create the site I took over the site, I just did some updates. I don't have the theme but prior to doing my updates, I did run a backup with updraft plus. The site is hosted with Siteground, but I am not sure what happened to the site the customer called me and told me that the site was down, so it could have been someone in the organization messing around in WordPress or god only knows.
Can I reinstall WordPress without having the theme? What other information do you need to assist
Thanks for all of your help so far
Can I reinstall WordPress without having the theme? What other information do you need to assist
Thanks for all of your help so far
Enable WP_DEBUG in your wp-config.php file + likely you'll see the exact problem.
If you get stumped, attach a copy of your debug.log file for review, or a clickable URL to your debug.log file, which is usually something like https://foo.com/debug.log or similar.
If you get stumped, attach a copy of your debug.log file for review, or a clickable URL to your debug.log file, which is usually something like https://foo.com/debug.log or similar.
ASKER
what are you guys thought about paying 19.99 for a one time use of the backup tool to restore the website? Site ground offers this, but my concern is I am kind of sure the site was up this past Friday but I am not sure if site ground is gonna give me the option of picking a day to restore from I have never used their restore tool.
ASKER
I personally never trust panel restores.
My preference is ssh, so I know exactly what's being restored + to where.
And before you muck about with restores, do the WP_DEBUG trick first.
Likely this will show you the one simple thing to do to get your site back online.
Tip: Always go the simple route first.
My preference is ssh, so I know exactly what's being restored + to where.
And before you muck about with restores, do the WP_DEBUG trick first.
Likely this will show you the one simple thing to do to get your site back online.
Tip: Always go the simple route first.
ASKER
I just enable the debug by
define('WP_DEBUG', true);
how do I access the log?
Sorry for the basic questions but never had to do this before
define('WP_DEBUG', true);
how do I access the log?
Sorry for the basic questions but never had to do this before
How you access logs depends on your wp-config.php settings.
Usually, as stated above, https://foo.com/debug.log will access your log.
Or you can download your log via SFTP.
Usually, as stated above, https://foo.com/debug.log will access your log.
Or you can download your log via SFTP.
I've used that backup restore at Siteground without a problem. However, it was for a site I custom built. At the very least you could make sure you download a complete backup of the current site and then use that Siteground feature. If things go further south, then you can reinstall your backup and keep picking away at it.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.