Support » Fixing WordPress » Fatal error “‘WP_Theme_JSON_Resolver’ not found”, in manual upgrade to 5.8

  • I’ve been trying to upgrade manually to 5.8 from 5.7.2, since the auto-upgrade seemed to have failed. I went to follow the WordPress instructions for manually updating.

    I did step 1. At step 2, I cannot access the admin panel — it only comes up with the critical error message. (“There has been a critical error on this website.”) Here is the log for the fatal error:

    
    Fatal error: Uncaught Error: Class 'WP_Theme_JSON_Resolver' not found in /htdocs/wp-includes/script-loader.php:1530 Stack trace: #0 /htdocs/wp-includes/class-wp-hook.php(303): wp_default_styles(Object(WP_Styles)) #1 /htdocs/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array) #2 /htdocs/wp-includes/plugin.php(518): WP_Hook->do_action(Array) #3 /htdocs/wp-includes/class.wp-styles.php(135): do_action_ref_array('wp_default_styl...', Array) #4 /htdocs/wp-includes/functions.wp-styles.php(24): WP_Styles->__construct() #5 /htdocs/wp-includes/functions.wp-styles.php(176): wp_styles() #6 /htdocs/wp-login.php(96): wp_enqueue_style('login') #7 /htdocs/wp-login.php(1285): login_header('Log in /htdocs/wp-includes/script-loader.php on line 1530
    

    There was also a warning:

    
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_enable_block_templates' not found or invalid function name in /htdocs/wp-includes/class-wp-hook.php on line 303
    

    I disabled plug-ins (by renaming it the folder to plugins.hold) and the same thing appeared, I think. I tried to disable the two non-default themes that I had (renamed their folders), but then I couldn’t access the site at all through my browser (as in, there was no critical error message displayed, because Safari can’t reach the server).

    I’m new to WordPress and totally unfamiliar with PHP, so it’s hard for me to diagnose what might be going on. In terms of themes, I have the Humani theme https://themeforest.net/item/humani-nonprofit-charity-wordpress-theme/32583278 and its plugin requirements (just for context). Do you think it is related to that theme? If so, I’ll go post in their support, rather than on this forum.

Viewing 14 replies - 1 through 14 (of 14 total)
  • @cactusflowertracey I am not sure if this is a theme problem or a WordPress problem so I have a few questions to help narrow it down: What plugins do you have installed? Do you use the Gutenberg plugin https://wordpress.org/plugins/gutenberg/? (not to be confused with the Gutenberg shipped directly with WordPress)

    • This reply was modified 1 year, 4 months ago by zieladam.

    Hi, I’m getting the exact same error and my WordPress was on auto-update. Did you find a fix for this? (I’ve disabled my plugins and set the template to a default theme via SQL)

    Thread Starter cactusflowertracey

    (@cactusflowertracey)

    @zieladam thanks a lot for trying to help narrow it down, so these are the plugins I have:

    • Akismet
    • breadcrumb-navxt
    • contact-form-7
    • elementor
    • give
    • header-footer-elementor
    • loginizer
    • mailchimp-for-wp
    • make-column-clickable-elementor
    • really-simple-ssl
    • rev-slider
    • svg-support

    Aside from Akismet, loginizer and Really Simple, the plugins were requirements of the theme. The themes I have in my theme folder are Humani, Humani-Child and twenty twenty one.

    I seem not to have the Gutenberg plugin or the one shipped with WordPress, I just realised. Is it recommended to have it? (I installed WordPress through Softaculous.)

    @awetherillweb Unfortunately not yet, it was evening for me when I posted but I am going to try again today.

    Edit: Ok, I just decided to go back to 5.7.2 for now (I replaced wp-admin and wp-includes folders from the 5.7.2 release) and my website is back up again

    @cactusflowertracey thank you for all the details! If you disabled all the plugins and the problem persisted (as indicated in your initial posts), it leads me to believe that it could be a compatibility issue between the Humani theme and WordPress 5.8 (especially if downgrading to WP 5.7 solved it). Unfortunately the support for third party themes is not provided on these forums, but you may be able to get support from the theme’s author.

    • This reply was modified 1 year, 4 months ago by zieladam.
    Thread Starter cactusflowertracey

    (@cactusflowertracey)

    @zieladam yeah thanks for the info, I’ll have to check with them to see if they have made their theme compatible with WordPress 5.8 yet. Cheers!

    Thread Starter cactusflowertracey

    (@cactusflowertracey)

    I would close the thread, but I might leave it open a bit further just to check with @awetherillweb, if they suspect that the issue is to do with 5.8, since they had the same error that I did

    Thanks! I manually upgraded to 5.8 via FTP, reactivated my plugins and theme and everything works. Hope the next auto update works, that was annoying!

    We’ve also run into this @zieladam while attempting to apply the 5.8.1 security patch to a site running 5.7.2. So far this is the only site with the issue. I’ve tried removing all plugins and switching to the 2021 theme but nothing resolves the issue.

    Here is the full error message/stack-trace:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_enable_block_templates' not found or invalid function name in /var/www/html/wp-includes/class-wp-hook.php on line 303 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/class-wp-hook.php:303) in /var/www/html/wp-includes/functions.php on line 6712 Fatal error: Uncaught Error: Class 'WP_Theme_JSON_Resolver' not found in /var/www/html/wp-includes/script-loader.php:1530 Stack trace: #0 /var/www/html/wp-includes/class-wp-hook.php(303): wp_default_styles(Object(WP_Styles)) #1 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array) #2 /var/www/html/wp-includes/plugin.php(518): WP_Hook->do_action(Array) #3 /var/www/html/wp-includes/class.wp-styles.php(135): do_action_ref_array('wp_default_styl...', Array) #4 /var/www/html/wp-includes/functions.wp-styles.php(24): WP_Styles->__construct() #5 /var/www/html/wp-includes/functions.wp-styles.php(176): wp_styles() #6 /var/www/html/wp-includes/class-wp-admin-bar.php(74): wp_enqueue_style('admin-bar') #7 /var/www/html/wp-includes/admin-bar.php(49): WP_Admin_Bar->initialize() #8 /var/www/html/wp-includes/class-wp-hook.php(303): _wp_admin_bar_init('') #9 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #10 /var/www/html/wp-includes/plugin.php(470): WP_Hook->do_action(Ar in /var/www/html/wp-includes/script-loader.php on line 1530

    Reverting to 5.7.2 fixes the issue.

    Initially I thought https://core.trac.wordpress.org/changeset/51472 might be related, but I see that this change to class-wp-theme-json-resolver.php is only in 5.8.1 but 5.8.0 causes the same issue on this site.

    Figured out what our issue was: some files in the docroot did not get updated, such as wp-settings.php, and that was the cause for us.

    • This reply was modified 1 year, 2 months ago by cfullsteam. Reason: formatting

    Same as @cfullsteam – Downloaded new wp files, replaced wp-setting.php. Error gone.

    • This reply was modified 1 year, 2 months ago by evalast.

    @cfullsteam and @evalast I have the same 303 problem. Forgive my naivete but where is wp-setting.php located and when you say replace what did you actually do? Just delete it? Updated wordpress manually to 5.8.2

    @cfullsteam and @evalast Found the wp-settings.php Replaced wp-setting.php No joy. Any other help would be appreciated.

    @singingfalls wp-settings.php is located in the root of the WordPress code files. Should be a sibling to wp-config.php. By replace, I mean exactly that. Replace the problematic file with a clean version obtained when downloading the appropriate version of WordPress (whichever version the rest of the files are from).

    @cfullsteam Thank you much for the reply. I tried your method. No joy. My problem is related to installing the Sydney Toolbox plugin. That is what is giving me the fatal error. I replaced all of the root files with a clean version also. I’m beginning to think it has something to do with the plugin itself.

    Once again. Thanks for your attention.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Fatal error “‘WP_Theme_JSON_Resolver’ not found”, in manual upgrade to 5.8’ is closed to new replies.