From 1d456706549ccf4f0cc867b8a17d1dceaabf8a77 Mon Sep 17 00:00:00 2001 From: "Marius L. J" Date: Sun, 28 Aug 2022 19:49:40 +0000 Subject: [PATCH] Site Health: Improve the fatal error handling text in multisite scenarios. The fatal error handler is responsible for providing a more user-friendly page to visitors if a site would normally encounter a fatal error, informing them of the next steps to access recovery mode (where applicable). Those next steps would be to check the email address for the site administrator, but this was only the case for single site installs; In a multisite scenario, no email is sent. This changes the text to account for that, still informing site administrators to check their email if it is a single site, but for multisite directing users to reach out to their site administrator for further assistance, so that they may take appropriate action. Props rkaiser0324, Clorith. Fixes #48929. git-svn-id: https://develop.svn.wordpress.org/trunk@53951 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-fatal-error-handler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-fatal-error-handler.php b/src/wp-includes/class-wp-fatal-error-handler.php index ca4bc8651e0b7..1fc5e0b968991 100644 --- a/src/wp-includes/class-wp-fatal-error-handler.php +++ b/src/wp-includes/class-wp-fatal-error-handler.php @@ -184,7 +184,11 @@ protected function display_default_error_template( $error, $handled ) { if ( true === $handled && wp_is_recovery_mode() ) { $message = __( 'There has been a critical error on this website, putting it in recovery mode. Please check the Themes and Plugins screens for more details. If you just installed or updated a theme or plugin, check the relevant page for that first.' ); } elseif ( is_protected_endpoint() && wp_recovery_mode()->is_initialized() ) { - $message = __( 'There has been a critical error on this website. Please check your site admin email inbox for instructions.' ); + if ( is_multisite() ) { + $message = __( 'There has been a critical error on this website. Please reach out to your site administrator, and inform them of this error for further assistance.' ); + } else { + $message = __( 'There has been a critical error on this website. Please check your site admin email inbox for instructions.' ); + } } else { $message = __( 'There has been a critical error on this website.' ); }