=== Squeezify ===
Contributors: xcast3d
Tags: image optimization, compress images, avif, webp, media library
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Optimize first, upload second. Batch-compress, convert, and resize images in your browser, then upload only the finished files to your Media Library.

== Description ==

Every major image plugin optimizes images *after* they're uploaded — the full-size originals still travel over the wire, still land on your server, and still eat disk space.

Squeezify flips the order. Drag a batch of images into the Squeezify editor (right inside wp-admin), tune format, quality, and size with a live before/after comparison, and nothing touches your site until you click Upload. Only the finished, optimized files reach your Media Library.

* Real encoders — libavif (AVIF), libwebp (WebP), MozJPEG, and Oxipng (PNG), running as WebAssembly in your browser
* Batch queue with per-image format, quality, effort, and resize controls
* Live before/after comparison loupe
* Upload straight to the Media Library when you're ready
* No cloud API, no credits, no quotas — the work happens on your machine
* Your images stay private until you upload them to your own site

Images are capped at 2560px on the longest edge before encoding — the same threshold WordPress core itself uses (`big_image_size_threshold`). Because the file you upload is already at or under that size, WordPress never generates its own separate `-scaled` copy: what you see in the editor is what ends up in your Media Library, one file, no server-side duplicate.

`assets/squeezify-wp.js` is shipped unminified — a Rollup/Vite bundle of the plugin's source with original names and formatting intact, not obfuscated or compressed.

== Installation ==

1. Upload the `squeezify` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Open Media → Squeezify, or click the Squeezify button on the Media Library screen.

== Frequently Asked Questions ==

= Are my images sent anywhere for processing? =

No. All compression, conversion, and resizing happens locally in your browser. The only network transfer is the final upload of finished files to your own WordPress site.

= What formats can it produce? =

AVIF, WebP, JPEG (MozJPEG), and optimized PNG (Oxipng). AVIF uploads require WordPress 6.5+.

= Uploads fail with an error mentioning a security plugin or firewall =

Some security hardening (Sucuri, ModSecurity, host firewalls) can block media uploads through the WordPress REST API before WordPress ever sees them. If uploads fail with that message, review your security plugin's hardening options or ask your host to allowlist REST media uploads (`/wp-json/wp/v2/media`). Squeezify uses the same standard upload format as WordPress's own uploader.

= Does it work with multisite? =

Yes. Squeezify checks the standard `upload_files` capability on whichever site you're on, so it works whether the plugin is network-activated or activated per-site — no separate configuration either way.

= What happens to my original files? =

Nothing — Squeezify never touches them. Everything happens in your browser on a copy of the image; your source file is only read, never modified. Only the optimized output you choose to upload leaves the editor, and only after you click Upload.

= Why is the first AVIF encode slower than the rest? =

The AVIF encoder is a WebAssembly module that has to be downloaded and compiled by your browser the first time it's used in a session. After that one-time warmup, your browser caches the compiled module and subsequent encodes are much faster.

= What browsers are supported? =

Any current version of Chrome, Firefox, Safari, or Edge. All processing uses standard Web APIs (WebAssembly, Web Workers) with no browser-specific requirements.

== Screenshots ==

1. The Squeezify button, right next to Add New Media File on the Media Library screen.
2. The Squeezify editor — "Let's get started".
3. Images added to the batch queue.
4. Before/after comparison preview on a photo.
5. The resize control.
6. Finalize — showing how much Squeezify saved.
7. Optimized files landed in the Media Library after upload.
8. The Media → Squeezify compatibility check, confirming your site is ready.

== Changelog ==

= 1.0.0 =
* First public release: editor overlay, batch queue, upload to Media Library.

= 0.1.0 =
* First development release: editor overlay, batch queue, upload to Media Library.

== Credits ==

Squeezify's WebAssembly encoders are provided via [jSquash](https://github.com/jamsinclair/jSquash) (MIT/Apache-2.0), which wraps libavif (BSD-2-Clause), libwebp (BSD-3-Clause), MozJPEG (BSD-style), and Oxipng (MIT) — all GPL-compatible. The `.wasm` files are unmodified upstream builds.
