WP-Optimize
95Get caching and more with this powerful cache plugin. Cache, optimize images, clean your database and minify f...
Merges/Concatenates CSS & Javascript and then minifies using Minify (for CSS) and Google Closure (for JS with Minify as a fallback).
Merge + Minify + Refresh is a WordPress plugin designed to improve website performance by merging and minifying CSS and JavaScript files. It processes these files using WP-Cron to avoid slowing down the site and automatically re-processes them when changes are detected, eliminating the need to clear cache manually.
This plugin is suitable for developers and site owners looking to optimize loading times and manage their site's scripts and styles efficiently. It offers features like HTTP2 Server Push support and the ability to specify cache directories, making it a flexible option for performance enhancement.
Best for: This plugin suits WordPress developers and site owners focused on enhancing site performance.
What it does well
Where it falls short
Merge + Minify + Refresh provides a straightforward solution for optimising CSS and JavaScript files, though users should be aware of potential compatibility issues.
launchinteractive's own description of Merge + Minify + Refresh, lightly tidied.
Development for this plugin is now done on GitHub. Pull requests are welcome.
This plugin merges/concatenates Cascading Style Sheets & Javascript files into groups. It then minifies the generated files using Minify (for CSS) and Google Closure (for JS – fallback to Minify when not available). Minification is done via WP-Cron so that it doesn’t slow down the website. When JS or CSS changes files are re-processed. No need to empty cache!
Inspired by MinQueue and Dependency Minification plugins.
Minification by Minify and Google Closure
In order to ensure fast loading times it’s recommended to set long expiry dates for CSS and JS as well as make sure gzip or deflate is on.
Version 1.10 added should_mmr filter which allows developers to disable MMR when needed. You could use this to disable MMR for certain WordPress roles or with some Page Builders. Three new plugins have been created that utilise this:
Merge + Minify + Refresh Check DIVI, Merge + Minify + Refresh Check Visual Composer and Merge + Minify + Refresh Check Beaver Builder. Please install these when required.
Version 1.6 added support for HTTP2 Server Push to further speed up your requests (thanks to Daniel Aleksandersen).
Version 1.6.9 added the ability to specify the cache directory. Set MMR_CACHE_DIR & MMR_CACHE_URL constants in wp-config.php. MMR_CACHE_DIR must be full server path and MMR_CACHE_URL must be absolute URL for this to work correctly (thanks to Daniel Aleksandersen).
Version 1.6.11 added the ability to specify seperate cache urls for javascript and CSS. Use MMR_JS_CACHE_URL & MMR_CSS_CACHE_URL to replace MMR_CACHE_URL.
Version 1.7.0 added the ability to generate .css.gz & .js.gz files. Your webserver may need to be configured to use these files. Here is how to use these files in Apache (mod_rewrite, mod_deflate and mod_headers need to be enabled):
<IfModule mod_rewrite.c>
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
#Serve gzip compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
#Serve gzip compressed JS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
#Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=is_gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=is_gzip:1]
Header set Content-Encoding "gzip" env=is_gzip
</IfModule>
</IfModule>
</IfModule>
Version 1.8.8 added a “merge_minify_refresh_done” hook that fires when JS or CSS has changed.
Version 1.11 added two new constants:
MMR_USE_CLOSURE – allows Google Closure Javascript minification to be disabled.
MMR_REMOVE_EXPIRED – disables removing expired files.
Version 1.13 added two new filters which can be used to exclude specific files:
mmr_ignored_css_sources
mmr_ingnored_js_sources
Version 1.13 also automatically moves the WordPress inline styles to a global stylesheet which it then enqueues.
Version 1.14.3 added two new filters which can be used to modify the output before it gets saved:
modify_css_output_before_save
modify_js_output_before_save
Note Installing this plugin on a server with the eAccellerator module installed has the potential to break as Minify uses anonymous functions which return NULL. View eAccellerator Issue Thread
Other plugins for making sites fast.
Get caching and more with this powerful cache plugin. Cache, optimize images, clean your database and minify f...
All-in-one unbeatable acceleration & PageSpeed improvement: caching, image/CSS/JS optimization...
Comprehensive image optimization with WebP, AVIF, Lazy Load, and more. Optimize images automatically for Faste...
Easy to use Under Construction Page & Coming Soon Page. Enable Under Construction Mode in seconds & sh...
Compress and optimize images, enable lazy load, serve WebP & AVIF, and speed up your site with a global im...
Speed up your website by using our WebP & AVIF Converter. Optimize images and serve WebP and AVIF images i...