wordpress-premium / wordpress-seo-premium

Yoast SEO Premium is a powerful plugin that helps you optimize your WordPress website for search engines. Its intuitive interface and robust features make it easy to improve your website's visibility, drive more traffic, and increase conversions.
http://wpseo.wordpress-premium.net/
Other
35 stars 14 forks source link

Cannot access offset of type string on string in /wordpress-seo-premium/src/integrations/admin/keyword-integration.php:46 on php 8.1 #1

Closed ali-osl closed 8 months ago

ali-osl commented 1 year ago

After updating the PHP to 8.1, the bellow error start showing on when editing some pages.


Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /root/html/wp-content/plugins/wordpress-seo-premium/src/integrations/admin/keyword-integration.php:46 
Stack trace:
 #0 /root/html/wp-includes/class-wp-hook.php(308): 
Yoast\WP\SEO\Premium\Integrations\Admin\Keyword_Integration->add_posts_for_related_keywords(Array, 443413) #1 /root/html/wp-includes/plugin.php(205):
 WP_Hook->apply_filters(Array, Array) #2 /root/html/wp-content/plugins/wordpress-seo/admin/formatter/class-post-metabox-formatter.php(167): 
apply_filters('wpseo_posts_for...', Array, 443413) #3 /root/html/wp-content/plugins/wordpress-seo/admin/formatter/class-post-metabox-formatter.php(72): 
WPSEO_Post_Metabox_Formatter->get_focus_keyword_usage() #4 /root/html/wp-content/plugins/wordpress-seo/admin/formatter/class-metabox-formatter.php(45): 
WPSEO_Post_Metabox_Formatter->get_values() #5 /root/html/wp-content/plugins/wordpress-seo/admin/metabox/class-metabox.php(289): 
WPSEO_Metabox_Formatter->get_values() #6 /root/html/wp-content/plugins/wordpress-seo/admin/metabox/class-metabox.php(908): 
WPSEO_Metabox->get_metabox_script_data() #7 /root/html/wp-includes/class-wp-hook.php(308): 
WPSEO_Metabox->enqueue('post.php') #8 /root/html/wp-includes/class-wp-hook.php(332): 
WP_Hook->apply_filters(NULL, Array) #9 /root/html/wp-includes/plugin.php(517): 
WP_Hook->do_action(Array) #10 /root/html/wp-admin/admin-header.php(118): 
do_action('admin_enqueue_s...', 'post.php') #11 /root/html/wp-admin/edit-form-blocks.php(309): 
require_once('/ro...') #12 /root/html/wp-admin/post.php(187): 
require('/ro...') #13 {main} thrown in /root/html/wp-content/plugins/wordpress-seo-premium/src/integrations/admin/keyword-integration.php on line 46
``
thaikolja commented 1 year ago

That's definitely a plugin error. I just pushed the latest version of the plugin. I guess you have a pretty unique installation and some components simply collide. Does the new version solve the problem?