-
Notifications
You must be signed in to change notification settings - Fork 39
WordPress Debugger 'WP_DEBUG'
Many times we get errors/warnings message in the code while executing certain functions. And at times, it is difficult to trace out each and every bug manually. For this reason we need a debugger to find the part of the code which is at fault. The WordPress comes with the inbuilt debugger system called "WP_DEBUG".
As a quality check we recommend all rtPanel developers to use WP-DEBUG to ensure that their themes is bug free (or with no obvious bugs).
In Codex it is mentioned that "WP_DEBUG is a PHP constant (a permanent global variable) that can be used to trigger the "debug" mode throughout WordPress". In other words, it is an option to enable or disable the PHP errors/warning in the WordPress site.
By default the WP_DEBUG value is false i.e. the debug mode in WordPress is disabled. To enable the debugger you need to set WP_DEBUG as true in the "wp-config.php" file.
define('WP_DEBUG', true);
Note: - true/false are the Boolean value and DO NOT enter these value in the apostrophes (').
Most of the error in the WordPress occurs due to installed plugins or themes (however there can be other coding issues which we will explain in later posts). The plugins that cause error to be displayed can be found out using WP-Debug. Follow the below step.
-
Deactivate all plugins and uninstall all the third party plugins from the WordPress back end.
-
Now activate the plugin one by one.
-
If the error occurs after activating particular plugin then this plugin has fault.
-
Same is with other remaining plugins.
In this way WP-Debug can be helpful to find the error in the site.
As discussed above, enabling WP_DEBUG will display all PHP errors, notices and warnings. It will have following advantages:
-
It will uncover all PHP Error/warning/notice.
-
Once the bug is fixed the resulting code will be bug-resistant and easier to maintain.
-
It will also cause notices about deprecated functions and arguments within WordPress that are being used on your site.
-
It will be helpful to find out if any plugin or theme is not compatible.
WP Debug mode is one of the powerful tool in WordPress, to display PHP errors, notices and warnings. So if you are developing the site in WordPress, enabling the WP Debug will help you to counter all the PHP errors, notices and warnings. And fixing all those error will make your site more better!!!
Warning: You should be very careful while editing the wp-config.php file as rearranging the contents of the file may create errors on your blog
rtPanel:
- End-User Documentation
- Developer Documentation
- General
- Customizing Image Sliders in rtPanel Child Theme
- Add Google ad-banner above logo in rtPanel
- Customize rtPanel Footer Information
- Filters in rtPanel
- Integrated SEO plugin in rtPanel
- Create Metabox on rtPanel Child Theme
- Add Google Adsense Link Unit In Header
- Create Custom Taxonomy on rtPanel
- rtPanel:Comments with Gravatar
- rtPanel: Subscribe Widget
- Create Custom Post Type with rtPanel Child Theme
- rtPanel Theme Options ‘General’
- Using rtp_generate_thumbs() function in child theme
- WordPress Debugger 'WP_DEBUG'
- Adding Social Sharing Button to Website: Using Text Widget
- Clickable header in rtPanel child theme
- CSS Checklist for developers
- Implementing rtp-slider in the child theme
- Creating custom page templates in rtPanel child theme
- Child Theme development using rtPanel – Part I
- Child Theme development using rtPanel – Part 2
- rtPanel Developer Program: Standards Guidelines
- rtPanel Developer Program:Test Project
- Removing the default rtPanel Hooks
- Browser Specific Styling