WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Adaptive Images for WordPress

Adaptive images plugin transparently resizes your images, per device screen size, in order to reduce download times in mobile environments.

Adaptive Images

Resizes and optimizes images delivered to mobile devices, in a transparent and unobtrusive way, so that the total download time is dramatically reduced. It works as a filter between the device and your WordPress website. It actually works for all types of device screen sizes, although it is targeted mostly at mobile environments.

Note that this is not a CSS responsive images solution. This plugin does not force browsers to render images as if they were smaller. It actually sends smaller images to them! Then it is the job of the CSS to instruct the browsers how to render them.

Fundamental goals

  1. Reduce the total download time in mobile devices dramatically.
  2. Work transparantly and unobtrusively by being independant of your theme code.
  3. Be agnostic of the yet-not-finalized picture element or HTML img srcset attribute.

Side benefits

  1. Respects search engines and sends them the orginal version of each image, because it depends on Javascript.
  2. If it does not recognise a device screen it falls over to the original image size. But even this is very rare and mostly refers to very old or possibly deprecated devices.
  3. Does not need to load the WordPress ennironment in order to resize and compress images.

Supported formats

  • JPEG
  • PNG
  • GIF (not animated)

CDN/Varnish/external caching service support

Since version 0.6.0 CDN/Varnish/external caching service support has been added as an option, in an experimental mode. This mode is experimental in the following ways: i) it is not thorougly tested yet ii) however, it works in almost all test cases so far iii) it bears no dangers to your isntallation iv) it adds a special url parameter to your image urls, so it is slightly obtrusive.

Tested with MaxCDN and Varnish up to now.

Default breakpoints

  • 1024px wide screens
  • 640px wide screens
  • 480px wide screens

Since version 0.5.0 and upwards it is configurable whether the plugin should take into account the landscape or the portrait orientation of each device.

HiDPI (high device pixel density or retina) screens are supported too.

How to test

  1. Test with Chrome's device emulation mode https://developer.chrome.com/devtools/docs/device-mode in Developer Tools. See here https://www.youtube.com/watch?v=hCAC1XUUOvw/ for an example. Unfortunately, Firefox's Responsive Design Mode does not actually emulate a mobile screen size!
  2. Test with a tool like Webpagetest http://www.webpagetest.org/. Make sure you set the "Emulate Mobile Browser" setting in the "Advanced Settings" > "Chrome" tab.
  3. Test with a tool like GTmetrix http://gtmetrix.com/. Make sure you enable mobile device testing. The plugin will have no effect on desktop sized devices.
  4. Test with an actual mobile device, a smartphone or tablet. Watch your website load in a snap.
  5. Check the /wp-contents/cache directory to see the /adaptive-images directory and its contents. This is where the resized images are kept and cached by default.

Also you can:

  1. View an image straight from a browser and add a "?debug=true" at the end of the url like this "http://www.website.com/wp-content/uploads/2015/01/image.jpg?debug=true". This should print useful debug information about the plugin functions in your installation. If you keep seeing your image, then the plugin is not working as it should and the cause is probably a failure to update the .htaccess file properly.
  2. Add a "?debug=original" at the end of the url of an image and you will see the orginal version of the image even when a smaller version of it should have been shown.
  3. Hit the "Print debug" and "Print diagnostics" buttons at the plugin settings page to see useful debug information about the plugin and your WordPress installation.

You could test with a normal desktop browser, but only if the computer screen size falls under at least of one of the specified breakpoints!

Incompatibilities and issues

  • Cannot work with installations where the /wp-content directory is not in its default position, which is inside the root directory of the WordPress installation, along with /wp-admin and /wp-includes.
  • The plugin supports Nginx, but it must be manually configured like this: location / { rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php; }
  • Windows IIS is not supported, but could be manually configured.

Stuff to keep in mind

  • The plugin needs to add a little bit of code to your .htaccess file in order to function properly. It removes this code once disabled. If you are not cool with that, then… tough luck!
  • The plugin does not care whether the device is actually mobile or not. It checks the device screen resolution. If you have set your breakpoints big enough then it should work just as good for desktop devices as well. However it targets mostly the mobile ones.
  • The resized versions of the pictures are kept in a special directory in the /wp-content/cache directory. This causes some storage overhead. It is up to you to judge whether this overhead is a sustainable option in your hosting environment.
  • The plugin does not help with (nor hinder) art direction. Simple as that. Art direction https://usecases.responsiveimages.org/#art-direction in responsive images is an entirely different, yet important, problem. This plugin does not tackle with it. But it works in a supplementary way without interfering with other solutions that do. This means that you can combine it with any art direction solution.

Credits

  • The plugin was originally based on the WP-Resolutions plugin https://github.com/JorgenHookham/WP-Resolutions/, but since version 0.3.0 it is a complete rewrite!
  • Both plugins - WP-Resolutions and this one - have borrowed ideas from the Adaptive Images http://adaptive-images.com/ solution specially adapted for WordPress.
  • Many-many thanks to "railgunner" for the initial idea in the forum and to the Pressidium team for helping with debugging the CDN/Varnish/external caching service feature.
  • Also, many thanks to my good friend and colleague Antonis Zachopoulos for the countless times that he provided ideas and debugging hints.

Thank you for using the plugin and, please, do let us know how it works (or doesn't work) for you. We love comments and creative feedback!

Requires: 4.0 or higher
Compatible up to: 4.7.3
Last Updated: 2 months ago
Active Installs: 6,000+

Ratings

4.8 out of 5 stars

Support

4 of 16 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1
100,1,1
100,2,2 75,4,3 100,1,1
100,1,1
50,2,1
100,1,1
100,2,2
100,2,2
50,2,1 100,2,2
100,1,1