wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

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

Open thiraiwa opened this issue 2 years ago • 11 comments

  • [ check ] I've read and understood the contribution guidelines.
  • [ check ] I've searched for any related issues and avoided creating a duplicate issue.

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

  • If relevant, which editor is affected (or editors):
  • [ ] Block Editor
  • [ ] Gutenberg Editor
  • [ ] Elementor Editor
  • [ ] Classic Editor
  • [ ] Other:
  • Which browser is affected (or browsers):
  • [ check ] Chrome
  • [ check ] Firefox
  • [ ] Safari
  • [ ] Other:

Used versions

  • Device you are using: DESKTOP-PC
  • Operating system: Windows 10 Home
  • PHP version: 7.4.33
  • WordPress version: 6.2.2
  • WordPress Theme: Twenty Twenty-One
  • Yoast SEO version: 20.8
  • Gutenberg plugin version:
  • Elementor plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug: There is nothing

I searched the forums and found the two articles below.

  • https://wordpress-org.translate.goog/support/topic/t-split-is-not-a-function/?_x_tr_sl=en&_x_tr_tl=ja&_x_tr_hl=ja&_x_tr_pto=sc
  • https://ja.wordpress.org/support/topic/yoast-seo%E3%81%AE%E3%80%8C%E6%8A%95%E7%A8%BF%E3%80%8D%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E5%87%BA%E3%81%A6%E3%81%97%E3%81%BE%E3%81%86%E3%80%82/ It says that this error will be fixed in the February 7th update, but it doesn’t seem to be fixed in my case.

I have tried the following.

  • Stopping plugins other than Yoast SEO and reinstalling Yoast SEO did not solve the problem.
  • Yoast SEO’s export setting is “disable-post_format =”, and re-importing both “disable-post_format = 1” and “disable-post_format =” did not improve the symptoms.
  • Commenting out "$args['has_archive'] = 'news';" will improve the problem.
  • I've checked other sites I've created in the past and have had no problems using the same code when using version 19.14 of Yoast SEO.

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 avatar Jun 07 '23 01:06 thiraiwa

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

thiraiwa avatar Jun 07 '23 02:06 thiraiwa

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?

thiraiwa avatar Jun 19 '23 10:06 thiraiwa

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.

jakewhiteley avatar Jun 24 '23 10:06 jakewhiteley

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.

jeroenrotty avatar Jul 04 '23 12:07 jeroenrotty

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?

thiraiwa avatar Jul 07 '23 09:07 thiraiwa

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?

jeroenrotty avatar Jul 18 '23 12:07 jeroenrotty

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.

thiraiwa avatar Jul 21 '23 09:07 thiraiwa

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

ahmedch1 avatar Aug 28 '23 20:08 ahmedch1

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

dave-gil avatar Jun 26 '24 13:06 dave-gil

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.

josevarghese avatar Jun 27 '24 12:06 josevarghese

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.

dave-gil avatar Jun 27 '24 15:06 dave-gil