WPBench
Hardware-focused WordPress benchmarking plugin - the Geekbench of WordPress
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/parhamfa/wpbench/archive/refs/heads/main.zipWPBench - Hardware-Focused WordPress Benchmarking
WPBench is the Geekbench of WordPress — a reproducible, hardware-sensitive benchmark designed to help you compare CPU performance across different hosting environments.
Why WPBench?
WordPress requests run single-threaded. CPU performance matters. WPBench helps you:
- ⚡ Compare hardware objectively across VPS providers
- 📊 Measure real performance with reproducible benchmarks
- 🎯 Focus on what matters - single-thread PHP execution, not page size or CSS minification
- 🔧 Test accurately with proper warm-up, percentiles, and environment fingerprinting
Features
- Quick Test: Reproducible benchmark of core WordPress (bootstrap, queries, templates)
- URL Test: Real-world testing with your theme, plugins, and content
- Dual Drivers: WP-CLI (in-process) and HTTP (full-stack) modes
- Composite Scoring: Single WPBench Score for easy comparison
- Environment Fingerprinting: CPU, PHP, OPcache, database captured with each run
- Compare Results: Side-by-side with percentage deltas
- Export/Import: JSON for sharing across servers
- Full WP-CLI Support: Automation-ready
Installation
From WordPress Plugin Directory (Coming Soon)
- Go to Plugins > Add New
- Search for "WPBench"
- Click Install and Activate
From Source
git clone https://github.com/parhamfa/wpbench.git
cd wpbench
npm install
npm run build
Then upload to wp-content/plugins/ and activate.
Pre-built Release
Download the latest release and upload via WordPress admin.
Quick Start
Admin UI
- Navigate to WPBench in your WordPress admin
- Go to Quick Test tab
- Click Run Quick Test
- View your WPBench Score!
WP-CLI
# Run quick benchmark
wp wpbench quick --iterations=30
# Test specific URLs
wp wpbench urls --url="/" --url="/blog" --iterations=20
# Export results
wp wpbench quick --output=results.json --format=json
# Test from file
echo -e "/\n/blog\n/about" > urls.txt
wp wpbench urls --file=urls.txt --driver=http
Understanding Scores
WPBench Score formula:
Score = 1000 × (baseline_time / your_time)
- Score = 1000: Matches baseline hardware
- Score > 1000: Faster than baseline (better CPU)
- Score < 1000: Slower than baseline
Example: If you score 1500, your hardware is 50% faster than the baseline.
Benchmark Protocol
For accurate, comparable results:
✅ Keep OPcache enabled ✅ Run when server is idle (no traffic) ✅ Use consistent iterations ✅ Compare same test types ✅ Bypass caching for raw performance
❌ Don't compare HTTP vs WP-CLI ❌ Don't test during traffic ❌ Don't compare different test types
Use Cases
Comparing VPS Providers
- Deploy identical site to multiple providers
- Run same benchmark on each (e.g.,
wp wpbench quick --iterations=50) - Compare WPBench Scores
- Choose the provider with better CPU performance
Testing PHP Versions
# PHP 7.4
wp wpbench quick --iterations=30 --output=php74.json
# Upgrade to PHP 8.2
# ...
# PHP 8.2
wp wpbench quick --iterations=30 --output=php82.json
# Compare results in admin UI
Hardware Upgrade Validation
- Run benchmark:
wp wpbench quick --output=before.json - Upgrade CPU/hosting plan
- Run benchmark:
wp wpbench quick --output=after.json - Import both in admin to see improvement percentage
Architecture
- Single-threaded sequential execution
- High-res timing (hrtime/microtime fallback)
- CPU measurement via getrusage()
- Percentiles (P50/P95) calculated from samples
- Warm-up cycles before timed runs
- Environment guards for load and OPcache checks
API
REST Endpoints
POST /wp-json/wpbench/v1/test/quick
POST /wp-json/wpbench/v1/test/url
GET /wp-json/wpbench/v1/runs
GET /wp-json/wpbench/v1/runs/{id}
GET /wp-json/wpbench/v1/runs/{id}/export
POST /wp-json/wpbench/v1/import
GET /wp-json/wpbench/v1/settings
POST /wp-json/wpbench/v1/settings
PHP API
use WPBench\Engine\BenchmarkRunner;
$runner = new BenchmarkRunner();
// Quick test
$result = $runner->run_quick_test([
'iterations' => 30,
'driver' => 'wpcli',
]);
// URL test
$result = $runner->run_url_test(
['/', '/blog'],
['iterations' => 20, 'driver' => 'http']
);
Development
Requirements
- PHP 7.4+
- WordPress 6.1+
- Node.js 18+
- Composer (optional)
Setup
git clone https://github.com/parhamfa/wpbench.git
cd wpbench
npm install
composer install # optional
Build
# Development
npm start
# Production
npm run build
File Structure
wpbench/
├── wpbench.php # Main plugin file
├── includes/ # PHP classes
│ ├── Data/ # Database layer
│ ├── Engine/ # Benchmark engine
│ ├── Env/ # Environment fingerprinting
│ ├── Http/ # REST API & middleware
│ └── Cli/ # WP-CLI commands
├── admin/
│ └── assets/
│ └── src/ # React admin UI
├── composer.json
├── package.json
└── readme.txt # WordPress.org readme
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
FAQ
Q: Why do I need OPcache? A: Without OPcache, you're measuring PHP parsing, not execution. All production sites use OPcache, so benchmarks should too.
Q: Can I use this to find slow plugins? A: No. WPBench measures hardware, not code quality. Use profiling tools like Query Monitor for debugging.
Q: Should I test with caching enabled? A: For hardware comparison, use bypass cache mode. For "real world" tests, enable caching.
Q: Why can't I compare HTTP and WP-CLI results? A: They measure different things. HTTP includes web server overhead. Keep driver consistent when comparing.
Roadmap
- [ ] v1.1: Major cache plugin detection improvements
- [ ] v1.2: Optional anonymous leaderboard
- [ ] v1.3: Historical trending charts
- [ ] v2.0: Optional concurrent stress profiles
License
GPL-2.0-or-later
Credits
Built with:
Inspired by:
- Geekbench
- Industry-standard CPU benchmarking methodologies
Support
- Documentation: wpbench.com/docs
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ⚡ for the WordPress community