IN PROGRESS
Technical summary
NEXUS plugin integrating Google PageSpeed Insights (v5 API) for web performance auditing: it runs Lighthouse on mobile/desktop, captures the 4 scores (Performance, A11y, Best Practices, SEO) and lab Core Web Vitals (LCP, CLS, TBT, SI, FCP, TTI), with 24h caching, run history, run comparison (performance/LCP delta) and URL enrichment in the Intelligence Hub.
Executed scope
backend.phpbackend (757 lines):PAGESPEED_API_BASE(Google runPagespeed v5),PAGESPEED_CACHE_TTL = 86400(24h),PAGESPEED_TIMEOUT = 90,PAGESPEED_CATEGORIES(performance, accessibility, best-practices, seo); config inDB::getConfig('pagespeed_settings')withapi_key,auto_enrich(default true) anddefault_strategy(default mobile).- Table:
pagespeed_install()createspagespeed_runs(id, url_norm VARCHAR(768), url_hash CHAR(32), strategy, status ok/error/quota/needs_api, score_perf/a11y/bp/seo, lcp_ms, cls DECIMAL(10,4), tbt/si/fcp/tti_ms, metrics_json/categories_json/summary_json LONGTEXT, http_code, error, from_cache, task_id, created_at; indexes idx_url_strategy + idx_created). - Lookup:
normalize_url()(https:// prefix, lowercase host),url_hash = md5(strategy|url), 24h cache per url_hash+strategy with ok status (forceparam bypasses cache); cURL request (90s timeout, 10s connect, SSL verify,Accept: application/json,NEXUS PageSpeed/1.0User-Agent). - Parsing: 0-100 scores per category; LCP, CLS, TBT, SI, FCP, TTI metrics (+ INP and max-potential-fid when present); lighthouseVersion, fetchTime and finalUrl persisted.
- Error classification: HTTP 429/rate/quota →
quotastatus; 403 "has not been used" →needs_api(no key); otherwise →errorwith message. - History:
pagespeed_history(page, limit ≤ 50, URL filter via mobile+desktop hash). - Comparison:
pagespeed_compareby IDs (a/b) or the last 2 OK runs for URL+strategy; score delta + LCP/TBT delta. - Connection test:
pagespeed_test_connectionprobes example.com (performance category); 429 without key → "API reachable, but anonymous quota exhausted". - Intelligence Hub:
pagespeed_intel_enrich(priority 48) —auto_enrichoff → empty;max_live_lookupsbudget (default 2, slice ≤ 5); summaryPSI <strategy> · perf=N · LCP=Xms · CLS=Y, severityclamp(5, 95, 100−perf); remaining URLs staypending. - API: 7 actions via
PluginManager::registerApiAction(pagespeed_stats, pagespeed_settings, pagespeed_settings_save, pagespeed_test_connection, pagespeed_lookup, pagespeed_history, pagespeed_compare) — session + CSRF;settings_savewithkeep_key(empty field keeps the current key). - Key security:
pagespeed_public_config()returns onlyapi_configured(bool),auto_enrichanddefault_strategy— the API key is never exposed to the frontend. - Alpine.js UI (
tab.php, 396 lines): Key OK / No Key badge, 4 stat cards (Runs, OK, Today, Avg Perf), Analyze tab (mobile/desktop, 4 scores color-coded ≥90/≥50/<50, Core Web Vitals cards), History (paginated table ID/URL/Strat/Perf/LCP/Status/When; click reloads in Analyze with cache), Compare (IDs or URL; Delta Perf card + LCP Δ) and Settings (API Key step-by-step, default strategy, auto-enrich toggle, Test connection). - Fastr
/pagespeed(fastr.json):arg_required=true,arg_key=url,pass_task_id=false→pagespeed_lookup. - No
cronjob.json— on-demand plugin with 24h local cache to absorb repeats.
Stack and tooling
- PHP 8 (no framework)
- MySQL 8 (config in admin_configs; pagespeed_runs table)
- Alpine.js + Tailwind CSS (premium light, emerald ring)
- NEXUS plugin system (PluginManager)
- cURL → Google PageSpeed Insights API v5 (runPagespeed)
Operational tags
- PageSpeed
- Lighthouse
- Core Web Vitals
- Performance
- SEO
Operational outcome
- Full audit in a single call: 4 scores + 6 lab Core Web Vitals per run, on mobile and desktop, with no browser extension required.
- 24h caching avoids quota burn: recent URLs are served from the table without hitting the API.
- Visible regression: comparing two runs (by IDs or the latest URL) shows the performance and LCP/TBT delta.
- Contextual Intelligence Hub: with auto-enrich on, task URLs gain
PSI <strategy> · perf · LCP · CLSsummaries and derived severity without leaving NEXUS.
GitHub progress (issues)
Real-time panel with latest repository issues.
live feed
open issues on GitHubcarregando andamento...
não foi possivel carregar as issues agora. abra no github pelo link acima.
Real results
NEXUS plugin integrating Google PageSpeed Insights (v5 API) for web performance auditing: runs Lighthouse on mobile/desktop, captures the 4 scores (Performance, A11y, Best Practices, SEO) and lab Core Web Vitals (LCP, CLS, TBT, SI, FCP, TTI), with 24h caching, run history, run comparison and Intelligence Hub enrichment.
Architecture and organization
- PHP 8
- MySQL 8
- Alpine.js
- Tailwind CSS
- Plugin NEXUS
Execution and operations
The project follows reproducible execution flow with technical validation in production-like environments.
Screenshots
Talk about this project
Apply this implementation pattern in your environment and accelerate delivery with technical consistency.