Yoast SEO for SportsPress dont work with PHP 8+
-
Hello @savvas,
On a “fresh” installation of Sportspress (2.7.16), the plugin “Yoast SEO for SportsPress” (1.0) (with Yoast SEO v. 20.4)does not work anymore in version PHP 8.1 (or 8.2).
Fatal WordPress error.
It was working fine in PHP version 7.4
Can you correct this? Thanks.
-
Hi there @plou77 ,
Can you please try php8.0 version? Not even core WordPress is not yet fully compatible with php8.1+.
Thanks, Savvas
Thank you for the quick reply. Unfortunately it doesn’t work with 8.0 ??
Hi Plou
Do you have access to the error logs? Your hosting provider can send you that in case you can’t find it.
We could check the lines affected in that case and fix it directly.
Thanks
Hello, here is the debug.log
[11-Apr-2023 19:14:13 UTC] PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/yoast-seo-for-sportspress/yoast-seo-for-sportspress.php:148 Stack trace: #0 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/yoast-seo-for-sportspress/yoast-seo-for-sportspress.php(148): implode() #1 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/inc/class-wpseo-replace-vars.php(310): Yoast_SEO_SportsPress::replace_terms() #2 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/inc/class-wpseo-replace-vars.php(164): WPSEO_Replace_Vars->set_up_replacements() #3 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/presenters/abstract-indexable-presenter.php(78): WPSEO_Replace_Vars->replace() #4 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/presenters/title-presenter.php(67): Yoast\WP\SEO\Presenters\Abstract_Indexable_Presenter->replace_vars() #5 /homepages/18/d655284828/htdocs/mywp/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Presenters\Title_Presenter->get_title() #6 /homepages/18/d655284828/htdocs/mywp/wp-includes/plugin.php(205): WP_Hook->apply_filters() #7 /homepages/18/d655284828/htdocs/mywp/wp-includes/general-template.php(1174): apply_filters() #8 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/presenters/title-presenter.php(41): wp_get_document_title() #9 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php(259): Yoast\WP\SEO\Presenters\Title_Presenter->get() #10 /homepages/18/d655284828/htdocs/mywp/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Integrations\Front_End_Integration->filter_title() #11 /homepages/18/d655284828/htdocs/mywp/wp-includes/plugin.php(205): WP_Hook->apply_filters() #12 /homepages/18/d655284828/htdocs/mywp/wp-includes/general-template.php(1174): apply_filters() #13 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/presenters/title-presenter.php(41): wp_get_document_title() #14 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/presenters/title-presenter.php(52): Yoast\WP\SEO\Presenters\Title_Presenter->get() #15 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php(326): Yoast\WP\SEO\Presenters\Title_Presenter->present() #16 /homepages/18/d655284828/htdocs/mywp/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Integrations\Front_End_Integration->present_head() #17 /homepages/18/d655284828/htdocs/mywp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #18 /homepages/18/d655284828/htdocs/mywp/wp-includes/plugin.php(517): WP_Hook->do_action() #19 /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php(300): do_action() #20 /homepages/18/d655284828/htdocs/mywp/wp-includes/class-wp-hook.php(308): Yoast\WP\SEO\Integrations\Front_End_Integration->call_wpseo_head() #21 /homepages/18/d655284828/htdocs/mywp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #22 /homepages/18/d655284828/htdocs/mywp/wp-includes/plugin.php(517): WP_Hook->do_action() #23 /homepages/18/d655284828/htdocs/mywp/wp-includes/general-template.php(3049): do_action() #24 /homepages/18/d655284828/htdocs/mywp/wp-content/themes/marquee/header.php(16): wp_head() #25 /homepages/18/d655284828/htdocs/mywp/wp-includes/template.php(783): require_once('/homepages/18/d...') #26 /homepages/18/d655284828/htdocs/mywp/wp-includes/template.php(718): load_template() #27 /homepages/18/d655284828/htdocs/mywp/wp-includes/general-template.php(48): locate_template() #28 /homepages/18/d655284828/htdocs/mywp/wp-content/themes/marquee/sportspress/single-player.php(8): get_header() #29 /homepages/18/d655284828/htdocs/mywp/wp-includes/template-loader.php(106): include('/homepages/18/d...') #30 /homepages/18/d655284828/htdocs/mywp/wp-blog-header.php(19): require_once('/homepages/18/d...') #31 /homepages/18/d655284828/htdocs/mywp/index.php(17): require('/homepages/18/d...') #32 {main} thrown in /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/yoast-seo-for-sportspress/yoast-seo-for-sportspress.php on line 148 [11-Apr-2023 19:15:15 UTC] PHP Warning: Undefined array key "show_all_players_link" in /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/sportspress-pro/includes/sportspress/includes/widgets/class-sp-widget-player-gallery.php on line 76 [11-Apr-2023 19:15:17 UTC] PHP Warning: Undefined array key "show_all_players_link" in /homepages/18/d655284828/htdocs/mywp/wp-content/plugins/sportspress-pro/includes/sportspress/includes/widgets/class-sp-widget-player-gallery.php on line 76
Hi Plou
Are you a Pro user? If yes, please get in touch in the Pro support and I can check this one for you:
support.themeboy.com
I’m unable to reproduce this here. Running PHP 8.x and it works fine with the latest SportsPress (Pro) version.
Thanks!
Hello,
Yes the plugin “works” as long as it is not actually used. For example on a page where a SportSpress SEO variable is not used the site works. But for example on a player’s page if I use the SEO variable %sp_teams or %sp_season the site no longer works.
To add an SEO variable, go to Yoast SEO configuration : wp-admin/admin.php?page=wpseo_page_settings#
You are right @plou77 . There is bug which causes a fatal error on version php8+
I will forward it to our developer team for a fix.
In the meantime you can replace the line 148 at
\wp-content\plugins\yoast-seo-for-sportspress\yoast-seo-for-sportspress.php
from:
return implode( $terms, ', ' );
to:
return implode( ', ', $terms );
to fix it ??
Thanks,
SavvasHi @savvasha
It works perfectly, thank you.
I am glad you sorted it out ??
Thanks, Savvas
- The topic ‘Yoast SEO for SportsPress dont work with PHP 8+’ is closed to new replies.