Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test compatibility of the jQuery delivered in oik with WordPress 5.5 and jQuery v3.5.1 #153

Closed
24 tasks done
bobbingwide opened this issue Aug 24, 2020 · 8 comments
Closed
24 tasks done
Assignees

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Aug 24, 2020

  • WordPress 5.5, delivered on 11th August 2020, removed the automatic enqueing of jQuery-migrate.
  • In a future version of WordPress, jQuery will be updated to v3.5.1.
  • The oik shortcodes deliver a number of jQuery files.
  • These are used by shortcodes such as [bw_countdown] and [bw_cycle] and a general purpose shortcode to run jQuery [bw_jq].
  • These jquery.*.js files were last updated in 2016
  • There are other shortcodes that enqueue JavaScript files; these should also be tested
  • And there are other .js files that should be tested.

Requirements

  • Test that these work without the need for jQuery-migrate
  • Test the behaviour with jQuery 3.5.1
  • With/without the new jQuery migrate
  • If there's anything wrong decide what to do
  • Such as updating the files to later versions
  • Or deprecating the logic
  • Update any PHPUnit tests, as required

The list of shortcodes to test includes:

  • bw_accordion - uses jquery-ui-accordion
  • bw_countdown - uses countdown
  • bw_cycle - uses cycle.all
  • bw_jq - uses whatever the user chooses
  • bw_logo - uses - oik_bw_logo.js
  • bw_tabs - uses jquery-ui-tabs
  • bw_testimonials - uses cycle.all

Other jQuery to test includes:

  • oik-quicktags
  • bw_shortcodes
  • oik_shortc_plugin (_4)
  • oik_button_plugin
  • oik_paypal_plugin.js

Dependent plugins to test include:

Method

  • Test on a local copy of oik-plugins.com
  • Use a combination of WordPress, Gutenberg and WordPress SEO that is believed to be stable; see below
  • Test with wp-jquery-update-test plugin with the 8 different combinations of radio buttons selected.
  • Report any issues here, creating new issues for tracking and version control.

Combinations which are believed to be stable are:

WordPress Gutenberg WordPress SEO
5.5 8.8.0 14.8
5.5 + fix for TRAC 50999 8.7.1 14.7
5.5 8.8.0 14.8.1
5.5.1 8.8.0 14.9
@bobbingwide
Copy link
Owner Author

bobbingwide commented Aug 24, 2020

Testing of the jquery files in shortcodes/jquery

  • To test on 5.4.2 use oik-plugins.com or oik-plugins.co.uk
  • To test on 5.5 use s.b/oikcom and change the settings on wp-admin/plugins.php?page=wp-jquery-update-test
jQuery File Shortcode Example(s) WP 5.4.2 WP 5.5 jQuery 3.5.1 Notes
captions n/a None found No No n/a Don't think this ever worked
countdown bw_countdown block/oik-countdown Yes Yes Yes Front end works for all 8 combinations
cycle.all bw_cycle bw_testimonials oik_shortcodes/bw_cycle Yes Yes Yes All 8 combinations
cycle2 bw_cycle2 None No No n/a Never released
easing-1.3 n/a None found No No n/a See fancybox
easy-confirm-dialog n/a None No No n/a Only ever used for a prototype in oik-external-link-warning
external n/a None found No No n/a Never used?
fancybox-1.3.4 /wordpress-plugins-from-oik-plugins/oik-base-plugin/oik-jquery-library/jquery-fancybox/ Yes No No See #153 (comment)
flexslider bw_flex - never completed shortcode_example/using-bw_jq-display-images-flexslider-jquery/ Yes Yes Yes All 8 combinations
mousewheel-3.0.4 n/a None found No No n/a See fancybox
pullquote bw_jq oik_shortcodes/bw_jq/ Yes Yes Yes All 8 combinations
target-blank nivo oik-nivo-slider/oik-nivo-slider-faq/oik-nivo-slider-with-links-opening-in-new-window/ Yes Yes Yes All 8 combinations

Testing matrix

  • Test with all 8 combinations of the radio buttons on the Test jQuery Updates admin page
    at wp-admin/plugins.php?page=wp-jquery-update-test
  • For blocks that use the jQuery code you need to test in the editor.

