WordPress 5.6 broke the slider

steve's Avatar

steve

09 Dec, 2020 09:06 AM

FYI, WordPress 5.6 broke the slider on my site.

I have restored previous snapshot, so no problem, but has anyone else had a problem? Would be grateful for a fix if so.

Stephen

  1. Support Staff 1 Posted by Dmitry Semenov on 09 Dec, 2020 10:09 PM

    Dmitry Semenov's Avatar

    Hello Stephen,

    Can you please elaborate on what/how exactly wasn't it working? And if you can provide a link to the staging version of your website that isn't working correctly - that would be great.

  2. 2 Posted by steve on 10 Dec, 2020 09:23 AM

    steve's Avatar

    I had some Javascript work done on the site and suspect this is the problem, if no one else had a problem. I shall investigate this further rather than bothering you more and get back if necessary. Thanks for the support!

  3. 3 Posted by info on 13 Dec, 2020 12:07 PM

    info's Avatar

    Same problem here. After updating to WP 5.6 all sliders are broken.

  4. Support Staff 4 Posted by Dmitry Semenov on 13 Dec, 2020 03:11 PM

    Dmitry Semenov's Avatar

    Please link to the page with the issue.

  5. 5 Posted by info on 13 Dec, 2020 03:47 PM

    info's Avatar
  6. Support Staff 6 Posted by Dmitry Semenov on 13 Dec, 2020 04:14 PM

    Dmitry Semenov's Avatar

    One of your plugins or the theme is adding defer attribute to all scripts of the page, which breaks execution order. Are you using any "performance optimization" plugins?

  7. 7 Posted by info on 13 Dec, 2020 06:01 PM

    info's Avatar

    Ok. I found this within the functions.php from the theme.

     

    --

    //Defer Pasing JavaScript for entire website, including Plugins, but without jQuery.js

    //Feel free to change "async" to "defer". $files will be excluded

    function defer_parsing_of_js($url)

    {

    //Specify which files to EXCLUDE from defer method. Always add jquery.js

        $files = array('jquery.js');

    //let's not break back-end

        if (!is_admin()) {

            if (false === strpos($url, '.js')) {

                return $url;

            }

     

            foreach ($files as $file) {

                if (strpos($url, $file)) {

                    return $url;

                }

            }

        } else {

            return $url;

        }

        return "$url' defer='defer";

    }

    add_filter('clean_url', 'defer_parsing_of_js', 11, 1);

     

    --

     

    Any suggestions what to change here? Deleting the whole section and the slider works again. But I am not sure how this effects the rest of the theme …

  8. Support Staff 8 Posted by Dmitry Semenov on 13 Dec, 2020 08:20 PM

    Dmitry Semenov's Avatar

    You can try modifying to:

    //Specify which files to EXCLUDE from defer method. Always add jquery.js
    $files = array('jquery.js', 'jquery.min.js', 'royalslider');
    
  9. 9 Posted by info on 14 Dec, 2020 05:01 AM

    info's Avatar

    Thank you Dmitry, problem solved.

  10. 10 Posted by flaminio2 on 02 Jan, 2021 01:26 AM

    flaminio2's Avatar

    Good day Dmitry and Happy New Year. I have the same issue, after updating to 5.6 the sliders are not working (the loading animation keep going without dispaying the pictures). Here is one of the pages where royalslider is in: https://www.fortbonifaciorent.com/the-fort-residences/1br-tfr38

  11. Support Staff 11 Posted by Dmitry Semenov on 02 Jan, 2021 11:13 PM

    Dmitry Semenov's Avatar

    @flaminio2 , your theme (or one of the plugins) is including jQuery and jQuery.Migrate incorrectly, thus you have multiple versions of them on the same page. Specifically these two script tags:

    <script   src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.0.0.js"></script>
    
  12. 12 Posted by flaminio2 on 04 Jan, 2021 11:33 PM

    flaminio2's Avatar

    Thanks Dmitry, the devs were able to fix the conflict. Now working.

  13. 13 Posted by Suzzz on 10 Jan, 2021 09:28 PM

    Suzzz's Avatar

    Update to WP 5.6 also broke my home page slider https://www.missouriantiquemalls.com/ Your help would be appreciated.

    Thanks

  14. Support Staff 14 Posted by Dmitry Semenov on 11 Jan, 2021 02:20 PM

    Dmitry Semenov's Avatar

    @Suzzz, you're using very old version of the plugin, consider updating. There is also a JS error from your theme or one of the plugins that may block the execution.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac