[WordPress] 外掛分享: Empirical Responsive Images

首頁外掛目錄 › Empirical Responsive Images
WordPress 外掛 Empirical Responsive Images 的封面圖片
全新外掛
安裝啟用
尚無評分
2 天前
最後更新
問題解決
WordPress 6.9+ PHP 7.4+ v0.2.0 上架:2026-07-27

內容簡介

Empirical Responsive Images 外掛幫助 WordPress 網站發現實際在真實設備上渲染的圖片寬度,並記錄前端觀察數據,生成響應式圖片變體,提升網站的圖片載入效率與性能。

【主要功能】
• 測量圖片的寬度、高度及其他屬性
• 註冊匹配的 WordPress 圖片尺寸
• 批次重新生成圖片縮圖和變體
• 支援生成 WebP 和 AVIF 格式的側邊檔
• 觀察數據僅對已登入的管理者可見
• 兼容多種快取設定,確保頁面穩定性

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.2.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Empirical Responsive Images」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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:

Administrator-only front-end observer measures rendered image width, height, viewport width, DPR, attachment ID, and local asset source URL.
Observations are stored as aggregate size data in WordPress options.
Observed width candidates are registered through add_image_size().
Admin batch tool regenerates image thumbnails and observed local asset variants.
Optional WP-CLI regeneration command.
WebP and AVIF sidecars are generated when supported by the active image editor.
WordPress attachment images and local asset images can be wrapped in with AVIF/WebP sources and original fallback markup.
Pages are kept out of page cache until a no-cache observation run confirms that known image sizes are already represented in srcset output.
No external service calls.

Privacy
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.
Cache compatibility
Before a page is confirmed stable, the plugin sends WordPress and HTTP cache bypass signals:

DONOTCACHEPAGE
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
CDN-Cache-Control: no-store
Cloudflare-CDN-Cache-Control: no-store
Surrogate-Control: no-store
X-LiteSpeed-Cache-Control: no-cache

It 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.
WP-CLI
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

延伸相關外掛

文章
Filter
Apply Filters
Mastodon