=== WP-Speed ===
Contributors: cloudwebi
Tags: cache, performance, minify, lazyload, pagespeed
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.4.26
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

License-free WordPress performance: page cache, file optimization, media, preload, database cleanup, CDN, and MCP. No tracking, no upsells.

== Description ==

WP-Speed is an original performance plugin. It covers page cache, browser cache, minify, delay JS, lazyload, preload, database cleanup, CDN CNAME, and Varnish/Cloudflare purge, without a license key or phone-home.

On activation it turns on the safe defaults (page cache, browser cache, GZIP, minify CSS, font optimization, lazy rendering, cache preload). JavaScript transforms stay off until you opt in, because those are what break sites.

= Included =

* PageSpeed Insights in the dashboard (mobile + desktop, Core Web Vitals, fix links)
* Image optimizer: compress on upload, WebP/AVIF sidecars, resize, strip metadata, PNG→JPEG, bulk library
* Disk page cache via `advanced-cache.php`
* Mobile cache, optional separate mobile files, optional logged-in user cache
* WebP/AVIF cache variants
* Cache lifespan + ignored marketing query strings
* WooCommerce cart/checkout/account exclusions
* Apache browser cache + GZIP/Brotli
* Minify CSS/JS, defer JS, delay JS until interaction
* Local unused-CSS pass (no SaaS)
* Google Fonts combine + optional local hosting
* LazyLoad images/iframes, YouTube preview, image dimensions
* Critical image skip (first N images get fetchpriority=high) plus LCP image preload
* content-visibility lazy rendering
* Sitemap/homepage cache preload
* Speculation Rules (prefetch or prerender) on WordPress 6.8+
* DNS prefetch / preconnect
* Database cleanup + schedule
* CDN CNAME rewrite
* Heartbeat control, Varnish, Cloudflare, Sucuri
* Lean WordPress: emoji, embeds, dashicons, jQuery Migrate, Woo cart fragments
* Local insights score (nothing sent off-site)
* REST API for cache, settings, and insights
* WP-CLI: `wp speed purge|preload|cleanup|settings|insights`
* Import/export, per-page “never cache” metabox, admin-bar clear cache

= Built in-house =

WP-Speed is original CloudWebi code. No license server, no paid CDN upsell, and no off-site performance SaaS.

== Installation ==

1. Upload the `WP-Speed` folder to `/wp-content/plugins/`
2. Activate through the Plugins screen
3. Open Settings → WP-Speed
4. Disable any other page-cache plugin first
5. Use Safe preset in production; test Power on staging

== Frequently Asked Questions ==

= Will this conflict with another page cache plugin? =

Yes. Turn off any other page cache or image optimizer before activating WP-Speed.

= Does unused CSS use a remote service? =

No. It is a conservative local pass on same-origin stylesheets.

= How does MCP work? =

Create an application password and call `/wp-json/wp-speed/v1/*`. Updates require `confirm=true`.

== Changelog ==

= 1.4.26 =
* Compress and resize the original JPEG or PNG on upload when the new file is smaller. WebP and AVIF are still written beside it.

= 1.4.25 =
* Preload now queues in the background. Each tick fetches a couple of URLs so Cloudflare does not return 502.

= 1.4.24 =
* CSS background images on divs and Elementor overlays get WebP/AVIF when a sidecar exists. Below-the-fold backgrounds lazy-load. Heroes stay eager.

= 1.4.23 =
* Do not cache 404 pages or files such as /llms.txt. A cached HTML 404 at that URL made PageSpeed Agentic Browsing report 2/3 instead of 2/2.

= 1.4.22 =
* Guest HTML loads front.js from the cache folder, so a WordPress wp-speed-1 install no longer appears in the page source.

= 1.4.21 =
* Combine leftover CSS into one file instead of many render-blocking sheets. Hold GSAP/Lenis until after first paint. One LCP fetchpriority. Image width/height on missing tags.

= 1.4.20 =
* Admin sidebar icon uses the same grey as Pages and Comments instead of black on the dark menu.

= 1.4.19 =
* Cap inlined CSS at 20 KB. Extra Elementor widget sheets load after paint. Preload only one LCP image.

= 1.4.18 =
* Every settings checkbox and button now saves that tab first, keeps missing fields, and shows a notice after redirect. UA and minify-JS exclusions are on the form.

= 1.4.17 =
* Google Lighthouse rules run on every site: vendor patterns plus URLs from that site's own PageSpeed run. Apply safe Google fixes on the PageSpeed tab.

= 1.4.16 =
* Drop Elementor Font Awesome (all.min.css and v4-shims) on pages with no fa-* icon classes. Pages that do use icons get a subset inlined.

