• Resolved dav74

    (@dav74)


    Hi there,

    Your plugin loads its script on every page of the website, even when we only have a popup on the checkout page. The issue with this is that the spu-public-css script is adding about 1 second to page load times, which is a lot.

    Is there any way we can unload this script on every page of the website, except for the page where the popup is? I do not really want to add an extra plugin just for this.

    Thanks again for your suggestions

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Damian

    (@timersys)

    Hi @dav74,
    there must be something else in there. As it’s impossible to take a whole second for that file.

    Anyway you could try the following:
    `
    add_action( ‘wp_enqueue_scripts’, ‘conditional_spu’,30);
    function conditional_spu(){

    if( ! is_page(‘your-page’) ){

    wp_dequeue_style(‘spu-public-css’);

    }
    }

    Thread Starter dav74

    (@dav74)

    Hi Damian,

    Sorry I should have been clearer. With your plugin, the floating cart we use takes about 1 second more to fully load. If we disable your plugin it speeds it up by about 1 second.

    Thank you for the snippet you provided. Will this dequeue your plugin on all pages, except for the page I list? Also, for ‘your-page’ do I enter the page url ie ‘checkout’?

    Thanks in advance

    Thread Starter dav74

    (@dav74)

    Hi there,

    Thanks for that, although what is slowing the page down is not the css file, but the js file. Could you let me know how I would change your snippet to include the exclusion of the js file?

    wp-content/plugins/popups/public/assets/js/min/public-min.js

    Thansk in advance

    • This reply was modified 8 years, 8 months ago by dav74.
    • This reply was modified 8 years, 8 months ago by dav74.
    Plugin Author Damian

    (@timersys)

    Simple use wp_dequeue_sscript(‘spu-public’);

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘1 second additional load time’ is closed to new replies.