For OpenCart 2.3, 3.0, 4.0 and 4.1
What it does
- WebP copies for browsers whose request says they accept WebP; optional AVIF copies first for browsers that accept AVIF (needs PHP 8.1 or later with AVIF in the image library). Other browsers keep getting the original picture.
- Works on every picture of the home, category, product, search, brand, special, cart and compare pages, including the resized pictures the shop makes and your own banners and logo.
- A copy is only used when it is smaller than the original. Quality of the copies is yours to set (40 to 95, 80 by default). A changed original gets a new copy.
- Copies are made while pages are viewed, at most 12 new ones per page view, so the first visit of a big page stays quick. "Convert all pictures now" in the admin makes the rest in steps of 20.
- Lazy loading: loading="lazy" and async decoding on the pictures of those pages, except the first few at the top (2 by default, up to 10) which should show at once. A picture that already says how to load is not touched.
- Your own pictures are never changed or deleted. Copies live in image/cache/webp and are removed with the module; "Delete the copies" does it at any time.
In the admin
- Numbers: how many WebP and AVIF copies exist and their size.
- A report of the 15 heaviest pictures of the shop with size and dimensions, the number of pictures over 300 KB, and the total.
- Tells you when the server cannot write WebP.
Safe
Not included: making pictures at other sizes (srcset), resizing on the fly, a Core Web Vitals measurement (the report shows picture weight, not visitor timing), GIF and SVG.
- Only JPG and PNG files inside the shop's own image folder are converted; paths with .. or other file types are ignored; very large files and broken pictures are skipped; no copy is left half written.
- Turning the module off puts the pages back as the shop made them.