[WordPress] 外掛分享: Inline Image Base64 – inline specific images into the HTML

首頁外掛目錄 › Inline Image Base64 – inline specific images into the HTML
WordPress 外掛 Inline Image Base64 – inline specific images into the HTML 的封面圖片
90+
安裝啟用
★★★★★
5/5 分(1 則評價)
98 天前
最後更新
問題解決
WordPress 4.6+ PHP 5.6+ v0.0.4 上架:2021-04-18

內容簡介

使用 Inline Image Base64 外掛,您可以將特定圖片以 base64 直接嵌入到 HTML 內。

您還可以使用它來禁用特定圖片的懶加載功能。

啟用後,當您在媒體庫中打開附件時,您將看到兩個核取方塊。一個是為了將圖像嵌入 HTML,另一個則是用於禁用本機懶加載。

將第一個出現在視口中的圖像嵌入 HTML 中,可以顯著提高渲染性能。

對於輕量級圖像,效益會更高,例如輕量級商標等。

如果對太大的圖像進行嵌入,HTML 的大小可能會變得太大。

將圖像嵌入 HTML 中對於不超過 20-30 kB 的圖像非常有用。但這取決於您已有的 HTML 大小。

建議使用 Google PageSpeed Insights 進行一些速度測試,以檢查效益。

上傳已具有正確尺寸的圖像。

為了達到最小的內容佈局移位,最好使用自定義 CSS 為圖像指定寬度和高度。

無論如何,建議禁用第一次渲染期間出現在視口中的所有圖像的本機懶加載。

禁用這些圖像的懶加載只能帶來好處。

您將在媒體庫中的每個附件中找到設置,而非這個外掛專屬的設置頁面。

如何將圖像嵌入 HTML

安裝並啟用 Inline Image Base64
前往媒體庫,打開要嵌入 HTML 的圖像
勾選「嵌入圖像」核取方塊

如何禁用特定圖像的本機懶加載

安裝並啟用 Inline Image Base64
前往媒體庫,打開要不加載懶加載的圖像
取消勾選「本機懶加載」核取方塊

建議事項

始終禁用第一次渲染期間出現在頁面視口中的圖像的懶加載
只嵌入在頁面初始加載期間出現在視口中的圖像,前提是它們沒有太大。最多不超過 20-30 kB,但這取決於 HTML 的大小。
在將圖像嵌入後,建議使用 Google PageSpeed Insights 進行測試,以評估可能導致太大 HTML 的效益和缺點。

幫助

如有任何問題,請勿猶豫在支援論壇開啟討論串。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Inline Image Base64 – inline specific images into the HTML」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

With Inline Image Base64 you can inline specific images directly into the HTML as base64.
You can also use it to disable the native lazy loading for specific images.
After successful activation, you will see two checkboxes when you open an attachment in the media library. One for inlining the image and another one to disable the native lazy loading.
Inlining the first image that appears in the viewport can drastically improve the rendering performance.
The benefits will be higher for light images. A typical example is a light logo.
If you do it for too big images the size of the HTML may become too big.
Inlining images is very useful for images that are not more than 20-30 kB. But it depends on the size of the HTML that you already have.
We suggest perform some speed tests with Google PageSpeed Insights to check the benefits.
Upload an image that already has the right dimensions.
To have a minimum Content Layout Shift, better you assign the width and hight to the image with custom CSS.
In any case, we suggest disabling the native lazy loading for all the images that appear on the viewport during the first rendering.
Disabling the lazy loading for those images can only give benefits.
You will find the settings on every single attachment in the media library, no dedicated settings page for this plugin.
Backend Speed Optimization
Is your dashboard slow? We optimize admin performance by improving queries and reducing plugin load.
Read Backend Speed Optimization Service for more information.
How to inline an image into the HTML

Install and activate Inline Image base64
Go to the media library and open the image that you want to inline into the HTML
Check the checkbox “Inline Image”

How to disable the native lazy loading of a specific image

Install and activate Inline Image base64
Go to the media library and open the image that you want to load without lazy loading
Unheck the checkbox “Native Lazy Loading”

Suggestions

Always disable the lazy loading for the images that appear in the viewport during the page loading
Inline only the images that appears in the viewport during the page loading, only if they aren’t too big. Until 20-30 kB should be ok, but it depends on the size of the HTML.
Perform some tests with Google PageSpeed Insights before and after inlining an image. So you can evaluate the benefits and drawbacks that could be caused by a too large HTML

Help
For any kind of issue, don’t hesitate to open a thread on the Support Forum

文章
Filter
Apply Filters
Mastodon