Agree. Not slowing down load performance ON ALL pages would be indeed something that should be priority. All this needs from the plugin authors is to move enqueues to the shortcode detection — not really that hard.
I’m only using the social login, and this is my work around to remove loading this plugin’s scripts and styles on all pages; use or modify at your own risk:
/**
* Remove about 300kb by loading social login scripts and styles only
* pages that have a login form
*/
$account_pages = array("account", "checkout");
function us_filter_scripts() {
global $wp_scripts, $wp, $account_pages;
wp_dequeue_script('wc-add-to-cart');
wp_dequeue_script('wc-cart-fragments');
if (empty($wp->query_vars['pagename']) || !in_array($wp->query_vars['pagename'], $account_pages)) {
wp_dequeue_script('the_champ_combined_script');
wp_dequeue_script('the_champ_ss_general_scripts');
wp_dequeue_script('the_champ_sl_common');
wp_dequeue_script('the_champ_sl_google');
wp_dequeue_script('the_champ_fb_sdk');
wp_dequeue_script('the_champ_sl_facebook');
}
}
add_action( 'wp_print_scripts', 'us_filter_scripts' );
function us_filter_styles() {
global $wp_styles, $wp, $account_pages;
if (empty($wp->query_vars['pagename']) || !in_array($wp->query_vars['pagename'], $account_pages)) {
wp_dequeue_style('the_champ_frontend_css');
}
}
add_action( 'wp_print_styles', 'us_filter_styles' );