[WordPress] 外掛分享: Images to WebP

首頁外掛目錄 › Images to WebP
WordPress 外掛 Images to WebP 的封面圖片
9,000+
安裝啟用
★★★★
4.4/5 分(31 則評價)
2 天前
最後更新
問題解決
WordPress 5.0+ PHP 7.0+ v5.0 上架:2019-11-16

內容簡介

Images to WebP 外掛可將 PNG、JPG 和 GIF 圖片轉換為 WebP 格式,顯著減少頁面重量而不損失圖片品質,提升網站速度,節省訪客下載數據,並改善 Google 排名。

【主要功能】
• 自動轉換上傳的圖片為 WebP
• 批量轉換現有圖片至 WebP
• 設定轉換後圖片的品質
• 支援 Apache 和 NGiNX 環境
• 不改變原始圖片的 URL
• 與 `Fly Dynamic Image Resizer` 外掛相容

外掛標籤

開發者團隊

⬇ 下載最新版 (v5.0) 或搜尋安裝

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

原文外掛簡介

Statistics say that WebP format can save over a half of the page weight without losing images quality.
Convert PNG, JPG and GIF images to WebP and speed up your web, save visitors download data, make your Google ranking better.

automated test after plugin activation to make sure it will work on your server
works with all types of WordPress installations: domain, subdomain, subdirectory, multisite/network
works on Apache and NGiNX
image URL will be not changed so it works everywhere, in src, srcset, , even in CSS backgrounds and there is no problem with cache
original files will be not touched
set quality of converted images
auto convert on upload
only convert image if WebP filesize is lower than original image filesize
bulk convert existing images to WebP ( you can choose folders )
bulk convert only missing images
works with `Fly Dynamic Image Resizer` plugin

Hooks for developers
itw_sizes
Maybe you want to disable WebP for thumbnails
add_filter( 'itw_sizes', 'disable_itw_sizes', 10, 2 );
function disable_itw_sizes( $sizes, $attachmentId ){
unset( $sizes['thumbnail'] );
return $sizes;
}

itw_htaccess
Maybe you want to modify htaccess rules somehow
add_filter( 'itw_htaccess', 'modify_itw_htaccess', 10, 2 );
function modify_itw_htaccess( $rewrite_rules ){
// do some magic here
return $rewrite_rules;
}

itw_abspath
Maybe you use roots.io/bedrock or other custom folder structure
add_filter( 'itw_abspath', 'modify_itw_abspath', 10, 2 );
function modify_itw_abspath( $abspath ){
return trailingslashit( WP_CONTENT_DIR );
}

$images_to_webp->convert_image()
Maybe you want to automatically generate WebP for other plugins
add_action( 'XXPLUGIN_image_created', 'XX_images_to_webp', 10, 2 );
function XX_images_to_webp( $image_path ){
global $images_to_webp;
$images_to_webp->convert_image( $image_path );
}

延伸相關外掛

文章
Filter
Apply Filters
Mastodon