=== Page Speed Culprit – Find What Slows LCP, FCP, CLS & TBT ===
Contributors: siteverostudio
Tags: page speed, core web vitals, performance, speed test, ai
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Find the exact plugin, file, line or server setting behind a low page speed score. Fix LCP, FCP, CLS and TBT yourself, or with any AI.

== Description ==

PageSpeed Insights tells you *what* is slow ("Render blocking requests", "Reduce unused JavaScript"). Page Speed Culprit tells you **who caused it and where**: the plugin or theme, the hooked function, the file and the line, with the code shown and highlighted, and plain steps to fix it yourself.

It is built for developers and site builders who need a good score before the client signs off, and who already tried "installing another cache plugin".

**Nothing on your site is changed.** Page Speed Culprit only finds and explains. You stay in control of every fix.

= What it finds =

* **Server and cache:** page cache not served to visitors (for example LiteSpeed Cache on a server that is not LiteSpeed), slow server response, a CDN that never caches HTML, missing compression, several cache plugins fighting each other, no object cache, large autoloaded options, WP-Cron on page visits, old PHP or OPcache off.
* **JavaScript:** render-blocking scripts by plugin, the same script loaded twice, broken async/defer quotes, large files, jQuery loaded twice, too much inline JavaScript.
* **CSS and fonts:** render-blocking stylesheets, too much CSS inside the HTML (with the share of each plugin), too many files, fonts without font-display, full icon libraries.
* **Printed code:** which hooked function printed what into the page head and footer, with its size, file and line.
* **Images:** the main (LCP) image lazy-loaded, several images preloaded for every screen size, images without width and height, heavy files, old formats.
* **Third-party:** every outside service with who added it, dead Universal Analytics (UA-) tags, reCAPTCHA on pages without a form.
* **PHP and database:** slow functions per plugin, outside API calls made while the page is built, slow and repeated queries with the file and line that ran them, very large pages.
* **In your browser (optional):** the real LCP element, layout shift culprits and the scripts that keep the browser busy (long animation frames), traced back to their plugin.

= Fix it with any AI, no API key =

Don't want to read every finding? Open the **Fix with AI** tab:

* **Copy prompt** or **Open ChatGPT / Claude / Gemini / Copilot.** The prompt teaches the AI how this plugin works (every tab and button), how to guide you (one short step at a time, with priority and risk) and what your scan found. Paste it into the chat. The AI tells you what to click or change, you paste back what you see, and it gives you the next step.
* **Download full report.** One Markdown file for mobile, desktop or both, with every finding, code excerpt, page and timing, and the time each plugin and theme costs on each page. Upload it to a paid AI plan or an AI coding tool for long tasks.
* Works with free AI chats and the AI built into your browser. The plugin sends nothing anywhere: you choose what to paste or upload, and secrets are masked.

= Made for developers =

