Jump to content


Welcome to the forum:

Welcome to the iThemes, PluginBuddy and WebDesign.com forum. We've created several tutorial video's to help you get you started with using the forum, please check them out!

Also take note of the forum guidelines.


Support hours:

Our moderators actively respond to forum support requests during normal business hours which are Monday-Friday, 8am - 5pm Central Standard Time, typically within one business day. Although some moderators choose to work during the weekends, we can not guarantee immediate attention to your requests. Thanks for understanding.

What is included with support:

Premium support includes theme/plugin issues such as: bugs encountered under normal operation, how to use basic features, basic WordPress help, and basic help with customization (meaning we point you to resources and will help in more depth as time allows). More information.

in progress

Stripe's Checkout.js File Being Loaded On Every Page

exchange stripe

5 replies to this topic

#1 Andrew Morris

Andrew Morris

    Advanced Member

  • Members
  • Others: Toolkit
  • PipPipPip
  • 32 posts

Posted 21 February 2014 - 07:07 PM

Hey Exchange peeps!

I'm really trying to get my site to load a little faster and I'm noticing that on non-exchange pages, the checkout.js file is being called and loaded. I'm wondering why this is the case? Isn't there a way to load this file only on the checkout/product/pages with the super widget? I'm also noticing that stripe-addon.js is being called in the same manner.

I would really like to get these loading only on the right pages. If it's something I need to do, I'll gladly update some code to make this happen.

You can checkout the site here, http://ajmorris.me.

I'm also including BackupBuddy's server config to give you an idea of what I've got going on here.

[OK]     BackupBuddy Version   =   4.2.14.11
[OK]     WordPress Version   =   3.8.1
[OK]     MySQL Version   =   5.5.35
[OK]     AddHandler in .htaccess   =   none, n/a
[OK]     PHP Version   =   5.4.6-1ubuntu1.5
[OK]     PHP max_execution_time (server-reported)   =   30
[OK]     PHP Memory Limit   =   256M
[OK]     Zip Methods   =   exec, ziparchive, pclzip  
[WARNING]     Database Dump Methods   =   php
[OK]     Site Size   =   Unknown  
[OK]     Site Size (Default Exclusions applied)   =   Unknown  
[OK]     Site number of files   =   Unknown  
[OK]     Site number of files (Default Exclusions applied)   =   Unknown  
[OK]     Database Size   =   6.86 MB  
[OK]     Database Size (Default Exclusions applied)   =   6.86 MB  
[OK]     Average Write Speed   =   451 KB/sec
[OK]     Guesstimate of max ZIP size   =   13.21 MB
[OK]     Http Loopbacks   =   enabled
[OK]     WordPress Cron   =   enabled
[OK]     WordPress Alternate Cron   =   disabled (default)
[OK]     Disabled PHP Functions   =   pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
[OK]     PHP Register Globals   =   disabled
[OK]     PHP Magic Quotes GPC   =   disabled
[OK]     PHP Magic Quotes Runtime   =   disabled
[OK]     PHP Safe Mode   =   disabled
[OK]     PHP API   =   fpm-fcgi
[OK]     PHP Architecture   =   64-bit
[OK]     Http Server Software   =   nginx/1.2.1
[OK]     Server Load Average   =   0.43, 0.15, 0.15
[OK]     PHP SSH2, SFTP Support   =   no, no
[OK]     WordPress ABSPATH   =   /home/wordpress/public_html/
[OK]     Operating System   =   Linux (Linux bazinga 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64)
[WARNING]     Active WordPress Plugins   =   gravityforms/gravityforms.php, CDN-Linker-master/wp-cdn-linker.php, admin-bar-disabler/admin-bar-disabler.php, akismet/akismet.php, backupbuddy/backupbuddy.php, exchange-addon-mailchimp/exchange-addon-mailchimp.php, exchange-addon-recurring-payments/exchange-addon-recurring-payments.php, exchange-addon-stripe/exchange-addon-stripe.php, floating-social-bar/floating-social-bar.php, gistpress-master/gistpress.php, google-analyticator/google-analyticator.php, gravityformsmailchimp/mailchimp.php, gravityformspolls/polls.php, gravityformszapier/zapier.php, ithemes-exchange/init.php, lazy-load/lazy-load.php, optin-monster-slide/optin-monster-slide.php, optin-monster/optin-monster.php, thirstyaffiliates/thirstyaffiliates.php, w3-total-cache/w3-total-cache.php, wordpress-seo/wp-seo.php, wp-migrate-db-pro-media-files/wp-migrate-db-pro-media-files.php, wp-migrate-db-pro/wp-migrate-db-pro.php, wp-optimize/wp-optimize.php, wp-retina-2x/wp-retina-2x.php, wp-smushit/wp-smushit.php
[OK]     PHP Process User (UID:GID)   =   www-data (33:33)


