| 开发者 | wpfixpath |
|---|---|
| 更新时间 | 2026年10月27日 23:08 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
<picture> element with WebP or your original image as the fallback: supported browsers download the smaller AVIF file, while browsers without AVIF support use the fallback. AVIF is offered when every responsive candidate has a matching copy, preserving the original crops and sizes.
The plugin doesn't rewrite saved posts, attachment URLs, CSS backgrounds, page builder fields, theme files, or hardcoded image markup. It converts JPEG and PNG attachments and their generated sizes.
Smaller copies reduce image downloads when your site serves them. Keeping both formats takes more disk space.
Example savings from four real images
These version 1.0.0 measurements use JPEG and PNG quality 80. Browser conversion, GD, and Imagick ran locally on the same Apple M1 Pro Mac with 32 GB RAM. They do not measure the optional PHP encoder.
The large JPEG and PNG contain the same 3000 x 1348 photo. The small JPEG is a 600 x 270 version of it; the small PNG is a 600 x 400 transparent graphic.
File sizes in KB, with the percentage saved in brackets. The server column covers GD and Imagick, which produced the same sizes in this test.
Image Original Browser WebP Server WebP
---------- -------- ------------- -------------
Large JPEG 1077.5 566.4 (47.4%) 566.4 (47.4%)
Small JPEG 51.4 28.0 (45.5%) 28.0 (45.5%)
Large PNG 6105.9 544.7 (91.1%) 544.7 (91.1%)
Small PNG 2.6 2.3 (11.6%) 2.3 (11.8%)
Time to convert and save one file:
Image Browser GD Imagick
---------- -------- -------- --------
Large JPEG 0.63 s 0.36 s 0.37 s
Small JPEG 0.10 s 0.04 s 0.04 s
Large PNG 0.74 s 0.41 s 0.41 s
Small PNG 0.09 s 0.04 s 0.04 s
The JPEG examples shrank by about 45-47%; the large PNG by 91%. The already-small transparent graphic saved about 12%. Your images and quality settings will give different results.
GD and Imagick were faster in this local test. The useful part of browser conversion is being able to do the job when your host can't.
Test details: macOS 26.6.2, WordPress 7.1.1, PHP 8.4.23 and Chrome 153.0.8010.52. Each time is the median of five fresh conversions after one warm-up. Times include conversion, validation, saving and local requests; they exclude queue waiting and the first encoder download. Your hosting, computer and connection affect the time, including the browser's image download and WebP upload. KB means 1,000 bytes. Full-size files were measured individually; generated sizes add more work.
Photo: Fronalpstock by Hannes Röst, CC BY-SA 3.0, resized for these tests.
Start with a few images
Open Tools -> IndexLane Safe WebP & AVIF Queue, scan your library, and try a few images. Check the results before enabling frontend serving or converting more. Command-line users can also manage server jobs and reports through WP-CLI; see the FAQ.
Plugin details and documentation.
Yes. The plugin still requires only PHP 7.4. picowebp is an optional conversion backend, not a requirement for using the plugin. On PHP 7.4 or 8.0 its library is not loaded and its setting is disabled automatically. Server conversion through compatible GD or Imagick, browser conversion, reports, and the other plugin features remain available.
Yes. The plugin saves WebP and AVIF copies beside your JPEGs and PNGs, including generated attachment sizes. Your originals remain available. You can use Delete Generated Images to remove copies owned by this plugin; files created by other tools are left alone.
You choose when. Frontend serving starts off. Enable it in Settings to use matching WebP and AVIF copies where your theme or plugin requests images through normal WordPress image output. Images with no matching copy continue to use their existing format. Saved post content, attachment URLs, CSS backgrounds, and hardcoded image markup are not rewritten.
Results vary by image and quality setting. The report shows actual file sizes and savings so you can judge the result. By default, the plugin skips newly converted files that are larger than their source. Keeping both formats uses additional disk space; this plugin does not free space by deleting originals.
No, not for conversion. Conversion runs on your hosting or on your computer, depending on the method you choose. Browser conversion exchanges images only with your own WordPress site. The conversion queue does not use an external optimization API, account, or credit system. Media Review is separate and optional. It requires a provider API key that you own, and provider charges may apply.
Media Review sends one metadata-stripped preview at a time to the provider selected in the plugin: OpenAI, Claude, or Grok. The preview is resized to at most 1600 pixels on its longest edge and capped at 4 MiB. If Include the linked page title and a short text excerpt is enabled, the attachment's parent-page title and up to 700 plain-text characters are sent as context. The provider returns structured findings, not a page summary. Findings remain proposals until you choose Apply Alternative Text. The previous alternative text is retained so Restore Previous Text can undo the change if nobody edited the value afterward. Review the provider's own data and retention terms before enabling the feature.
You can define ILSWQ_AI_API_KEY in wp-config.php, which keeps the key out of the database. Otherwise the plugin encrypts the key with AES-256-GCM using a key derived from your WordPress authentication salt. The saved key is never loaded into the browser, shown in the settings field, included in a report, or written to the review history. If your server cannot provide the required cryptography functions, the plugin asks you to use the constant instead.
Turn on Convert images in the browser in Queue Settings. The image encoder that ships with the plugin then runs inside your own browser, so the image data never goes to another server and nothing has to be installed on your computer or your host. Your browser sends the finished WebP or AVIF file back to your WordPress site, where it is stored beside the original exactly like a server conversion. This mode is attended work: keep the plugin page open while it runs. If you would rather not keep a tab open, and your site runs PHP 8.1 or newer with zlib, turn on Convert images with the built-in PHP encoder instead. The normal background queue, whole-library jobs, automatic uploads, and WP-CLI can use it without a WebP-capable image editor. It is much slower than GD or Imagick and is limited to smaller images. The plugin detects compatibility automatically; this optional setting stays disabled on PHP 7.4 or 8.0.
No desktop software or browser extension is needed. The WebAssembly encoder comes with the plugin and runs in a supported browser on macOS, Windows, or Linux. It doesn't use image tools installed on your computer. Use a current Chrome, Edge, Firefox, or Safari browser. The admin page must use HTTPS (localhost also works for development), and the site must allow the bundled scripts, module workers, and WebAssembly encoder to load. The panel tests these capabilities on your site before enabling conversion. Older browsers can lack a required feature even if they can display WebP images.
Server conversion normally uses the WordPress image editor through GD or Imagick with WebP support. The plugin does not call the standalone cwebp command. If your image editor cannot write WebP, use the optional built-in PHP encoder (PHP 8.1 or newer with zlib) or browser conversion. Both encoders ship with the plugin.
Each source file must be at most 20 MiB, at most 8,192 pixels along either edge, and at most 16 million pixels in total. Your configured maximum pixel limit also applies. The browser processes one file at a time, and very large images may still exceed your device's memory or the conversion time limit. Source images and the conversion endpoints must be available on the same origin as your WordPress admin (the same protocol, host, and port). Offloaded images, CDN-only uploads, or a separate media domain are not supported by browser conversion. Your hosting must also accept the finished file upload; its upload-size limits still apply. Animated PNGs are not supported by the browser encoder.
It's your choice, and you can convert the same library again later if you change your mind. AVIF is the newer format and is usually smaller than WebP, depending on the image and quality settings for the same picture, so it is worth choosing when your visitors use current browsers. WebP is the safer default: every current browser reads it, it encodes much faster, and it is what the server background jobs produce when your hosting can create WebP. AVIF is produced by the browser converter in this version, so it is attended work: keep the plugin page open while it runs. Its files are served through a picture element with WebP or your original image as the fallback, so browsers without AVIF support use the fallback. Some very small or already-optimized images can come out larger as AVIF; those are skipped by default, just like oversized WebP files.
It moves the image encoding to your computer. That can help when PHP cannot spare enough memory for an image, provided the file fits the browser's limits. Your server still serves the source file, receives and validates the generated upload, saves it, and updates the conversion records. Browser conversion reduces the encoding work on your hosting; it doesn't remove all server work.
Use the server queue for background work when your hosting has a WebP-capable image editor or the optional PHP encoder is enabled. Browser conversion handles selected images on your computer and can help with files that exceed the server's memory estimate or PHP encoder limits. The browser run needs the plugin page to stay open.
WordPress normally creates an upright version when it processes a photo with EXIF rotation data. Those images convert normally. Older uploads or images that WordPress could not rotate may still depend on a rotation or mirror tag. Browser conversion and the optional PHP encoder refuse those files before encoding, including mirrors that leave the dimensions unchanged. Save an upright copy without that tag and upload it again.
For server conversion, yes. Conversion progress is saved, and WP-Cron can continue the queue when your site receives traffic. If traffic is low or WP-Cron is disabled, work may wait until you reopen the plugin page or your configured cron runner runs. You can pause, resume, cancel pending work, or retry failures from the queue controls. If a whole-library job has more than 10,000 failures, retry rescans the library and reuses valid existing WebP files. For browser conversion, keep the tab open: closing it stops the remaining work, while files already saved stay in place.
Choose Convert Entire Library when your host has a WebP-capable image editor or the optional PHP encoder is enabled. The plugin processes images in small batches and saves progress. WP-Cron can continue the job between visits, depending on site traffic or your cron runner. Files beyond the PHP encoder's limits need another conversion method. If neither server method is available, use selected browser conversions and keep the page open.
Yes. Use Exclude from WebP in the Media Library row actions, or the exclude bulk action for several images at once. Excluded images are skipped by every conversion job, are not regenerated when you change quality settings, and are not served as WebP. Existing copies generated earlier stay on disk until you delete them, and you can include an image again at any time.
The plugin records the original and WebP byte size of every file it generates, so the totals on the plugin page reflect real files rather than estimates. Totals are adjusted when files are regenerated or deleted. If you converted images with an earlier version, press Recalculate once to rebuild the totals from the metadata stored on your attachments.
Yes. wp ilswq status reports server support, settings, queue state, and stored savings; wp ilswq scan lists images with their status; wp ilswq convert converts specific IDs, a dry run, or the whole library with --all; wp ilswq totals shows or rebuilds the savings; wp ilswq queue inspects or controls the queue; and wp ilswq cleanup removes generated WebP and AVIF files.
Yes, if your server has a WebP-capable image editor or the optional PHP encoder is enabled, and you turn on automatic new-upload conversion in Settings. It starts off. New uploads are queued after WordPress finishes creating their image sizes. Background conversion follows the same limits and settings as manual server jobs.
Run a scan, then search the report by filename, attachment title, or ID. Search works together with the status filters. Export CSV downloads only matching rows, and Convert Selected queues only selected eligible images in that view. Clear the search and choose All to see the full report again.
Check the Reason column for that attachment. A file may be missing, unsupported, above your pixel limit, or likely to need more memory than your server can spare. A small file on disk can still require substantial memory when decoded. A conflict means a WebP already exists that this plugin does not own, so it is left unchanged.
The plugin detects source-file and quality-setting changes before regenerating its WebP output. It also reconciles its copies when attachment sizes change and cleans them up when an attachment is deleted. Run a fresh scan to review which images need conversion after making changes.
ILSWQ_AI_API_KEY override, metadata-stripped previews, optional page context, bounded requests, and strict provider result validation.<picture> element with WebP and the original image as fallbacks, so an AVIF copy never reaches a browser that cannot read it. URL swaps keep serving WebP.cwebp, or a browser. It is off by default, capped by megapixels, and much slower than the other backends.