How to Debug your Website

Brandon Graves is a front-end developer associated with HireWPGeeks, a HTML to WordPress service provider company. He is deeply fascinated to write informational blogs on a wide range of topics including WordPress development, themes, plugins etc., and sharing his experience with others.

Generally, WordPress websites run smoothly, but, many times it becomes necessary for you to monitor the performance and activity of various plugins and themes you are using on your site. If you think that your site is sluggish or have technical issues, then you need to debug your WordPress sites.

The Basic Concept Of Debugging A WordPress Site:

As a matter of fact, debugging is a traditional technique used by WordPress developers to debug fragments of software codes to locate and resolve errors. After debugging, your site starts to perform smoothly.

Here are effective ways to debug your WordPress site:

1. WP_Debug:

WP_Debug

WP_Debug is actually a PHP constant, that can be used by WordPress developers to start “debugging process” throughout WordPress. By default, it is assumed to be false and set to true in the wp-config.php file. Don’t use WP_DEBUG or the other debug tools when your site is live. Use them only while local testing and staging installs. When you enable WP_DEBUG, all PHP errors, notices and warnings will be displayed automatically. There are high possibilities that all these will modify the default behavior of PHP, which usually displays only fatal errors or shows a white screen of death when you find out errors. Enabling WP_DEBUG will also cause notices about deprecated functions and arguments within WordPress that are being utilized on your WordPress site. Deprecation notices notifies your the new function that you should use.

 

WordPres Debugging Mode

2. WP_Debug_log:

WP_Debug_log

Actually, it’s an associate to WP_DEBUG which is responsible for saving all errors to debug.log log file inside the /wp-content/directory. This is quite beneficial for you when you wish to review all notices later or you need to look at view notices generated off-screen during an AJAX request or wp-cron run.

 3. WP_Debug_Display:

It is also a companion to WP_Debug which controls whether debug messages are displayed in the HTML of pages or not. It is “true” by default which displays errors and warnings when they are generated. If you set it to false, it will hide all errors. You must use this in collaboration with WP_Debug_Log so that you can review errors later.

4. Savequeries:

The savequeries definition saves the database queries to an arrangement and that arrangement can be displayed to help the WordPress developers to inspect those queries. It is defined as true and causes each query to be saved, how long time took to execute that query and what function called it. Always keep in mind that it has a performance impact on your site. So, just turn this off when you are not debugging your website.

5. Script_Debug:

This constant will compel the WordPress to make use of the “dev” versions of core CSS and Javascript files rather than the minified versions which are loaded normally. It is false by default and is quite useful when you test modifications to any built-in .js or .css files.

6. Make use of WordPress Debugging Plugins:

You can also use WordPress debugging plugins to trace errors in your WordPress site and remove them easily and quickly.

Final Thoughts:

WordPress developers can debug their WordPress sites using the above mentioned ways. It will help them to improve their site’s performance easily.

Brandon Graves is a front-end developer associated with HireWPGeeks, a HTML to WordPress service provider company. He is deeply fascinated to write informational blogs on a wide range of topics including WordPress development, themes, plugins etc., and sharing his experience with others.

Leave a Reply

Your email address will not be published. Required fields are marked *