Would definitely love to get this solved if possible. Thanks!

-AJ

#2 Ronald

Ronald

    Forum Admin

  • Administrators
  • Others: All Plugins, All Themes, Moderators, Webdesign
  • 30,743 posts

Posted 22 February 2014 - 07:41 AM

Hi AJ,

you can add the following code at the end of your child theme's functions.php (but before a closing ?>, if any):

function my_stripe_enqueue_scripts() {
	
	if ( !it_exchange_is_page() ||  !function_exists( 'it_exchange_stripe_addon_enqueue_script' ) ) {
		
		wp_dequeue_script( 'stripe' );
		wp_dequeue_script( 'stripe-addon-js' );
	}
}
add_action( 'wp_enqueue_scripts', 'my_stripe_enqueue_scripts', 99);

This is fairly "rough" way to unload these scripts when NOT on an Exchange page. More granular control can be done using a condition such as:

	if ( !it_exchange_is_page( 'checkout' ) ||  !function_exists( 'it_exchange_stripe_addon_enqueue_script' ) ) {

which will test for the "checkout" page specifically, but this may(!) be too tight, and the plugin may not function properly,

Ronald

Join the iThemes Builder Community on Google+.



To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. Please also read the forum guidelines.



When asking your question/posting your request on the forum, please be as concise and specific as possible. The shorter your request, the more to the point, the more specific, the easier it will be for us to try and help out.


#3 Rob Hess

Rob Hess

    Member

  • Members
  • Others: All Plugins
  • PipPip
  • 20 posts

Posted 13 March 2014 - 10:01 PM

I noticed this as well. Thanks Ronald, for the response. I'll test your approaches and see how that goes.

As an aside, It seems strange that Exchange loads Stripe's checkout.js on every page when Exchange currently only allows the actual checkout process to occur on product pages. I believe Exchange also manages product pages (I don't think there's any other option right now). It'd be handy if Exchange would be able to detect and add checkout.js automatically to those product pages.

In my case, checkout.js takes between 500 and 600 milliseconds to load, which makes up a bit less than half of my total load time (1.36s). Personally, I'd love to see this changed in the next version of the Stripe plugin.

Cheers,

Rob

#4 Ronald

Ronald

    Forum Admin

  • Administrators
  • Others: All Plugins, All Themes, Moderators, Webdesign
  • 30,743 posts

Posted 14 March 2014 - 09:23 AM

Hi Rob,

I have added this as an enhancement request for the developers to look into,

Ronald

Join the iThemes Builder Community on Google+.



To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. Please also read the forum guidelines.



When asking your question/posting your request on the forum, please be as concise and specific as possible. The shorter your request, the more to the point, the more specific, the easier it will be for us to try and help out.


#5 Rob Hess

Rob Hess

    Member

  • Members
  • Others: All Plugins
  • PipPip
  • 20 posts

Posted 14 March 2014 - 02:48 PM

Thanks Ronald!

#6 mjsdiaz

mjsdiaz

    Member

  • Members
  • Others: All Plugins, BackupBuddy, BackupBuddy, Exchange - Stripe, Sync
  • PipPip
  • 20 posts

Posted 29 September 2014 - 11:04 AM

I would like to add that I would appreciate Stripe Checkout scripts added only on iThemes Exchange pages too. I couldn't find it in the Trello Roadmap to add my vote.

Thanks!



Reply to this Topic


ATTENTION
If this topic is marked RESOLVED or INFORMATION, or if you are NOT experiencing EXACTLY the same issue, please start a new topic to provide the details of your problem. If the solution provided doesn't work for you, you should start a new topic. If you feel this thread contains relevant information, you may include a link to it in your new topic. To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. When posting your question or request on the forum, please be as concise and specific as possible. The shorter and more to the point you can make your request, the better.

For BackupBuddy related issues, be sure to include the status log from your most recent backup.

CLICK HERE to start a new topic in the Exchange Add-on - Stripe forum.


  



Also tagged with one or more of these keywords: in progress, exchange, stripe

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users