Skip to main content
KadiCache
Browse 37 Docs Guides & Search

Google PageSpeed Insights v5, CrUX Lab & Admin Speed Column

Encrypt your Google PageSpeed API key, benchmark Cached vs Uncached performance side by side, and inspect Mobile/Desktop scores inside Posts, Pages & WooCommerce Products with 0 SQL queries.

Integrations/PageSpeed/PageSpeedStore.phpIntegrations/PageSpeed/PageSpeedClient.phpIntegrations/PageSpeed/Distiller/LighthouseReportDistiller.phpAdmin/PostListSpeed.php
WP Admin -> KadiCache -> PageSpeed & CrUX Lab
MODULE 26 · 2X RETINA
Integrated PageSpeed Insights v5 & CrUX Lab compares Cached vs Uncached performance and maps opportunities directly to KadiCache controls.2880×1840 WebP
Quick Summary · 30-Second Operational SpecSource-Verified Guide
WP Admin Path
WP Admin -> KadiCache -> Core Web Vitals -> PageSpeed & CrUX Lab
Expected Outcome
Libsodium-Encrypted Key · 0-SQL Admin Speed Column · Cached vs Uncached Delta
Key Marker / Engine
PageSpeedStore.php | LighthouseReportDistiller.php | PostListSpeed.php
  • Encrypts your free Google PageSpeed Insights API key at rest (PageSpeedStore.php, kadicache_pagespeed_key_v1)—and supports KADICACHE_PAGESPEED_API_KEY in wp-config.php or Multisite network-wide sharing.
  • Runs official Google PageSpeed Insights v5 + 28-Day CrUX audits with optional Cached vs Uncached speedup comparison (PageSpeedBypass.php) and warm-before-scan protection.
  • LighthouseReportDistiller.php maps failing Lighthouse opportunities directly to the exact KadiCache toggle that fixes each audit—storing up to 30 distilled reports on disk (0 DB bloat).
  • PostListSpeed.php adds a 0-SQL-query Speed column to Posts, Pages, and WooCommerce Products tables showing Mobile/Desktop scores plus live RUM p75 LCP ratings.

Auditing Pages Right Inside WordPress Without Leaving Admin#

Copy-pasting URLs back and forth into pagespeed.web.dev—and trying to guess which WordPress setting fixes each Lighthouse warning—wastes hours every week for agency engineers and store owners. Worse, auditing a freshly edited post before its page cache is warm measures a cold PHP miss rather than what 99% of visitors actually receive!

KadiCache’s built-in PageSpeed & CrUX Lab (PageSpeedClient.php, PageSpeedStore.php, LighthouseReportDistiller.php, and PostListSpeed.php) brings official Google PageSpeed Insights API v5 and 28-day Chrome UX Report (CrUX) testing straight into WP Admin -> KadiCache -> Core Web Vitals—in 100% Free Core.

FIG 01Viewing 99 Mobile / 100 Desktop scores, Cached vs Uncached speedup deltas, and mapped KadiCache opportunity fixes inside WP Admin -> KadiCache -> Core Web VitalsZoom 2x

Step 1: Connecting & Encrypting Your Free Google PageSpeed API Key#

Google provides a 100% free PageSpeed Insights API key (25,000 queries/day quota) from Google Cloud Console. KadiCache supports three flexible ways to supply that key (PageSpeedStore::config()):

Configuration MethodHow to Set It UpBest For
1. WP Admin UI (Encrypted)Paste key in Core Web Vitals -> PageSpeed & CrUX Lab & click Verify & SaveSingle sites (encrypted at rest via sodium_crypto_secretbox + masked in UI)
2. wp-config.php Constantdefine('KADICACHE_PAGESPEED_API_KEY', 'AIzaSy...');Git/Bedrock deployments, CI/CD environments & agency starter stacks
3. Multisite Network KeySave once in Network Admin -> KadiCache -> Shared ConfigurationMultisite networks (PageSpeedStore::saveNetworkKey() shares quota cleanly across subsites)

When you click Verify & Save, KadiCache validates both Lighthouse v5 and CrUX API readiness (PageSpeedStore::saveCruxStatus()) and automatically tracks quota_backoff_until if Google ever returns HTTP 429.

Step 2: Running Warm Before Scan & Cached vs Uncached Comparisons#

Inside PageSpeed & CrUX Lab, two built-in engineering features eliminate misleading benchmark numbers:

  1. Automatic Warm-Before-Scan (warm_before_scan = true): Before calling Google’s remote Lighthouse servers, KadiCache performs a fast anonymous loopback warmup on the target URL so Google measures your warm cached HTML (X-KadiCache: HIT) rather than an accidental cold cache miss.
  2. With-vs-Without KadiCache Benchmark (compare_bypass via PageSpeedBypass.php): Toggle Compare Cached vs Uncached to benchmark your optimized page side-by-side against a signed, short-lived unoptimized baseline token. You get an instant before/after delta card (TTFB, FCP, LCP, TBT, CLS, and Performance Score gain) ready for client reports!
  3. Actionable Opportunity Mapping (LighthouseReportDistiller.php): Instead of dumping 4 MB of raw Lighthouse JSON into wp_options, LighthouseReportDistiller extracts scores, Core Web Vitals, LCP target element HTML/selector, and failing audits—linking each warning (Reduce unused CSS, Defer offscreen images, Eliminate render-blocking resources) directly to the KadiCache tab that solves it! Up to 30 distilled reports and 25 history snapshots are stored in flat files (PageSpeedFileRepository.php) with zero database table bloat.

