Have you ever been concerned with your site’s performance and not been sure how to check if it is working properly? This can lead to building out complex tests that may or may not yield results because you just aren’t sure what you are looking for.
Two of the most common issues I’ve run into while supporting MODX sites are emails not sending, and pages loading slowly. Today we’ll review two MODX Extras that will help you solve each of these problems.
Is my email sending?
Email deliverability is an ever-growing issue with modern protocols. While we always recommend using an enterprise email relay service, you still might run into issues with the connection to those systems.
Longtime MODX contributor Bob Ray created a great snippet called QuickEmail to help you diagnose if your MODX site is the cause of email not going out. This snippet will simply send a transactional email test and output the results. It is as easy as adding the snippet
[[!QuickEmail? &debug=`1`]] to a page to quickly discover if you are hitting a roadblock.
By default, the QuickEmail snippet will use your default email configuration found in your system settings but can be manually configured with parameters. Manual configuration is helpful if you are having an issue with a specific sender or recipient not receiving emails that aren’t configured in your system settings.
Why is my page slow?
A slow running page is like a leaky faucet. It can eventually lead to major issues if it is not addressed. If you have ever wondered what is slowing down your site you need to check out debugParser by Vasiliy Naumkin.
With the debugParser plugin running, you can add the
?debug=1 parameter to any URL on your site and see the timings as each element is loaded in the template. This is helpful for learning exactly which chunk or snippet is taking the most time to run or making the most requests. I have also used this to find snippets that could run cached when they were being called uncached.
The main drawback to debugParser is it doesn’t report plugins that load during a page request. If the issue is something that happens during a plugin event, you may need to start by disabling all of your site’s plugins and turning them on individually to find the problem. However, for most issues, it usually comes down to a rogue element in your template.
You can learn more about debugParser on the MODX.pro documentation site.