Skip to main content
Print

PHP errors

Hera Site Monitor records the PHP errors your site raises, on every kind of request: pages your visitors open, wp-admin, AJAX and REST requests, scheduled tasks and WP-CLI. This article explains what is recorded and how it appears on the Site Monitor screen.

What is recorded

PHP error Shown as
A fatal error, the kind that stops the page and makes WordPress show “There has been a critical error on this website” Fatal error in the plugin or theme, marked Critical
A warning PHP warning in the plugin or theme, marked Worth a look

Notices and deprecation messages are not recorded. They are useful to developers but are not problems a site owner needs to act on.

An error hidden on purpose in the code, with PHP’s @ operator, is not recorded either.

A fatal error is recorded even when it only happens on pages your visitors see. WordPress itself only emails the site administrator about fatal errors in wp-admin and on the login page.

Which plugin or theme it came from

The problem’s title and the line under it name the plugin or theme whose file raised the error, for example Fatal error in Example Contact Form and Plugin: Example Contact Form. Details under the title shows the message, with the file and the line.

Sometimes a plugin passes WordPress something it cannot handle, and the error is raised inside WordPress’s own code. In that case the problem still names the plugin, and Details shows both places: the WordPress file where the error was raised and the plugin file that called it (“called from”).

Repeats

The same error from the same line is one row on the screen, with the number of times it happened in Times. To keep a busy page fast, at most 10 different warnings are kept from one page load; repeats of those 10 are still counted. Fatal errors are always kept.

What is stored

For each error the plugin stores the error message, the file and line, which kind of request raised it, and the address of the page without the part after the ?, which can contain personal data. Email addresses and IP addresses in the message are replaced with [email] and [ip]. The server’s own folder path is removed, so files show as wp-content/plugins/....

Catching errors earlier

WordPress loads plugins one after the other, and an error raised while a plugin that comes before Hera Site Monitor is loading happens before the error catcher starts. To record those errors too, go to Site Monitor → Settings and tick Catch errors earlier.

This copies one small file, hera-site-monitor-early.php, into wp-content/mu-plugins. WordPress loads that folder before any plugin, so the error catcher starts first. The file does nothing while Hera Site Monitor is not active, and it is removed when you untick the box, deactivate Hera Site Monitor or delete it.

The box needs WordPress to be able to write files directly on your server. When it cannot, the settings say so, and everything else works as usual.

What it cannot see

An error that stops WordPress before it loads any plugin, such as a broken wp-config.php or a database that is down, happens before Hera Site Monitor can run. Without Catch errors earlier, neither are errors raised while the plugins before Hera Site Monitor load.

Table of Contents