[WordPress] 外掛分享: CSS Optimizer – Remove Unused CSS

首頁外掛目錄 › CSS Optimizer – Remove Unused CSS
100+
安裝啟用
★★★☆☆
3.7/5 分(6 則評價)
1464 天前
最後更新
問題解決
WordPress 4.7+ PHP 5.1+ v1.7 上架:2021-11-03

內容簡介

「移除未使用的 CSS」通常會被 Google 的 PageSpeed Insights 指出。事實上,在大多數情況下,一個網頁的 70% - 80% CSS 代碼是多餘的,可以移除而不影響整體外觀。這主要是因為 WordPress 的主題和外掛是作為通用解決方案創建的,包括了大量可能在特定頁面上使用或可能不使用的功能。

例如:一個主題可能帶有許多功能,如幻燈片、輪播、動畫等等,但你的首頁可能只使用了幻燈片功能,你的關於頁面可能只使用了輪播功能。然而,基於實際考量,要只選擇性地包含在特定頁面上啟用的功能所需的 CSS 規則幾乎是不可能的。

這就是 CSS Optimizer 變得有用的地方。該外掛會調用 ZippiSite 的 CSS Optimizer API,查找特定頁面上需要的 CSS 規則並刪除不必要的規則。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「CSS Optimizer – Remove Unused CSS」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

“Remove Unused CSS” is frequently flagged in Google’s PageSpeed Insights. Indeed, most scenario, around 70% – 80% of a page’s CSS codes are redundant, and can be removed without affecting the overall visual. This happens mainly because WordPress themes and plugins are created as generic solutions that includes a bunch of features that may or may not be used on a particular page.
Example: A theme may come with a bunch of features such as slider, carousel, animation and etc, but your home page may use only the slider feature and your about page may use only the carousel feature. However, for practical reason, it’s virtually impossible to selectively include only the required CSS rules for the features that were enabled on a particular page.
This is where the CSS Optimizer becomes useful. The plugin make calls to ZippiSite‘s CSS Optimizer API to find the required CSS rules on a particular page, and remove the ones that are not needed.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon