Yoast / wordpress-seo

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

Support jQuery 3.5.1 before WordPress 5.6 to avoid editor crashing with YoastSEO is not defined #15921

Open bobbingwide opened 4 years ago

bobbingwide commented 4 years ago

This is a follow on to #14126, specifically raised for early support of jQuery 3.5.1 prior to its delivery with WordPress 5.6.

Please give us a description of what happened.

While attempting to test my own plugins for compatibility with jQuery 3.5.1, using the wp-jquery-update-test plugin, the editor crashed when WordPress SEO was the only other activated plugin.

The error message is:

ReferenceError: YoastSEO is not defined
    at i (https://s.b/oikcom/wp-content/plugins/wordpress-seo/js/dist/post-edit-1480.js:1:4745)
    at t.default (https://s.b/oikcom/wp-content/plugins/wordpress-seo/js/dist/post-edit-1480.js:1:4583)
    at t.value (https://s.b/oikcom/wp-content/plugins/wordpress-seo/js/dist/post-edit-1480.js:1:56417)
    at re (https://s.b/oikcom/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:95:261)
    at Vg (https://s.b/oikcom/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:95:54)
    at ph (https://s.b/oikcom/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:217:70)
    at lh (https://s.b/oikcom/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:126:409)
    at O (https://s.b/oikcom/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:121:71)
    at ze (https://s.b/oikcom/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118:14)
    at https://s.b/oikcom/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53:49

The console log shows many more messages

Please describe what you expected to happen and why.

The editor should not crash.

How can we reproduce this behavior?

  1. Deactivate all plugins except WordPress SEO and wp-jQuery-update-test
  2. Configure wp-jQuery-update-test to use jQuery version 3.5.1 - see first screen shot
  3. Add new post - see second screen shot

image

image

Workaround

4a. Switch back to jQuery default and try again image

OR

4b. Activate Gutenberg 8.8.0 and try again

Technical info

Used versions

Summary for when wp-jquery-update-test plugin is set to 3.5.1

WordPress Yoast SEO Gutenberg Add new works?
5.5 14.8 No
5.5 14.8 8.7.1 No
5.5 14.8 8.8.0 Yes
Djennez commented 4 years ago

For internal reference: https://yoast.atlassian.net/browse/QAK-2015 is the internal bug. Interestingly, there is a comment in there that states that https://github.com/Yoast/wordpress-seo/pull/15735 should have fixed JQ3.5.1 compatibility. A comment on that PR seems to suggest that we're JQ 3.5.1 / WO 5.6 compatible.

Looking at both your findings and that PR, it looks to me like there is something else, maybe Gutenberg, that is not JQ3.5.1 compatible?

bobbingwide commented 4 years ago

I don't appear to have access to your internal system.

Looking at both your findings and that PR, it looks to me like there is something else, maybe Gutenberg, that is not JQ3.5.1 compatible?

Not sure how you came to that conclusion. The second screenshot was taken when the only two plugins activated were WordPress SEO and wp-jquery-update-test

Since then, I've been performing my own tests with GB 8.8.0 activated as well. I got another message in the block editor with jQuery 3.5.1, Migrate enabled and jQuery UI version default. image

Djennez commented 4 years ago

In your table, you indicate that WP 5.5 + Yoast 14.8 + GB 8.8 works, WP 5.5 ships with GB up to 8.5. So if there are problems with Yoast + GB up to 8.7.1 there may be a conflict with JQ 3.5.1 + Yoast + GB up to 8.7.1 and that may be caused by Gutenberg and fixed in 8.8.

Will still need additional testing.