WP Performance Debugger
WP Performance Debugger is a WordPress plugin that analyzes your site's performance, identifies bottlenecks, and provides automated fixes to improve loading speeds.
by Your Name · github.com/divangrastogi/wp-performance-debugger · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/divangrastogi/wp-performance-debugger/archive/refs/heads/main.zipTransform your WordPress site's performance with intelligent analysis and automated optimization
WP Performance Debugger is a WordPress plugin that analyzes your site's performance, identifies bottlenecks, and provides automated fixes to improve loading speeds.
✨ Key Features
📊 Performance Analysis
- Real-time Monitoring: Tracks page load times, TTFB, DOM load times, database queries, and memory usage
- Database Profiling: Identifies slow queries and query execution times
- Plugin Profiling: Individual plugin load time measurement
- Hook Profiling: WordPress action/filter execution timing
- Template Profiling: Header/footer/sidebar rendering performance analysis
- API Monitoring: External API call tracking
- Shortcode Analysis: Custom shortcode execution profiling
- Function Profiling: WordPress core function timing
- Options Analysis: WordPress options performance analysis
- Cache Analysis: Caching configuration checking
- Timing Breakdown: Analysis of WordPress core, plugins, theme, and template processing times
🔧 Automated Optimization
- Database Cleanup: Remove post revisions, spam comments, and expired transients
- Asset Optimization: Enable lazy loading, defer JavaScript, and minify CSS/JS files
- Caching Setup: Configure object and page caching
- Performance Tuning: Reduce heartbeat frequency
📊 Admin Dashboard
- Performance Score: 0-100 rating with color-coded circular indicators
- Interactive Charts: Visual charts showing timing breakdowns and resource usage
- Issue Detection: Performance issues with recommendations
- One-Click Fixes: Apply optimizations directly from the dashboard
🔧 Automated Fixes
- Database Cleanup: Remove post revisions, spam comments, and expired transients
- Asset Optimization: Enable lazy loading and defer JavaScript
- Caching Setup: Configure object caching
- Performance Tuning: Reduce heartbeat frequency
- Asset Minification: Create minified CSS/JS versions
📈 Reporting
- Report Generation: Download performance reports
- WP-CLI Integration: Command-line scanning
📦 Installation & Setup
🎯 Quick Install
Option A: WordPress Admin (Easiest)
- Download
wp-performance-debugger.zip - Go to WordPress Admin → Plugins → Add New
- Upload the ZIP file and click "Install Now"
- Activate the plugin
- Navigate to Tools → Performance Debugger
Option B: Manual Upload
- Extract plugin files to
wp-content/plugins/wp-performance-debugger/ - Activate via WordPress Admin → Plugins
✅ System Requirements
| Component | Minimum | Recommended |
|---|---|---|
| WordPress | 5.8 | 6.0+ |
| PHP | 7.4 | 8.0+ |
| MySQL | 5.6 | 8.0+ |
| Memory | 128MB | 256MB+ |
| Disk Space | 5MB | 10MB+ |
🔧 Post-Installation Setup
- Visit Tools → Performance Debugger
- Enter a page URL to analyze (default is your home page)
- Click "🔍 Scan Now" for your first analysis
- Review the performance score and recommendations
- Apply safe fixes first (database cleanup, lazy loading)
- Re-scan to measure improvements
🚀 First Scan Checklist
- [ ] Plugin activated successfully
- [ ] Admin dashboard accessible
- [ ] "Scan Now" button works
- [ ] Performance score displays
- [ ] Charts load properly
- [ ] Issues are detected
- [ ] Fixes can be applied
🚀 Quick Start Guide
Step 1: Access the Dashboard
- Go to WordPress Admin → Tools → Performance Debugger
- You'll see the beautiful dashboard with performance metrics
Step 2: Run Your First Scan
- Enter a URL to scan (or use the default home page URL)
- Click the 🔍 Scan Now button
- Wait for the analysis to complete (usually 10-30 seconds)
- Review your Performance Score and detailed metrics
Step 3: Analyze Results
- Performance Score: Overall rating (0-100)
- Timing Breakdown: See where time is spent loading your site
- Issues Found: Critical, warning, and info-level problems
- Available Fixes: One-click optimizations
Step 4: Apply Fixes
- Review recommended fixes
- Click "Apply Fix" for each optimization
- Re-scan to see improvements
- Download before/after reports
📊 Understanding Your Results
Performance Score Ranges
- 80-100: 🟢 Excellent - Your site is performing well
- 60-79: 🟡 Good - Room for improvement
- 0-59: 🔴 Needs Work - Significant optimizations needed
Key Metrics Explained
- Load Time: Total time to load the page
- TTFB: Time to First Byte (server response time)
- DOM Load: Time for browser to parse and render content
- DB Queries: Number of database operations
- Memory Usage: PHP memory consumed
- Query Time: Time spent on database operations
Issue Severity Levels
- 🔴 Critical: Major performance problems requiring immediate attention
- 🟡 Warning: Moderate issues that should be addressed
- 🔵 Info: Suggestions for further optimization
🎯 Detailed Usage Guide
🖥️ Admin Dashboard Walkthrough
1. Dashboard Overview
The dashboard features a modern, intuitive interface with:
- Clean Interface: Distraction-free environment (other admin notices hidden)
- Header Section: Quick access to scan and report functions
- Performance Score: Visual circular indicator with overall rating
- Metrics Grid: Six key performance indicators with hover effects
- Charts Section: Interactive visualizations for timing breakdowns
- Issues & Fixes: Color-coded problems and one-click solutions
- Historical Data: Past scan results in a clean table format
2. Running a Performance Scan
- Click "🔍 Scan Now" in the header
- Watch the progress indicator
- Wait for analysis completion (10-30 seconds)
- Review the comprehensive results
3. Understanding the Metrics
- Load Time: How long your page takes to fully load
- TTFB: Server response time (ideal: < 600ms)
- DOM Load: Browser rendering time
- Database Queries: Number of DB operations (ideal: < 50)
- Memory Usage: PHP memory consumption
- Query Time: Database processing time
4. Detailed Analysis Tabs
The plugin provides comprehensive analysis through specialized tabs:
- Plugins Tab: Individual plugin load times and performance impact
- Hooks Tab: WordPress hook execution timing and call counts
- Queries Tab: Database query analysis with execution times
- APIs Tab: External API call monitoring and response times
- Options Tab: WordPress options analysis and autoload optimization
- Cache Tab: Caching configuration status and recommendations
5. Slow Components Section
Automatically identifies and highlights the slowest performing elements:
- Plugins taking >100ms to load
- Hooks with execution time >50ms
- Database queries >10ms
- API calls >1 second
4. Applying Fixes
- Scroll to "Available Fixes" section
- Review recommended optimizations
- Click "Apply Fix" for each item
- Some fixes require confirmation
- Re-scan to measure improvements
5. Generating Reports
- Click "📊 Download Report" after scanning
- Choose format: HTML (recommended), JSON, or CSV
- Reports include before/after comparisons for applied fixes
- HTML reports are interactive and shareable
💻 WP-CLI Commands
WP Performance Debugger includes command-line support:
Basic Scanning
# Scan homepage
wp performance scan
# Scan specific page
wp performance scan --url=https://example.com/about/
# Save results to database
wp performance scan --save
# Output in different formats
wp performance scan --format=json
wp performance scan --format=csv
📋 Best Practices
Regular Monitoring
- Scan weekly to catch performance degradation
- After plugin updates to ensure compatibility
- After theme changes to verify performance
- Before major traffic events to optimize for load
Optimization Workflow
- Baseline scan to establish current performance
- Apply safe fixes first (database cleanup, lazy loading)
- Re-scan to measure improvements
- Apply advanced fixes (minification, deferring)
- Monitor for any issues
- Generate reports for documentation
Performance Targets
- Load Time: < 3 seconds
- TTFB: < 600ms
- DB Queries: < 50 per page
- Memory Usage: < 64MB per page
- Performance Score: > 80/100
Requirements
- WordPress 5.8+
- PHP 7.4+
- MySQL 5.6+
Database Tables
The plugin creates two custom tables:
wp_performance_logs: Stores performance scan data and historical metricswp_performance_frontend_metrics: Stores Core Web Vitals and frontend performance data
Security
- All AJAX requests use WordPress nonces
- Admin-only access to performance data
- Sanitized inputs and escaped outputs
- No external API dependencies
Development
File Structure
wp-performance-debugger/
├── wp-performance-debugger.php # Main plugin file
├── README.md # Documentation
├── languages/ # Translation files
│ └── wp-performance-debugger.pot
├── admin/ # Admin interface
│ └── class-admin-page.php
├── includes/ # Core functionality
│ ├── class-wp-performance-debugger.php
│ ├── class-performance-manager.php
│ ├── class-performance-analyzer.php
│ ├── class-background-profiler.php
│ ├── class-alert-engine.php
│ ├── class-budget-tracker.php
│ ├── class-root-cause-analyzer.php
│ ├── class-performance-logger.php
│ ├── class-execution-trace.php
│ ├── class-component-profiler.php
│ ├── class-lifecycle-breakdown.php
│ ├── class-differential-scanner.php
│ ├── class-test-simulator.php
│ ├── class-heatmap-generator.php
│ ├── class-dependency-analyzer.php
│ ├── class-recommendation-engine.php
│ ├── class-frontend-metrics.php
│ ├── class-conflict-detector.php
│ ├── class-database-checker.php
│ ├── class-asset-checker.php
│ ├── class-plugin-profiler.php
│ ├── class-auto-fixer.php
│ ├── class-report-generator.php
│ ├── class-minifier.php
│ └── class-wp-cli-command.php
└── assets/ # CSS/JS resources
├── css/
│ └── admin.css
└── js/
└── admin.js
Hooks & Filters
Actions:
wp_performance_debugger_scan_complete: Fires after scan completionwp_performance_debugger_fix_applied: Fires after fix application
Filters:
wp_performance_debugger_scan_data: Modify scan data before storagewp_performance_debugger_available_fixes: Add custom fixes
❓ Troubleshooting & FAQ
Common Issues
Scan Fails or Times Out
- Cause: Server timeout or resource limits
- Solution: Increase PHP
max_execution_timeor reduce server load - Alternative: Use WP-CLI for scanning:
wp performance scan
Charts Don't Load
- Cause: JavaScript errors or CDN issues
- Solution: Check browser console, ensure Chart.js loads from CDN
- Fallback: All data is still available in text format
Fixes Don't Apply
- Cause: File permissions or server restrictions
- Solution: Check write permissions on
wp-content/uploads/ - Manual: Apply fixes manually if automated ones fail
High Memory Usage During Scan
- Cause: Large sites with many assets
- Solution: Increase PHP memory limit to 256MB
- Alternative: Scan individual pages instead of homepage
Frequently Asked Questions
Q: How often should I scan my site?
A: Weekly scans are recommended. Also scan after major updates, plugin installations, or traffic spikes.
Q: Will the fixes break my site?
A: Safe fixes (database cleanup, lazy loading) are very low risk. Advanced fixes (minification, deferring) are generally safe but monitor your site after applying.
Q: Can I undo applied fixes?
A: Some fixes can be reversed:
- Database cleanup cannot be undone
- Lazy loading can be disabled in settings
- Minified files can be deleted to restore originals
- Defer settings can be reverted
Q: Does this work with caching plugins?
A: Yes! It complements caching plugins and can detect if they're properly configured.
Q: Can I automate scanning?
A: Yes, use WP-CLI with cron jobs:
# Add to crontab for daily scanning
0 2 * * * cd /path/to/wordpress && wp performance scan --save
Q: What if my score is still low after fixes?
A: Consider:
- Upgrading hosting plan
- Optimizing images further
- Reducing plugin count
- Implementing CDN
- Code optimization by a developer
Performance Benchmarks
| Score Range | Performance Level | Action Required |
|---|---|---|
| 90-100 | Excellent | Monitor regularly |
| 80-89 | Very Good | Minor optimizations |
| 70-79 | Good | Apply recommended fixes |
| 60-69 | Fair | Address warning issues |
| 0-59 | Poor | Major optimization needed |
🔧 Advanced Configuration
Custom Fix Development
// Add custom fixes via filter
add_filter('wp_performance_debugger_available_fixes', function($fixes) {
$fixes['custom_fix'] = array(
'title' => 'Custom Optimization',
'description' => 'My custom performance fix',
'callback' => 'my_custom_fix_function',
'requires_confirmation' => true,
);
return $fixes;
});
Custom Metrics
// Hook into scan completion
add_action('wp_performance_debugger_scan_complete', function($scan_data) {
// Add custom metrics
$scan_data['custom_metric'] = my_custom_measurement();
});
Database Optimization
For large sites, consider:
- Regular database cleanup
- Index optimization
- Query monitoring
- Connection pooling
🤝 Contributing
We welcome contributions! Here's how to get involved:
Development Setup
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/wp-performance-debugger - Install development dependencies
- Create feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly
- Submit pull request
Code Standards
- Follow WordPress Coding Standards
- Use PHP 7.4+ syntax
- Include comprehensive documentation
- Add unit tests for new features
- Test on multiple WordPress versions
Reporting Issues
- Use GitHub Issues for bugs and feature requests
- Include WordPress version, PHP version, and error logs
- Describe steps to reproduce
- Attach relevant screenshots
📄 License
WP Performance Debugger is licensed under the GPL v2 or later.
Copyright (C) 2024 WP Performance Debugger Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
🆘 Support
Getting Help
- Documentation: Check this README first
- GitHub Issues: Search existing issues
- Community: WordPress.org support forums
- Professional: Contact for custom development
Support Resources
- 📖 Documentation: This comprehensive guide
- 🐛 Bug Reports: GitHub Issues
- 💬 Community: WordPress.org Forums
- 📧 Email: For business inquiries
📈 Changelog
Version 1.0.0
- 🚀 Initial Release: Core performance analysis and monitoring
- 📊 Performance Metrics: Load time, TTFB, database queries, memory usage
- 🔍 Component Profiling: Plugin, hook, template, API, and function profiling
- 🔧 Automated Fixes: Database cleanup, lazy loading, JS deferring, caching
- 📊 Admin Dashboard: Performance score and metrics display
- 💻 WP-CLI Integration: Command-line scanning
- 📄 Report Generation: Downloadable performance reports
📸 Screenshots & Interface
Dashboard Overview
The modern dashboard features:
- Gradient Header: Eye-catching design with quick action buttons
- Performance Score: Circular progress indicator with color coding
- Metrics Grid: Six key performance indicators with hover effects
- Interactive Charts: Pie and doughnut charts for data visualization
- Issue Management: Color-coded issue cards with severity indicators
- Fix Panel: One-click optimization buttons
Key Interface Elements
- 🎨 Modern Design: Gradients, shadows, and smooth animations
- 📱 Responsive: Works perfectly on desktop, tablet, and mobile
- 🎯 Intuitive: Clear icons, helpful tooltips, and logical flow
- ⚡ Fast: Optimized loading with minimal resource usage
- 🎪 Interactive: Hover effects, loading states, and progress indicators
Performance Score Guide
- 🟢 80-100: Excellent (green gradient)
- 🟡 60-79: Good (yellow/orange gradient)
- 🔴 0-59: Needs Improvement (red gradient)
🎉 Success Stories
"WP Performance Debugger helped us reduce our load time from 8 seconds to 2.3 seconds! The automated fixes were a game-changer." — Sarah M., E-commerce Store Owner
"The visual charts made it so easy to understand where our performance bottlenecks were. Highly recommend!" — Mike R., Blog Owner
"WP-CLI integration is perfect for our automated monitoring setup. Runs daily and alerts us to issues." — DevOps Team, Corporate Website
🌟 Why Choose WP Performance Debugger?
- ✅ Comprehensive: Covers all aspects of WordPress performance
- ✅ User-Friendly: Beautiful interface anyone can use
- ✅ Clean UI: Distraction-free dashboard (hides other admin notices)
- ✅ Automated: One-click fixes for common issues
- ✅ Professional: Enterprise-grade reporting and monitoring
- ✅ Flexible: WP-CLI, API, and manual options
- ✅ Safe: Non-destructive fixes with rollback options
- ✅ Fast: Lightweight with minimal performance impact
- ✅ Free: Open source with community support
Made with ❤️ for the WordPress community
Transform your slow WordPress site into a lightning-fast performance machine! ⚡
Ready to supercharge your WordPress performance? Get started now!