Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.76k stars 891 forks source link

Error “t.split is not a function” - Latest version Yoast SEO #20400

Open thiraiwa opened 1 year ago

thiraiwa commented 1 year ago

Please give us a description of what happened

To Reproduce

Step-by-step reproduction instructions

  1. Install WordPress
  2. Write the following code in functions.php

function post_has_archive( $args, $post_type ) { if ( 'post' == $post_type ) { $args['rewrite'] = true; $args['has_archive'] = 'news'; } return $args; } add_filter( 'register_post_type_args', 'post_has_archive', 10, 2 );

Expected results

  1. Enable post archiving, specify the slug "news" and set up SEO with Yoast SEO.

Actual results

  1. I get an error "t.split is not a function" in the "post" setting.

Screenshots, screen recording, code snippet

If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.

Share 3 screenshots. https://pasteboard.co/PRZ4K2bFdXhk.png https://pasteboard.co/AXY00HTzbhei.png https://pasteboard.co/YWw0DdQrpHjl.png

Technical info

Used versions

I searched the forums and found the two articles below.

I have tried the following.

I have also asked this issue on the forum, please see the URL below. https://wordpress.org/support/topic/error-t-split-is-not-a-function-2/#new-topic-0

I'm looking forward to hearing from you.

thiraiwa commented 1 year ago

P.S. I updated the PHP version to 8.2 (CGI), but the symptoms did not improve.

thiraiwa commented 1 year ago

This seems to be a bug specific to the latest version of Yoast SEO. Doesn't it support changing the slug of the archive page? I was directed to this topic by Plugin Support, why is no one replying?

jakewhiteley commented 1 year ago

I also have this issue on Version 20.9.

I have not altered the rewrite settings of any built in post types using code, but I am using the page for posts feature.

jeroenrotty commented 1 year ago

Hey @thiraiwa,

Thank you for creating this issue.

We've seen "t.split is not a function" previously and in older cases, it was due to incorrect translations on translate.wordpress.org. Just as a quick check, does it also occur if you would change your profile language to English (US) on Users --> Profile?

I tried to reproduce it by adding your code snippet to a custom plugin, but I could still access Yoast SEO > Settings > Content Types > Posts. Then I switched my local site to the Japanese (ja) WordPress locale - and I was still able to visit/load the settings page. So I'm unable to reproduce the issue. I recommend doing a conflict check as well to exclude any possible theme/plugin conflict.

@jakewhiteley I tried to set a custom page as the post page under Settings > Reading, but in that case, I was also able to visit/configure the settings on our Settings page. I'd recommend also to do a conflict check as mentioned above.

thiraiwa commented 1 year ago

Hi jeroenrotty. Thank you for your reply. I tried changing the language of the site to English, but the symptoms did not improve. Next, I enabled the "Health Check & Troubleshooting" plugin and turned on the troubleshooting mode, but the symptoms did not improve. https://pasteboard.co/DDa3jFzaBQvW.png

I deselected "Your homepage displays" in Settings > Reading and specified a custom page, but the symptoms did not improve. https://pasteboard.co/0I04NReZpXjN.png

Did you add the code snippet to functions.php? Is there anything else I should try?

jeroenrotty commented 1 year ago

Hey @thiraiwa ,

Did you add the code snippet to functions.php?

Yes, I did. But it turns out that the page would load with Premium activated. With only Yoast SEO free enabled, I was able to reproduce the t.split error. I'm not sure why though, I'll ask internally.

A possible workaround is just adding /news/ into your permalinks structure so it would be used for your post permalinks. Or am I overseeing anything?

thiraiwa commented 1 year ago

I'm sorry, I'm not good at English, but I can understand that you despise me. I reported a bug in the plugin and hoped it would be fixed. You took a lot of time just to reproduce the problem. I've tried to provide the necessary information for that, but what am I doing wrong? How many more years until this bug is fixed? Please let me know when the bug is fixed.

ahmedch1 commented 1 year ago

I have same problem using Sage starter theme for WordPress using bedrock setup , but I can't also figure out the problem . Thanks in advance

dave-gil commented 3 months ago

Same problem with latest free version of Yoast v22.9, but not the premium.

josevarghese commented 3 months ago

Hi @dave-gil

Sometimes, it occurs due to a conflict caused by other plugins. To narrow down the issue, have you performed a conflict check to narrow down this?

Also, can you please confirm whether the Organization name and Organization logo within the Yoast SEO > Settings > General > Site representation has already been added? Is the same for the page Site basics with the Website name and Site image? For a customer, adding these details fixed the issue, but for some, it was due to a conflict.

We look forward to hearing from you.

dave-gil commented 3 months ago

Hi @josevarghese, this occurs on brand new install of Wordpress using the default Twenty Twenty Four theme with only 2 plugins installed Yoast (Free version) and Code Snippets (with only 1 snippet including the aforementioned code) - so no chance of a plugin conflict.

The problem does not occur with the premium version of Yoast

I can confirm only the Website name has been added Yoast SEO > Settings > General > Site basics and this matches the Organization name in Yoast SEO > Settings > General > Site representation.