=== UZYTAK Image Optimizer ===
Contributors: uzytak
Tags: image optimization, webp, compress images, resize images, performance
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Compress images and convert them to WebP in your own browser. No credits, no subscription, no external server. Restorable originals. 10 languages.

== Description ==

Most image optimizers send your photos to their servers and sell you credits for it. This one does the work in the browser of the person who presses "Optimize": the image is compressed on your own computer and saved back to your own site. Nothing is sent anywhere else, there is no account and there are no limits.

* **Optimize from the Media Library** — an "Optimize" button next to every JPEG, PNG and WebP image (list view and image details), and the page Media → Optimize images.
* **WebP** — WebP copies of the image and of every size WordPress made from it. Typically 25–35% smaller than JPEG at the same look.
* **Two safe ways to deliver WebP** — (1) WebP copies next to the originals, served with the HTML `<picture>` tag, so browsers without WebP still get the original; or (2) replace the files with WebP and update the image links in your posts.
* **Quality you choose** — 82 by default, a good balance for photos.
* **Too-large photos made smaller** — a maximum width (2560 px by default); the height follows.
* **Re-compress JPEG and WebP** files themselves — kept only when the result is really smaller.
* **Backup of every original** — in `wp-content/uploads/uzytak-io-backup`, restored with one click ("Restore original").
* **See what you saved** — per image (before → after) and in total.

= How it works =

1. Your browser downloads the main image from your site.
2. It makes each size WordPress uses (thumbnail, medium, large …) with the same centred crop as WordPress, and encodes them as JPEG/WebP with the quality you chose.
3. It sends the files to your own site (WordPress REST API, logged-in users who may edit the image). The site checks that every file is a real image of the expected type and size, keeps a backup of the originals and saves the new files.

Because the browser does the work, your server needs no special image library: WebP works even where the server cannot make WebP itself.

= 10 languages =

Deutsch, English, Español, Français, Italiano, Nederlands, Polski, Svenska, Русский, Українська.

= Private =

The plugin sends nothing to UZYTAK or anyone else, loads nothing from other servers and sets no cookies.

= Pro add-on =

UZYTAK Image Optimizer Pro (separate plugin) optimizes the whole Media Library in one go with progress and resume, optimizes new uploads automatically, adds AVIF (where the browser can encode it), a statistics page and an exclude list.

== Installation ==

1. Install the plugin from Plugins → Add New, or upload the zip, and activate it.
2. Go to Media → Optimize images and check the settings (WebP and the `<picture>` delivery are a safe start).
3. Press "Optimize" next to an image in Media → Library (list view), or choose an image on the Optimize images page.

== Frequently Asked Questions ==

= Which browser do I need? =

A current Chrome, Edge, Firefox or Opera can save WebP. Safari cannot save WebP from a web page at the time of writing; use another browser for optimizing (your visitors can use any browser). The Optimize images page shows what your browser can save.

= What happens to my original images? =

They are copied to `wp-content/uploads/uzytak-io-backup/<image ID>/` before anything changes. "Restore original" puts them back and removes the optimized files. Deleting the plugin does not delete the backups.

= What is the difference between the two WebP options? =

`<picture>` keeps the original JPEG/PNG and adds WebP copies (photo.jpg.webp). Your theme prints the image as usual; the plugin wraps it in `<picture>` so browsers pick WebP. It needs a little more disk space and works with every browser.

"Replace the files" turns the image into a .webp file, deletes the old files (they stay in the backup) and updates the image addresses inside post content. Page builders or themes that keep image addresses elsewhere (for example in their own settings) may still point to the old address; use `<picture>` in that case.

= Does it work with images on a CDN or another server? =

No. The browser must be able to load the image from your own site.

= Why is an image "already well compressed"? =

The new files would not be smaller than the existing ones, so nothing is changed.

= What about PNG? =

PNG images get WebP copies (with transparency). A PNG itself is not re-compressed, because the browser cannot make a smaller PNG.

= Will WordPress regenerate my WebP copies? =

If you regenerate thumbnails with another plugin, restore and optimize the image again so the copies match.

== Screenshots ==

1. Media → Optimize images with totals and settings.
2. Optimization column in the Media Library.

== Source code ==

All code of this plugin is included in readable form (assets/engine.js, assets/optimizer.js, assets/optimizer.css). There is no build step and no minified or third-party code. Image encoding uses the browser's built-in canvas encoders.

== Changelog ==

= 1.0.0 =
* First release: optimize images in the browser, WebP with `<picture>` or file replacement, resize, backups and restore, savings, 10 languages.
