Wordpress-seo: Fatal error Yoast 8 with Timber plugin

Created on 24 Aug 2018  路  11Comments  路  Source: Yoast/wordpress-seo

Suddenly I get a server 500 fatal error on every page.

Website was doing okay for months. But probably after some plugin update I get a fatal error.
A blank page with a server error 500 message appears. After checking my apache error log I notice this error:

" Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to WPSEO_Admin_Bar_Menu::get_post_score() must be an instance of WP_Post, instance of Timber\Post given, called in /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php on line 144 and defined in /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php:482\nStack trace:\n#0 /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php(144): WPSEO_Admin_Bar_Menu->get_post_score(Object(Timber\Post))\n#1 /home/runcloud/webapps/jungle-1/www/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php(60): WPSEO_Admin_Bar_Menu->add_root_menu(Object(WP_Admin_Bar))\n#2 /home/runcloud/webapps/jungle-1/www/wp-includes/class-wp-hook.php(286): WPSEO_Admin_Bar_Menu->add_menu(Object(WP_Admin_Bar))\n#3 /home/runcloud/webapps/jungle-1/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#4 /...\n'"

Temporary solution

Disabling the Yoast plugin solves the problem for now.

Technical info

  • WordPress version: 4.9.8
  • Yoast SEO version: 8.0

Relevant plugins

Timber (latest)
Yoast (latest)

Theme

Tested with theme: custom child theme based on the default timber starter theme.

Most helpful comment

Just putting this in here for anyone who gets here via google rather than the other issue pages: As mentioned in the #10825 the non-code workaround (if you can get into WP-Admin backend) until the issue is resolved is to toggle "Admin bar menu" off in Yoast under SEO > General > Features. h/t @andrejpavlovic

All 11 comments

Thanks for reporting! We've already created a fix for this issue though, as it had been reported before. The fix for this is scheduled to be in 8.1, which is planned to be released tomorrow. Therefore, I'm going to close this.

I've just updated to 8.1 on 2 environments and the issue persists (now with get_post_focus_keyword()).

I can confirm still not fixed!

Same with me. Problem still exist!

Thanks for following up. Please check issue https://github.com/Yoast/wordpress-seo/issues/10825 and https://github.com/Yoast/wordpress-seo/issues/10836 for future reference, since this one is closed and is technically a different error.

Confirm still not fixed, tossing more errors than 8.0 for me.

Please solve this issue.
I solved temporaly add this from functions.php:

show_admin_bar(false);

Just putting this in here for anyone who gets here via google rather than the other issue pages: As mentioned in the #10825 the non-code workaround (if you can get into WP-Admin backend) until the issue is resolved is to toggle "Admin bar menu" off in Yoast under SEO > General > Features. h/t @andrejpavlovic

This issue was only present on my front-page.php template.

To resolve it I replaced new Timber\PostQuery( ... ) with Timber::get_posts( ... ).

Same here on version 8.3

Still getting this with 9.0.1

only on my homepage... would prefer not modifying my code...

2018/10/24 02:25:11 [error] 2627#2627: *13070 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to WPSEO_Admin_Bar_Menu::get_post_focus_keyword() must be an instance of WP_Post, instance of Timber\Post given, called in /PATH/web/app/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php on line 204 and defined in /PATH/web/app/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php:474

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theRealRizeo picture theRealRizeo  路  5Comments

Chouby picture Chouby  路  4Comments

tholu picture tholu  路  3Comments

isaumya picture isaumya  路  4Comments

Pcosta88 picture Pcosta88  路  6Comments