• Resolved shecky

    (@shecky)


    Hi!

    “Move scripts to the footer” option after last plugin update brokes website: javascripts files disappear and are not loaded!!!

    Please fix it!!!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi @shecky – I’m sorry to hear that. Could you please tell me more about your site setup and what exact options you’re using?

    In the meantime, here’s a link to the old plugin version: https://downloads.www.ads-software.com/plugin/speed-booster-pack.3.6.1.zip that used to work just fine with you.

    Also, could you please let me know your site’s URL so I can go ahead and check? Move scripts to footer works just fine at my end, but it might be I’m missing something.

    Thanks,
    Cristian.

    I can now confirm that this appears to be a bug with SBP. It doesn’t seem to play nicely with some themes/plugins. I’ll look more into this and address it via an update shortly.

    Thanks,
    Cristian.

    Thread Starter shecky

    (@shecky)

    Hi Cristian (@machothemes).

    The problem has occurred in more than one site.
    In these sites I had the following GENERAL options active:
    – Move scripts to the footer
    – Load JS from Google Libraries
    – Remove query strings
    – Removes extra Font Awesome styles

    Now:
    1) I have deselect “Move scripts to the footer”
    2) I have insert in my function.php this code:

    function load_my_custom_scripts() {
    	// ------- Move javascripts from the Head to the Footer -------
    	remove_action('wp_head', 'wp_print_scripts');
    	remove_action('wp_head', 'wp_print_head_scripts', 9);
    	remove_action('wp_head', 'wp_enqueue_scripts', 1);
    	add_action('wp_footer', 'wp_print_scripts', 5);
    	add_action('wp_footer', 'wp_enqueue_scripts', 5);
    	add_action('wp_footer', 'wp_print_head_scripts', 5);
    	// ------- Move javascripts from the Head to the Footer -------
            
            ...
            ...
            ...
            ...
            ...
    }
    add_action( 'wp_enqueue_scripts', 'load_my_custom_scripts', 20 );

    and everything is back to work as before.

    I tried before making these changes to reload version 3.6.1 of your plugin and everything worked properly.

    So I can tell you (with absolute certainty) that the problem is related only to the new version 3.7.0.

    Regards.
    Davide.

    Thread Starter shecky

    (@shecky)

    For your information Cristian, I debugged the core.php file inserted in SBP.
    In this file I found the various “remove_action” functions but I did not find any reference related to the “add_action” functions for move javascripts from HEAD to FOOTER.

    I hope this helps you!

    Regards.
    Davide.

    Hi Davide,

    the way this used to work is that it allowed users to dequeue scripts by the script handle but also required users to input the HTML source code of the script the users wanted to exclude from being moved to the footer. Because we had to offer a backwards compatible way of making this work for our users, you can find the appropriate code in: core.php, L216-396 (https://github.com/MachoThemes/speed-booster-pack/blob/master/inc/core.php#L216-L396)

    The function sbp_scripts_to_head is hooked in the same file(core.php) at L17-19 (https://github.com/MachoThemes/speed-booster-pack/blob/master/inc/core.php#L17-L19)

    Thanks for giving this a stab David ??

    Thread Starter shecky

    (@shecky)

    It was clear Cristian, but not having in my sites script js to be excluded but having various online sites (including three e-commerce) that no longer worked, I looked for the quickest solution to put everything back online ??

    I’m waiting for a new release of SBP ??

    Davide,

    yep, we’re working on a new release ??

    It doesn’t seem to be affecting everyone though.

    Thread Starter shecky

    (@shecky)

    Cristian,
    if you need a beta tester, I’m here ??

    That’s actually great to hear ?? We’re located in Eastern Europe and we’re about to go on a small vacation to celebrate Easter.

    We’ll back to work on Tuesday and I’ll try to release an update early next week to address this as well as add some much needed functionality, like: concatenate JS/CSS files and minify ??

    I’ll ping in this thread to let you know once a BETA version is up for grabs ??

    Thanks,
    Cristian.

    Thread Starter shecky

    (@shecky)

    Have a nice holiday, Cristian ??

    Thread Starter shecky

    (@shecky)

    Hi Cristian!

    For your information, latest release you made (v. 3.7.1) still does not fix the problem ??

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi @shecky, unfortunately the latest release does not address your issue. This release was needed because of difficulties with lazyload. Please read the following note.

    Changelog
    3.7.1

    Temporarily remove lazyLoad as the bundled JS files, namely, CrazyLazy don’t seem to be working properly with the latest jQuery version.

    Kind regards

    @shecky – what @mbrsolution said ?? Basically, v3.7.1 was a hotfix release.

    Thread Starter shecky

    (@shecky)

    There’s news about that?

    Thread Starter shecky

    (@shecky)

    @machothemes do you have good news?

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Move scripts to the footer option broke websites’ is closed to new replies.