| 开发者 | grzegorzpuszka |
|---|---|
| 更新时间 | 2026年9月11日 03:44 |
| 捐献地址: | 去捐款 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp pdevio.image.jpg.pio.webp).wp pdevio for optimization, targeted conversion, cleanup, status, the live delivery test, and format or speed changes..htaccess rewrite rules.photo.jpg and usually creates thumbnail files such as photo-768x512.jpg.photo.jpg.webp, photo.jpg.avif, or photo-768x512.jpg.webp..jpg, .png, .gif, or .webp.Accept header.PDEV Image Optimizer block to .htaccess inside the uploads directory.
If theme image optimization is enabled, the plugin also manages a marked block inside the active theme directory.
The rules:
Vary: Accept so caches know that one URL can return different image formats..htaccess file must be writable when the plugin needs to add or update these rules.
Image delivery on Nginx
WordPress cannot safely edit Nginx server configuration.
PDEV Image Optimizer therefore generates ready-to-copy map and location blocks in System status.
A server administrator must:
map block to the appropriate http context.location block to the correct server context.Accept header.Content-Type.image/webp or image/avif.
The test runs only when an administrator starts it manually.
Server requirements
PDEV Image Optimizer needs both:
mod_rewrite).mod_mime).mod_headers)..htaccess files must be allowed and processed for the uploads directory.AllowOverride setting..htaccess file must be writable by PHP when the plugin manages delivery rules.map block to the http context.location block to the correct server context..htaccess overrides are allowed.image/webp or image/avif.Yes. Every feature is available for free. There is no PRO version, paid feature unlock, image quota, subscription, or limited free plan.
No. Images are converted locally on your WordPress server using Imagick or GD. PDEV Image Optimizer has no image optimization API, cloud conversion service, telemetry endpoint, or analytics endpoint. Cloudflare is contacted only when an administrator explicitly configures the optional Cloudflare integration or runs its compatibility test.
No. Original files remain untouched. PDEV Image Optimizer creates a separate optimized sidecar next to each converted source image. WordPress continues using the original image URL.
Yes. The Media library optimization tool processes existing image attachments together with their registered WordPress thumbnail sizes. Work is divided into small restartable requests. A failed, oversized, or resource-intensive image is logged and skipped without stopping the remaining optimization job.
Yes. Automatic optimization can be enabled for newly uploaded images and the WordPress thumbnails generated from them.
Yes. WebP can be generated when the installed Imagick or GD library supports WebP encoding.
Yes, when the installed Imagick or GD build supports AVIF encoding. Many servers support WebP but were compiled without AVIF support. PDEV Image Optimizer cannot add AVIF support to PHP itself. If AVIF is unavailable, the PHP image library installed by your hosting provider must support it.
Image conversion and image delivery are separate operations. If optimized files exist but visitors still receive JPEG or PNG, conversion is working but the required web-server delivery rules are not. On Apache or LiteSpeed, check:
.htaccess.mod_rewrite.mod_mime.mod_headers.AllowOverride.Imagick is preferred when it supports the selected output format. GD is used as a fallback. The detailed System status report shows both libraries, their versions, supported image formats, and applicable resource limits.
Open Settings > Overview and click Test image delivery.
PDEV Image Optimizer creates temporary local test files, requests the original URL with the selected format in the Accept header, verifies the response, and immediately removes the test files.
A successful result confirms an image/webp or image/avif response.
The latest result remains visible until conversion or delivery settings change.
You can also verify a real image using your browser developer tools:
Content-Type..jpg while the response type is image/webp or image/avif. This is expected.
This is intentional. PDEV Image Optimizer keeps existing WordPress URLs unchanged. The web server serves the optimized WebP or AVIF sidecar transparently when the browser supports it. This avoids replacing URLs stored in WordPress content, metadata, themes, or plugins.
The compressed file size does not indicate how much memory an image requires after decoding. PDEV Image Optimizer skips sources:
Thumbnail tools scan the Media Library for:
Yes. Enable active theme image optimization in Settings. The active theme directory must be readable and writable, and the web-server delivery rules must also cover that directory. Development directories including the following are excluded from scanning:
node_modulesvendor.git.svnAnimated GIF files are detected and skipped so animation is not replaced with a static image. A non-animated GIF can be converted when GIF is selected as a source format.
Yes. Original files are preserved and optimized WebP or AVIF sidecars are stored next to them. The Storage savings card shows the disk space used by optimized sidecars and estimates the smaller transfer size visitors may receive.
Yes. Optimized file cleanup can scan PDEV-generated optimized files before deleting anything. You can choose to remove:
image.jpg.pio.webp. A real source extension must precede .pio., and the file must sit inside the uploads or active theme folder, so a file you happened to name something.pio.webp is always left alone.
Uninstalling removes:
.htaccess delivery rules..pio.webp and .pio.avif files remain on disk by default.
To remove them as well:
Yes. Local conversion and origin delivery work without a Cloudflare API connection. Without a confirmed shared-cache rule, PDEV Image Optimizer uses private-cache protection so Cloudflare does not cache the wrong image format for a shared original URL. The optional Cloudflare integration can:
wp-config.php:
define( 'PDEV_IMAGE_OPTIMIZER_CLOUDFLARE_ZONE_ID', 'your-zone-id' );
define( 'PDEV_IMAGE_OPTIMIZER_CLOUDFLARE_API_TOKEN', 'your-api-token' );
No. Images are converted locally. PDEV Image Optimizer has no telemetry or analytics endpoint. Cloudflare is contacted only when an administrator explicitly provides credentials or runs the compatibility test. The Ko-fi page is opened only after the user clicks its link.
The system report includes:
Only errors from the last 24 hours are shown and included in the report, with an additional maximum of 50 entries. Paths, URLs, email addresses, and image names are redacted from the support report. The log is removed when the plugin is uninstalled.
Yes. Every bulk operation is available through the wp pdevio command:
wp pdevio optimize [--force] [--attachments-only] [--theme-only] - convert the Media Library, plus the active theme images when that option is enabled. --force re-optimizes every image from the start. This command uses the same lock as the admin screen, so a command-line run and a browser run never process the same images at once.wp pdevio convert <id>... [--force] - convert one or more attachments by ID.wp pdevio cleanup [--all] [--dry-run] [--yes] - preview and delete generated optimized files. --all also removes current-format files, --dry-run only reports, --yes skips the confirmation prompt.wp pdevio status - show the output format, encoder, optimization speed, optimized and pending counts, delivery-rule status, and the last delivery test.wp pdevio test-delivery - run the live HTTP delivery test.wp pdevio set [--format=<webp|avif>] [--speed=<conservative|balanced|fast>] - change the output format or optimization speed, exactly like the Settings screen. Run without options to print the current values.No. Every feature is free and the plugin will remain free.
wp pdevio (optimize, convert, cleanup, status, test-delivery, set). The optimize command shares the same lock as the admin screen, so a command-line run and a browser run never process the same images at once.pdev_image_optimizer_max_batch_limit and pdev_image_optimizer_min_cooldown_ms tune the ceilings further.image.jpg.pio.webp) and its location inside the uploads or active theme folder. Cleanup and uninstall never remove a file unless a real source extension precedes .pio. in its name and it sits in a managed folder, so a file you happened to name something.pio.webp is always left alone. The old table is dropped automatically on update. New filter pdev_image_optimizer_generated_roots adds folders to the scan for sites that store media elsewhere..pio.webp or .pio.avif path derived from a real source image is treated as PDEV's own and refreshed normally.pdev_image_optimizer_avif_speed), a batch the web server kills mid-request no longer holds the lock for 90 seconds (kept fresh while running, reclaimed within 45 seconds otherwise), and the optimizer waits out a busy lock or a dropped connection instead of failing immediately. The crash-skip threshold is adjustable through pdev_image_optimizer_max_attachment_attempts.pdev_image_optimizer_imagick_resource_limits filter.pdev_image_optimizer_preferred_driver (gd or imagick) forces which encoder is tried first. The capability probe still runs, so forcing a driver that cannot encode the chosen format falls back to the other one..pio path is now treated as an earlier PDEV conversion and re-created normally (the hard refusal is kept only for a file that is not a valid image of the target format), and the ownership table is recreated automatically if a migration left it behind..htaccess after that plugin is removed - no longer disables PDEV delivery. PDEV now installs its own rules regardless and shows a warning that names the competing block, says whether the plugin that created it is still active, tells you which # BEGIN / # END block to delete when it is not, and points to the live delivery test.Class "PDEV\ImageOptimizer\Rest\CleanupRoute" not found) on sites that installed or updated to 1.3.0. This release ships the complete plugin..pio.webp / .pio.avif files (best effort, time-limited) while never touching originals..pio.webp and .pio.avif naming contract; legacy sidecars are no longer served or removed automatically.