• Resolved tinkerjet

    (@tinkerjet)


    PHP version: 8.1.14

    Symptoms: Website throws a critical error when logged in and viewing the page that dynamically loads blog posts.

    Warning: Attempt to read property "post_type" on null in /home/.../public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/SeoPreview.php on line 93

    Warning: Attempt to read property "labels" on null in /home/.../public_html/wp-includes/post.php on line 2028

    Fatal error: Uncaught Error: Attempt to assign property "labels" on null in /home/.../public_html/wp-includes/post.php:2028 Stack trace: #0 /home/.../public_html/wp-includes/post.php(1984): _get_custom_object_labels() #1 /home/.../public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/SeoPreview.php(93): get_post_type_labels() #2 /home/.../public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/SeoPreview.php(67): AIOSEO\Plugin\Common\Standalone\SeoPreview->getVueData() #3 /home/.../public_html/wp-includes/class-wp-hook.php(308): AIOSEO\Plugin\Common\Standalone\SeoPreview->init() #4 /home/.../public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #5 /home/.../public_html/wp-includes/plugin.php(565): WP_Hook->do_action() #6 /home/.../public_html/wp-includes/class-wp.php(797): do_action_ref_array() #7 /home/.../public_html/wp-includes/functions.php(1332): WP->main() #8 /home/.../public_html/wp-blog-header.php(16): wp() #9 /home/.../public_html/index.php(17): require('…') #10 {main} thrown in /home/.../public_html/wp-includes/post.php on line 2028

    There has been a critical error on this website.

    Learn more about troubleshooting WordPress.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @tinkerjet,

    Thank you for including the additional information and I’m sorry you’re experiencing an issue here.

    In order to clear the error, please add the following code snippet –

    add_action( 'init', function() {
    	if ( ! function_exists( 'aioseo' ) ) {
    		return;
    	}
    
    	if ( version_compare( '4.3.1', aioseo()->version, '<' ) ) {
    		return;
    	}
    
    	remove_action( 'wp', [ aioseo()->standalone->seoPreview, 'init' ] );
    }, 100);

    Please use the WPCode plugin to easily add the snippet to your website.

    Feel free to reach out if you have any other questions.

    Thanks!

    Thread Starter tinkerjet

    (@tinkerjet)

    Thank you. The snippet you provided works, but I also achieved the same fix by commenting out the offending line. (Line 93 in the SeoPreview.php file.)

    Do I need to keep the fix permanently?

    Thank you.

    Hi @tinkerjet,

    You will not need to keep this permanently.

    A fix is scheduled to be released in v4.3.1.

    We appreciate your patience and apologize for any inconvenience that this has caused.

    Thanks!

    Plugin Support Steve M

    (@wpsmort)

    Hi @tinkerjet ,

    I wanted to let you know that we released All in One SEO Pro v4.3.1.1 today which fixes this issue.

    Please update to the latest version to get this fix.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal error. (Debug log attached.)’ is closed to new replies.