Title: Javascript always loaded?
Last modified: April 25, 2017

---

# Javascript always loaded?

 *  Resolved [Hien D. Nguyen](https://wordpress.org/support/users/hiendnguyen/)
 * (@hiendnguyen)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/)
 * Hi,
 * Below js is always loaded in every single page.
 * >  <!– OneAll.com / Social Login for WordPress / v5.3 –>
   >  <script data-cfasync
   > =”false” type=”text/javascript”> (function() { var oa = document.createElement(‘
   > script’); oa.type = ‘text/javascript’; oa.async = true; oa.src = ‘[https://vntesters.api.oneall.com/socialize/library.js&#8217](https://vntesters.api.oneall.com/socialize/library.js&#8217);;
   > var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(
   > oa, s); })(); </script> <style type=”text/css” media=”print”>#wpadminbar { 
   > display:none; }</style> <style type=”text/css” media=”screen”> html { margin-
   > top: 32px !important; } * html body { margin-top: 32px !important; } [@media](https://wordpress.org/support/users/media/)
   > screen and ( max-width: 782px ) { html { margin-top: 46px !important; } * html
   > body { margin-top: 46px !important; } } </style>
 * Is there any option to just load it in Login Page?
 * Thanks,
    Hien

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

 *  Plugin Author [Claude](https://wordpress.org/support/users/claudeschlesser/)
 * (@claudeschlesser)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9064178)
 * Hi Hien,
 * yes, to give you the best flexibility, it’s loaded on every page. This allows
   you to simply embed the plugin by using a shortcode or by using JavaScript.
 * The JavaScript is loaded asynchronously, so it will never block or slowdown the
   loading of your page. It’s also cached, so it will actually only be loaded once
   by the browser and then the cached version will be used.
 * Do not hesitate to get back to use if you have any other questions.
 *  Thread Starter [Hien D. Nguyen](https://wordpress.org/support/users/hiendnguyen/)
 * (@hiendnguyen)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9064310)
 * This one as well [https://[name].api.oneall.com/socialize/library.js](https://[name].api.oneall.com/socialize/library.js)
 * GTMetrix is showing that these are sources of performance issue.
 * -Hien
 *  Plugin Author [Claude](https://wordpress.org/support/users/claudeschlesser/)
 * (@claudeschlesser)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9064400)
 * Could you please post a link to the tool that you are using?
 *  Thread Starter [Hien D. Nguyen](https://wordpress.org/support/users/hiendnguyen/)
 * (@hiendnguyen)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9064418)
 * I am using
    – [https://gtmetrix.com/](https://gtmetrix.com/) – [https://tools.pingdom.com/](https://tools.pingdom.com/)
 *  Plugin Author [Claude](https://wordpress.org/support/users/claudeschlesser/)
 * (@claudeschlesser)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9064685)
 * Hello,
 * what I get from gtmetrix is this notice:
 * > Leverage browser caching for the following cacheable resources:
   >  [http://oneall.api.oneall.com/socialize/library.js](http://oneall.api.oneall.com/socialize/library.js)(
   > 4 hours)
 * 4 hours cache is the compromise between keeping the JavaScript up-to-date and
   allow the browser to cache it.
 * Do you have any other messages?
 *  Thread Starter [Hien D. Nguyen](https://wordpress.org/support/users/hiendnguyen/)
 * (@hiendnguyen)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9067861)
 * No. I got same message. So the file will be cached for 4 hours and you think 
   it’s good enough.
 * Thanks for all your inputs. I appreciate that.
 *  Thread Starter [Hien D. Nguyen](https://wordpress.org/support/users/hiendnguyen/)
 * (@hiendnguyen)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9098404)
 * FYI, I could remove these extra script by using remove_action, wp_dequeue_script,
   wp_deregister_script. It saves loading page some time (2.2s reported by gtmetrix)…
   –
   Before: [https://gtmetrix.com/reports/vndeveloper.com/NAuUEwxn](https://gtmetrix.com/reports/vndeveloper.com/NAuUEwxn)–
   After: [https://gtmetrix.com/reports/vndeveloper.com/Bx6OOZy3](https://gtmetrix.com/reports/vndeveloper.com/Bx6OOZy3)
 * Snippets are below to whom it may concern
 *     ```
       if(is_user_logged_in() || !is_account_page()){
       		# style
       		wp_deregister_style('oa_social_login_admin_css');
       		wp_dequeue_style('oa_social_login_admin_css');
       		wp_deregister_style('oa_social_login_link_css');
       		wp_dequeue_style('oa_social_login_link_css');
       		wp_deregister_style('css_theme_uri');
       		wp_dequeue_style('css_theme_uri');
       		# script
       		wp_deregister_script('oa_social_login_admin_js');
       		wp_dequeue_script('oa_social_login_admin_js');
       		wp_deregister_script('oa_social_library');
       		wp_dequeue_script('oa_social_library');
       		# action
       		remove_action('login_head', 'oa_social_login_add_javascripts');
       		remove_action('wp_head', 'oa_social_login_add_javascripts');
       		remove_action('show_user_profile', 'oa_social_login_add_javascripts');
       		remove_action('login_form', 'oa_social_login_render_login_form_wp_login');
       		remove_action('wppb_before_login', 'oa_social_login_render_login_form_login');
       		remove_action('bp_before_sidebar_login_form', 'oa_social_login_render_login_form_login');
       		remove_action('va_after_admin_bar_login_form', 'oa_social_login_render_login_form_login');
       		remove_action('sidebar_login_widget_logged_out_content_end', 'oa_social_login_render_login_form_login');
       		remove_action('woocommerce_login_form_end', 'oa_social_login_render_login_form_login');
       		remove_action('register_form', 'oa_social_login_render_login_form_wp_registration');
       	}
       ```
   
 *  [zvhipp](https://wordpress.org/support/users/zvhipp/)
 * (@zvhipp)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9525387)
 * I tried putting this in my functions.php file, I replaced account page with !
   is_single() but it didn’t work. It removed the code from everywhere. Anyway to
   just keep scripts limited to single.php or where the comment is enabled. It does
   improve the page loading time by 25%. Thanks
 *  Thread Starter [Hien D. Nguyen](https://wordpress.org/support/users/hiendnguyen/)
 * (@hiendnguyen)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9529537)
 * [@zvhipp](https://wordpress.org/support/users/zvhipp/) I am glad that it’s helpful
   for you.
 * I used WooCommerce for user management so it will be much different if you don’t
   use WooCommerce since “!is_account_page()” always returns “True” which will remove
   the code from everywhere.
 *  [zvhipp](https://wordpress.org/support/users/zvhipp/)
 * (@zvhipp)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9530400)
 * Thank you. I actually used ‘plugin load filter’ plugin, which allowed me to take
   care of this. It’s working as I wanted now.

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

The topic ‘Javascript always loaded?’ is closed to new replies.

 * ![](https://ps.w.org/oa-social-login/assets/icon-256x256.gif?rev=2680668)
 * [Social Login](https://wordpress.org/plugins/oa-social-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/oa-social-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/oa-social-login/)
 * [Active Topics](https://wordpress.org/support/plugin/oa-social-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/oa-social-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/oa-social-login/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [zvhipp](https://wordpress.org/support/users/zvhipp/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/javascript-always-loaded/#post-9530400)
 * Status: resolved