Fast, zero-dependency WordPress performance analyzer that catches critical issues before they crash your site.
Versioning: See
dist/README.mdfor the current released version. The version in the dist README (and the main bash script header) is the canonical source of truth.
WordPress sites fail in production because of performance antipatterns that slip through code review:
- π₯ Unbounded queries (
posts_per_page => -1) that fetch 50,000 posts and crash the server - π N+1 query patterns that turn 1 request into 1,000 database calls
- π₯ Missing capability checks that let subscribers delete your entire site
- π Insecure deserialization that opens remote code execution vulnerabilities
- π§² Debug code in production (
var_dump,console.log) that exposes sensitive data
WP Code Check catches these issues in seconds β before they reach production.
| Feature | WP Code Check | WPCS | PHPStan-WP |
|---|---|---|---|
| Zero dependencies | β Bash + grep only | β Requires PHP, Composer | β Requires PHP, Composer |
| Runs anywhere | β Local, CI/CD, any OS | ||
| WordPress-specific | β WP performance focus | ||
| Speed | β Scans 10K files in <5s | ||
| Production-tested | β Real-world patterns | β Industry standard | β Type-focused |
# Clone the repository
git clone https://github.com/Hypercart-Dev-Tools/WP-Code-Check.git
cd WP-Code-Check
# Run against your WordPress plugin/theme
./dist/bin/check-performance.sh --paths /path/to/your/pluginβββ CRITICAL CHECKS (will fail build) βββ
βΈ Unbounded posts_per_page [CRITICAL]
β FAILED
./includes/query-helpers.php:45: 'posts_per_page' => -1
βΈ Debug code in production [CRITICAL]
β FAILED
./admin/js/admin.js:293: debugger;
βββ SUMMARY βββ
Errors: 2
Warnings: 0
β Check failed with 2 error(s)
- Critical: Unbounded queries, insecure deserialization, localStorage sensitive data, client-side serialization, direct database queries without $wpdb->prepare()
- High: Direct superglobal manipulation, unsanitized superglobal read, admin functions without capability checks, WooCommerce N+1 patterns, AJAX without nonce validation, unbounded SQL, expensive WP functions in polling
- Medium: N+1 patterns, transients without expiration, HTTP requests without timeout, unsafe RegExp construction, PHP short tags, WooCommerce Subscriptions queries without limits
- Low: Timezone-sensitive patterns
See full check list.
# Human-readable text (default)
./dist/bin/check-performance.sh --paths .
# JSON for CI/CD integration
./dist/bin/check-performance.sh --paths . --format json
# Auto-generated HTML reports
# Opens in browser automatically (local development)Manage technical debt in legacy codebases:
# Generate baseline from current state
./dist/bin/check-performance.sh --paths . --generate-baseline
# Future scans only report NEW issues
./dist/bin/check-performance.sh --paths .Save scan configurations for frequently-checked projects:
# Create template
./dist/bin/run my-plugin
# Reuse template
./dist/bin/run my-pluginSee HOWTO-TEMPLATES.md for details.
name: WP Code Check
on: [push, pull_request]
jobs:
performance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run WP Code Check
run: |
git clone https://github.com/Hypercart-Dev-Tools/WP-Code-Check.git
./WP-Code-Check/dist/bin/check-performance.sh --paths . --format jsonwp-code-check:
script:
- git clone https://github.com/Hypercart-Dev-Tools/WP-Code-Check.git
- ./WP-Code-Check/dist/bin/check-performance.sh --paths . --format json- User Guide - Complete command reference and examples (includes canonical version number)
- Template Guide - Project template system
- Changelog - Version history and development progress
- AI Agent Guide - WordPress development guidelines for AI assistants
# Basic scan
./dist/bin/check-performance.sh --paths /path/to/plugin
# JSON output for CI/CD
./dist/bin/check-performance.sh --paths . --format json
# Strict mode (warnings fail the build)
./dist/bin/check-performance.sh --paths . --strict
# Generate baseline for legacy code
./dist/bin/check-performance.sh --paths . --generate-baseline
# Verbose output (show all findings)
./dist/bin/check-performance.sh --paths . --verbose
# Disable logging
./dist/bin/check-performance.sh --paths . --no-logWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
Note: Contributors must sign a Contributor License Agreement (CLA) before their first pull request can be merged. This is a one-time process that ensures legal clarity for the dual-license model.
WP Code Check is dual-licensed:
The core tool is licensed under the Apache License 2.0, which means:
- β Free for everyone - Use for personal or commercial projects
- β Modify and distribute - Fork, customize, and share
- β Patent protection - Includes explicit patent grant
- β No restrictions - Use in proprietary software
See LICENSE for full terms.
For organizations that need priority support, advanced features, or SLA guarantees, we offer commercial licenses:
- π― Priority Support - Guaranteed response times, dedicated channels
- π Advanced Features - Custom rules, white-label reports, team collaboration
- π’ Enterprise Features - SSO, audit logs, on-premise deployment
- π Service Level Agreements - Uptime guarantees and compliance support
See LICENSE-COMMERCIAL.md for details and pricing.
Contact: noel@hypercart.io
WP Code Check is developed by Hypercart, a DBA of Neochrome, Inc.
- π Website: WPCodeCheck.com
- π§ Support: noel@hypercart.io
- π Issues: GitHub Issues
Made with β€οΈ for the WordPress community