=== Bulk Image Compressor ===
Contributors: snehalpancholi
Tags: image compression, bulk compress, jpeg optimizer, png optimizer, media library
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 8.1
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Re-compress existing JPEG and PNG uploads at your chosen quality level using GD or Imagick, with a live progress bar and before/after size reporting.

== Description ==

**Bulk Image Compressor** lets you compress every JPEG and PNG already in your WordPress Media Library without touching your workflow. Pick a quality level, hit Start, and watch a live progress panel tell you exactly how many bytes each image lost.

**Key Features**

* **Batch processing** — compresses 5 images per request so even sites with thousands of images run smoothly without server timeouts.
* **Library choice** — use Imagick (strips EXIF/XMP metadata, progressive JPEG, better PNG zlib compression) or fall back to GD automatically.
* **Smart skip** — ignore files already compressed at the same quality level, and optionally skip files below a configurable size threshold.
* **Live progress** — animated progress bar with a per-image results table showing filename ID, before/after sizes, bytes saved, and a coloured status pill.
* **Stop anytime** — a Stop button halts the queue mid-run; re-running picks up from scratch.
* **Statistics dashboard** — three at-a-glance stat boxes: total JPEG/PNG count, already-compressed count, and cumulative bytes saved.
* **No originals deleted** — only the compressed file replaces the original; compression history meta is preserved on uninstall.

== Installation ==

1. Upload the `bulk-image-compressor` folder to the `/wp-content/plugins/` directory, or install it via the WordPress admin Plugins screen.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Media → Bulk Compressor** in the admin sidebar.
4. Adjust your preferred quality (default 82) and library settings, then click **Save Settings**.
5. Click **Start Compression** to begin processing your Media Library images.

== Frequently Asked Questions ==

= What is the difference between Imagick and GD? =

Imagick is a PHP extension that wraps the ImageMagick library. It generally produces smaller files than GD because it can strip EXIF/XMP/IPTC metadata and offers finer-grained control over JPEG progressive rendering and PNG zlib compression. GD is built into most PHP installations and is a reliable fallback when Imagick is unavailable. The "Auto" setting always prefers Imagick when available.

= What happens to my original images? =

The plugin overwrites the file in place — it does not create backup copies. If you need to preserve originals, take a full site backup before running a batch. Thumbnail files generated by WordPress are not recompressed; only the full-size uploaded file is processed (WordPress will regenerate thumbnails if you use a tool like "Regenerate Thumbnails" afterwards).

= Can I recompress images at a different quality later? =

Yes. If you change the quality setting and run compression again, the plugin will detect that the stored quality does not match the new setting and will recompress the images. If the quality has not changed, images marked as "already compressed" will be skipped automatically.

= Will this speed up my website? =

Smaller image files mean faster page loads and lower bandwidth costs, which can improve Core Web Vitals scores (especially Largest Contentful Paint). Gains vary depending on your original images, but typical JPEG savings with quality 82 range from 20–50%.

= Is it safe to stop mid-compression? =

Yes. Any image that was fully processed before you clicked Stop will retain its compressed state. The next time you start, the batch tool restarts from offset 0, but images already at the current quality setting will be skipped instantly (status: "Already optimised").

== Changelog ==

= 1.0.0 =
* Initial release.
* Batch compression for JPEG and PNG via Imagick or GD.
* Live progress bar and per-image results table.
* Settings: quality, library, skip-small threshold.
* Statistics panel: total images, compressed count, bytes saved.
* Update system integrated with AddonLogic update server.
