Dependency Minification
This plugin takes all scripts and stylesheets that have been added via wp_enqueue_script and wp_enqueue_style and automatically concatenates and minifies them into logical groups. For example, scripts in the footer get grouped together and styles with the same media (e.g. print) get minified together. Minification is done via WP-Cron in order to prevent race conditions and to ensure that the minification process does not slow down page responses. This is a reincarnation and rewrite of the Optimize Scripts plugin, which this plugin now supersedes. Features: Minified sources are stored in the WP Options table so no special filesystem access is required. Endpoint for minified requests is at /_minified, which can be configured. Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data. Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter. Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-case basis via the filter previously mentioned. By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter. The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option. If a minified source is not available yet, the page source will note that the dependency minification process is pending. Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled; such errors are enabled by default if WP_DEBUG. If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting to minify in perpetuity. Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option). Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script. WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. Stale minified scripts and stylesheets remain until replaced by refreshed ones; this ensures that full-page caches which reference stale minified sources won’t result in any 404s. Can serve compressed responses with gzip or deflate. Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404. Development of this plugin is done on GitHub. Pull requests welcome. Please see issues reported there before going to the plugin forum. If you are using Nginx with the default Varying Vagrant Vagrants config, you’ll want to remove css|js from this rule in nginx-wp-common.conf (or remove the rule altogether): # Handle all static assets by serving the file directly. Add directives # to send expires headers and turn off 404 error logging. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 24h; log_not_found off; }
Image Optimizer, Resizer and CDN – Sirv
Accelerate your website and improve SEO with Sirv – the most complete image CDN and media optimization plugin for WordPress & WooCommerce. Automatically resize, compress and serve videos & images in next-gen formats, from Sirv’s fast CDN in 25 major cities. Why is Sirv the best choice for WordPress image optimization? Automatic optimization Automatic scaled images Automatic next-gen formats (AVIF & WebP) Smaller files than any other WP optimization plugin Incredibly fast CDN Perfect on WooCommerce Lazy loading The best WordPress image optimizer – you don’t need to lift a finger. Just install the plugin and Sirv will automatically serve perfectly scaled and optimized images possible file-size. Every option is easily configured, if you wish to change the defaults. Optimize your WordPress Media Library Automatically optimize your existing WordPress media library images, without lifting a finger. Sirv can automatically copy your media library to Sirv, from where images will be served as highly optimized images across Sirv’s fast, global WordPress CDN (19 worldwide locations). All these images (and more) can be automatically optimized by Sirv: Media gallery images Featured images WooCommerce product & category images Images added via other plugins or scripts Images added via “Add Media” button CSS background images Simply enable the Sirv CDN and images will sync to your Sirv account automatically. See the complete list of features of Sirv’s fresh new take on media hosting and optimization. Take your WooCommerce sales to another level Optimization & CDN delivery of all your product images Ultra-deep image zoom, 3D GLB models and 360-spin for your media viewer Add image watermarks Add text captions Serves your files wherever you need them – websites, apps, feeds, social media, email campaigns Image zoom Sirv loves huge images – it can zoom deep inside them very fast. No matter how big, images load fast, just like zooming on a Google Map. The bigger your images, the more impressive this image zoom is – perfect if you have really high quality images. Video streaming Any video you upload to Sirv will be converted to different resolution video streams, for instant playback. Every user will receive the most optimal stream for their device, screen and network connection speed. 3D models (GLB and USDZ) Upload your 3D models to Sirv and embed them in your web pages and product galleries. It’s easy and automated with Sirv Media Viewer. No coding needed. It also provides Augmented Reality (AR) automatically. 360 spin Shoppers adore spinning products around to see them from all sides. If you’re selling something online, maybe with WooCommerce, Sirv provides a stunning 360-degree photography experience. Simply upload a set of photos and a 360 spin will be immediately ready to embed in your page. It feels incredible on desktop and mobile alike, especially the big full-screen 360 spin view. Try demos. Free and paid plans are available, depending on your needs. See “Price Plans” below. What our users say ★★★★★ “We’ve halved the load time on mobiles of a site that we had already done quite a bit of work on to get image sizes down.” @martingfisher ★★★★★ “So far the best CDN plugin for WordPress. Please, never disappear!” @mavenickster ★★★★★ “I was looking for a CDN fast and easy (no need to code)! Sirv is the best – Just upload your photos to your WordPress library and voilà “roulez jeunesse!!!” (French expression). Very good service!” @disconance ★★★★★ “Sirv is fantastic! I have a lot of images on my website, and most of them are large, which resulted in slow site speeds, even with a CDN. What I love about Sirv is that they offer a CDN service, but also dynamically resize images based on the user’s browser/device, and serve the right file type. It has meant HUGE speed improvements on my website.” @basellen Optimal format (every time) Google loves next-gen image formats for SEO, but it’s a pain to convert all your images and keep track of them. Sirv solves that. It automatically delivers images to each user in the most optimal format. Usually that’ll be AVIF or WebP and the filesize is dramatically smaller, so Google will reward you with better search ranking. Sirv’s intelligence always serves the smallest possible file format to each users’ browser. It is 100% automatic. Plus, images are automatically scaled down to the suitable width/height and they’re lazy loaded, so you’ll really have the best possible image solution for WordPress. Price plans Sirv is a professional image hosting and WordPress CDN service. Most websites require a paid plan. Sirv also provides a free plan for light usage (500 MB storage and 2 GB monthly transfer). Free 0.5 GB storage, $0/month Business 5 GB storage, $19/month Business 12 GB storage, $39/month Business 20 GB storage, $59/month Business 40 GB storage, $89/month Business 60 GB storage, $119/month Business 100 GB storage, $199/month Enterprise: tailored to your needs – Contact us. Create a Sirv account. We believe in fair and transparent pricing: Upgrade/downgrade any time. Start/stop any time. Complete and easy access to your images. No credit card required for the Free plan. Further reading Keep learning with these helpful resources: Sirv for WordPress documentation. Sirv for WooCommerce documentation. The official Sirv Help Center & Documentation. Serve images from your own domain name. Next steps… Create your Sirv account Login to your Sirv account