How To Debug Your WordPress Errors From Website
If you do not have a detailed error message, you will keep guessing the issue until the website suffers from anything unusual. WIth the detailed error message, you can easily resolve the issue. Have you any good reason for turned off WP_DEBUG When you’re developing your themes and plugins ? For getting a detailed error message, You need to enable the WP_DEBUG. ~ WP_DEBUG ~ Introduced in WordPress version 2.3.1, this feature has gained a higher importance in the WordPress field. If we see from the point of view of WordPress, WP_DEBUG is basically a permanent global variable which is also known as a PHP constant, that can be used to turn on/off debugging mode in WordPress. – Default: The debug mode is turned off, But turn it on when starting work on a new WordPress theme or plugin. – In the wp-config.php file we can trigger WP_DEBUG. wp-config.php lives in a WordPress directory * To turn on WP_DEBUG, just add the following code to your wp-config.php file: define ( ‘WP_DEBUG’, true); * To turn the debugging mode off, replace the above code with: define ( ‘WP_DEBUG’, false); – When WP_DEBUG Turning on (setting to true) then all PHP warnings, notices, and errors to be displayed. Note – Every good developer should turn on debugging before getting started on a new plugin or theme. While developers working on code they plan to release publicly, WordPress codex “highly recommended” to use WP_DEBUG mode. It’s important to keep in mind that WP_DEBUG should not be used on a live site. While it’s a useful feature during development, It can be dangerous on a live site because text in the PHP notices can reveal details about your code,