=== KushalPawar Performance Optimizer ===
Contributors: kushaldeepakpawar
Tags: performance, image optimization, lazy load, cache, webp
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

Automatic image compression, WebP, lazy loading, script optimization, and page caching. Make your WordPress site faster in one click.

== Description ==

**KushalPawar Performance Optimizer** makes your WordPress site faster automatically — no tuning required. Activate it and it starts compressing images, lazy-loading off-screen media, deferring render-blocking scripts, and caching your pages. Everything runs locally on your own server, and the plugin never sends any data anywhere.

= Features =

* **Automatic image compression** — every new upload is compressed (JPEG/PNG) with a configurable 60–95% quality slider. 85% is visually lossless for most photos.
* **WebP conversion with fallback** — generates modern WebP copies and serves them via a `<picture>` element, falling back to the original for browsers that don't support WebP. Works for content images, featured images, and responsive `srcset` variants.
* **Bulk media optimization** — one click compresses your entire existing media library, with a live progress bar.
* **Lazy loading** — adds `loading="lazy"` to images and iframes, while keeping your first images eager so above-the-fold content stays instant.
* **Script optimization** — adds `defer` to non-critical scripts and loads non-critical CSS asynchronously, with a safe-mode exclusion list for scripts that should not be deferred.
* **Inline CSS minification** — strips comments and whitespace from inline style blocks.
* **Page caching** — a fast file-based cache for anonymous visitors, stored in `wp-content/cache/kushalpawar-performance-optimizer/`, with smart invalidation on content, comment, theme, and plugin changes.
* **Speed score dashboard widget** — shows an estimated before/after load time, image weight saved, images optimized, and cache hit rate. Calculated locally — no external API call.
* **Native settings UI** — a clean tabbed screen under Settings → KushalPawar Performance Optimizer, built with WordPress admin components and vanilla JavaScript.

== Installation ==

1. Upload the `kushalpawar-performance-optimizer` folder to the `/wp-content/plugins/` directory, **or** install it directly from **Plugins → Add New** in your WordPress dashboard.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → KushalPawar Performance Optimizer** to configure modules. Sensible defaults are applied automatically, so the plugin starts optimizing immediately.
4. (Optional) On the **Images** tab, click **Start bulk optimization** to compress images you've already uploaded.

== Frequently Asked Questions ==

= Will compressing my images reduce their quality? =

Not visibly. The default quality of 85% is what most photographers consider visually lossless. You can raise it toward 95% for maximum fidelity or lower it toward 60% for the smallest files using the quality slider on the Images tab.

= Does the plugin keep the original images? =

Compression of the displayed sizes happens in place to save disk space, which is what most users want. WebP copies are generated as separate `.webp` files alongside the originals, so the source format is always preserved for the fallback.

= My site uses a plugin that breaks when scripts are deferred. What do I do? =

Add the offending script's handle to the **Do-not-defer list** on the Scripts tab (one handle per line). The plugin already excludes jQuery and the block editor runtime by default, so script optimization never has to be all-or-nothing.

= Is the page cache compatible with WooCommerce? =

Yes. The plugin automatically skips caching for logged-in users, commenters, requests with query strings, and WooCommerce cart, checkout, and account pages. You can exclude additional URLs on the Caching tab.

= Does the plugin send any of my data to a third party? =

No. KushalPawar Performance Optimizer performs all of its work on your own server and never contacts any external service. It collects no personal data and phones home to nothing.

= Which image library does the plugin use? =

It automatically uses Imagick if your host provides it (better quality and metadata stripping), and falls back to PHP's GD library otherwise. The Settings → General tab shows which one is active on your server.

= Where are cached files stored, and how do I clear them? =

Cached HTML lives in `wp-content/cache/kushalpawar-performance-optimizer/`. The cache clears itself automatically when you publish or edit content, receive a comment, switch themes, or change a plugin. You can also clear it manually with the **Clear cache now** button on the General tab.

== Screenshots ==

1. The settings screen — a tabbed interface (General, Images, Scripts, Caching) built with native WordPress admin components.
2. Bulk media-library optimization with a live progress bar.
3. The Images tab with the quality slider and WebP toggle.
4. The Speed Score dashboard widget showing estimated before/after load time and total savings.

== Changelog ==

= 1.0.0 =
* Initial release.
* Automatic JPEG/PNG compression on upload with a 60–95% quality slider.
* WebP generation and `<picture>` fallback serving for content images, featured images, and responsive srcset variants.
* Bulk media-library optimization with AJAX progress.
* Lazy loading for images and iframes with above-the-fold skipping.
* Script deferral and async CSS with a user-managed exclusion list.
* Inline CSS minification.
* File-based page caching with automatic invalidation.
* Speed score dashboard widget.

== Upgrade Notice ==

= 1.0.0 =
First public release of KushalPawar Performance Optimizer.
