This plugin makes ALL scripts loaded by other plugins to be loaded in asynchronous way just like Google PageSpeed Insights recommends.
All CSS files will be inserted inline into the document code or moved from the document beginning to the end, just before closing BODY tag (or just where you placed wp_foot() function). There are various methods to do that – they are all in plugin’s configuration page.
Plugin makes all scripts to be loaded asynchronously using wp_enqueue_script and also can detect scrips included inside of wp_head and wp_footer hooks.
All CSS files loaded using wp_enqueue_style can be loaded just before closing BODY tag by four methods:
* Internet Explorer 7 - Some scripts could be loaded impropertly (trying to fix it) * Plugin - WP JetPack - Share - everithing works but "More" dropdown menú * Plugin - Google Analyticator<h3>Special thanks</h3> * NicMic<h3>TODO</h3> * Inline JS * Minify JS * Cache
Like any other plugin
1. Upload `asyncJSandCSS` folder to the `/wp-content/plugins/` directory 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Configure the plugin if needed (Settings/Async Settings)
Plugin can affect only those files loaded using worpdress’s queue (using wp_enqueue_script and wp_enqueue_style), so if you include your CSS file inserting into head.php of your theme – it WILL NOT be affected and will be loaded in standart render-blocking way.
- What can I do with a “Leverage browser caching” warning in Google’s PageSpeed Insights ?
You just need to include cache configuration in your .htaccess file. For example:
- Errors with jQuery
Add this line to exceptions box:
or if you are using jQuery from Google Hosted Libraries, you need to put:
- Colorbox is not working
Add this line to exceptions box:
Does the job and helps to do more tweaks.
Giving it 1 star because it breaks the site, especially the Revslider. Don’t risk.
you will get a high pagespeed score but some parts of the site brakes and also my site has lower request but loads longer as without plugin. For a small simple site you may use it but for a complex one no chance to use it.
Massive 30% reduction is google page insights across the board. DO NOT RECOMMEND AT ALL! Doesn’t break site however doesn’t function as described!
This was the only plugin that made the magic happen. Tested dozens of plugin and this is the only one I solved my problem with PageSpeed.
Contributors & Developers
“Async JS and CSS” is open source software. The following people have contributed to this plugin.
Removed foreach PHP warnings
Minify CSS method is more reliable with multiline commments.
Minify CSS compression bettered.
Added localization support
Added Spanish language
Added Russian language
Default CSS loading method is changed to “Inline in HEAD”
Better dependencies list build.
Changed hooks min priority to make them always non-negative.
Removed unsetting of dependencies of excluded scripts.
Fixed some path issues in CSS url(…)
Fixed some warnings
Support for dependensy only enqueued scripts with no src specyfied.
Fixed WordPress dependency jquery-core for jquery-migrate.
Added support to CSS inlined resourses like url(data:application/font….)
Added support for CSS media conditions and queries.
Converting JS files relative URLs to absolute form.
Fix: CSS minify function
Fix: Incorrectly detected wordpress installation URL for CSS inlineing
Option to include inline CSS in HEAD tag
Fixed .css files exclusion option
Option to remove an ?ver=XXX part from scripts and css files URLs
Option to exclude some files and to load them in default render-blocking way.
Added Settings page
Possibility to load CSS in inline mode and to minify it
Some other improvements
Better regular expression used to get scripts loaded in wp_foot.
Added detection of scripts added through wp_head hook
Incompatibility with jQuery lightbox solved.
Some workaround about compatibility with jQuery Colorbox and JetPack