Make WordPress Core


Ignore:
Timestamp:
03/21/2019 09:52:07 PM (6 years ago)
Author:
flixos90
Message:

Bootstrap/Load: Introduce a recovery mode for fixing fatal errors.

Using the new fatal handler introduced in [44962], an email is sent to the admin when a fatal error occurs. This email includes a secret link to enter recovery mode. When clicked, the link will be validated and on success a cookie will be placed on the client, enabling recovery mode for that user. This functionality is executed early before plugins and themes are loaded, in order to be unaffected by potential fatal errors these might be causing.

When in recovery mode, broken plugins and themes will be paused for that client, so that they are able to access the admin backend despite of these errors. They are notified about the broken extensions and the errors caused, and can then decide whether they would like to temporarily deactivate the extension or fix the problem and resume the extension.

A link in the admin bar allows the client to exit recovery mode.

Props timothyblynjacobs, afragen, flixos90, nerrad, miss_jwo, schlessera, spacedmonkey, swissspidy.
Fixes #46130, #44458.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r44962 r44973  
    1818// Include files required for initialization.
    1919require( ABSPATH . WPINC . '/load.php' );
     20require( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' );
    2021require( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' );
     22require( ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php' );
     23require( ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php' );
     24require( ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php' );
     25require( ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php' );
     26require( ABSPATH . WPINC . '/class-wp-recovery-mode.php' );
    2127require( ABSPATH . WPINC . '/error-protection.php' );
    2228require( ABSPATH . WPINC . '/default-constants.php' );
     
    346352register_theme_directory( get_theme_root() );
    347353
     354if ( ! is_multisite() ) {
     355    // Handle users requesting a recovery mode link and initiating recovery mode.
     356    wp_recovery_mode()->initialize();
     357}
     358
    348359// Load active plugins.
    349360foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
Note: See TracChangeset for help on using the changeset viewer.