Skip to main content

GET /debug

Returns the current state of WordPress debug constants and error log metadata.
curl -X GET https://example.com/wp-json/wp-manager-pro/v1/debug \
  -H "X-WP-Nonce: YOUR_NONCE"

Response

wp_debug
boolean
Current value of the WP_DEBUG constant.
wp_debug_log
boolean
Current value of the WP_DEBUG_LOG constant.
wp_debug_display
boolean
Current value of the WP_DEBUG_DISPLAY constant.
savequeries
boolean
Current value of the SAVEQUERIES constant.
script_debug
boolean
Current value of the SCRIPT_DEBUG constant.
log_file
string
Absolute path to the detected error log file.
log_exists
boolean
Whether the error log file exists on disk.
log_size
integer
Error log file size in bytes. 0 if the file does not exist.
config_writable
boolean
Whether wp-config.php is writable, which is required for toggling constants.

POST /debug/toggle

Writes updated define() statements for the specified debug constants into wp-config.php. If a constant is not yet present in wp-config.php, it is inserted before the /* That's all, stop editing! */ marker.
This endpoint modifies wp-config.php directly. Ensure the file is writable and that you have a backup before making changes. The config_writable field from GET /debug tells you whether the file can be written.
curl -X POST https://example.com/wp-json/wp-manager-pro/v1/debug/toggle \
  -H "X-WP-Nonce: YOUR_NONCE" \
  -H "Content-Type: application/json" \
  -d '{"wp_debug": true, "wp_debug_log": true, "wp_debug_display": false, "savequeries": false, "script_debug": false}'

Parameters

wp_debug
boolean
Set WP_DEBUG to true or false.
wp_debug_log
boolean
Set WP_DEBUG_LOG to true or false. When true, errors are written to wp-content/debug.log.
wp_debug_display
boolean
Set WP_DEBUG_DISPLAY to true or false. When false, errors are hidden from page output.
savequeries
boolean
Set SAVEQUERIES to true or false. When true, database queries are saved for inspection.
script_debug
boolean
Set SCRIPT_DEBUG to true or false. When true, WordPress uses unminified versions of core CSS and JavaScript files.

Response

success
boolean
Always true on success.
message
string
Confirmation message.
wp_debug
boolean
New value of WP_DEBUG.
wp_debug_log
boolean
New value of WP_DEBUG_LOG.
wp_debug_display
boolean
New value of WP_DEBUG_DISPLAY.
savequeries
boolean
New value of SAVEQUERIES.
script_debug
boolean
New value of SCRIPT_DEBUG.

GET /debug/log

Reads the last N lines of the WordPress error log. Supports optional filtering by severity level.
curl -X GET "https://example.com/wp-json/wp-manager-pro/v1/debug/log?lines=500&level=error" \
  -H "X-WP-Nonce: YOUR_NONCE"

Parameters

lines
integer
Number of lines to return from the end of the log file. Defaults to 200.
level
string
Filter log output by severity. Accepted values: error, warning, notice, deprecated. When omitted, all lines are returned.

Response

exists
boolean
Whether the error log file was found on disk.
content
string
Log file content (last N lines, optionally filtered). Empty string if the file does not exist.
size
integer
Total log file size in bytes.
path
string
Absolute path to the log file.
lines
integer
The requested number of lines.
level
string
The level filter that was applied, if any.

DELETE /debug/log/clear

Clears the error log by truncating the file to zero bytes. Returns a success response even if the file does not exist.
curl -X DELETE https://example.com/wp-json/wp-manager-pro/v1/debug/log/clear \
  -H "X-WP-Nonce: YOUR_NONCE"

Response

success
boolean
Always true.
message
string
Confirmation message, or a note that the log file did not exist.

Build docs developers (and LLMs) love