wp-rocket
wp-rocket copied to clipboard
Social Media Share Buttons compatibility with Defer and Delay JS when the jQuery library is excluded
Before submitting an issue please check that you’ve completed the following steps:
- [x] Made sure you’re on the latest version
3.11.4.2
- [x] Used the search feature to ensure that the bug hasn’t been reported before
Describe the bug When the Social Media Share Buttons & Social Sharing Icons is used with either Delay JS or Defer JS, and the jQuery library is excluded, the following console error shows up:
Uncaught Error: Shuffle.js requires Modernizr.
http://vestride.github.io/Shuffle/#dependencies
at jquery.shuffle.min.js?ver=6.0.1:1:177
at jquery.shuffle.min.js?ver=6.0.1:1:85
at jquery.shuffle.min.js?ver=6.0.1:1:119
In addition to the console error, the buttons don't show up.
Excluding the following from Delay JS and Defer JS (when jQuery is already excluded) fixes the issue:
/ultimate-social-media-icons/js/shuffle/modernizr.custom.min.js
Not pushing a PR as this will require a compatibility file to manage both exclusions.
To Reproduce Steps to reproduce the behavior:
- Enable the Social Media Share Buttons plugins
- Add the bottoms to the page from the settings
- Exclude jQuery from either Defer or Delay JS
- See error
Expected behavior There shouldn't be any errors when the Social Media Share Buttons is used with Delay and Defer JS, even if jQuery is already excluded.
Screenshots N/A
Additional context Ticket - https://secure.helpscout.net/conversation/1947798264/355636/
Backlog Grooming (for WP Media dev team use only)
- [ ] Reproduce the problem
- [ ] Identify the root cause
- [ ] Scope a solution
- [ ] Estimate the effort