= 1.4.15 =
* Hold reCAPTCHA, Google Analytics, Translate, and AdaBundle until a real tap or click. They no longer load on scroll or an 8-second timer, so PageSpeed unused-JS should drop those files.

= 1.4.14 =
* Minify CSS is on by default. Small stylesheets (including the child-theme hero CSS) are minified and inlined so PageSpeed no longer downloads the raw file.

= 1.4.13 =
* Delay the AdaBundle widget until the visitor interacts so its ES5 polyfills stay off the first paint.

= 1.4.12 =
* Shorten critical request chains: one combined CSS block, preload woff2, defer Elementor/GSAP/Lenis, delay reCAPTCHA, drop duplicate preconnects.

= 1.4.11 =
* LCP: seed JS hero collage images in the HTML, preload them, fetchpriority=high, never loading=lazy.

= 1.4.10 =
* font-display: swap on local @font-face (Poppins and other self-hosted fonts).

= 1.4.9 =
* Browser cache 1 year for images and fonts. Sets Cloudflare Browser Cache TTL when credentials are saved.

= 1.4.8 =
* Fix render-blocking CSS: inline files under 32 KB, async font/icon stylesheets, defer jQuery Migrate.

= 1.4.7 =
* Responsive srcset: write 480w and 640w copies and add srcset/sizes so project cards do not download a 716px image.

= 1.4.6 =
* Red alert at the top when another cache, file, or image optimization plugin is active.

= 1.4.5 =
* Event log drops rows older than 30 days (on view, on write, and daily cron).

= 1.4.4 =
* Drop-in warning is a real Write drop-in now button at the top of every WP-Speed screen.

= 1.4.3 =
* Drop-in check says missing or owned by another plugin, instead of claiming it is in place. Write drop-in button on the dashboard.

= 1.4.2 =
* Optimize never overwrites or deletes the original image. Only WebP/AVIF (and optional JPEG copies) are added beside it.

= 1.4.1 =
* Event log records button clicks, cache/Cloudflare work, and errors. Copy, download as text, or email.

= 1.4.0 =
* Admin bar: Clear Cache All Pages and Clear Cache This Page. Deletes the HTML files, then rebuilds them.

= 1.3.9 =
* Do not wrap logos in picture tags. Next-gen sources are added only when the sidecar file exists.

= 1.3.8 =
* Cloudflare API lives on the CDN tab. Saving a page purges that URL on Cloudflare, not the whole zone.

= 1.3.7 =
* Image savings show in KB. WebP/AVIF smaller than the original now count toward Saved.

= 1.3.6 =
* Same-site prefetch is one /* rule. Skip list uses path patterns instead of every menu URL.

= 1.3.5 =
* PageSpeed card no longer shows a large dash when the site has not been tested.

= 1.3.4 =
* Auto detect lists safe-to-prefetch pages and skipped links with the reason.

= 1.3.3 =
* Image log shows two-decimal sizes so 4.12 MB to 3.90 MB is visible. Unchanged originals say original kept.

= 1.3.2 =
* One-batch image optimize no longer calls wp-cron through Cloudflare, uses smaller passes, and shows a clear error if the proxy times out.

= 1.3.1 =
* Dashboard card buttons sit on one baseline at the bottom of each card.

= 1.3.0 =
* Local health score has Optimize: applies safe setup for this site and skips file transforms that break builders and checkout.

= 1.2.9 =
* Admin menu and admin-bar icons are black and white like the rest of WordPress.

= 1.2.8 =
* Database tab shows table fragmentation and can rebuild indexes (InnoDB recreate or MyISAM OPTIMIZE).

= 1.2.7 =
* Preload tab can auto detect fonts, preconnect/DNS hosts, and same-site URLs from the public homepage.

= 1.2.6 =
* Images tab runs optimize in the background and logs each file, URL, and size from / to.

= 1.2.5 =
* PageSpeed Insights runs in the admin browser (their IP and key). The WordPress server never calls Google.

= 1.2.4 =
* PageSpeed quota and API errors no longer show Google project or consumer IDs.

= 1.2.3 =
* Safer image compression: keep ICC color profiles, never replace a file that grew, skip tiny logos, map WebP/AVIF quality separately, preload the LCP image.

= 1.2.2 =
* Optimize every Media Library upload immediately; write WebP/AVIF on upload and create missing sidecars when an image is displayed.

= 1.2.1 =
* Write HTML cache as the page is generated; purge and rebuild on content, CSS/JS, theme/plugin, Customizer, and Elementor updates.

= 1.2.0 =
* PageSpeed Insights inside the plugin: mobile/desktop scores, CWV, opportunities mapped to WP-Speed settings.

= 1.1.0 =
* Image optimizer: upload compress, WebP/AVIF, max dimensions, bulk, media column, REST/CLI.

= 1.0.0 =
* First release.
