[WordPress] 外掛分享: Nik Images Auto Convert

首頁外掛目錄 › Nik Images Auto Convert
全新外掛
安裝啟用
尚無評分
2 天前
最後更新
問題解決
WordPress 6.0+ PHP 7.4+ v1.0.1 上架:2026-07-26

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Nik Images Auto Convert」→ 直接安裝(推薦)

原文外掛簡介

Nik Images Auto Convert does two things.
New uploads are converted the moment they arrive, before WordPress generates the thumbnails, so every registered size is created directly in the new format. Nothing is converted twice.
Images already on the site are converted in bulk. This is the part most plugins get wrong: renaming photo.jpg to photo.webp breaks every page that referenced the old name. This plugin rewrites those references — in post content, custom fields, widgets, theme options and page builder data — so published pages keep displaying the same images.
What it converts

JPEG, PNG and GIF, to WebP, AVIF, or the same format (compress only)
The full size image, every thumbnail size, and the untouched original WordPress keeps for large uploads
Animated GIFs are always skipped — converting them would keep only the first frame

How existing content is kept working

Every URL variant is handled: absolute, protocol relative, root relative, percent encoded, and the escaped-slash form page builders store in JSON
Serialized data is unserialized, rewritten and re-serialized so string lengths stay valid. Values that cannot be rebuilt with certainty are left untouched rather than risking corruption
Original files are copied to wp-content/uploads/nik-iac-originals/, so any conversion can be undone
An optional .htaccess rule — written inside the uploads folder, never in the site root — serves the converted file when something still requests the old URL; useful for hard coded theme paths, external links and search engine caches

Uploading WebP and AVIF files
WordPress permits both formats out of the box, but sites lose them again to security plugins, host level mime whitelists or themes that overwrite the upload_mimes filter wholesale. The plugin puts them back.
It also rescues uploads that are refused with “Sorry, this file type is not permitted for security reasons” — which happens when the server’s fileinfo library is too old to recognise the format and reports it as a plain binary. The extension is never trusted on its own: such a file is accepted only when its own header proves it really is WebP or AVIF, so renaming a script to .webp still gets it rejected.
Safety

Conversions that would produce a bigger file are skipped and the original is kept
EXIF orientation is baked into the pixels, so photos from phones do not end up sideways
Colour profiles survive metadata stripping
Nothing is deleted until the converted file has been written and verified
A built in test button converts five real images in a temporary folder and reports the actual saving, changing nothing

Requirements
The server needs either the Imagick extension or GD with WebP support. AVIF needs Imagick built with an AVIF delegate, or PHP 8.1+ for GD. The settings screen tells you exactly what your server can do.
WP-CLI
wp nik-images run [--force] [--dry-run] [--limit=]
wp nik-images restore
wp nik-images status

Privacy
The plugin sends nothing anywhere. All conversion happens on your own server, and no external service is contacted.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon