i.sharethis.js hangs-up load time
-
i.sharethis.js was constantly making load-time increase by minutes…
Not sure if there was a built in way already; but it seems to be resolved for at-least for the moment by forcing it to load asynchronously.
Modified -> /class/GA_Frontend.php line 5 to:
const GA_SHARETHIS_PLATFORM_URL = '//platform-api.sharethis.com/js/sharethis.js#asyncload';
Modified my functions.php to include:
// Async load function ikreativ_async_scripts($url) { if ( strpos( $url, '#asyncload') === false ) return $url; else if ( is_admin() ) return str_replace( '#asyncload', '', $url ); else return str_replace( '#asyncload', '', $url )."' async='async"; } add_filter( 'clean_url', 'ikreativ_async_scripts', 11, 1 );
fix source from: https://ikreativ.com/async-with-wordpress-enqueue/
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘i.sharethis.js hangs-up load time’ is closed to new replies.