=== FlipWebP ===
Contributors: saadbashir1000
Tags: webp, images, compression, performance, media
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Convert Media Library images to WebP and reduce their file size, one at a time or in bulk.

== Description ==

FlipWebP converts JPEG, PNG, and GIF images that are already in the Media Library to WebP. You can convert one image or a selection, and you can work through every image that is still waiting.

Conversion runs on your server with WordPress’s image editor (Imagick or GD). Files are not uploaded to FlipWebP or any other service.

An image is replaced only when the WebP version is meaningfully smaller. Animated GIF and animated WebP files are left unchanged. SVG files are never converted.

After a successful conversion, FlipWebP updates the attachment and rewrites stored addresses in posts, comments, and settings so existing content keeps pointing at the image. Addresses inside serialized objects are left unchanged rather than risk corrupting them.

= What you can do =

* Convert the selected images on the FlipWebP screen.
* Convert every waiting image, one request at a time, and stop after the current image.
* Convert from the Media Library bulk action, a row action, or the attachment details panel.
* Choose quality from 40 to 100 and an optional maximum dimension.
* Delete the original only after a smaller WebP file is saved, or keep it.
* Store a restorable backup in a protected folder under uploads.
* Optionally convert new JPEG, PNG, and GIF uploads. This is off until you enable it.

== Installation ==

1. Upload the `flipwebp` folder to `/wp-content/plugins/`, or install the zip from Plugins → Add New.
2. Activate FlipWebP through the Plugins screen.
3. Open Media → FlipWebP.
4. Save the quality and backup settings, then convert a single image before running a large batch.

The server needs Imagick or GD with WebP support. The FlipWebP screen shows whether that support is available.

== Frequently Asked Questions ==

= Does FlipWebP send my images anywhere? =

No. Images are read and written on the server that runs your site. The plugin does not phone home, and it does not load scripts or styles from another domain.

= Will existing posts keep showing the image? =

FlipWebP updates the attachment, then replaces the old uploads path in posts, comments, meta, and options. Clear any page cache or CDN cache afterward. Very large serialized values, and serialized values that contain objects, are skipped so they are not corrupted. If a reference cannot be updated, the original file is kept.

= What happens when WebP is not smaller? =

The original file is restored and the image is marked as unchanged. Convert all skips those images. You can select one later and try again after changing the quality.

= Are animated images converted? =

Animated GIF and animated WebP files are skipped so the animation is preserved. A static GIF can be converted.

= Can I get the original file back? =

Yes, when “Keep restorable backups” was enabled for that conversion. Use Restore on that row. Backups live in `wp-content/uploads/flipwebp-backups` and are blocked on Apache and IIS. On nginx, deny access to `wp-content/uploads/flipwebp-backups` and `wp-content/uploads/flipwebp-tmp`.

= Does this change the front of the site? =

No styles or scripts are added to public pages. The plugin loads its interface only in wp-admin.

== Screenshots ==

1. The FlipWebP screen with library totals, space saved, and the image list.
2. The confirmation and progress dialog used for one image or a batch.
3. Quality, resizing, backup, and server WebP support settings.

== Changelog ==

= 1.0.3 =
* Stop rejecting photos that fit in a normal hosting memory limit. Images that are still too large are scaled down and converted.

= 1.0.2 =
* Convert normal and large photos instead of stopping at a memory estimate that was too small for a 256 MB limit.
* Raise the memory available during conversion when the server allows it.
* Recognize GD and Imagick WebP support even when WordPress does not list WebP as an editable format.

= 1.0.1 =
* Name the plugin author.
* Prepare database lookups used while updating image addresses, including table names.
* Protect backup folders without placing PHP files in the uploads directory.
* Sanitize nonces before they are verified.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.3 =
Fixes conversion of large photos that reported a memory-limit error.

= 1.0.2 =
Large photos no longer fail with a memory-limit message on typical hosting limits.

= 1.0.1 =
Security and directory-review fixes. Update before converting a large library.

= 1.0.0 =
Initial release.
