MG Image Optimizer: Free WordPress Image Plugin

MG Image Optimizer is a free WordPress plugin made by Mobile Geeks, the Lahore phone accessories store that runs this website. It compresses images on your own server, makes WebP and AVIF copies, and serves them with <picture> tags. No account, no API key and no monthly image limit. We built it because our own product photos kept failing Google’s PageSpeed test. It now optimises the images on mobilegeeks.pk.

Free · Licence: GPLv2 or later · Needs WordPress 6.5+, PHP 8.0+ and Imagick or GD · Install: Plugins → Add New → Upload Plugin

What it does

  • Passes Lighthouse “Improve image delivery”. Each WebP and AVIF copy is checked against a bytes-per-pixel budget, and its quality is lowered step by step until it fits (never below a safe floor).
  • Serves the right size to phones. It measures how wide each image is really shown on visitors’ screens and writes that into sizes="", so phones stop downloading files bigger than the box.
  • Compresses JPEG and PNG and makes WebP and AVIF copies of the original and every thumbnail size.
  • Works with page caches and Cloudflare. <picture> delivery needs no server rewrite rules, and only the pages that show a changed image are cleared from the cache.
  • WooCommerce aware. Gallery and variation photos switch to WebP in place, so changing a colour still changes the photo.
  • Safe to try. Backups and one-click restore for every image. New uploads are optimised in the background, and a bulk run has progress, stop and resume.
  • Works alongside Imagify. It reuses Imagify’s WebP files and never compresses an already-compressed photo twice.

Why images fail “Improve image delivery”

PageSpeed flags an image when its file uses more than about 0.167 bytes per pixel and the saving would be over 4 KB, and that includes WebP and AVIF files. MG Image Optimizer keeps every copy under 0.14 bytes per pixel, so it stays on the safe side. To check a single image yourself, use our free Lighthouse image check, which also explains the rules in detail.

Test results

Tested on 6 December 2026 on WordPress 7.1.5 and PHP 8.3, with GD:

ImageBeforeAfter
1200 × 800 JPEG (original)738 KB230 KB JPEG, 135 KB WebP
768 × 512 thumbnailn/a117 KB JPEG, 60 KB WebP
960 × 640 test photo329 KB JPEG85 KB WebP (−74%)

Restore brought the 738 KB original back byte for byte. The plugin also passes WordPress’s official Plugin Check with no errors. Results on your images depend on the photos and on whether your server supports AVIF.

Install

  1. Download the ZIP above, then in WordPress go to Plugins → Add New → Upload Plugin and choose the file.
  2. Activate it, then open Media → MG Image Optimizer → Tools → Run self-test.
  3. On the Dashboard tab, press “Optimize all remaining images”.
  4. Clear your page cache. WP Rocket is cleared automatically when the bulk run finishes.

Add ?mgio=off to any page address to see it without WebP and AVIF, for a quick before-and-after.

Privacy

The plugin sends nothing to us or to any outside service. The width measuring is on by default: about 30% of page views load a small script that sends your own site the page type, the screen width and the width each image is shown at. No cookies, no IP addresses and nothing that identifies a visitor. You can switch it off in the plugin’s Settings.

Frequently asked questions

Is it really free?

Yes. There is no paid version, no image limit and no account. All the work happens on your own server.

Will it slow down my server?

Images are processed in the background in small batches, not while visitors load pages. A bulk run over a large library takes a while on shared hosting, and you can stop and resume it.

What happens if I deactivate it?

Compressed images stay compressed. WebP and AVIF files stay on disk but are no longer served. Backups stay in uploads/mgio-backups, so you can still restore them.

Does it work with Cloudflare and WP Rocket?

Yes. That is the setup it was built on. Keep “Apache rewrite rules” off: the <picture> tags work with any cache because every visitor gets the same HTML.

Why does my server not make AVIF files?

AVIF needs a recent Imagick or GD build with AVIF support. The self-test tells you what your server can make. Without AVIF the plugin still serves WebP.

Where do I report a problem?

Send us a message through our contact page with your WordPress and PHP versions and what you see. We read every message, but we are a phone accessories store, so replies can take a few days.

Easy 7 days returns

7 days money back guarantee

Brand Warranty

Local Brand 1 year Warranty, Offical Partner

100% Secure Checkout

Bank Transfer, Easy Paisa, Jazz Cash