=== Squishify ===
Contributors: xcastaneda
Tags: image optimization, resize images, crop image, avif, webp
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Batch-resize, crop, rename and compress a whole set of images at once, right 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.

Squishify flips the order. Drag a batch of images into the Squishify editor (right inside wp-admin), resize, tune format and quality 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, and effort controls
* Resize images individually or all at once to the exact size needed
* Crop with aspect-ratio presets (1:1, 4:3, 16:9) or exact output dimensions — one image, or the same shape across the whole batch
* Batch rename three ways — one image, a numbered sequence, or a name per image
* Number a sequence with or without a prefix (gallery-01… or just 1, 2, 3), zero-padded so it sorts correctly
* 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.

== Installation ==

1. Upload the `squishify` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Open Media → Squishify, or click the Squishify 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`). Squishify uses the same standard upload format as WordPress's own uploader.

= Does it work with multisite? =

Yes. Squishify 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 — Squishify 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 Squishify button, right next to Add New Media File on the Media Library screen.
2. The Squishify 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 Squishify saved.
7. Optimized files landed in the Media Library after upload.
8. The Media → Squishify compatibility check, confirming your site is ready.

== Changelog ==

= 1.4.0 =
* Crop is now free, on every version — web and WordPress. Drag a frame or lock it to a ratio and type exact output dimensions, on one image or across the whole batch. It used to be part of Pro; it isn't any more, and nothing about it was cut down on the way.
* The Pro feature tour now shows Image Boost, which never had a place in it before.

= 1.3.1 =
* Opening Squishify from the Media Library now eases in with a real progress bar instead of cutting straight to the editor.
* Fixed: changing a setting across the whole queue — resizing everything, or clearing a resize — left images you had already finished holding their previous version, so they could be downloaded at the old settings. Those images now show that they will be re-encoded, and Finalize brings them up to date.
* More room for your images: the sidebar and drop area now step aside once you have a queue going, and long filenames are trimmed with the full name on hover.
* Tool buttons are shorter — they show the setting itself ("16:9", "1800px") instead of spelling it out, so the toolbar keeps its shape as you use more tools.
* The Resize window now tells you the size you're resizing from.
* Crop gained a Reset, matching Resize — with "Apply to all" ticked it clears the crop across the whole queue.
* Clearing the queue no longer flashes the previous image for a moment when you add new ones.
* The loading sequence when images arrive now plays for every batch, not just the first one of a session.

= 1.3.0 =
* Rename now has three modes — rename this image, number a whole sequence, or type a name for every image in one pass.
* Sequences can skip the prefix entirely, so you can number files 1, 2, 3.
* Sequences are zero-padded automatically, so 12 images sort correctly instead of running 1, 10, 11, 12, 2.
* Add more images to a numbered batch and they pick up the sequence instead of arriving unnamed.
* Switching between rename modes keeps what you already typed.
* Fixed an error that could interrupt the first image of a batch with an "Encode failed" message when it was added.
* Various interface adjustments.

= 1.2.2 =
* Adding a batch now eases in: a brief loading pass, then your images arrive in the queue one after another — so you can see at a glance how many landed.
* The file heading now shows where you are in the queue ("1 of 15"), next to the filename and dimensions.
* "Apply to all" is now a checkbox on the main button instead of a second button competing with it — tick it and Next file becomes Finalize, which processes everything and takes you straight to the summary.
* Slimmer format and quality bar, leaving noticeably more room for the image you're actually working on.
* Images scaled down to the maximum working size are now reported once, with a count of how many were affected, instead of a separate notice per image.
* Notices and toasts no longer sit on top of dialogs.

= 1.2.0 =
* Batch rename is now part of the free tier — give a whole set a base name and automatic numbering, no licence needed.

= 1.1.2 =
* Fixed resized images looking softer or jagged compared to a desktop editor's export, especially on small or heavily cropped outputs — resizing now uses a sharper algorithm, with safeguards to keep large source photos fast.

= 1.1.0 =
* Drag a whole folder of images onto the dropzone to queue everything inside it at once.
* SVG images now rasterize at a proper working size instead of their (often tiny) declared dimensions.
* Added an in-app "what's new" modal so you'll see a quick summary the next time a new version ships.

= 1.0.1 =
* Fix: guard against a file being added to the queue twice from a single drop/select action.

= 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 ==

Squishify'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.
