[WordPress] 外掛分享: Lazy Loading Feature Plugin

首頁外掛目錄 › Lazy Loading Feature Plugin
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
400+
安裝啟用
★★★★
4/5 分(6 則評價)
2188 天前
最後更新
問題解決
WordPress 5.3+ PHP 5.6.20+ v1.1 上架:2020-01-28

內容簡介

「懶加載功能外掛」是由 WordPress 團隊維護的官方外掛,旨在測試自動將 loading HTML 屬性新增至支援其的圖片和其他元素。

有關 loading 屬性的更多資訊:
說明: https://developer.mozilla.org/zh-TW/docs/Web/HTML/Element/img#attr-loading.
HTML 規格: https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-loading。

目前支援 loading 屬性的瀏覽器有:https://caniuse.com/#feat=loading-lazy-attr。

安裝並啟用外掛以進行測試。它將自動在所有新的和現有的文章、頁面和文字小工具的前端圖片中添加 loading="lazy" 屬性。

然後使用其中一個支援它的瀏覽器(如 Chrome、Opera、Firefox、Edge、Android 等)訪問網站。最好使用較慢的連接(如手機)進行測試,以及測試包含大量圖片的網頁(例如畫廊文章)。

測試事項

明顯的錯誤,例如遺失圖片。
在頁面加載後嘗試向下滾動。所有圖片應該在它們的位置上,並且頁面不應該在圖片加載時「跳動」。

開發人員注意事項

此外掛旨在進行測試。如果測試成功,這個功能將會被新增至 WordPress,但是程式碼可能會有所更改,甚至重大更改。

在進行測試時,請測試此外掛新增的篩選器,並在 https://github.com/WordPress/wp-lazy-loading 或 https://core.trac.wordpress.org/ticket/44427 上提供反饋。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Lazy Loading Feature Plugin」→ 直接安裝(推薦)

原文外掛簡介

Lazy Loading Feature Plugin is an official plugin maintained by the WordPress team. It is intended for testing of automatically adding the loading HTML attribute to images and other elements that support it.
More information about the loading attribute:
Description: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading.
HTML Specification: https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-loading.
Currently the loading attribute is supported in the following browsers: https://caniuse.com/#feat=loading-lazy-attr.
To test, install and enable the plugin. It will automatically add loading="lazy" attributes to all images in all new and existing posts, pages, and text widgets on the front-end.
Then use one of the browsers that support it (Chrome, Opera, Firefox, Edge, Android, etc.) and visit the site. Best would be to test over a slower connection, with a phone, etc. and test web pages that have a lot of images, like gallery posts.
Things to look for

Obvious bugs, for example images are missing.
Try to scroll down as soon as the page loads. All images should be at their places, and the page shouldn’t “jump” when images are loaded.

Note to developers
This plugin is intended for testing. If the tests are successful, this functionality will be added to WordPress, but the exact code may change, perhaps significantly.
When testing, please also test the filters added by this plugin, and provide feedback at https://github.com/WordPress/wp-lazy-loading or at https://core.trac.wordpress.org/ticket/44427.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon