Challenge - 5 Problems
WP_DEBUG Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🔧 Debug
intermediate2:00remaining
What happens when WP_DEBUG is set to true?
In a WordPress site, if you set
define('WP_DEBUG', true); in wp-config.php, what is the expected behavior?Attempts:
2 left
💡 Hint
Think about what debugging means and what showing errors helps with.
✗ Incorrect
Setting WP_DEBUG to true tells WordPress to show PHP errors and warnings on the site. This helps developers find and fix problems.
❓ component_behavior
intermediate2:00remaining
Effect of WP_DEBUG_DISPLAY set to false
If
WP_DEBUG is true but define('WP_DEBUG_DISPLAY', false); is also set, what will happen?Attempts:
2 left
💡 Hint
Think about separating error display from error logging.
✗ Incorrect
When WP_DEBUG_DISPLAY is false, errors are hidden from the site pages. They are neither logged nor shown unless WP_DEBUG_LOG is enabled.
📝 Syntax
advanced2:00remaining
Correct way to enable error logging in WordPress
Which code snippet correctly enables error logging to a file in WordPress?
Attempts:
2 left
💡 Hint
Both WP_DEBUG and WP_DEBUG_LOG must be true to log errors.
✗ Incorrect
To log errors, WP_DEBUG must be true and WP_DEBUG_LOG must also be true. This combination enables logging to wp-content/debug.log.
❓ state_output
advanced2:00remaining
What file stores logged errors when WP_DEBUG_LOG is true?
When
WP_DEBUG_LOG is set to true, where does WordPress save the error logs by default?Attempts:
2 left
💡 Hint
Think about the folder where WordPress stores content files.
✗ Incorrect
By default, WordPress saves error logs to wp-content/debug.log when WP_DEBUG_LOG is true.
🧠 Conceptual
expert2:00remaining
Why avoid enabling WP_DEBUG on a live site?
Why is it generally not recommended to have
WP_DEBUG set to true on a live WordPress site?Attempts:
2 left
💡 Hint
Think about what showing errors publicly might reveal.
✗ Incorrect
Enabling WP_DEBUG on a live site can show error messages to visitors, which might reveal sensitive information and create security risks.