• Resolved Henry

    (@henrybaum)


    In the old version, I couldn’t move scripts to the footer because it broke the slider – images never loaded – even with scripts excluded. After the upgrade, I have to switch off “Defer parsing of javascript files” for the slider to work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • @henrybaum – defer parsing of javascript files doesn’t make sense/shouldn’t be used in combination with “move scripts to footer”.

    If you move all the scripts to the footer, deferring doesn’t have much effect (if any), since the DOM is already pretty much all loaded and there’s no more render blocking resources being loaded.

    What I’m basically trying to say is that they should be mutually exclusive. Use one or the other (I’m sorry I haven’t been able to put up some better documentation to explain this, but I’m working on it).

    Also, if defer parsing of javascript files is breaking your slider, try excluding the file that you believe is the culprit. Under the “Advanced” tab, the bottom panel is labeled: “Exclude scripts from being deferred”.

    If You could provide me with your site’s URL I could try and help out with this ??

    Thanks,
    Cristian.

    Thread Starter Henry

    (@henrybaum)

    If I defer anything else, it will be along the lines of “If you want to exclude more than 4 scripts, your page score will be hit and therefore the use of “Defer parsing of javascript files” option will become useless so you can disable it.”

    In any case, no script seems to be helping – at least no theme scripts, and there’s nothing for the slider.

    I can’t link to it currently, as I’m testing it on a dev site before upgrading on the main one. However, the speed test is better after the upgrade with a faster load time and 42 DB queries instead of 100 – even with defer and scripts turned off. When I turn on defer, the load time gets worse!

    @henrybaum – could you please tell me the theme name / plugins you’re using? If they’re all free, I can spin up a WordPress instance and start testing away, see what might break.

    Also, as I said, if you’re using both “Move scripts to footer” & “defer javascript” there’s no point. Deferring javascript is only useful IF you don’t plan to load all your JS files in the footer. By the time the browser has reached your footer (where your JS files exist), it has finished loading most if not all of the DOM.

    You can safely ignore that rule of deferring more than 4 scripts as that’s an old rule that no longer applies.

    Thread Starter Henry

    (@henrybaum)

    It’s 44 plugins, so a bit complicated, and not all free. I’m using the Sahifa theme, which isn’t free either.

    I guess I’ll have to try to defer every .js and see what works.

    There’s also a filter included in the latest version of this plugin, just in case you need to defer more than the 4 scripts included with the plugin.

    You can use the following filter, this way:


    add_filter('sbp_exclude_defer_scripts', 'my_function_name_here');

    function my_function_name_here( $array ) {

    $array = (
    'script-handle-1',
    'script-handle-2'
    );

    return $array;
    }

    Thanks,
    Cristian.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Slider Stopped Working’ is closed to new replies.