Critical Error - Not Sure How to Fix

I’m suddenly encountering a critical error and I’m not sure what broke the site. I’m not a coder, so I’ve been installing various plugins to do a wordpress block theme on gutenberg. The last time I opened the site on Wednesday, everything was working fine but it suddenly hit a critical error when I tried to open the site today and I’m not sure how I can fix it.

I’ve tried disabling the plugins by going into the wp-content folder and changing the name and changing it back but it doesn’t change the critical error.

Any help would be appreciated!

The error is

( ! ) Fatal error: Uncaught Error: Call to undefined function wp_theme_has_theme_json() in /www/kinsta/public/socius-22/wp-includes/block-template-utils.php on line 373
( ! ) Error: Call to undefined function wp_theme_has_theme_json() in /www/kinsta/public/socius-22/wp-includes/block-template-utils.php on line 373
Call Stack

Time Memory Function Location

1 0.0449 364544 {main}( ) …/index.php**:0
2 0.0456 365824 require_once( '/www/kinsta/public/socius-22/wp-admin/admin.php ) …/index.php
:10
3 0.0456 366640 require_once( '/www/kinsta/public/socius-22/wp-load.php ) …/admin.php
:34
4 0.0456 367224 require_once( '/www/kinsta/public/socius-22/wp-config.php ) …/wp-load.php
:50
5 0.0457 376216 require_once( '/www/kinsta/public/socius-22/wp-settings.php ) …/wp-config.php
:105
6 0.6467 6243904 do_action( $hook_name = ‘init’ ) …/wp-settings.php
:617
7 0.6467 6244280 WP_Hook->do_action( $args = [0 => ‘’] ) …/plugin.php
:517
8 0.6467 6244280 WP_Hook->apply_filters( $value = ‘’, $args = [0 => ‘’] ) …/class-wp-hook.php
:332
9 0.6877 7529488 register_block_core_template_part( ‘’ ) …/class-wp-hook.php
:308
10 0.6877 7529864 build_template_part_block_variations( ) …/template-part.php
:257
11 0.6877 7531744 build_template_part_block_instance_variations( ) …/template-part.php
:246
12 0.6877 7531808 get_block_templates( $query = [‘post_type’ => ‘wp_template_part’], $template_type = ‘wp_template_part’ ) …/template-part.php
:206
13 0.6877 7531808 apply_filters( $hook_name = ‘pre_get_block_templates’, $value = NULL, …$args = variadic([‘post_type’ => ‘wp_template_part’], ‘wp_template_part’) ) …/block-template-utils.php
:895
14 0.6877 7532216 WP_Hook->apply_filters( $value = NULL, $args = [0 => NULL, 1 => [‘post_type’ => ‘wp_template_part’], 2 => ‘wp_template_part’] ) …/plugin.php
:205
15 0.6877 7533720 Gutenverse\Theme_Helper->get_block_template( $query_result = NULL, $query = [‘post_type’ => ‘wp_template_part’], $template_type = ‘wp_template_part’ ) …/class-wp-hook.php
:308
16 0.7047 7703040 _build_block_template_result_from_post( $post = class WP_Post { public $ID = 321; public $post_author = ‘1’; public $post_date = ‘2023-03-21 03:14:35’; public $post_date_gmt = ‘2023-03-21 03:14:35’; public $post_content = ‘\n

\n\n\n<!-- wp:group {“align”:“full”,“style”:{“spacing”:{“padding”:{“right”:“var:preset spacing 30”,“left”:"var:’…; public $post_title = ‘Footer (Posts)’; public $post_excerpt = ‘’; public $post_status = ‘publish’; public $comment_status = ‘closed’; public $ping_status = ‘closed’; public $post_password = ‘’; public $post_name = ‘footer-w-posts’; public $to_ping = ‘’; public $pinged = ‘’; public $post_modified = ‘2023-03-23 12:17:08’; public $post_modified_gmt = ‘2023-03-23 12:17:08’; public $post_content_filtered = ‘’; public $post_parent = 0; public $guid = ‘http://socius-22.local/?p=321’; public $menu_order = 0; public $post_type = ‘wp_template_part’; public $post_mime_type = ‘’; public $comment_count = ‘0’; public $filter = ‘raw’ } ) …/class-theme-helper.php:219
17 0.7048 7710352 _get_block_template_file( $template_type = ‘wp_template_part’, $slug = ‘footer-w-posts’ ) …/block-template-utils.php
:712
18 0.7087 7711296 _add_block_template_part_area_info( $template_info = [‘slug’ => ‘footer-w-posts’, ‘path’ => ‘/www/kinsta/public/socius-22/wp-content/themes/wabi/parts/footer-w-posts.html’, ‘theme’ => ‘wabi’, ‘type’ => ‘wp_template_part’] ) …/block-template-utils.php
:**275

There has been a critical error on this website. Please check your site admin email inbox for instructions.

Learn more about troubleshooting WordPress.

Hey @gigi,
Can you please share what OS you use on your computer?

Regards,
Alessandro

Hi @gigi

It looks like the WordPress 6.2 version update has broken your theme, or your theme doesn’t support the changes required for compatibility:

So, this would not be a DevKinsta issue unfortunately. As an immediate solution to the problem so you can get it back online, you could roll back the WordPress version with WP-CLI over SSH:

cd ~/public
wp core download --version=6.1 --locale=en_US --force --skip-themes

Then, either use wp-config.php or a plugin to enforce disabling automatic / core updates, since DevKinsta can only push/pull to staging - A Deep Dive Into WordPress Automatic Updates

Let us know if that helps!

Hi @Alessandro and @ZachE thanks for your help!

I’m on a Mac OS Monterey 12.2.1, MacBook Pro 14 inch M1.

I managed to get it into recovery mode by changing the theme name in the DevKinsta folder containing my site and then also disabling all the plugins.

I will try to enforce disabling automatic updates, but in order for this critical error to not repeat, should I follow the github link in order to include wp_theme_has_theme_json()?

Hello @gigi :slight_smile:

Thank you for your reply and update.

but in order for this critical error to not repeat, should I follow the github link in order to include wp_theme_has_theme_json()?

We can’t really tell or guarantee if that would help (for the critical error to not repeat) and it’s out of our support scope - as it’s not DevKinsta issue at all but WordPress’s theme code/compatibility with WordPress core version 6.2.

It’s better to reach out to your web developers/programmers to help you out with it, or best please ask the theme ( wabi ) support team if possible and see if they have newest theme version which might be compatible with WordPress 6.2 version.

Cheers,
Agus