=== BuildsByLuke Speed Autopsy – Cache & Minify Conflict Troubleshooter ===
Contributors: lukeaxiomflow
Tags: cache, minify, optimization, performance, troubleshooting
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

When a cache or minify setting silently breaks your CSS, JS or layout, it finds the exact setting that did it. Read-only, changes nothing.

== Description ==

**You turned on a speed plugin. Now your menu won't open, your checkout looks broken, or your fonts are gone — and you have no idea which setting did it.**

Cache and optimization plugins make sites faster by combining and minifying files, deferring and delaying JavaScript, removing "unused" CSS, and lazy-loading images. When it works, it's great. When it breaks something, it breaks *silently* — and the settings that caused it are buried across dozens of checkboxes. Even the plugins' own "safe mode" just turns whole categories off and leaves you to bisect the rest by hand.

Speed Autopsy is the post-mortem. It finds what your optimizer broke, **names the setting responsible**, and tells you how to fix it — without touching a single setting itself.

= What it does =

* **Detects your active cache/optimization plugins** (LiteSpeed Cache, WP Rocket, Autoptimize, W3 Total Cache, SiteGround Optimizer, WP-Optimize, Perfmatters, FlyingPress, WP Fastest Cache) and reads — never changes — their current settings.
* **Confirms real breakage.** It fetches your own pages and checks whether the combined and minified files your optimizer generates actually load. A combined stylesheet or script that is **missing or empty** is the single most common catastrophic failure — your page requests a file that isn't there, so its styles or scripts silently vanish. Speed Autopsy catches exactly this.
* **Names the risky setting.** It cross-references the settings you have enabled against a knowledge base of known-breakage patterns — Remove Unused CSS breaking dropdowns and cart drawers, Combine JavaScript killing sliders and menus, Delay JavaScript stopping the checkout, lazy-load hiding slider images — and tells you the symptom to look for and the exact setting to change.
* **Gives you a clear verdict**: confirmed breakage, risky settings enabled, or all clear.

= Strictly read-only, by design =

Speed Autopsy **never** changes a setting, deactivates a plugin, clears a cache, or modifies your site in any way. It reads and it fetches — that's all. Every fix it suggests is for **you** to apply, in control, when you're ready. A diagnostic you can trust must never be a hand on the controls.

= Also included, free =

* Scan the pages you choose — the front page always, plus your shop, cart and key landing pages (the ones where breakage actually costs money)
* Weekly automatic scan + an email when new issues appear
* Findings report with severity, plain-language symptom and fix, and dismiss-with-note
* Site Health integration
* WP-CLI: `wp speed-autopsy scan` / `status`, including `--format=json`
* A REST status endpoint (`spau/v1/status`, administrators only) with the verdict and open findings as JSON, for your own dashboards and tooling
* An honest loopback self-check: if your host blocks self-requests, Speed Autopsy says "scan impaired" — it never pretends everything is fine

= Speed Autopsy Pro =

