Make WordPress Core


Ignore:
Timestamp:
03/21/2019 09:52:07 PM (5 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/tests/phpunit/tests/user/capabilities.php

    r44717 r44973  
    102102            'switch_themes'          => array( 'administrator' ),
    103103            'edit_dashboard'         => array( 'administrator' ),
     104            'resume_plugins'         => array( 'administrator' ),
     105            'resume_themes'          => array( 'administrator' ),
    104106
    105107            'moderate_comments'      => array( 'administrator', 'editor' ),
     
    182184            'switch_themes'          => array( 'administrator' ),
    183185            'edit_dashboard'         => array( 'administrator' ),
     186            'resume_plugins'         => array( 'administrator' ),
     187            'resume_themes'          => array( 'administrator' ),
    184188
    185189            'moderate_comments'      => array( 'administrator', 'editor' ),
     
    393397            $actual['author'],
    394398            $actual['subscriber'],
    395             $actual['contributor']
     399            $actual['contributor'],
     400            // the following two are granted via `user_has_cap`:
     401            $actual['resume_plugins'],
     402            $actual['resume_themes']
    396403        );
    397404
     
    455462            $expected['activate_plugin'],
    456463            $expected['deactivate_plugin'],
     464            $expected['resume_plugin'],
     465            $expected['resume_theme'],
    457466            $expected['remove_user'],
    458467            $expected['promote_user'],
Note: See TracChangeset for help on using the changeset viewer.