Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/soare-robert-daniel/wp-sql-query-report/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
SQL Analyzer
WordPress plugin to analyze SQL queries with EXPLAIN plans and export reports for LLM optimization.
Requirements
- WordPress 6.7+, PHP 7.4+, MySQL 5.6+ (MySQL 8.0+ for EXPLAIN ANALYZE)
Install
- Upload
simple-sql-query-analyzerfolder to/wp-content/plugins/ - Activate in WordPress admin
- Go to Tools > SQL Analyzer
Development Setup
npm install && composer install
npm run build
Commands
npm run build # Production build
npm run build:watch # Dev watch mode
npm run lint # Lint JS/TS
composer lint # Check PHP standards
composer lint:fix # Auto-fix PHP
composer phpstan # Static analysis
Usage
- Enter a SELECT query
- Click "Analyze"
- View EXPLAIN results and table structure
- Export to LLM via copy/download
REST API
POST /wp-json/simple-sql-query-analyzer/v1/analyze
{
"queries": [{ "id": "1", "label": "My Query", "query": "SELECT ..." }],
"include_analyze": false
}
Requires: WordPress REST nonce + manage_options capability
Troubleshooting
| Problem | Solution |
|---|---|
| "Query contains invalid SQL" | Only SELECT queries allowed |
| EXPLAIN ANALYZE unavailable | Requires MySQL 8.0.18+ |
| Assets not loading | Run npm run build |