Works as advertised
-
This is the very first plugin that managed to load my scripts asynchronously, without breaking my site.
All I had to do was to exclude ‘jquery’ and ‘cycle’ from deferral, in my functions.php of my child-theme…
add_filter('do_not_defer','scripts_to_not_defer'); function scripts_to_not_defer(){ return array('jquery', 'cycle'); }
due to a slider plugin I’m using.
I took off one star because of 2 things:
- No back-end settings (e.g. for the exclusions).
- It forcefully appends query strings with the current wp version at the url of the scripts.
The second one is not a biggie, but it hurts the GTmetrix PageSpeed ratings.
It can be easily fixed though by replacing…
$ver = ( ! empty( $wp_scripts->registered[ $d ]->ver ) ) ? $wp_scripts->registered[ $d ]->ver : get_bloginfo( 'version' );
with…
$ver = ( ! empty( $wp_scripts->registered[ $d ]->ver ) ) ? $wp_scripts->registered[ $d ]->ver : null;
That is: null instead of get_bloginfo( ‘version’ )
Please also note, that the line to be fixed appears twice inside the plugin’s php file.
I haven’t tested the plugin extensively, but I’m quite happy I finally found one that works.
- The topic ‘Works as advertised’ is closed to new replies.