=== DVMAGIC Local Image Conversion for AVIF and WebP ===
Contributors: dvmagic
Tags: avif, webp, image optimization, media library, convert images
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Unlimited local AVIF and WebP conversion for the WordPress Media Library. No API keys. No monthly quota.

== Description ==

**DVMAGIC Local Image Conversion for AVIF and WebP** converts JPEG, PNG and GIF uploads to modern formats on your own server — and can batch-convert your existing Media Library.

Built by [Auslander Studio](https://seohero.uk/free-plugins/) for production WordPress sites we operate ourselves. Unlike SaaS optimizers, everything runs locally with no usage caps — full feature set, free.

= What makes this plugin different =

* **No external API** — images never leave your server
* **No subscription or quota** — batch the whole Media Library when you need to
* **AVIF-first with WebP fallback** when the host cannot encode AVIF
* **Optional keep originals** for rollback without a second plugin
* **Server capability panel** so you know what the host can encode before you batch
* **URL rewrite** in post content and meta after conversion

= Features =

* Convert on upload (optional)
* Batch convert legacy library images
* AVIF primary with automatic WebP fallback when the host lacks AVIF encode
* Optional **Keep originals** (off by default)
* Server capability panel (Imagick, GD, AVIF/WebP)
* URL rewrite in post content and meta after conversion
* Action Scheduler queue when available; WP-Cron fallback

= Requirements =

* **AVIF encoding:** PHP extension **imagick** (PECL imagick) with ImageMagick built for AVIF output (AVIF in `Imagick::queryFormats('AVIF')`). GD cannot encode AVIF in this plugin.
* **WebP encoding:** **imagick** with WebP support, **or** PHP extension **gd** with WebP enabled (`imagewebp` available).
* Sufficient disk space and CPU for batch jobs
* **Back up `wp-content/uploads/` before running a full library batch**

Check **Media → DVMAGIC Image Conversion → Server capabilities** after install — the panel shows Imagick, Imagick WebP, Imagick AVIF, and GD WebP on your host.

= PHP extensions (summary) =

* **AVIF output** — PHP extension `imagick` (PECL). ImageMagick on the server must support AVIF encode (host-dependent; often ImageMagick 7 + libavif). Check “Imagick AVIF” in the plugin’s Server capabilities panel.
* **WebP output** — `imagick` with WebP support, **or** PHP extension `gd` with WebP enabled (`imagewebp`).
* **Reading JPEG/PNG/GIF** — `imagick` and/or `gd` (typical on most hosts).

If only GD with WebP is available, set **Primary format** to WebP, or leave AVIF and the plugin will fall back to WebP when AVIF encode is not detected.

= Author =

DVMAGIC — [LinkedIn](https://www.linkedin.com/in/dmitri-shevelkin-4a654098/)

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install from WordPress.org.
2. Activate **DVMAGIC Local Image Conversion for AVIF and WebP**.
3. Open **Media → DVMAGIC Image Conversion**.
4. Review server capabilities, save settings, then run a small test upload before batching the whole library.

== Frequently Asked Questions ==

= Does this call an external API? =

No. All encoding happens on your server.

= Will AVIF work on every host? =

No. **AVIF encoding requires the PHP `imagick` extension** and an ImageMagick build that can write AVIF (see Server capabilities: “Imagick AVIF”). Many shared hosts have Imagick without AVIF, or only GD with WebP.

When AVIF encode is unavailable, the plugin **falls back to WebP** (via Imagick or GD).

= Which PHP extensions do I need? =

* **AVIF:** enable **`imagick`** in PHP and ensure ImageMagick on the server supports AVIF output (ask your host or check the plugin’s capability panel).
* **WebP:** **`imagick`** (WebP) **or** **`gd`** with WebP (`imagewebp`).
* You do **not** need both imagick and gd — one working WebP path is enough if you use WebP as primary or accept AVIF→WebP fallback.

= Can I keep JPEG/PNG files after conversion? =

Yes. Enable **Keep originals** in settings. WordPress still serves the modern attachment file.

== Screenshots ==

1. Settings and server capability panel

== Changelog ==

= 1.0.2 =
* Renamed plugin for WordPress.org guidelines (distinctive DVMAGIC branding)
* Unified `dvmlic_` prefixes for options, AJAX, hooks, and classes
* Admin batch UI JavaScript moved to enqueued `assets/admin.js`
* Migrates legacy `smo_*` settings on activation when present
* Readme: explicit PHP extension requirements for AVIF (imagick) and WebP (imagick or gd)

= 1.0.1 =
* Plugin Check: WP_Filesystem / wp_delete_file for file ops
* Prefixed filters and settings helper
* Tested up to WordPress 7.1

= 1.0.0 =
* Initial WordPress.org release
* Upload + batch conversion, keep originals, server status panel
