=== Safe WebP Queue ===
Contributors: indexlane
Tags: webp, image optimization, images, media library, performance
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Convert WordPress Media Library images and generated sizes to WebP locally, with originals kept and skip reasons shown.

== Description ==

Safe WebP Queue converts JPEG and PNG media attachments and their generated image sizes to sibling `.webp` files from inside wp-admin.

The plugin checks local server support, estimates memory risk, preserves original files, skips unsafe files, and reports which images converted, skipped, or failed.

It is built for cautious local conversion, not cloud optimization or automatic file replacement.

What it does:

* Scans JPEG and PNG attachments in the Media Library.
* Checks GD and Imagick WebP support.
* Estimates memory risk before conversion.
* Converts selected original images and generated attachment sizes to sibling `.webp` files.
* Keeps original files.
* Skips files that are too large, unsupported, missing, or likely unsafe for the current server.
* Exports the visible report as CSV.
* Deletes WebP files generated by this plugin when explicitly requested.
* Optionally uses generated WebP files in normal WordPress image output where a matching generated file exists.
* Can optionally generate WebP files for new uploads after WordPress finishes creating attachment sizes.

Limits:

* Does not rewrite post content.
* Does not replace attachment URLs.
* Does not delete original images.
* Does not convert GIF, SVG, AVIF, or existing WebP files.
* Does not crawl CSS, theme files, page builder fields, or hardcoded image URLs.
* Does not call an external API or optimization service.
* Frontend WebP serving is off by default and only affects normal WordPress image output when enabled.
* New-upload conversion is off by default.

== Installation ==

1. Upload the `indexlane-safe-webp-queue` folder to `/wp-content/plugins/`.
2. Activate the plugin in wp-admin.
3. Go to Tools -> Safe WebP Queue.
4. Run a scan before converting images.

== Frequently Asked Questions ==

= Does this replace my JPEG or PNG files? =

No. Original files are preserved. The plugin creates sibling `.webp` files beside original and generated attachment image files.

= Will my frontend automatically serve WebP after conversion? =

No. Frontend serving is off by default. When enabled, the plugin uses generated WebP files in normal WordPress image output where a matching generated file exists. It does not rewrite post content, attachment URLs, or database content.

= Does this convert new uploads automatically? =

Not by default. Existing media can be scanned and converted from Tools -> Safe WebP Queue. Automatic WebP generation for new uploads can be enabled in settings.

= Does it use a cloud service? =

No. Conversion runs locally through WordPress image editors, GD, or Imagick when WebP writing support is available.

= Why are large images skipped? =

Image conversion memory use depends on decoded pixels, not just compressed file size. The plugin estimates decoded memory as width x height x 5 and skips files that look risky for the current PHP memory limit.

== Screenshots ==

1. Server checks and conservative queue settings.
2. Media Library scan showing eligible, skipped, and already-supported files.
3. Conversion results with WebP size, savings, status, and reason.
4. Optional frontend serving and new-upload settings.

== Changelog ==

= 0.1.3 =

* Renamed the generated-file check from Delivery Check to Validate WebP.
* Added Mac/archive ZIP ignores to the repository.
* Refreshed screenshots with safety defaults visible and the Reason column readable.
* Widened the screenshot capture viewport for public plugin assets.

= 0.1.2 =

* Added generated attachment size conversion.
* Added stored WebP file map per attachment.
* Added optional frontend serving for normal WordPress image output.
* Added optional WebP generation for new uploads.
* Added pause, stop, resume, result filters, and WebP validation controls.
* Added generated WebP output validation.
* Added stale and invalid existing WebP detection.
* Stored new WebP maps with uploads-relative paths.
* Hardened uploads-directory validation before scan and conversion.
* Hardened cleanup path validation.
* Hardened AJAX settings and ID handling.
* Added clean Plugin Check CI build handling and ignored IDE/build artifacts.
* Removed full server paths from admin AJAX rows.
* Lowered the max pixel setting ceiling.

= 0.1.0 =

* Initial release.
* Added server capability checks.
* Added Media Library dry-run scan.
* Added small-batch selected conversion.
* Added sibling WebP output with originals preserved.
* Added skip reasons and CSV export.
* Added explicit cleanup for generated WebP files.
