• Resolved Jeff Starr

    (@specialk)


    I just noticed that Stripe 4.4.7 is adding over 50 external scripts on every front-end page. So that means 50 extra URI requests for every visitor. That results in a significant performance hit.

    How to disable all Stripe assets (CSS and JavaScript) programatically?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Jeff Starr

    (@specialk)

    Nevermind, it’s:

    <?php wp_dequeue_script('simpay-block-button'); ?>

    Thread Starter Jeff Starr

    (@specialk)

    Follow up question: why isn’t simpay_before_register_public_scripts working?

    I had been using it to disable all the scripts loaded by this plugin, but it did not prevent simpay-block-button and all of its dependencies from loading.

    Plugin Author Spencer Finnell

    (@spencerfinnell)

    Hello @specialk,

    Thank you for the report. We are aware of this unintended side effect of the new button block support in the latest version of WP Simple Pay. We will be releasing a fix shortly that ensures the script is only loaded when the block editor is loaded.

    simpay_before_register_public_scripts will not be needed as the script only needs to load in the admin when using the block editor.

    Sorry for the inconvenience; we will have this resolved as soon as possible!

    Plugin Author Spencer Finnell

    (@spencerfinnell)

    This issue has been resolved in version 4.4.7.1.

    Thread Starter Jeff Starr

    (@specialk)

    Thank you!

    Hey follow up question: are these still valid or necessary to disable simpay scripts:

    wp_dequeue_script('simpay-stripe-js-v3');
    wp_dequeue_script('simpay-polyfill');
    wp_dequeue_script('simpay-accounting');
    wp_dequeue_script('simpay-shared');
    wp_dequeue_script('simpay-public');

    ..or will simpay_before_register_public_scripts take care of all those scripts?

    Plugin Author Spencer Finnell

    (@spencerfinnell)

    @specialk I would recommend filtering simpay_before_register_public_scripts to remove the script handles you do not want to load on particular pages. simpay_before_register_public_styles can be used to exclude CSS assets as well, if needed.

    Thread Starter Jeff Starr

    (@specialk)

    Nevermind, figured it out. Thanks for your help.

    • This reply was modified 1 year, 11 months ago by Jeff Starr.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to disable the 50+ scripts that this plugin loads on every page?’ is closed to new replies.