Empirical Responsive Images helps WordPress sites discover the image widths they actually render on real devices. It records aggregate front-end observations, registers matching WordPress image sizes, regenerates missing thumbnails, generates responsive variants for local theme/plugin asset images, and can create WebP and AVIF sidecar files when the server image editor supports those formats.
Features:
add_image_size().<picture> with AVIF/WebP sources and original fallback markup.srcset output.The observer runs only for logged-in users who can manage site options. Requests require WordPress REST authentication and a valid REST nonce. It stores aggregate rendered image data and canonical page paths only; query strings and raw IP addresses are not persisted.
By default, settings, observations, and generated asset variants are retained when the plugin is uninstalled. Site administrators can explicitly enable deletion under Tools > Responsive Images before uninstalling.
Before a page is confirmed stable, the plugin sends WordPress and HTTP cache bypass signals:
DONOTCACHEPAGECache-Control: no-store, no-cache, must-revalidate, max-age=0CDN-Cache-Control: no-storeCloudflare-CDN-Cache-Control: no-storeSurrogate-Control: no-storeX-LiteSpeed-Cache-Control: no-cacheIt also disables LiteSpeed page optimization and lazy-loading constants during those warming requests so the measured image slots match the real rendered layout.
The observer script is marked with optimizer bypass attributes including data-cfasync="false", data-no-optimize="1", data-no-defer="1", data-no-minify="1", and data-pagespeed-no-defer="1". Its REST configuration is also duplicated into data-empirical-responsive-images-* attributes so it can still run when an optimizer delays inline scripts.
List observed sizes:
wp empirical-responsive-images sizes
Regenerate thumbnails and modern sidecars:
wp empirical-responsive-images regenerate --batch-size=10
Force rebuild:
wp empirical-responsive-images regenerate --force