Make WordPress Core

Ticket #46898: 46898.6.diff

File 46898.6.diff, 4.0 KB (added by pento, 5 years ago)
  • src/wp-includes/class-wp-recovery-mode-email-service.php

    diff --git a/src/wp-includes/class-wp-recovery-mode-email-service.php b/src/wp-includes/class-wp-recovery-mode-email-service.php
    index 82bca75f17..24e904277f 100644
    a b final class WP_Recovery_Mode_Email_Service { 
    122122                        $details = '';
    123123                }
    124124
     125                /**
     126                 * Filters the support message sent with the the fatal error protection email.
     127                 *
     128                 * @since 5.2.0
     129                 *
     130                 * @param $message string The Message to include in the email.
     131                 */
     132                $support = apply_filters( 'recovery_email_support_info', __( 'Please contact your host for assistance with investigating this issue further.' ) );
     133
     134                /* translators: Do not translate LINK, EXPIRES, CAUSE, DETAILS, SITEURL, PAGEURL, SUPPORT: those are placeholders. */
    125135                $message = __(
    126                         'Howdy,
     136                        'Howdy!
    127137
    128 Your site recently crashed and may not be working as expected.
     138Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
    129139###CAUSE###
    130 Please click the link below to initiate recovery mode and fix the problem.
     140First, visit your website (###SITEURL###) and check for any visible issues. Next, visit the page where the error was caught (###PAGEURL###) and check for any visible issues.
     141
     142###SUPPORT###
     143
     144If your site appears broken and you can\'t access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further.
    131145
    132 This link expires in ###EXPIRES###.
     146###LINK###
    133147
    134 ###LINK### ###DETAILS###
     148To keep your site safe, this link will expire in ###EXPIRES###. Don\'t worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
    135149
    136 --The WordPress Team
    137 https://wordpress.org/
    138 '
     150###DETAILS###'
    139151                );
    140152                $message = str_replace(
    141153                        array(
    https://wordpress.org/ 
    143155                                '###EXPIRES###',
    144156                                '###CAUSE###',
    145157                                '###DETAILS###',
     158                                '###SITEURL###',
     159                                '###PAGEURL###',
     160                                '###SUPPORT###',
    146161                        ),
    147162                        array(
    148163                                $url,
    149164                                human_time_diff( time() + $rate_limit ),
    150165                                $cause ? "\n{$cause}\n" : "\n",
    151166                                $details,
     167                                home_url( '/' ),
     168                                home_url( $_SERVER['REQUEST_URI'] ),
     169                                $support,
    152170                        ),
    153171                        $message
    154172                );
    https://wordpress.org/ 
    224242                                $name = $plugins[ "{$extension['slug']}/{$extension['slug']}.php" ]['Name'];
    225243                        } else {
    226244                                foreach ( $plugins as $file => $plugin_data ) {
    227                                         if ( 0 === strpos( $file, "{$extension['slug']}/" ) ) {
     245                                        if ( 0 === strpos( $file, "{$extension['slug']}/" ) || $file === $extension['slug'] ) {
    228246                                                $name = $plugin_data['Name'];
    229247                                                break;
    230248                                        }
    https://wordpress.org/ 
    236254                        }
    237255
    238256                        /* translators: %s: plugin name */
    239                         $cause = sprintf( __( 'This was caused by the following plugin: %s.' ), $name );
     257                        $cause = sprintf( __( 'In this case, WordPress caught an error with one of your plugins, %s.' ), $name );
    240258                } else {
    241259                        $theme = wp_get_theme( $extension['slug'] );
    242260                        $name  = $theme->exists() ? $theme->display( 'Name' ) : $extension['slug'];
    243261
    244262                        /* translators: %s: theme name */
    245                         $cause = sprintf( __( 'This was caused by the following theme: %s.' ), $name );
     263                        $cause = sprintf( __( 'In this case, WordPress caught an error with your theme, %s.' ), $name );
    246264                }
    247265
    248266                return $cause;
  • src/wp-includes/class-wp-recovery-mode.php

    diff --git a/src/wp-includes/class-wp-recovery-mode.php b/src/wp-includes/class-wp-recovery-mode.php
    index fc38afdb54..31d33d38fe 100644
    a b class WP_Recovery_Mode { 
    299299                 *
    300300                 * @since 5.2.0
    301301                 *
    302                  * @param int $rate_limit Time to wait in seconds. Defaults to 4 hours.
     302                 * @param int $rate_limit Time to wait in seconds. Defaults to 1 day.
    303303                 */
    304                 return apply_filters( 'recovery_mode_email_rate_limit', 4 * HOUR_IN_SECONDS );
     304                return apply_filters( 'recovery_mode_email_rate_limit', DAY_IN_SECONDS );
    305305        }
    306306
    307307        /**