As of right now, WordPress is the most popular content management system on the planet. If you run a WordPress site, you have almost certainly run into a theme or plugin code conflict. Enabling debug mode may assist you in determining why your WordPress site is not functioning properly.
The ‘debug’ mode added straight into the WordPress code may be used to address even the most basic of issues, so let me provide some instructions before listing the plugins I recommend. In many circumstances, there is no need to install any plugins in order to detect issues.
The tools provided in WordPress, as well as the logs accessible in your server administration panel, might be of use here. If you use one of the most common systems, Plesk or cPanel, I will show you how to find them in this post.
In the final section of this article, I mentioned some plugins that might aid you in troubleshooting. The tools I have included in this post are some of the best out there for debugging and fixing WordPress issues.
How to debug WordPress without any third-party plugin?
Before I list the plugins I suggest, let me explain how to use the built-in WordPress debug mode to identify the most basic problems. Using PHP error logs to debug WordPress plugins and themes is one of the best ways to find out what is wrong.
In order to save server resources, error logs are turned off by default. They may also be a security issue if the logs are presented in the front-end, since they might disclose potential vulnerabilities.
How to enable debugging mode in WordPress?
In general, the process of enabling debug mode may be broken down into three steps.
- Use an FTP client or File Manager to go to WordPress’s root directory.
- Find the wp-config.php file in your WordPress installation.
- Set the ‘WP_DEBUG’ constant to true.
Enabling debug mode in WordPress requires access to the directory where your website is installed through FTP or cPanel/Plesk file management. To utilize this functionality, open the wp-config.php file and locate the line of code shown below.
define( 'WP_DEBUG', false );
To use the debugging function, all you have to do is change ‘false‘ with ‘true‘. If you do not locate it anywhere in wp-config.php, you may add it at the end.
define( 'WP_DEBUG', true );
Upon enabling debug mode, all PHP errors, notifications, and warnings will be shown. This may result in warnings being shown for code that is not broken, but do not properly match PHP standards, so please keep that in mind while using this tool.
Deprecated functions and hooks used by WordPress or third-party plugins will also be shown in debug mode. These have not yet been deleted from the source code, but will be in the near future. Deprecation notices are typically accompanied with a recommendation for a new function to be used in its place.
Accordingly, even if your website does operate to some level, it is still best not to disregard the warnings that are given for security and bug prevention reasons.
What is the location of the debug log in Plesk?
If you are having trouble debugging WordPress, the server logs are a great place to start. From my experience, I can tell you that not all problems are logged in WordPress debug mode.
You may also examine the PHP error log in the admin panel if your hosting company uses Plesk. To access it, go to the main panel, choose the domain, and click the “Logs” button.
Once the log information has been shown, you may use the dropdown box above to filter the entries to show just the errors.
What is the location of the debug log in cPanel?
The instructions for cPanel are fairly similar to those for Plesk. Instead of repeating what can be found on Plesk’s website, I will just link to it.
How to use WooCommerce Status Report?
Not everyone is aware that WooCoomerce may be used to get general information about your server. What is more, the information presented there may be useful even if the problem is not caused by WooCommerce.
Use the “WooCommerce -> Status” link in the admin menu to see it. The information presented there includes, for example, PHP version, database size, and a list of active plugins. The latter may be highly valuable if you need to submit this information to the plugin/theme developer so that they can duplicate your environment and debug the issue you have experienced.
How to utilize the browser’s console to debug JS and CSS?
Fortunately, all popular browsers have developer tools that may be used to track out such issues. Attaching a screenshot of your browser’s console log when submitting your support request may help the developers in fixing the problem you are experiencing.
You may make live changes to your website’s front-end code using the browser developer tools without impacting other users. Using these, you can quickly identify the HTML and CSS code responsible for a certain content element and interact with it using live preview.
Recommended free WordPress debugging tools
How can you use Query Monitor to debug WordPress plugins and themes?
Now that I have given you some insight into the debug tools included in WordPress and WooCommerce, I would like to highlight the first plugin that saved me a lot of time. The Query Monitor plugin is highly recommended by many WordPress developers and businesses, and for good reason.
It includes an easy-to-use interface that allows you to quickly identify not just PHP errors, but also issues with queries sent to the database.
You may also use it to determine which plugin is slowing down or creating troubles on your site. Furthermore, you can also access information about your server on the “Environment” page, similar to the Status Report built into WooCommerce.
How to debug WordPress email sending?
If you moved your WordPress website or built a new one in a fresh environment, the contact forms may not be delivering emails. Your server is most likely not correctly setup to use the PHP mail() function, which is the most likely cause of these frustrating WordPres issue.
If your website is hosted on shared hosting, the mail functionality may be deactivated to decrease the amount of spam. The recipient’s server may be blocking messages received from the server for no apparent reason. Whether you have ruled out this scenario, you will need to see if the message has left the outgoing server.
In any case, I recommend using the Post SMTP Mailer/Email Log plugin to track out the source of the issue. It allows you to perform numerous tests and scan your SMTP server for firewall blockages and setup errors. In addition to this, the emails sent via your WordPress website may be logged for troubleshooting purposes.
To be clear, this plugin is not only for troubleshooting the issue of your server not delivering emails. This plugin allows you to configure WordPress to send emails from a third-party server (for example, Gmail) through the SMTP protocol.