The latest WordPress release, version 5.2, came bundled with some new administrative features to evaluate and troubleshoot problems related to the site. Below we’ll look at a couple of notable additions.
Site Health Check
Version 5.1 of WordPress kicked off the release of Site Health features. This included a notice to administrators running outdated versions of PHP. Version 5.2 expounded on this by bumping the minimum PHP requirement to version 5.6.20—this version is still three years old, released in May of 2016. It is recommended to always run the latest version of PHP for security and performance.
The 5.2 release added a new page titled Site Health in the Tools admin with a Status and Info tab. The Status tab highlights critical errors and makes recommendations for the site. The Info tab shows the site configuration. Based on the information it gathers, it will aggregate a site health score from 0-100%.
Site Health Status
The site health status tab will run a series of tests in the background and report on the findings. It will show critical errors, recommendations, and passing tests. Each test result appends a label to the issue marking it as performance or security. WordPress provides a filter to allow developers to add or modify the tests being run on the site.
The various tests include:
- Check WordPress version.
- Test if plugins are outdated or unnecessary.
- Test if themes are outdated or unnecessary.
- Test if the supplied PHP version is supported.
- Test if required PHP modules are installed on the host.
- Test if the SQL server is up to date.
- Test if the database server is capable of using utf8mb4.
- Test if the site can communicate with WordPress.org servers.
- Test if debug information is enabled.
- Test if the site is serving content over HTTPS.
- Check if the HTTP API can handle SSL/TLS requests.
- Test if scheduled events run as intended.
- Test if WordPress can run automated background updates.
- Test if loopbacks work as expected.
- Test if HTTP requests are blocked.
- Test if the REST API is accessible.
Site Health Info
The site health info tab gives an overview of the site’s configuration settings, helpful for debugging and auditing. WordPress provides a filter to allow theme and plugin developers to add their own debug information. It also provides a button to easily copy all the information to your clipboard.
The type of debug information includes:
- WordPress
- Directories and Sizes
- Drop-ins
- Active Theme
- Other Themes
- Must Use Plugins
- Active Plugins
- Inactive Plugins
- Media Handling
- Server
- Database
- WordPress Constants
- File System Permissions
PHP Error Protection
The error protection allows administrators to troubleshoot fatal errors like the “white screen of death” without involving a developer. Similar to an operating system, the site can be put into “recovery mode” so the admin can still be accessed and errors assessed.
In the case of a fatal error, two actions will occur: a default message will be displayed on the front-end of the site and an email will be sent to the site admin email address containing a link to place the site in recovery mode.
The default error message reads: “The site is experiencing technical difficulties.” This isn’t the most user-friendly, so WordPress provides a filter to allow developers to modify this text.
While in recovery mode, errors caused by plugins or themes are temporarily “paused.” The administrator can begin assessing the problem and implement a temporary resolution such as deactivating the offending plugin.