• Resolved saz25

    (@saz25)


    Hi,
    I am using the free version of GiveWP. Everything seems to be working fine except that my site loads slowly on almost all pages even those pages that have nothing to do with donations.

    When I look at the headers on all pages I see scripts with references to stripe, give-stripe-js, donate forms, etc.

    There is lots of script code that has to do with currency, donate button text, etc. I see this on my normal site non-donation pages.

    When the pages load I see “waiting for m.stripe, etc.

    Why is this code in all my pages? Did the GiveWP plugin create all that?

    Anything I can do to improve performace and possibly only have this code on pages where its needed?

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter saz25

    (@saz25)

    A bit more info.
    When I load my home page I see on the bottom “waiting for m.stripe” for about 3-4 seconds. My site has a “Donate” button on the main menu, but I would hope/assume that when someone goes to the home or non-donate page, they wouldn’t be impacted time-wise by going to stripe and other donation related resources, pages, apis, etc.

    Here is site url:

    https://cancareatlanta.org/

    thanks

    Plugin Support Rick Alday

    (@mrdaro)

    Hi @saz25,

    The default behavior of GiveWP (as you have discovered) is to add GiveWP assets to every page on the WordPress site, which is a WordPress e-commerce standard practice. The main reason for that is that we don’t know where people are going to place GiveWP forms. We are in the process of a long-term plan to utilize those assets in a more performant way by conditionally loading them. That doesn’t help you today, though.

    We have a plan to take a look at how we can optimize things better from our end, and you can follow along on that here: https://feedback.givewp.com/feature-requests/p/givewp-should-enqueue-scripts-only-on-needed-pages-instead-of-adding-it-to-the-e

    The workaround for today is to use this custom PHP to only load GiveWP assets on a particular page:

    https://github.com/impress-org/givewp-snippet-library/blob/master/theme-compatibility/conditional-script-loading.php

    That will prevent GiveWP assets from loading unless you specifically call for them.

    If you need assistance implementing custom PHP code on your website we have this guide:

    https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/

    Please note that this code snippet (a) is NOT copy-paste ready, and (b) is provided as an example of how you can extend GiveWP with code. It’s up to you to implement and customize to your liking. We cannot provide support for custom code on your website, only the code that we create and distribute.

    Thanks!

    Thread Starter saz25

    (@saz25)

    Thanks for the reply. I see that this has been an issue for over 2 years given the dates on the comment in the first file above.

    My problem is that I built this website for a non-profit and they aren’t happy with the performance.

    I selected GiveWP after reading many positive reviews and seeing that its been downloaded/installed so many times.

    I’d prefer to stay with this plugin and even purchase the premium version, but I need to know that improvement is coming in some decent time frame.

    I rather not start from scratch with another donation plugin.

    I can make code changes myself with php and css but not on a large scale. If there was a well documented work around that would be great too.

    Having said that how soon do you expect improvements?

    thanks

    • This reply was modified 2 years, 11 months ago by saz25.
    Plugin Support Rick Alday

    (@mrdaro)

    We try to make overall performance improvements but we don’t have a timeline for that specific request I linked before.

    The reason why assets load globally is to support pages with forms created with shortcodes or page builders.

    However, if you really don’t need those assets except on GiveWP pages then you can use this plugin to dequeue scripts and styles.

    https://www.ads-software.com/plugins/gonzales/

    Hope this helps

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘GiveWP scripting code on all pages slows site’ is closed to new replies.