* **Every file, line, hook, URL and image is clickable:** open it in the built-in read-only code viewer at the exact line, open it in VS Code, Cursor, PhpStorm or Sublime Text, copy the path, view or download the CSS/JS file.
* **Source chain for every finding:** Plugin › Hook › Function › File:line.
* **Copy for AI:** a ready prompt for ChatGPT, Claude, Gemini or any AI chat, split into parts that each fit a free chat. Secrets are always masked.
* **Sources table:** PHP time, database queries, CSS, JS, printed code, requests and render-blocking files per plugin and theme.
* **Snapshots:** pin a scan before you fix, scan again, compare, and download the comparison for your client.
* **Admin bar item:** issue count (or Google's score when PageSpeed Insights is connected) and "Scan this page" on every page.
* **Scheduled scans and email alerts:** pick the days; get an email only when something new and important appears.
* **Pause switch:** turn it off when you are not working on speed, without deleting it.
* **WP-CLI:** `wp psc scan`, `wp psc findings --format=json`, `wp psc queue run`, `wp psc pause`.
* **REST API** (`page-speed-culprit/v1`) and the `svpsc_checks` filter to add your own checks.

= Safe on any host, small or large =

A scan is a queue of small steps, never one long request. Each step stays inside your server's `max_execution_time` and `memory_limit`, saves its progress and continues in the next request. Large sites can scan "one page of each type" (6–15 pages that cover the whole site), a list of pages, or the sitemap in the background.

When it is not scanning, Page Speed Culprit adds no work for your visitors: on a normal page view it does one quick check and stops.

= Guides =

* [Minimum setup: your first scan in 5 minutes](https://siteverostudio.com/page-speed-culprit/docs/quick-start/)
* [Full guide](https://siteverostudio.com/page-speed-culprit/docs/)
* [Troubleshooting and every finding explained](https://siteverostudio.com/page-speed-culprit/docs/troubleshooting/)
* [Fix your site with AI](https://siteverostudio.com/page-speed-culprit/docs/ai-helper/)
* [Support forum](https://wordpress.org/support/plugin/page-speed-culprit/)

== Installation ==

1. Install and activate the plugin through the Plugins screen.
2. Open **Speed Culprit** in the admin menu.
3. Choose what to scan (this page, one page of each type, your list or the sitemap), choose Mobile or Desktop and press **Scan**.
4. Open **Findings**, start with the red ones, and follow "How to fix it yourself".
5. Optional: add your own free PageSpeed Insights API key under **Settings › Developer** to see Google's score next to the findings.

== Frequently Asked Questions ==

= Which plugin is slowing down my WordPress site? =

Run a scan and open the **Sources** tab. Every plugin, theme and outside service is listed with the server time, database queries, CSS, JavaScript and render-blocking files it adds, and the **Findings** tab shows the exact function, file and line.

= How do I increase my WordPress page speed score? =

Fix the findings from the top: Critical first, and server/cache problems before anything else. A slow or uncached server response delays every other metric, and no CSS or JavaScript optimisation can make up for it.

= How do I fix LCP, FCP, CLS and TBT in WordPress? =

Every finding says which metric it affects and which PageSpeed Insights warning it causes, and gives manual fix steps. The metric cards on the Overview link to the findings that slow each metric.

= Why is my score still low after installing a cache plugin? =

Often because the cache is not actually serving pages (for example the server type does not match the plugin), because a CDN passes every page to the server, or because two cache plugins conflict. The Server & Cache tab tests what logged-out visitors really get.

= Why does my score change on every test? =

PageSpeed Insights runs one test on a simulated slow phone and network, and every run differs a little. Page Speed Culprit measures in your own browser, which is faster than Google's test phone, and labels those numbers "your browser". Connect PageSpeed Insights to see Google's own numbers.

= Can I use ChatGPT, Claude or another AI to fix my site speed with this plugin? =

Yes. Run a scan, open **Fix with AI** and click **Open ChatGPT** (or Claude, Gemini, Copilot). The prompt is copied for you; paste it and the AI guides you step by step. For long tasks, download the full report and upload it to the AI. No API key or account is needed, and the plugin never sends your data anywhere.

= I fixed something but the result did not change. Is the plugin showing an old cache? =

No. Every scan builds the page fresh, and old results are never reused. To be sure, click **Clear all results** on the Overview; the dashboard empties and the next scan starts from zero. If the numbers still do not change, your visitors are probably getting an old copy from a cache: purge your cache plugin, your host's cache and Cloudflare (and any minified or combined files), then scan again.

= Does this plugin fix problems automatically? =

No. It shows you the exact cause and how to fix it, so you decide what changes. Nothing on your site is modified by a scan.

= Can it slow down my site? =

No. Scans run only when an administrator starts one or a scheduled scan is due, in small steps. Normal visitors never run the tracer, and you can pause the plugin at any time.

= Who can see the results? =

Administrators only (the `svpsc_manage` capability). Passwords, keys, salts and tokens are masked in every code view, header and AI prompt.

= Does it work with page builders and optimisation plugins? =

Yes. Files rebuilt by optimisation plugins (LiteSpeed Cache, WP Rocket, Autoptimize and others) and CSS generated by Elementor are recognised and labelled.

== External services ==

Page Speed Culprit connects to:

* **Your own site.** Scans request your pages from your server (loopback requests) to trace and time them, and the browser check loads your pages in your own browser.
* **Google PageSpeed Insights, only if you turn it on.** When you add your own API key and enable it in Settings › Developer, your browser sends the URL of the page being scanned and your key to `https://www.googleapis.com/pagespeedonline/v5/runPagespeed` when you scan. Google returns the performance score and audit results, which are stored in your site's database. Nothing is sent before you enable it. Google's [Terms of Service](https://policies.google.com/terms) and [Privacy Policy](https://policies.google.com/privacy) apply.

* **AI chat sites, only when you click.** The "Open ChatGPT", "Open Claude", "Open Gemini" and "Open Copilot" buttons on the Fix with AI screen copy a prompt to your clipboard and open `https://chatgpt.com/`, `https://claude.ai/`, `https://gemini.google.com/` or `https://copilot.microsoft.com/` in a new tab. Nothing is sent to these sites by the plugin: you decide whether to paste the prompt. Scheduled alert emails have "Ask ChatGPT" and "Ask Claude" links (`https://chatgpt.com/?q=…`, `https://claude.ai/new?q=…`) that carry a short summary of the problems found (titles, sources, costs and the pages they were found on; no server details or code), opened only if you click them. Their own terms and privacy policies apply: [OpenAI](https://openai.com/policies/), [Anthropic](https://www.anthropic.com/legal), [Google](https://policies.google.com/privacy), [Microsoft](https://privacy.microsoft.com/privacystatement).

No data is sent to SiteVero Studio. No outside scripts, fonts or images are loaded on the admin screens. Links to the plugin's documentation and to other SiteVero Studio plugins appear only inside the plugin's admin screen.

== Privacy ==

Scan results (URLs of scanned pages, script and style lists, timings, response headers with cookies masked, findings and, for the latest scans, the page HTML) are stored in your site's database. Old scans are deleted automatically (20 by default; pinned snapshots are kept). The plugin does not use cookies and does not track visitors.

Deactivating stops scheduled work and keeps all data. Deleting the plugin keeps the data too, unless you add `define( 'SVPSC_UNINSTALL_DELETE_DATA', true );` to wp-config.php before deleting it.

== Source code ==

The readable source of the admin screens is in `assets/src`, with `package.json` and `tsconfig.json`. Run `npm ci` and `npm run build` to rebuild `assets/build`.

== Changelog ==

= 1.0.0 =
* First release: server, cache, JavaScript, CSS, font, image, third-party, PHP and database checks with plugin/file/line attribution; time per plugin and theme on every page; server and load timelines; browser check; optional PageSpeed Insights; Fix with AI (guided prompt and full report for mobile, desktop or both); Copy for AI; Clear all results; snapshots and comparison; scheduled scans with email alerts; admin bar item; pause switch; WP-CLI and REST API.

== Upgrade Notice ==

= 1.0.0 =
First release.
