Avada Forums Community Forum Kudos | Avada 7.1.2 | More Secure and Faster Website

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Jetxpert-Envato
    Blocked
    Post count: 339

    Way to go, Theme-Fusion!

    Thanks to your update, Avada V7.1.2, we are now able to use jQuery 3.5.1 with our website.

    Using jQuery 3.5.1 eliminates several security issues identified by Google PageSpeed Insights and Google Lighthouse. Our website runs faster as well.

    Again, thank you!

    To those who would like to use jQuery 3.5.1 instead of older jQuery versions, accomplish the following:

    (1) Go to WP Dashboard > Avada > Options > Advanced > Code Fields and add the following to the section titled, “Space before </head>”:

    <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" as="script" />

    (2) Add the following snippet to your functions.php file (preferably, with the plugin Code Snippets):

    function enqueue_scripts()
    {
        wp_deregister_script('jquery-core');
        wp_register_script('jquery-core', '//cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js', array(), null, false);
    }
    add_action('wp_enqueue_scripts', 'enqueue_scripts');

    (3) Clear all cache (e.g., Avada, Cache plugins, CDN, and browser)

    (4) Perform a Google PageSpeed Insights Test (to see the improvement).

    If the above does not work for you, check for plugin or other code conflicts, etc.

    Cheers!

    crimsonvspurple
    Participant
    Post count: 1

    Thank you for making this post. Pardon me if this is a stupid question…I’d expect Avada to do this automatically or have an option?

    Jetxpert-Envato
    Blocked
    Post count: 339

    @crimsonvspurple,

    Yes, very stupid question. Nah, just kidding 🙂

    Avada v7.1.2 incorporates jQuery 3.5.1 to ensure it’s compatible with WP v5.6 (scheduled to be released on December 8, 2020). Plugin developers are doing the same (i.e., updating their plugins to ensure compatibility with WP v5.6).

    jQuery 3.5.1 is downward compatible with WP v5.5 or lower (at this time).

    For more information on this topic, please read post provided below (great summary).

    https://wptavern.com/major-jquery-changes-on-the-way-for-wordpress-5-5-and-beyond

    Above procedure will remain valid and helpful after the release of WP v5.6.

    Cheers!

    Jetxpert-Envato
    Blocked
    Post count: 339

    @crimsonvspurple,

    One other comment …

    No, I don’t expect Avada (nor WordPress) to incorporate nor offer the above procedure. jQuery is built into both WP and Avada.

    The above procedure simply de-registers jQuery from your host server and registers JQuery with a CDN. In this case, with Cloudflare – which offers many advantages.

    I hope this answers your (great) question.

    Cheers!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.