This plugin adds monitoring features to your WordPress site, and it’s useful to spot problems or collect data when debugging.
I’ve used it over time to help customers, so it implements the features and logging I needed on a case-by-case basis. But I’m open to adding new things; feel free to contact me.
This plugin is mainly for tech people.
First installation
You need to download the ZIP package and install it from Plugins/Add New/Upload. After the first installation, the plugin should update automatically. You can always update it by hand, downloading and reinstalling the ZIP.
Email monitoring
This monitor records tracks of all emails sent using the wp_mail() function (it works even when an SMTP plugin is installed), and if they succeeded or failed.
How to use the collected data.
- An email is listed as successfully sent, but you don’t see it in your mailbox. It usually means the hosting provider dropped it: open a support ticket
- An email is listed as failed:
- If the error is something like “could not instantiate the mail() function”, your hosting provider has disabled the mailing functionality: open a support ticket
- If the error is something like “connection timeout”, probably you’re using an SMTP plugin. Run a test from that plugin, and it will fail. Check the SMTP parameters, try different options (every SMTP has different parameters you can use). If nothing changes, your hosting provider is blocking the connection with the SMTP: open a support ticket
- If the error is something like “authentication failure”, probably you’re using an SMTP plugin. Run a test from that plugin, and it will fail. Check the SMTP parameters.
- If you get the errors above but you’re not using an SMTP plugin, probably the SMTP connection has been hard-coded somewhere: ask who created the site.
- If there is no error text: hard debug time!
Bonus. If the email test goes great from the admin side, but every email fails (or it’s not sent) when “triggered” from the frontend (a form submission, a comment, …), something is changing the WP mailing functionality only on the frontend. Check the “Filters” details of the failed email and ask a WP tech to read them.
Email sending duration
The plugin collects the time needed to send an email. If your site just sends transactional email (password recovery, order confirmation, …), it’s not a problem if the sending process takes seconds.
If your site sends a massive number of emails, the time required to send a single message is very important. Example: if a single email takes 3 seconds, you can send at most 1200 emails per hour.
Scheduler monitoring
This monitor records every time the WP scheduler is activated, the scheduled jobs, and if a job is late. The results are not easy to read, but they provide interesting information when the background tasks do not seem to be executed on time.
The monitor overview reports if the scheduler is activated enough often to respect the minimum frequency required by recurrent jobs, and provides a graph of that interval.
You can use this monitor in combination with the standard Tools/Site Health provided by WP and the plugin WP Crontrol.
Not all tasks have been executed
If you see that message, something BAD is happening (I saw and solved this problem so many times…).
What is happening: the scheduler starts, and it starts executing the queued jobs. For some reason, it does not run all the tasks, creating long delays in the background operations.
Those delays are usually seen by the site administrators as a malfunction of the plugins, while they’re not, and they contact the plugins’ authors, reporting bugs (not always with kindness….).
Reasons for that error condition:
- The background tasks take more time than allowed by the PHP configuration. When a process takes more than the allowed time, it is “killed” by the server (“kill” is a tech term, not violence). That means the scheduler cannot complete all the tasks and, usually, it leaves some unclean status around (the
doing_crontransient). You can do much than increasing the PHP execution time limit or, if it’s a temporary condition, leave the scheduler time to complete the skipped task on the next run. - A background task triggers a fatal error. Even in this case, the scheduler is “killed” and not all the queued tasks are executed. But don’t worry, they’ll be considered on the next scheduler run. The problem is when that erratic task is executed very often, continuously blocking the scheduler. Check the error log file of the server for fatal errors.
- An object caching plugin is messing up the transients. Ok, that’s so technical, I don’t have enough room to explain it. The main effect is that the scheduler starts, one job is executed, and then nothing else happens. Many queued tasks start to be delayed, and the queue never empties. Disable the object caching or reconfigure it (I saw it on an installation with Lightspeed and Memcache – switching to Redis solved the problem).
Abilities monitoring
This is something so new I’ll write about it later on.
X monitoring
If you have specific needs, please contact me; maybe the plugin can be extended.
FAQ
Are there alternative plugins to Monitor?
Of course! Two plugins you cannot miss are WP Crontrol and WP Mail Logging.
Photo by cottonbro studio:
