Support » Plugin: Speed Booster Pack: Easy Performance & PageSpeed Optimization » Exclude JS files defer for checkout page

  • Resolved mitsakos999

    (@mitsakos999)


    Hello.

    Is there any way via functions.php (or any) to exclude this feature from being applied in a specific page ?

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, at present you might have to disable this feature in the plugin.

    The developers do mention the following option to be implemented in the future.

    Option to disable specific plugin actions on specific pages directly via the page edit screen metabox.

    Kind regards

    Hi,thanks for response,

    I ended up disabling the feature, but implemented it myself via php code. I was easier thanIexpected

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, that is great news 😉

    Would you be able to share your solution for others to know. This might help others with the same issue.

    Can you also mark this support thread as resolved, if you no longer need any more help.

    Thank you

    /* I added the bellow code to my child theme functions.php */

    function defer_parsing_of_js ( $url ) {
    if ( FALSE === strpos( $url, ‘.js’ ) ) return $url;
    if (is_page(9)) return $url; /*dont defer scripts for this page*/
    if ( strpos( $url, ‘jquery.min.js’ ) ) return $url; /*dont defer this */
    if ( strpos( $url, ‘jquery.js’ ) ) return $url;/*dont defer this */
    if ( is_admin() ) return $url; /*dont defer scripts for admins pages*/

    return “$url’ defer “;

    }
    add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );

    resolved

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude JS files defer for checkout page’ is closed to new replies.