Wordpress error - PHP Fatal error: Uncaught Error: Call to undefined function register_block_type_from_metadata()

wordpress.stackexchange https://wordpress.stackexchange.com/questions/375628

سؤال

I'm working on a website that has been met with the WordPress "white screen of death" error, 'The site is experiencing technical difficulties.'

I believe this occurred when updating all plugins, I have tried disabling all plugins of the website (by renaming the /wp-content/plugins to /wp-content/plugins.hold), but that did not work. I did the same with disabling the used theme but got the same result.

So after enabling debugging and looking through the debug.log, I have found this error:

PHP Fatal error: Uncaught Error: Call to undefined function register_block_type_from_metadata() in /home/uni19047/public_html/udu.com.au/wp-includes/blocks/archives.php:119

I am not sure what is causing this and I would really appreciate any help in this.

Here's the full log.

[28-Sep-2020 16:34:36 UTC] PHP Warning:  include_once(/home/uni19047/public_html/udu.com.au/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: No such file or directory in /home/uni19047/public_html/udu.com.au/wp-content/advanced-cache.php on line 22
[28-Sep-2020 16:34:36 UTC] PHP Warning:  include_once(): Failed opening '/home/uni19047/public_html/udu.com.au/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:/opt/alt/php71/usr/share/pear') in /home/uni19047/public_html/udu.com.au/wp-content/advanced-cache.php on line 22
[28-Sep-2020 16:34:36 UTC] PHP Notice:  The called constructor method for WP_Widget in Roots_Vcard_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /home/uni19047/public_html/udu.com.au/wp-includes/functions.php on line 4503
[28-Sep-2020 16:34:36 UTC] PHP Warning:  include_once(/home/uni19047/public_html/udu.com.au/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: No such file or directory in /home/uni19047/public_html/udu.com.au/wp-content/advanced-cache.php on line 22
[28-Sep-2020 16:34:36 UTC] PHP Warning:  include_once(): Failed opening '/home/uni19047/public_html/udu.com.au/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:/opt/alt/php71/usr/share/pear') in /home/uni19047/public_html/udu.com.au/wp-content/advanced-cache.php on line 22
[28-Sep-2020 16:34:37 UTC] PHP Notice:  The called constructor method for WP_Widget in Roots_Vcard_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /home/uni19047/public_html/udu.com.au/wp-includes/functions.php on line 4503
[28-Sep-2020 16:34:37 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function register_block_type_from_metadata() in /home/uni19047/public_html/udu.com.au/wp-includes/blocks/archives.php:119
Stack trace:
#0 /home/uni19047/public_html/udu.com.au/wp-includes/class-wp-hook.php(286): register_block_core_archives('')
#1 /home/uni19047/public_html/udu.com.au/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 /home/uni19047/public_html/udu.com.au/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#3 /home/uni19047/public_html/udu.com.au/wp-settings.php(525): do_action('init')
#4 /home/uni19047/public_html/udu.com.au/wp-config.php(114): require_once('/home/uni19047/...')
#5 /home/uni19047/public_html/udu.com.au/wp-load.php(37): require_once('/home/uni19047/...')
#6 /home/uni19047/public_html/udu.com.au/wp-cron.php(39): require_once('/home/uni19047/...')
#7 {main}
  thrown in /home/uni19047/public_html/udu.com.au/wp-includes/blocks/archives.php on line 119
[28-Sep-2020 16:34:37 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function register_block_type_from_metadata() in /home/uni19047/public_html/udu.com.au/wp-includes/blocks/archives.php:119
Stack trace:
#0 /home/uni19047/public_html/udu.com.au/wp-includes/class-wp-hook.php(286): register_block_core_archives('')
#1 /home/uni19047/public_html/udu.com.au/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 /home/uni19047/public_html/udu.com.au/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#3 /home/uni19047/public_html/udu.com.au/wp-settings.php(525): do_action('init')
#4 /home/uni19047/public_html/udu.com.au/wp-config.php(114): require_once('/home/uni19047/...')
#5 /home/uni19047/public_html/udu.com.au/wp-load.php(37): require_once('/home/uni19047/...')
#6 /home/uni19047/public_html/udu.com.au/wp-blog-header.php(13): require_once('/home/uni19047/...')
#7 /home/uni19047/public_html/udu.com.au/index.php(17): require('/home/uni19047/...')
#8 {main}
  thrown in /home/uni19047/public_html/udu.com.au/wp-includes/blocks/archives.php on line 119
[28-Sep-2020 16:34:45 UTC] PHP Warning:  include_once(/home/uni19047/public_html/udu.com.au/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: No such file or directory in /home/uni19047/public_html/udu.com.au/wp-content/advanced-cache.php on line 22
[28-Sep-2020 16:34:45 UTC] PHP Warning:  include_once(): Failed opening '/home/uni19047/public_html/udu.com.au/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:/opt/alt/php71/usr/share/pear') in /home/uni19047/public_html/udu.com.au/wp-content/advanced-cache.php on line 22
[28-Sep-2020 16:34:45 UTC] PHP Notice:  The called constructor method for WP_Widget in Roots_Vcard_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /home/uni19047/public_html/udu.com.au/wp-includes/functions.php on line 4503
[28-Sep-2020 16:34:45 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function register_block_type_from_metadata() in /home/uni19047/public_html/udu.com.au/wp-includes/blocks/archives.php:119
Stack trace:
#0 /home/uni19047/public_html/udu.com.au/wp-includes/class-wp-hook.php(286): register_block_core_archives('')
#1 /home/uni19047/public_html/udu.com.au/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 /home/uni19047/public_html/udu.com.au/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#3 /home/uni19047/public_html/udu.com.au/wp-settings.php(525): do_action('init')
#4 /home/uni19047/public_html/udu.com.au/wp-config.php(114): require_once('/home/uni19047/...')
#5 /home/uni19047/public_html/udu.com.au/wp-load.php(37): require_once('/home/uni19047/...')
#6 /home/uni19047/public_html/udu.com.au/wp-blog-header.php(13): require_once('/home/uni19047/...')
#7 /home/uni19047/public_html/udu.com.au/index.php(17): require('/home/uni19047/...')
#8 {main}
  thrown in /home/uni19047/public_html/udu.com.au/wp-includes/blocks/archives.php on line 119

And I am using cPanel for this.

Please do give me some guidance on how to fix this, thanks very much.

هل كانت مفيدة؟

المحلول

What comes to my mind is that You should check Your wp-settings.php file, as it should include wp-includes/blocks.php file where "register_block_type_from_metadata" function is defined

check that file for this line of code:

require ABSPATH . WPINC . '/blocks.php';

if its not there, then Your wordpress installation could have been either hacked or interupted while updating

As We find Out, register_block_type_from_metadata function definition was missing in blocks.php file, due to wordpress update interuption. Replacing that file with the original version fixes the problem

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى wordpress.stackexchange
scroll top