Automatically audit and fix all critical Lighthouse performance issues in a single HTML file β no config needed.
You built a beautiful 3D product page. You open Lighthouse. Score: 42/100. You spend 4 hours hunting down: excess font weights, render-blocking scripts, missing preconnect, lazy-loaded hero images, broken JSON-LD schemas...
python web_performance_surgeon.py index.html --fix| Issue | Detection | Auto-Fix |
|---|---|---|
| Excess font weights (>3) | β | β Reduces to 400;600;700 |
Render-blocking <script> in <head> |
β | β
Moves to </body> |
Missing preconnect + dns-prefetch |
β | β Injects for all domains |
Hero image lazy loaded |
β | β
Sets eager + fetchpriority=high |
| Corrupted JSON-LD schema | β | β Report only (use json-ld-guardian) |
git clone https://github.com/tanphan1105/web-performance-surgeon.git
cd web-performance-surgeon
# Audit only (no changes)
python web_performance_surgeon.py path/to/index.html
# Audit + auto-fix
python web_performance_surgeon.py path/to/index.html --fixUsed on a B2B industrial 3D model landing page (model-viewer + 21 product cards):
- Font requests: 8 β 4 files (-50%)
- Render-blocking scripts: 1 β 0
- Estimated LCP improvement: ~800ms
"Stop guessing. Measure first. Fix surgically."
If this tool saved you hours of Lighthouse debugging, consider buying me a coffee. It fuels the continuous development of these SEO and performance tools!