Recovery Mode in WordPress
Recovery Mode was introduced in WordPress 5.2 version.
If the Recovery Mode is enabled, it will display an error message rather than a white screen when a plugin causes a fatal error.
PHP error messages and White screens are not displayed to users any more after WordPress 5.2. But there is a way to enable it in a development environment.
We can control disable the fatal error handler and recovery mode using WP_DISABLE_FATAL_ERROR_HANDLER in wp-config.php file.
How to disable the Recovery Mode?
To enable WP_DEBUG_DISPLAY, disable recovery mode by setting WP_DISABLE_FATAL_ERROR_HANDLER constant true.
This is how you can do it in WordPress version before 5.2:
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
define( 'WP_DEBUG_DISPLAY', true );
This is how you can do it in WordPress version 5.2 and later:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
How to check the Recovery Mode status?
You can check the status for the fatal error handler (Recovery Mode) by using wp_is_fatal_error_handler_enabled() function.
debug disable error handler WP_DEBUG_DISPLAY wp-config