WP Debug Toolkit 1.1.0 is LIVE. Get $300 discount on the lifetime deal now
Use Discount Code WPDTLTD

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.

Who it’s for

  • Developers building WordPress plugins or themes who want to debug and profile from the terminal
  • Users building with AI who need their LLM agent to diagnose performance issues or interact with WordPress APIs
  • LLM agents that need structured, machine-readable access to WordPress site data — all commands support --format=json

Commands

Debug and logging

Toggle 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

API discovery

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
...

Endpoint calling with profiling

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:

FlagWhat it captures
--profile or --profile=fullTiming, memory, full query analysis, PHP errors
--profile=queriesTiming, memory, query analysis (no PHP error capture)
--profile=summaryTiming, memory, query count only

Viewer management

Install and manage the standalone log viewer from the terminal:

wp dbtk viewer setup --password=MySecurePass123
wp dbtk viewer status
wp dbtk viewer remove
On this page
Try WP Debug Toolkit
The best error log viewer with amazing developer tools to help you troubleshoot your WordPress site securely and efficiently. Something something more.