skip to Main Content

Background: Several years ago I developed a simple WordPress site for my local government that they took over in terms of managing/updating. This summer a local resident contacted me stating the site wasn’t loading, and I reached out to the current admin user to see if I could assist. When attempting to access the site’s login (or any other resource), we see the message "There has been a critical error on this website. Please check your site admin email inbox for instructions."

The current admin has assured me they’ve searched their mailbox and have no emails from WordPress with a link to recovery mode logins. I’ve since changed the admin user’s email to mine via MySQL, but haven’t received any emails from WP regarding the site. The host, Network Solutions, told me they cannot restore a backup as they’re only retained for 30 days, and I was brought in about 5 months after the site went down in February.

So far, I’ve tried the basics like:

  • Renaming the plugins folder and active theme folder via SFTP, without any impact.
  • The WP version appears to have been upgraded around the time this
    issue occurred. Either from 6.3.1 to 6.6.2, or unsuccessfully from
    6.6.2 to 6.7.1. The current WP version is reported 6.6.3. I do not know the PHP version and the host is unable to provide that info. I
    will try to upload a PHP file to determine it later this evening.
  • I can access the MySQL database where I also disabled all plugins,
    but still no joy
  • I also manually replaced WP 6.6.3 with the original 6.3.1, but this
    still did nothing.

I updated the wp_config.php file to enable debugging, and see the following message in the output, though I’m unsure how to resolve it. Has anyone ever seen this?

Uncaught Error: Call to undefined function wp_get_wp_version() in /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-includes/blocks/index.php:30
Stack trace:
#0 /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-includes/class-wp-hook.php(324): register_core_block_style_handles()
#1 /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#2 /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-includes/plugin.php(517): WP_Hook->do_action()
#3 /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-settings.php(700): do_action()
#4 /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-config.php(81): require_once(‘/data/user/2018…’)
#5 /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-load.php(50): require_once(‘/data/user/2018…’)
#6 /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-blog-header.ph in /data/user/2018/295/5738/wordpress/.5f11b27f131494a1c014fcced2f13165/wp-includes/blocks/index.php on line 30

2

Answers


  1. enter image description here

    <?php
        add_action('init', function () {
            global $wp_version;
            echo $wp_version;
        });
        ?>
    
    Login or Signup to reply.
  2. You can try to create custom function in your yourTheme/function.php:

    if (!function_exists('wp_get_wp_version')) {
        function wp_get_wp_version() {
            static $wp_version;
    
            if (!isset($wp_version)){
                require ABSPATH . WPINC . '/version.php';
            }
    
            return $wp_version;
        }
    }
    

    enter image description here

    Also you can try rollback your wordpress to 6.2.6

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search