**[Pro](https://buildsbyluke.com/plugins/speed-autopsy)** adds the runtime layer a server-side scan can't see, plus agency tools: an **opt-in, admin-only JavaScript-error collector** that catches the actual errors and failed asset loads hit in the browser while testing — correlated to the deferred or combined script that caused them — **Slack and webhook alerts** when a scan finds new breakage, and a **white-label client report** (print / save as PDF). Sold and licensed through Freemius (see "External services").

= This is a diagnostic, not a fixer =

Speed Autopsy does not speed up your site, does not change your optimizer, and cannot guarantee a fix — it tells you, in plain language, what your optimizer appears to have broken and what to change. You stay in control of every change.

== External services ==

**The scan contacts nothing external.** Speed Autopsy fetches **this site's own pages and its own optimizer-generated asset files** from your own server (loopback requests). Asset files served from a different host (a CDN) are reported as "not checked" and are never fetched. Redirects are not followed by the HTTP layer: Speed Autopsy resolves each hop itself and re-checks the destination against your site address before requesting it, so a URL of yours that redirects off-site is stopped and reported rather than followed. Findings stay in your database. No third-party crawler, API, or CDN is involved, and nothing about your site is transmitted anywhere.

**Freemius (freemius.com), who sell and license the Pro version**

Freemius is contacted in four situations, each one something you click — never in the background:

1. **If you opt in on the activation screen** (or start a trial / activate a licence): your site URL, WordPress and PHP versions, and the activating account's email are sent to api.freemius.com. Skipping the opt-in is a first-class choice and the plugin is fully functional without it.
2. **If you open the "Upgrade" page**: your own server asks api.freemius.com for current plan prices, sending your site URL. The page loads no third-party scripts — everything it renders is served from this plugin's own folder. The payment SDK's bundled pricing script used to inject Google Analytics and a remote checkout script into wp-admin; this build removes both (see "Source code").
3. **If you open the "Contact Us" page** (Freemius's hosted support form, wp.freemius.com): the link carries your site URL and WordPress login URL.
4. **If you click a plan to buy**: you go to Freemius's hosted checkout (checkout.freemius.com), which receives your site URL, name, WordPress and PHP versions, and administrator email (pre-filled). Freemius is the merchant of record; their checkout loads its own third-party scripts (Stripe, PayPal, Google Tag Manager, Freemius's own). If you never click a plan, none of it loads.

Terms: https://freemius.com/terms/ — Privacy: https://freemius.com/privacy/

In Pro, the runtime collector POSTs errors **only to this site's own REST endpoint**, and Slack/webhook alerts POST **only to endpoint URLs you enter yourself**.

== Source code ==

This plugin's own PHP and JavaScript are unminified and readable in the plugin folder. The one exception is the third-party payment SDK in `vendor/freemius/`, which ships pre-minified; its source and build tooling are public:

* Freemius WordPress SDK: https://github.com/Freemius/wordpress-sdk
* The pricing screen at `vendor/freemius/assets/js/pricing/freemius-pricing.js`: https://github.com/Freemius/pricing-page

This plugin ships four deliberate modifications to that SDK (all in `assets/js/pricing/freemius-pricing.js`, all removing remote references from wp-admin): the `appendScripts()` method is emptied (it injected Google Analytics + checkout.js), the GA pageview tracker is stubbed out, the remote loader GIF is replaced with an inline data-URI, and testimonial photos are forced to the bundled placeholder. Three carry a "Speed Autopsy:" comment at the patch site.

== Known limitations ==

* **Loopback-blocked hosts.** If your server can't fetch its own pages (password protection, firewall, some local setups), the page/asset scan can't run. Speed Autopsy detects this and shows "scan impaired" — it never reports a false all-clear. Optimizer settings are still checked.
* **CDN-served assets.** Files rewritten to a CDN host are reported as "not checked" rather than fetched, to keep Speed Autopsy's outbound requests to your own server only.
* **Off-site redirects.** If one of your own URLs redirects to a different host, Speed Autopsy stops at the redirect and reports it instead of following it — a page in that state is reported as unreachable, an asset as "not checked". Its requests never leave your own server, so a file that only exists on the far side of such a redirect cannot be verified.
* **Runtime-only breakage.** A server-side fetch sees the HTML and whether files load, but does not execute JavaScript, so it can't observe a script that loads fine but errors at runtime. That's what the Pro runtime collector is for.

== Frequently Asked Questions ==

= Will it change my cache settings or clear my cache? =

No. Speed Autopsy is strictly read-only. It reads your optimizer's settings and fetches your pages; it never writes a setting, clears a cache, or deactivates anything. Every fix it suggests is for you to apply.

= How is this different from my cache plugin's "safe mode"? =

Safe mode turns whole categories of optimization off and leaves you to work out which specific setting was the problem. Speed Autopsy keeps everything on and tells you which individual setting is the likely culprit, with the symptom and the fix — and confirms real breakage by checking that your combined files actually load.

= Which cache/optimization plugins does it support? =

LiteSpeed Cache, WP Rocket, Autoptimize, W3 Total Cache, SiteGround Optimizer, WP-Optimize, Perfmatters, FlyingPress and WP Fastest Cache. It detects any of them that are active and reads the settings it understands; a couple store settings in a form it can't read, in which case it relies on the page/asset scan.

= It says a combined file is missing — what does that mean? =

Your optimizer combined several scripts or stylesheets into one cached file, but that file returns an error or is empty. Your pages ask for it, so the styles or scripts it should contain never load. Clearing your optimizer's cache usually rebuilds it; if it keeps failing, exclude the offending file from combination.

= Does it slow my site down? =

No. Scans run on demand or weekly via WP-Cron, fetch your own pages with a strict time budget, and store compact findings. Nothing runs on your visitors' page loads.

== Screenshots ==

1. The report: the verdict, the risky settings, and the confirmed breakage — with the fix for each
2. Settings
3. Site Health integration

== Changelog ==

= 1.1.1 =
* Initial public release.

== Upgrade Notice ==

= 1.1.1 =
First public release.
