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.
One of the key features of WordPress is the ability to enable debug mode, which allows users to see detailed error messages and other debugging information on the frontend of their site. This can be very useful for troubleshooting any problems or issues that may arise with a WordPress site.
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. Additionally, server error logs can also be very helpful for troubleshooting issues with a WordPress site. Most web servers keep detailed logs of all errors and other events that occur on the server, and these logs may be used to identify and resolve PHP errors and warnings.
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.
If you use dedicated WordPress hosting, you may be able to enable debug mode even more easily, like with Kinsta.
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.
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.
This data can be accessed from the WordPress admin dashboard by going to "WooCommerce > Status" tab. Once on the WooCommerce Status Report page, users can view detailed information about the current status of their WooCommerce installation, including the version of WooCommerce, the current theme and plugins in use, and the server and WordPress environment. 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.
In addition to the overall status information, the WooCommerce Status Report also provides detailed information about specific components of the WooCommerce site, such as the payment gateways, shipping methods, and tax settings. This can be useful for identifying and troubleshooting any potential issues or problems with these components.
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.
Getting to the console log differs depending on the browser you are using. Please see the WordPress documentation for additional information on how to utilize developer tools in Chrome, Firefox, and Safari.
Recommended free WordPress debugging tools
When working with WordPress, it is important to have tools that can help you troubleshoot any problems that may arise. There are many different debugging tools available for WordPress, but some of the most popular and effective ones include the following:
- Query Monitor
This plugin provides detailed debugging information for WordPress developers, including information about database queries, PHP errors, and hooks and actions.
- Post SMTP Mailer/Email Log
The plugin provides users with a way to send email from their WordPress site using a third-party SMTP (Simple Mail Transfer Protocol) provider, such as Gmail or Mailgun. The plugin also logs all email activity on the site, allowing users to see a record of all email messages that are sent from their WordPress site.
- User Switching
The plugin that allows administrators and users with the appropriate permissions to quickly and easily switch between different user accounts on a WordPress site.
Overall, these tools can be very useful for anyone who is working with WordPress and needs to troubleshoot problems or debug their code. It is always a good idea to have a few different debugging tools in your toolkit, so that you can quickly and easily identify and fix any issues that may arise.
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.
Post SMTP Mailer/Email Log
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.
One of the key features of the User Switching plugin is that it adds a new "Switch To" link to the user list on the WordPress admin dashboard. When clicked, this link allows administrators and other users with the appropriate permissions to switch to a different user account without having to log out and log back in. This makes it much easier and faster to switch between different user accounts, and can be a valuable time-saver for anyone who needs to manage multiple accounts on a WordPress site.
The plugin also provides a number of other useful features, such as the ability to automatically switch back to the original user account when a user logs out, and the ability to switch to other user accounts from the WordPress login screen.
Overall, the User Switching plugin is a useful tool for anyone who needs to manage multiple user accounts on a WordPress site. It provides a convenient way to switch between different user accounts without having to log out and log back in, and can be a valuable time-saver for administrators and other users who need to manage multiple accounts on a WordPress site.
Leave a Reply