Plugin Author
Claude
(@claudeschlesser)
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.
This one as well https://[name].api.oneall.com/socialize/library.js
GTMetrix is showing that these are sources of performance issue.
-Hien
Plugin Author
Claude
(@claudeschlesser)
Could you please post a link to the tool that you are using?
Plugin Author
Claude
(@claudeschlesser)
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 (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?
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.
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
– After: 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');
}
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
@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.
Thank you. I actually used ‘plugin load filter’ plugin, which allowed me to take care of this. It’s working as I wanted now.