WordPress.org

Make WordPress Core

Changeset 45268


Ignore:
Timestamp:
04/25/2019 12:46:39 AM (2 years ago)
Author:
pento
Message:

Bootstrap/Load: Tweak the recovery mode email text and behaviour.

  • Change the recovery mode link expiry to 1 day.
  • Improve the email text.
  • Add a new recovery_email_support_info filter, for hosts to be able to customise their support contact information.

Props pento, chanthaboune, michelleweber, matt.
Fixes #46898.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-recovery-mode-email-service.php

    r45181 r45268  
    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,
    127 
    128 Your site recently crashed and may not be working as expected.
     136            'Howdy!
     137
     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.
    131 
    132 This link expires in ###EXPIRES###.
    133 
    134 ###LINK### ###DETAILS###
    135 
    136 --The WordPress Team
    137 https://wordpress.org/
    138 '
     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.
     145
     146###LINK###
     147
     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.
     149
     150###DETAILS###'
    139151        );
    140152        $message = str_replace(
     
    144156                '###CAUSE###',
    145157                '###DETAILS###',
     158                '###SITEURL###',
     159                '###PAGEURL###',
     160                '###SUPPORT###',
    146161            ),
    147162            array(
     
    150165                $cause ? "\n{$cause}\n" : "\n",
    151166                $details,
     167                home_url( '/' ),
     168                home_url( $_SERVER['REQUEST_URI'] ),
     169                $support,
    152170            ),
    153171            $message
     
    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;
     
    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'] );
     
    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
  • trunk/src/wp-includes/class-wp-recovery-mode.php

    r45238 r45268  
    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
Note: See TracChangeset for help on using the changeset viewer.