Step 3: Using the Zero-SQL-Query Speed Column in Posts, Pages & Products (PostListSpeed.php)#

Once your API key or RUM collector is active, open WP Admin -> Posts, Pages, or Products (WooCommerce):

  • Zero Database Queries per Row: PostListSpeed::renderColumn() reads memoized score indexes (PageSpeedStore::scoreForUrl(), capped at 300 indexed URLs in memory) plus live RUM path summaries (RumStore::pathSummaryForUrl())—adding 0 SQL queries to WordPress admin list tables!
  • Smart Draft & Password Guards: Drafts and password-protected posts automatically display a muted Draft or Protected badge with an explanation tooltip instead of wasting API calls on non-public URLs.
  • 1-Click Row Re-Audit Modal: Hover any published post, page, or WooCommerce product and click Test Speed (or click its score badge) to open the Quick Speed Inspector modal and run a fresh Mobile + Desktop audit on the spot.
  • Custom Post Type Filter: Developers can customize which public post types display the Speed column via the kadicache_pagespeed_post_types PHP filter.
PHPOptional wp-config.php Key & Custom Post Type Column Filter
// 1. Define your PageSpeed API key in wp-config.php (optional)
define('KADICACHE_PAGESPEED_API_KEY', 'AIzaSyYourGoogleCloudKeyHere');

// 2. Limit the Admin Speed Column to Pages and WooCommerce Products (optional)
add_filter('kadicache_pagespeed_post_types', static function (array $types): array {
    return array_values(array_intersect($types, ['page', 'product']));
});

How Mapped Opportunity Cards Accelerate Client Reporting#

When an agency manages 25 client sites, translating raw Google Lighthouse JSON diagnostics into plain-English action items saves hours during monthly maintenance reviews:

  • Direct Audit-to-Setting Mapping: When LighthouseReportDistiller.php sees render-blocking-resources, unused-css-rules, offscreen-images, uses-webp-images, or server-response-time, each card links straight to the exact KadiCache control (CSS & JavaScript, Lazyload, Images, or Cache) rather than leaving editors to search Google.
  • Disk-Capped Report Retention (MAX_REPORTS = 30, MAX_HISTORY = 25): Stored inside KadiCache’s file repository (PageSpeedFileRepository.php) with exclusive file locking (PageSpeedStore::withLock()), historical score trends survive plugin updates without adding a single row to wp_postmeta.
  • MCP & Headless Audit Trigger (run_pagespeed_audit): You can also trigger Mobile and Desktop audits programmatically from Claude Code, Cursor, or KadiCache Pulse (compare_bypass: true) right after deploying a theme update.

Frequently Asked Operational Questions

Does Google charge money for a PageSpeed Insights API key?
No! The Google PageSpeed Insights API v5 and Chrome UX Report API are 100% free in Google Cloud Console with a generous default quota of 25,000 requests per day.
Is my PageSpeed API key exposed in browser JavaScript or exported settings JSON?
Never. PageSpeedStore encrypts the key at rest using Libsodium secretbox (showing only a masked preview in WP Admin), runs all Google API calls server-side in PHP, and strips API keys from exported settings JSON files.
Does the Speed column slow down WP Admin when viewing 100 WooCommerce products?
Zero slowdown. PostListSpeed reads a lightweight memoized file index once per admin screen load—executing 0 SQL queries whether your table displays 20 or 200 rows.
Why does CrUX field data say "Insufficient real-user data" on a brand-new domain?
Google’s public CrUX dataset only includes origins/URLs that cross Chrome’s monthly public traffic eligibility threshold. Until your new domain crosses that threshold in Google’s dataset, KadiCache’s built-in Cookieless RUM gives you immediate real-visitor p75 metrics from your very first visitor!
Can I schedule automatic weekly or daily homepage PageSpeed tracking?
Yes! PageSpeedStore supports off, weekly, and daily background audit schedules so your 25-run score history stays fresh automatically.
Gergis — Lead Systems & Cache Architect
Principal WordPress & Cloud Edge Architect
E-E-A-T Source Verified

Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.

apps/wordpress-plugin/src/Integrations/PageSpeed/PageSpeedStore.phpapps/wordpress-plugin/src/Integrations/PageSpeed/PageSpeedClient.phpapps/wordpress-plugin/src/Integrations/PageSpeed/Distiller/LighthouseReportDistiller.phpapps/wordpress-plugin/src/Admin/PostListSpeed.php
Was this engineering guide helpful?