[WordPress] 外掛分享: Just Responsive Images

WordPress 外掛 Just Responsive Images 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Just Responsive Images」是 2017-03-05 上架。
  • 目前有 600 個安裝啟用數。
  • 上一次更新是 2021-09-06,距離現在已有 1336 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.5 以上版本才可以安裝。
  • 有 7 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

aprokopenko |

外掛標籤

retina image | retina support | retina post thumbnail | responsive post thumbnail | post thumbnail as background |

內容簡介

Just Responsive Images 外掛會讓你掌握響應式影像屬性的控制權,WordPress 4.4+ 預設會將它們插入到所有文章縮圖中。

預設解決方案是將所有可用的圖像大小作為 srcset 屬性插入到 img 標籤中。這不是最佳解,因為瀏覽器獲得的圖像分辨率過多,它可能會產生更多對伺服器的請求(以獲取正確的圖像),並且顯示圖像本身需要的時間更長。更不用說,Google Page Speed 检查器對這種方法並不滿意。

如果為你的佈景主題編寫了手機友好的 HTML/CSS,通常它具有背景圖像和標籤的媒体查詢,而不是標籤。經常將許多圖像用作塊背景,這些圖像應該可以從CMS中編輯。這些最佳實踐在WordPress核心中不會被預設支持,你最終會浪費時間重新編寫標準函數。

這就是為什麼我們出現了!我們想要提供易於使用的控制功能,以自定義每個圖像尺寸維度的 srcset 屬性。此外,我們樂意為您提供一些幫助程序,這些幫助程序將生成標籤並生成背景所需的媒体查詢。

完整的文件和配置選項可在我們的 GitHub 頁面上找到:
https://github.com/justcoded/just-responsive-images。

如有建議或錯誤,請隨時在 GitHub 的 Issues 部分發帖。

按需生成圖像大小

此外掛不會使用 WordPress 的 add_image_size 函数註冊圖像大小,因此他們不會在管理面板上優化上傳大小。這是因為在大型網站上存在太多圖像大小(尤其是啟用 retina 選項時),WordPress 會浪費磁盤空間和資料庫使用無效的檔案。

當您使用具有 rwd 函數印刷的圖像打開頁面時,我們的插件僅在重新調整 WordPress 內置函數之後執行調整大小。因此,調整大小後,WordPress 將有有關可用於圖像的新大小的信息。不幸的是,這會影響當您第一次加載帶有圖像的頁面時的網站速度。任何好的文案/管理員在發布之前都會檢查他的內容,因此大多數情況下,管理用戶會看到此延遲。

重要

在版本1.2中,預設的 RWD 設置背景選項已更新為mobile-first策略(從desktop-first策略)。
如果您使用RWD設置的嵌套規則,則應該更新您的主要大小背景選項,以擁有包含min-width規則的媒體查詢。

DEV 模式

在 DEV 模式下,該外掛不會調整任何圖像,僅使用占位圖像。這可以在您開發和配置我們的外掛以符合所有所需屏幕尺寸時減少磁盤空間使用。

要啟用它,您需要在 wp-config.php 文件中定義新的常量:

define( 'JRI_DUMMY_IMAGE', true );

原文外掛簡介

The Just Responsive Images plugin gives you control of responsive image properties, which WordPress 4.4+ inserts to all post thumbnails by default.
The default solution is to insert all available image sizes as srcset attribute into img tag. This is not optimal, because the browser gets too much image resolutions, it can generate more requests to the server (to get the right image) and it takes longer to display the image itself. Not to mention, Google Page Speed inspector is not satisfied with such a method.
If you have hand-coded a mobile-friendly HTML/CSS for your theme it usually has media queries for background images and tags instead of tags. A lot of images are used as block backgrounds very often, which should be editable from CMS. All these best practices are not supported in the WordPress core by default and you end up wasting your time re-writing standard functions.
That’s why we’re here! We want to provide easy-to-use control for customizing srcset for each image size dimension you use inside your theme. Also we’re happy to provide you with a few helpers which will generate tags and generate required media queries for backgrounds.
Full documentation and configuration options are available on our github page:
https://github.com/justcoded/just-responsive-images.
Feel free to post your suggestions or bugs under Issues section on github.
Generating image sizes on request
This plugin DOES NOT register image sizes with WordPress add_image_size function. So they are not resized on upload in admin panel. This is done because on big sites there are too much image sizes (especially with enabled retina option) and in this case WordPress wastes the disk space and database with useless files.
Our plugin resize images ONLY when you open the page with an image, printed with rwd functions. Resize is performed through WordPress built in functions, so once resized – WordPress will have information about new sizes available for your image. Unfortunately it’s impact the site speed, when you load the page with images by a first time. Any good copywriter/administrator checks his content before publishing, so this delay will be seen by admin users in most cases.
IMPORTANT
In version 1.2 default RWD set background options updated to mobile-first strategy (from desktop-first).
If you use nested rules from RWD set you should update your main size background option to have @media query with min-width rule.
DEV Mode
In DEV mode plugin does not resize any images and simply use placeholder images. This can be used to reduce disk space, while you develop and configure our plugin to match all required screen sizes.
To enable it you need to define new constant in your wp-config.php file:
define( 'JRI_DUMMY_IMAGE', true );

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Just Responsive Images」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.0.3 | 1.0.4 | 1.0.5 | 1.0.6 | 1.0.7 | 1.0.8 | 1.1.1 | 1.1.2 | 1.1.3 | 1.1.4 | 1.2.1 | 1.4.1 | 1.5.1 | 1.6.1 | 1.6.2 | 1.6.3 | 1.6.4 | 1.6.5 | 1.6.6 | 1.6.7 |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon