Catch WSODs and provide a means for recovery for end users#3
Catch WSODs and provide a means for recovery for end users#3felixarntz wants to merge 73 commits into
Conversation
|
The initial commit here is based on the state of 44458.6.diff. |
When we are on a protected endpoint, we redirect to the same page after we paused a plugin. This has two effects: * The protected endpoints are always immediately available, they don't show the error message on first encounter. * The flow is exactly the same, whether only one plugin or multiple plugins are broken. So, if you update PHP and ten plugins break at once, you still get into the admin backend with one click, and the ten plugins will be paused already.
…e `.php` extension Reported by @bradleyt in https://core.trac.wordpress.org/ticket/44458#comment:29
|
I'm not entirely sure about dbe5bc0 yet (see https://core.trac.wordpress.org/ticket/44458#comment:33), we might need to discuss this further. |
… drop-in and clarify its usage.
| * @return string Error message HTML output. | ||
| */ | ||
| protected function get_error_message_markup() { | ||
| if ( ! function_exists( '__' ) ) { |
There was a problem hiding this comment.
Why not call wp_load_translations_early(); here?
There was a problem hiding this comment.
Not sure, but that sounds like it might be too risky for a shutdown handler...
There was a problem hiding this comment.
I agree with @schlessera. We might not even have the database initialized and thus might not even know which locale to use. Stubbing __() is not risky in that regard.
There was a problem hiding this comment.
But that is the point of the function, it doesn’t call the database or cache, but does it best to load translations. It loads in wp_db class super early. This function is designed exactly for this...
There was a problem hiding this comment.
Stubbing __() is safe, but it also means that the translation do not work at all. Trying to support translations if possible.
|
I opened #4 as requested to implement an opt-out mechanism via a plugin header. |
|
This has been fixed (see https://core.trac.wordpress.org/ticket/44458#comment:56). Further work should happen through separate Trac tickets and patches or PRs. |
This is the PR accompanying https://core.trac.wordpress.org/ticket/44458.
This is only for development, discussion should continue to happen on the Trac ticket as usual.