Support » Fixing WordPress » Various widget & block related PHP errors

  • I have updated to WP 5.8 and am using PHP 7.4 and am seeing various PHP warnings & errors relating to blocks and widgets.

    I have already changed the definition of ABSPATH in my wp-config.php file from:
    define('ABSPATH', dirname(__FILE__) . '/');
    to
    define('ABSPATH', __DIR__ . '/');

    I am aware that WP 5.8 introduced new widget blocks but I have not started using that feature. I am assuming I do not have to install the classic widgets plugin for existing pages to continue working?

    Below is a summary of the errors being logged. Any help will be much appreciated.

    (E1) Fatal error: Uncaught Error: Class 'WP_Widget' not found in /home/xxx...xxx/wp-includes/widgets/class-wp-widget-block.php:17
    
    (E2) Fatal error: require(): Failed opening required 'ABSPATHWPINC/blocks/archives.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/xxx...xxx/wp-includes/blocks/index.php on line 9
    
    (E3) Fatal error: Uncaught Error: Call to undefined function get_the_block_template_html() in /home/xxx...xxx/wp-includes/template-canvas.php:12

    I am also seeing warnings that might give a clue

    (W1) Warning: require(ABSPATHWPINC/blocks/archives.php): failed to open stream: No such file or directory in /home/xxx...xxx/wp-includes/blocks/index.php on line 9
    
    (W2) Warning: Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in /home/xxx...xxx/wp-includes/blocks/index.php on line 9
    
    (W3) Warning: Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in /home/antipole/public_html/ovni-owners/wp-includes/blocks/index.php on line 9

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Topher

    (@topher1kenobe)

    I also had issues with 5.8 because the new widgets manager was causing problems. I went ahead and installed the classic widgets plugin and it fixed everything. I’d give that a go.

    Thread Starter Antipole

    (@antipole)

    Installed the classic widgets plugin and it may have helped a bit but I am still seeing errors and warnings above.

    Same here. I have classic widgets plugin installed but have:

    PHP Fatal error: Uncaught Error: Class 'WP_Widget' not found
    PHP Fatal error: require(): Failed opening required 'ABSPATHWPINC/blocks/archives.php'
    PHP Fatal error: Uncaught Error: Call to undefined function get_the_block_template_html()

    • This reply was modified 5 days, 2 hours ago by TKServer.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.