[wp-trac] [WordPress Trac] #44458: Catch WSODs and provide a means for recovery for end users
WordPress Trac
noreply at wordpress.org
Wed Jan 9 20:05:00 UTC 2019
#44458: Catch WSODs and provide a means for recovery for end users
-------------------------------------------------+-------------------------
Reporter: schlessera | Owner: flixos90
Type: task (blessed) | Status: closed
Priority: normal | Milestone: 5.1
Component: Bootstrap/Load | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch needs-testing servehappy | Focuses: multisite
needs-dev-note |
-------------------------------------------------+-------------------------
Changes (by flixos90):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"44524" 44524]:
{{{
#!CommitTicketReference repository="" revision="44524"
Bootstrap/Load: Introduce fatal error recovery mechanism allowing users to
still log in to their admin dashboard.
This changeset introduces a `WP_Shutdown_Handler` class that detects fatal
errors and which extension (plugin or theme) causes them. Such an error is
then recorded, and an error message is displayed. Subsequently, in certain
protected areas, for example the admin, the broken extension will be
paused, ensuring that the website is still usable in the respective area.
The major benefit is that this mechanism allows site owners to still log
in to their website, to fix the problem by either disabling the extension
or solving the bug and then resuming the extension.
Extensions are only paused in certain designated areas. The frontend for
example stays unaffected, as it is impossible to know what pausing the
extension would cause to be missing, so it might be preferrable to clearly
see that the website is temporarily not accessible instead.
The fatal error recovery is especially important in scope of encouraging
the switch to a maintained PHP version, as not necessarily every WordPress
extension is compatible with all PHP versions. If problems occur now, non-
technical site owners that do not have immediate access to the codebase
are not locked out of their site and can at least temporarily solve the
problem quickly.
Websites that have custom requirements in that regard can implement their
own shutdown handler by adding a `shutdown-handler.php` drop-in that
returns the handler instance to use, which must be based on a class that
inherits `WP_Shutdown_Handler`. That handler will then be used in place of
the default one.
Websites that would like to modify specifically the error template
displayed in the frontend can add a `php-error.php` drop-in that works
similarly to the existing `db-error.php` drop-in.
Props afragen, bradleyt, flixos90, ocean90, schlessera, SergeyBiryukov,
spacedmonkey.
Fixes #44458.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44458#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list