0
0
Wordpressframework~20 mins

Debugging with WP_DEBUG in Wordpress - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
WP_DEBUG Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🔧 Debug
intermediate
2: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?
ANothing changes; WP_DEBUG has no effect.
BThe site will automatically fix all PHP errors.
CThe site will disable all plugins to prevent errors.
DPHP errors and warnings will be displayed on the site pages.
Attempts:
2 left
💡 Hint
Think about what debugging means and what showing errors helps with.
component_behavior
intermediate
2: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?
AErrors will be logged but not shown on the site pages.
BErrors will be shown on the site pages and logged.
CErrors will cause the site to crash immediately.
DErrors will be neither logged nor shown.
Attempts:
2 left
💡 Hint
Think about separating error display from error logging.
📝 Syntax
advanced
2:00remaining
Correct way to enable error logging in WordPress
Which code snippet correctly enables error logging to a file in WordPress?
A
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
B
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', 'false');
C
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', true);
Ddefine('WP_DEBUG_LOG', true);
Attempts:
2 left
💡 Hint
Both WP_DEBUG and WP_DEBUG_LOG must be true to log errors.
state_output
advanced
2: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?
Awp-content/uploads/error.log
Bwp-content/debug.log
Cwp-includes/error.log
Droot directory error.log
Attempts:
2 left
💡 Hint
Think about the folder where WordPress stores content files.
🧠 Conceptual
expert
2: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?
ABecause it automatically deletes all user data.
BBecause it disables all caching, slowing down the site.
CBecause it can expose sensitive error details to visitors, risking security.
DBecause it prevents plugins from updating.
Attempts:
2 left
💡 Hint
Think about what showing errors publicly might reveal.