=== Designed2Use Convert to WebP/AVIF ===
Contributors: designed2use, guy1ncognito
Tags: webp, avif, optimization, convert, privacy
Requires at least: 6.0
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

Private, reversible image optimization: convert uploads and existing media to WebP or AVIF on your own server, with one-click restore.

== Description ==

**Designed2Use Convert to WebP/AVIF** is a privacy-first image optimizer with one promise the
big-name plugins can't make: **your images never leave your server, and every conversion
can be undone.**

Most popular optimizers upload your images to a third-party cloud service to do the work —
counting against monthly quotas and handing your media to someone else's servers. This
plugin does everything **locally**, using WordPress's own image editor (Imagick, falling
back to GD). No accounts, no API keys, no external requests.

= Why it's different =

* **100% local & private** — no cloud service, no telemetry, no phone-home. Every image is
  processed on your own site.
* **Fully reversible** — bulk conversion (and uploads made with "Keep original file" on)
  keep your original JPG/PNG on disk and record a restore manifest, so you can put any image
  (or all of them) back with one click. Uploads that replace the original can't be undone.
* **WebP *or* AVIF** — choose the modern format you want. AVIF (newer, smaller) is offered
  automatically when your server supports it, with a safe fall back to WebP.
* **See your savings** — a built-in dashboard shows how much disk space you've saved, all
  calculated on-site.

= What it does =

* **Converts on upload** — JPG/JPEG and PNG uploads become WebP or AVIF automatically, and
  because the conversion happens before WordPress builds its sub-sizes, every thumbnail size
  is generated in the new format too.
* **Converts existing media** — a batch tool under **Media → Convert Existing** processes
  your library a few images at a time with a live progress bar (no timeouts).
* **Convert & restore from the Media Library** — convert or restore a single image right
  from its details (both list and grid view), or select several and use the Media-list bulk
  actions; roll back the whole library from the Tools page.
* **Resizes oversized images** — anything larger than your chosen longest-edge limit is
  scaled down (aspect ratio preserved); smaller images are never enlarged.
* **Never breaks an upload** — if anything goes wrong, or the server can't write the format,
  the original file is kept and the upload proceeds normally.

= Settings =

Under **Settings → Convert to WebP/AVIF**:

* **Enable conversion** — master on/off switch for upload-time conversion.
* **Output format** — WebP (broad support) or AVIF (smaller, when available).
* **Quality** — 1–100 (default 80). Lower means smaller files.
* **Max longest edge (px)** — default 1600. Set 0 to convert without resizing.
* **Keep original file** — affects new uploads only; off by default (the original is
  replaced). Turn on to keep both — and only then can an upload be restored later.
* **Convert these formats** — JPG/JPEG and PNG.

= Converting and restoring existing images =

Go to **Media → Convert Existing**. The page shows how many images still need converting,
how many can be restored, and your running savings total. Conversions run in safe batches.

Because bulk conversion **always keeps the original file on disk**, the change is never
destructive: use **Restore all to originals** on the Tools page, or the **Restore original**
row action on any converted item in the Media list (single images, or several at once via the
Media-list bulk actions), to delete the converted files and put the attachment back exactly
as it was. Uploads converted with **Keep original file** turned on are restorable the same
way; uploads that replaced their original cannot be undone.

= Privacy =

This plugin contacts **no external server**, collects no data, and adds no tracking. WebP
and AVIF are written by your own server's image library. Everything happens on your site.

== Installation ==

1. Upload the `designed2use-convert-to-webp` folder to `/wp-content/plugins/`, or install
   through **Plugins → Add New**.
2. Activate the plugin through the **Plugins** screen.
3. Go to **Settings → Convert to WebP/AVIF**, choose your output format, quality, and maximum
   edge (sensible defaults are set for you).
4. Upload an image as usual — it's stored in the modern format automatically.
5. To convert your existing library, open **Media → Convert Existing** and click
   **Convert existing images**.

== Frequently Asked Questions ==

= Does it send my images to a cloud service? =

No. Unlike many optimizers, this plugin does all conversion on your own server using
WordPress's built-in image editor. There are no external requests, accounts, or quotas.

= Can I undo a conversion? =

Yes — as long as the original is still on disk. Bulk conversion always keeps originals, and
uploads keep theirs when **Keep original file** is enabled. Use **Restore all to originals**
on the Tools page, the **Restore original** row action on any converted image, or the
Media-list bulk action for several at once. Restore deletes the converted files and puts the
attachment back to its original JPG/PNG, mime type, and thumbnails. Uploads that replaced
their original (the default) cannot be undone.

= WebP or AVIF — which should I choose? =

WebP has the broadest browser and host support and is the default. AVIF produces smaller
files and is offered when your server's image library can write it; if you select AVIF on a
server that can't, the plugin safely falls back to WebP.

= Does it convert images already in my Media Library? =

Yes — that's what **Media → Convert Existing** is for. It processes JPG/PNG attachments in
batches with a progress bar and updates the savings dashboard as it goes.

= Will my originals be deleted? =

Bulk conversion never deletes originals — that's what makes restore possible. For new
uploads, the original is replaced by default; turn on **Keep original file** to keep both,
which is also what makes an upload restorable later.

= Does it work on shared hosting? =

Yes, as long as the server's image library can write the chosen format — the Imagick PHP
extension, or GD with WebP/AVIF support. If it can't, the plugin shows a notice and leaves
your images untouched.

== Screenshots ==

1. Settings — output format (WebP/AVIF), quality, maximum edge, and format options.
2. Media -> Convert Existing — savings dashboard, batch converter, and restore controls.
3. Media -> Convert/Restore single image from media library.

== Changelog ==

= 1.0.0 =
* Initial release: private, on-server conversion of uploads and existing media to WebP or
  AVIF; resize-to-max-edge; convert and restore from the Media Library (row actions and bulk
  actions); one-click restore of a single image or the whole library — including uploads kept
  with "Keep original file"; and a local savings dashboard. No external services.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
