PHP Meeting Recap – October 15th

This recap is a summary of our previous PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher meeting. It highlights the ideas and decisions which came up during that meeting, both as a means of documenting and to provide a quick overview for those who were unable to attend.

You can find this meeting’s chat log here.

Chat Summary

  • We discussed how the php-error.php drop-in in WSOD protection and the 500.php in the PWA feature pluginFeature Plugin A plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. would relate to each other and how work could potentially be deduplicated/harmonised.
  • The php-error.php drop-in in WSOD protection is used server-side when a fatal error was caught. As it could be triggered by a theme or before the theming functionality has actually been loaded, it cannot be styled through a theme. It is “always-on”, though, and catch fatal errors very early on in the bootstrapping process.
  • The 500.php template from the PWA feature plugin is displayed by client-side code when the request made by the service worker returns a HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. 500 status code. To achieve this, an offline cache is built through the service worker, and the site is requested to do a server-side rendering of the 500.php once so that it can be cached for the case where it is needed. Because of this, it can be styled through the theme, as the request to actually render is is a normal “render a page template” request. It requires for the service worker to have been installed previously and the server to have successfully rendered the page template once so that it can be cached. This means that there scenarios where this mechanism is not yet available.
  • There is an error query variable that would be a good fit to reuse for the 500 and offline mechanisms of the PWA feature plugin, but this would first require a change in WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. as this query variable is currently being unset. There is already a Trac ticket to change this. For now, the PWA feature plugin uses a custom query variable wp_error_template instead.
  • Currentl functionality already should work as-is to always catch fatal errors on the server side and display the php-error.php drop-in, and if the service worker is active and the 500.php has already been cached, it will be used to progressively enhance the php-error.php drop-in to style it according to the current theme.
  • @westonruter suggested a change to make this more reliable and explicit by adding headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. information to the WSOD screen along the lines of X-WP-WSOD: true.
  • We should also add some token to the rendered page, as the headers might already have been sent in some scenarios, like a special form of HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. comment.
  • @joyously has added that for diagnosing errors, having access to even half of a HTML page can help, so cleaning everything out might further obfuscate the nature of errors.
  • @flixos90 argued that the php-error.php might not even be needed, with PWA as a later option in the future.

Next week’s meeting

  • Next meeting will take place on Monday, October 22nd, 2018 at 15:00 UTC in #core-php.
  • Agenda: Discuss current roadmap and priorities.
  • If you have suggestions about this but cannot make the meeting, please leave a comment on this post so that we can take them into account.

#core-php, #php, #servehappy, #summary