=== Harvify Image Optimizer for WebP and AVIF ===
Contributors: harv, freemius
Tags: webp, avif, image optimizer, compress images, image converter
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 1.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Convert Media Library images to WebP or AVIF locally in your browser.

== Description ==

Harvify Image Optimizer helps WordPress administrators convert Media Library images to modern WebP and AVIF formats without running heavy compression work inside PHP.

The plugin scans lightweight attachment metadata first, then your browser converts selected images in a small queue. Images are processed with Web Workers and OffscreenCanvas where available, uploaded back through authenticated WordPress REST API requests, and released from browser memory as each item finishes.

This client-side approach is designed for shared hosting environments where PHP memory limits and execution timeouts can interrupt large image optimization jobs.

= Key features =

* Convert JPEG, PNG, WebP, and AVIF source images to WebP or AVIF.
* Scan one source format at a time so existing target-format images are not accidentally reprocessed.
* Select a few images for a test run before processing the full queue.
* Skip small files, very large images, selected upload paths, or filename patterns.
* Deliver Pro sidecar variants through PHP picture tags when available.
* Adjust quality and queue concurrency from the admin screen.
* Save queue state in the browser with IndexedDB so work can resume after interruption.
* Keep wp-admin responsive by doing conversion work in browser workers.
* Process images locally in your browser without using an external optimization API.
* Optional original-file deletion, disabled by default.

= Privacy and external services =

Harvify Image Optimizer does not send images to a third-party compression service, load scripts from external CDNs, or track usage. Images are fetched by your browser from your own WordPress site and uploaded back to your own WordPress REST API.

AVIF encoding uses bundled WebAssembly encoder files. The current AVIF path uses the Apache-2.0 licensed @jsquash/avif single-thread encoder, with the earlier bundled wasm-avif encoder retained as a local fallback.

= Format testing =

If you want to experiment with AVIF conversion outside your WordPress Media Library first, you can use this browser-based test tool:

[AVIF to PNG Converter](https://conversores.online/en/avif-to-png-converter/)

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen in WordPress.
3. Open Harvify Image Optimizer in the WordPress admin menu.
4. Choose a source format, choose WebP or AVIF as the target, and scan the library.
5. Select a few test images if desired, adjust quality, and start the selected queue.

== Frequently Asked Questions ==

= Which conversions are supported? =

The source selector can scan JPEG, PNG, WebP, or AVIF attachments. The target selector can write WebP or AVIF, depending on browser, WordPress, and server image metadata support.

= Can I test only a few images first? =

Yes. Scan a source format, select only the queue rows you want to process, adjust quality, and start the selected queue. This is recommended before processing a large live media library.

= Does it modify theme or plugin files? =

No. This version only replaces Media Library attachment files inside the uploads directory. Theme and plugin asset rewriting is intentionally excluded because it can break updates, checksums, and third-party package expectations.

= Does this send my images to a remote service? =

No. Images are fetched by your browser from your own WordPress site and uploaded back to your WordPress REST API.

= Why can AVIF be slower than WebP? =

AVIF compression is more CPU intensive, especially when using a WebAssembly encoder in the browser. For large batches, start with a small test selection and keep concurrency low.

= Why is AVIF unavailable on some sites? =

AVIF output depends on browser WebAssembly support and WordPress/server support for AVIF media metadata. WordPress added AVIF support in version 6.5, but the hosting image library must also support it.

= What happens if the tab is closed? =

The queue is saved in IndexedDB in the same browser. Open Harvify Image Optimizer again and choose Start Selected / Resume.

= Are original files deleted? =

No, not by default. The admin must explicitly enable the delete originals option before starting the queue.

== Changelog ==

= 1.0.0 =
* Initial release.
