=== Flex Image Optimizer ===
Contributors: flexfields, hovoqoch
Tags: images, webp, thumbnails, svg, compression
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Regenerate thumbnails, generate WebP/AVIF, allow sanitized SVG uploads, and compress images on your own server.

== Description ==

**Flex Image Optimizer** is part of the FLEX plugin suite from **FLEX LLC** (https://flexible.am/). It keeps image work on your WordPress server. There is no compression API, no CDN account, and no call home.

* Bulk regenerate all thumbnail sizes, or only missing sizes
* Generate WebP (and optional AVIF) copies next to JPEG/PNG files
* Serve modern formats with a picture tag so JPEG/PNG remains the fallback
* Allow SVG uploads with sanitization (scripts and unsafe markup removed)
* Resize oversized originals, set JPEG/WebP quality, and strip GPS/EXIF
* Skip unused registered sizes (including 1536×1536 / 2048×2048)
* Media library column, row actions, bulk actions (up to 20), and WP-CLI

Admin CSS and JavaScript ship with the plugin. No remote stylesheets, no telemetry.

= Privacy =

Flex Image Optimizer does not send images or metadata to FLEX or any third-party service. Processing uses the WordPress image editor (Imagick or GD) on this site. Optional EXIF stripping is done on the server. SVG sanitization runs on upload before the file is stored.

= Limitations =

* WebP and AVIF require PHP/GD or Imagick built with those formats.
* Animated GIF is not converted.
* Picture-tag rewriting wraps `img` tags. CSS that requires `img` to be a direct child of another element may need a small adjustment.
* SVG is treated like HTML: only trust roles you allow to upload it.
* This is not a CDN, lazy-load extra, or offsite backup plugin.

== Installation ==

1. Upload the `flex-image-optimizer` folder to `/wp-content/plugins/`, or install the zip via **Plugins → Add New → Upload Plugin**.
2. Activate **Flex Image Optimizer**.
3. Open **Flex Images → Settings** and review WebP, SVG, and quality.
4. Open **Tools** to generate WebP for the existing library or regenerate thumbnails.

== Frequently Asked Questions ==

= Where are WebP files stored? =

Next to the original, with an extra extension: `photo.jpg.webp`. Thumbnails follow the same pattern. Deleting the media item removes those copies. Uninstalling the plugin does not.

= Will visitors without WebP support see a broken image? =

No. The original JPEG or PNG stays in the `img` tag. Supporting browsers pick WebP or AVIF from the picture sources.

= Is SVG safe? =

The plugin strips scripts, event handlers, foreignObject, and external URLs. That is not a guarantee against every XML trick. Keep SVG limited to administrators unless you trust the other roles.

= Can I regenerate one image? =

Yes. In the media library, hover the row and use **Regenerate thumbnails** or **Generate WebP**. Bulk actions handle up to 20 selected items.

= What happens when I uninstall? =

Plugin settings are removed. Uploaded images and generated WebP/AVIF files stay in the uploads directory.

== Screenshots ==

1. Tools — regenerate thumbnails and generate WebP/AVIF
2. Settings — compression, SVG, and sizes
3. Usage — in-plugin guide

== Changelog ==

= 1.0.1 =
* Remove the deprecated libxml entity loader call. SVG parsing still rejects entities and blocks network access.
* Load image functions from image.php only.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.1 =
Review fixes: no deprecated libxml call, and no direct load of media.php.

= 1.0.0 =
First release: thumbnails, WebP/AVIF, sanitized SVG, and local compression.
