=== Optiq ===
Contributors: ikamal
Tags: media, webp, avif, svg, image optimization
Requires at least: 6.2
Tested up to: 7.0
Stable tag: 1.0.0
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Faster WordPress through smarter media — optimize, convert, and offload to the cloud.

== Description ==

Unoptimized images drag down your site speed, hurt Core Web Vitals, and drive visitors away. Optiq handles it all — automatically.

Upload any image and Optiq converts it to WebP or AVIF, cleans up unused files, and offloads everything to cloud storage. Your workflow stays exactly the same.

= What you get: =

* **Paste from anywhere** — Copy an image and paste it directly into the Media Library. No saving to desktop, no browsing folders.
* **Safe SVG uploads** — Enable SVG support with automatic sanitization. No security trade-offs.
* **Automatic WebP & AVIF** — Every upload generates next-gen formats. Smaller files, identical quality, better Core Web Vitals.
* **Find unused files** — The Unused Media Cleaner checks every file against all posts, pages, meta fields, and featured images. Review flagged files and delete with one click.
* **Bulk convert your library** — Run existing images through the same WebP and AVIF pipeline. Convert your entire media library in a single batch.
* **Offload to the cloud** — Store media on Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean Spaces, or MinIO. Serve from fast object storage, not your server.
* **Your originals stay safe** — Optiq never deletes your source files. Optimized versions live alongside your originals.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate Optiq from the Plugins menu.
3. Go to the Optiq menu in wp-admin to configure settings.

== Frequently Asked Questions ==

= Will Optiq delete my original images? =
No. Optiq generates optimized versions alongside your originals. Nothing gets removed unless you explicitly confirm.

= Is SVG upload safe? =
Yes. Every SVG file is sanitized before it reaches your server. No scripts, no vulnerabilities.

= How does the Unused Media Cleaner work? =
It cross-references your entire media library against posts, pages, meta fields, widgets, and featured images. Any file with zero references is flagged as "possibly unused." You review, you decide, you delete.

= Will it delete files automatically? =
Never. All deletions require your explicit confirmation. You stay in control.

== External Services ==

This plugin can optionally connect to third-party cloud storage services to offload your media files. This feature is **opt-in** and only activates when you enable Cloud Offload in Settings and configure a provider.

= Amazon S3 =
Used to store and serve media files from Amazon Web Services object storage.
* **What is sent:** Media file binary data, filename, and content-type on upload. File deletion requests when local copies are removed.
* **When:** Only when a media file is uploaded or deleted and Cloud Offload is enabled with S3 as the provider.
* Terms of Service: https://aws.amazon.com/service-terms/
* Privacy Policy: https://aws.amazon.com/privacy/

= Cloudflare R2 =
Used to store and serve media files from Cloudflare's S3-compatible object storage.
* **What is sent:** Media file binary data, filename, and content-type on upload.
* **When:** Only when a media file is uploaded or deleted and Cloud Offload is enabled with R2 as the provider.
* Terms of Service: https://www.cloudflare.com/terms/
* Privacy Policy: https://www.cloudflare.com/privacypolicy/

= Google Cloud Storage =
Used to store and serve media files from Google Cloud Platform object storage.
* **What is sent:** Media file binary data, filename, and content-type on upload.
* **When:** Only when a media file is uploaded or deleted and Cloud Offload is enabled with GCS as the provider.
* Terms of Service: https://cloud.google.com/terms/
* Privacy Policy: https://policies.google.com/privacy

= DigitalOcean Spaces =
Used to store and serve media files from DigitalOcean's S3-compatible object storage.
* **What is sent:** Media file binary data, filename, and content-type on upload.
* **When:** Only when a media file is uploaded or deleted and Cloud Offload is enabled with Spaces as the provider.
* Terms of Service: https://www.digitalocean.com/legal/terms-of-service-agreement/
* Privacy Policy: https://www.digitalocean.com/legal/privacy-policy/

= MinIO =
Used to store media files on a self-hosted or third-party MinIO instance configured by the site owner.
* **What is sent:** Media file binary data sent to the MinIO endpoint URL you configure.
* **When:** Only when a media file is uploaded or deleted and Cloud Offload is enabled with MinIO as the provider.
* Terms of Service / Privacy Policy: Depends on your MinIO host — review their policies.

No data is sent to any external service unless you explicitly enable and configure Cloud Offload.

== Screenshots ==

1. Settings panel.
2. Paste upload in action.
3. Unused Media Cleaner.

== Changelog ==

= 0.1.0 =
* Initial release.
* Paste upload support.
* SVG upload enable.
* WebP generation.
* Added Unused Media Cleaner feature.
* Improved detection for media usage across posts, meta, and widgets.

== Upgrade Notice ==

= 0.2.0 =
New Unused Media Cleaner to help you identify and remove unused media files.

= 0.1.0 =
First public version.
