WP Debug Toolkit Pro includes a WP-CLI integration under the wp dbtk command group. It provides terminal access to debug settings, query logging, REST API discovery, endpoint calling with performance profiling, and standalone viewer management.
--format=jsonToggle WordPress debug constants and manage logs without editing wp-config.php:
$ wp dbtk debug status
Setting Value
WP_DEBUG ON
WP_DEBUG_LOG ON
WP_DEBUG_DISPLAY OFF
SAVEQUERIES OFF
Enhanced logging OFF
Log path /path/to/wp-content/debug.log
wp dbtk debug on # Enable WP_DEBUG + WP_DEBUG_LOG
wp dbtk debug off # Disable all debug constants
wp dbtk query-log on # Enable database query logging
wp dbtk query-log stats # Show log file size and entry count
wp dbtk log clear # Clear the debug.log file
Scan and search all registered REST routes across plugins, themes, and WordPress core:
$ wp dbtk api discover
Success: Discovered 690 routes across 17 sources.
$ wp dbtk api search "product" --format=table
Source Route Methods Description
wc /wc/v3/products GET, POST
wc /wc/v3/products/(?P<id>[\d]+) GET, POST, PUT, PATCH, DELETE
wc /wc/v3/products/categories GET, POST
wc /wc/v3/products/(?P<product_id>[\d]+)/variations GET, POST
...
Call any REST endpoint and optionally profile its performance. The --profile flag adds execution time, memory usage, query count, duplicate detection, and per-plugin attribution:
$ wp dbtk api call GET /wc/v3/products --params='{"per_page":3}' --profile
{
"status": 200,
"data": [ ... ],
"headers": {
"X-WP-Total": 20,
"X-WP-TotalPages": 7
},
"profile": {
"execution_time_ms": 19.63,
"memory": {
"delta_mb": 0.18,
"peak_mb": 117.79
},
"queries": {
"total": 22,
"slow": 0,
"duplicates": 12,
"by_type": { "SELECT": 22 },
"total_time_ms": 18.67,
"by_component": {
"wordpress-core": 19,
"woocommerce": 3
},
"slowest": []
},
"php_errors": []
}
}
Three profiling modes are available:
| Flag | What it captures |
|---|---|
--profile or --profile=full | Timing, memory, full query analysis, PHP errors |
--profile=queries | Timing, memory, query analysis (no PHP error capture) |
--profile=summary | Timing, memory, query count only |
Install and manage the standalone log viewer from the terminal:
wp dbtk viewer setup --password=MySecurePass123
wp dbtk viewer status
wp dbtk viewer remove