Combinations

jQuery Version jQuery Migrate jQuery UI version Console message
Default Disable Default WordPress jQuery: 1.12.4, Migrate: not available, UI: 1.11.4
Default Disable 1.12.1 WordPress jQuery: 1.12.4, Migrate: not available, UI: 1.11.4
Default Enable Default WordPress jQuery: 1.12.4, Migrate: 1.4.1, UI: 1.11.4
Default Enable 1.12.1 WordPress jQuery: 1.12.4, Migrate: 1.4.1, UI: 1.11.4
3.5.1 Disable Default WordPress jQuery: 3.5.1, Migrate: not available, UI: 1.11.4
3.5.1 Disable 1.12.1 WordPress jQuery: 3.5.1, Migrate: not available, UI: 1.12.1
3.5.1 Enable Default WordPress jQuery: 3.5.1, Migrate: 3.3.0, UI: 1.11.4
3.5.1 Enable 1.12.1 WordPress jQuery: 3.5.1, Migrate: 3.3.0, UI: 1.12.1

Notes:

  • When WordPress jQuery is default ( 1.12.4 ), the UI version is always 1.11.4

Test failures

captions

Uncaught TypeError: jQuery(...).captions is not a function
    at HTMLDocument.<anonymous> ((index):243)
    at i (jquery.js?ver=1.12.4-wp:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
    at Function.ready (jquery.js?ver=1.12.4-wp:2)
    at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)

When I tested bw_countdown in the editor I noticed another message from WordPress SEO with Gutenberg 8.8.0 activated.
I added this to the issue I'd raised against WordPress SEO.
Then I lost my test results I'd been working on here. So I've redone them.
It doesn't occur when WordPress SEO is deactivated.
.
This occurs with Gutenberg 8.8.0, WordPress SEO 14.8 and all 4 combinations with jQuery version 3.5.1

post-edit-1480.js:1 Uncaught TypeError: Cannot read property 'loadFacebookPreviewData' of null
    at HTMLDocument.<anonymous> (post-edit-1480.js:1)
(anonymous) @ post-edit-1480.js:1

@bobbingwide
Copy link
Owner Author

bobbingwide commented Aug 24, 2020

jQuery Fancybox needs jQuery Migrate for WordPress 5.5.

jquery.fancybox-1.3.4.pack.js?ver=5.5:18 Uncaught TypeError: Cannot read property 'msie' of undefined
    at jquery.fancybox-1.3.4.pack.js?ver=5.5:18
    at jquery.fancybox-1.3.4.pack.js?ver=5.5:46
(anonymous) @ jquery.fancybox-1.3.4.pack.js?ver=5.5:18
(anonymous) @ jquery.fancybox-1.3.4.pack.js?ver=5.5:46
(index):361 WordPress jQuery: 1.12.4, Migrate: not available, UI: 1.11.4

(index):369 Uncaught TypeError: jQuery(...).fancybox is not a function
    at HTMLDocument.<anonymous> ((index):369)
    at i (jquery.js?ver=1.12.4-wp:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
    at Function.ready (jquery.js?ver=1.12.4-wp:2)
    at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)

It doesn't work at all with jQuery 3.5.1. ie. Fails with and without jQuery Migrate.

jquery.fancybox-1.3.4.pack.js?ver=5.5:18 Uncaught TypeError: Cannot read property 'msie' of undefined
    at jquery.fancybox-1.3.4.pack.js?ver=5.5:18
    at jquery.fancybox-1.3.4.pack.js?ver=5.5:46
(anonymous) @ jquery.fancybox-1.3.4.pack.js?ver=5.5:18
(anonymous) @ jquery.fancybox-1.3.4.pack.js?ver=5.5:46
(index):304 WordPress jQuery: 3.5.1, Migrate: 3.3.0, UI: 1.12.1
jquery-3.5.1.min.js?ver=3.5.1:2 jQuery.Deferred exception: jQuery(...).fancybox is not a function TypeError: jQuery(...).fancybox is not a function
    at HTMLDocument.<anonymous> (https://s.b/oikcom/wordpress-plugins-from-oik-plugins/oik-base-plugin/oik-jquery-library/jquery-fancybox/jquery-fancybox-with-nivo-slider/:312:741)
    at e (https://s.b/oikcom/wp-content/plugins/wp-jquery-update-test/assets/jquery-3.5.1.min.js?ver=3.5.1:2:30005)
    at t (https://s.b/oikcom/wp-content/plugins/wp-jquery-update-test/assets/jquery-3.5.1.min.js?ver=3.5.1:2:30307) undefined
S.Deferred.exceptionHook @ jquery-3.5.1.min.js?ver=3.5.1:2
t @ jquery-3.5.1.min.js?ver=3.5.1:2
setTimeout (async)
(anonymous) @ jquery-3.5.1.min.js?ver=3.5.1:2
c @ jquery-3.5.1.min.js?ver=3.5.1:2
fireWith @ jquery-3.5.1.min.js?ver=3.5.1:2
fire @ jquery-3.5.1.min.js?ver=3.5.1:2
c @ jquery-3.5.1.min.js?ver=3.5.1:2
fireWith @ jquery-3.5.1.min.js?ver=3.5.1:2
ready @ jquery-3.5.1.min.js?ver=3.5.1:2
B @ jquery-3.5.1.min.js?ver=3.5.1:2
jquery-3.5.1.min.js?ver=3.5.1:2 Uncaught TypeError: jQuery(...).fancybox is not a function
    at HTMLDocument.<anonymous> ((index):312)
    at e (jquery-3.5.1.min.js?ver=3.5.1:2)
    at t (jquery-3.5.1.min.js?ver=3.5.1:2)

For possible solutions see https://stackoverflow.com/questions/14344289/fancybox-doesnt-work-with-jquery-v1-9-0-f-browser-is-undefined-cannot-read

@bobbingwide
Copy link
Owner Author

bobbingwide commented Aug 25, 2020

On retesting I found that the [bw_testimonials] examples worked for all combinations but the [bw_cycle] examples were badly styled when jQuery version was 3.5.1
Also, with bw_cycle, for none of the 8 combinations did I get anything other than UI: not available.

See #155

@bobbingwide bobbingwide changed the title Test compatibility of the jQuery delivered with the [bw_jquery] shortcode with WordPress 5.5 and jQuery v3.5.1 Test compatibility of the jQuery delivered with the [bw_jq] shortcode with WordPress 5.5 and jQuery v3.5.1 Aug 26, 2020
@bobbingwide
Copy link
Owner Author

bobbingwide commented Aug 26, 2020

I noted that the documentation for [bw_jq] was rather lacking. And the syntax didn't reflect the order of the positional parameters. So I chose to update the code and PHPUnit tests for this shortcode’s syntax.

@bobbingwide
Copy link
Owner Author

I haven’t checked all uses of the following APIs in plugins dependent upon oik or oik shared libraries.

  • bw_jquery
  • bw_jquery_enqueue_script
  • bw_jquery_enqueue_style

@bobbingwide
Copy link
Owner Author

At the end of August I'd created some examples for [bw_jq] with pullquote and they worked. When I retested them they didn't work until I ensured that the <span class="pq"> was nested in a paragraph tag <p>. I then realised that the example was sensitive to the value of the Disable automatic paragraph creation checkbox. So I changed the example so that it wasn't, and wrote some notes.

PS. The pullquote jQuery is not something I'd expect anyone to use unless they really wanted to.

@bobbingwide bobbingwide changed the title Test compatibility of the jQuery delivered with the [bw_jq] shortcode with WordPress 5.5 and jQuery v3.5.1 Test compatibility of the jQuery delivered in oik with WordPress 5.5 and jQuery v3.5.1 Sep 2, 2020
@bobbingwide
Copy link
Owner Author

bw_logo - uses - oik_bw_logo.js

The jQuery for bw_logo didn't work properly. I'll remove it. See #159

@bobbingwide
Copy link
Owner Author

oik still works with WordPress 5.8.1 with the latest version of jQuery - v3.6.0
Closing therefore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant