WordPress is a highly customizable platform with the ability to completely change the way it works through the plugin and theme system. This is partly what makes WordPress and WooCommerce such a successful platform, but also adds to difficulty in diagnosing bugs. In addition to a pretty much unlimited amount of different possible server configurations this means that almost no two WordPress installations are the same, making debugging errors in each installation unique.
Bugs usually occur or can be diagnosed in one or more of 4 major groups.
• Server settings or setup
• WordPress / WooCommerce settings or setup
• Cross plugin conflict
• Error with our plugin
The general process below should be followed get the right information together to fix almost or at least reveal the cause of most bugs you come across with our plugins. By knowing what is actually causing your bug, you're most of the way to solving it.
1 Check the WooCommerce System Status
Located at WooCommerce > System Status in your Admin area, ( http://www.yoursiteurl.com/wp-admin/admin.php?page=wc-status ) this status screen pulls together most of the info you need to diagnose a lot of problems quickly. Most problems will be because of something not set up correctly or out of date. This screen will show you where errors may be.
Make sure that WordPress, WooCommerce, your theme, and plugins are all up to date. Remember to backup fully first so that you can revert! Or do this on a development version of your site to avoid unwanted errors or changes in functionality after update.
Check for any errors revealed in WordPress, WooCommerce or other areas which may be causing your bug. At the top of this page there is a button labelled Get System Report which will give you a formatted text file which you can use to copy and paste to send for further debugging.
If your bug is on a specific page, open the Developer Tools in your browser and check for any errors in the console. This can usually reveal a lot about what is going wrong under the hood of your site.
All browsers have a Developer Tools console but they may call it slightly different things. I will only cover Chrome's dev tools here as they're widely considered the best. To open them in your browser, go to View > Developer > Developer Tools. Once open you can click over to the Console Tab. (You can also jump straight to this tab from the Developer menu in View or with a keyboard shortcut specific to your operating system, Mac or PC)
If there were any errors, they would show up in red and from reading you'd likely be able to gain a lot of insight into your bug or be able to send these to us in helping to diagnose.
3. Start Turning off Plugins.
Many bugs are a result of conflicts between one or multiple plugins on your installation. The best way to find this out is to turn off every plugin except only the most crucial ones you need. In our case this usually means everything except WooCommerce and our plugin. Make sure you do this in a maintenance mode on your site, or on a development version to avoid showing a broken looking site to your visitors.
Once everything except WooCommerce and our plugin are active, try repeat the process which caused the bug. If it does not occur with this minimal setup in place you can safely day that the bug is due to a plugin conflict. Start turning the plugins on one by one (or three by three to save time) and repeat the steps to generate the bug. When it occurs you will have found the plugin causing the conflict and will be in a much better position to understand and solve the bug.
If with the minimal setup in place the bug still occurs, you can say that the bug is not a plugin conflict and is likely a PHP / JS error, WordPress or WooCommerce settings or setup bug, server or hosting bug, or bug with our plugin.
4. Turn on wp_debug
Wp_debug is a setting in WordPress which will reveal all PHP warnings which are normally hidden from you. Turning this on while you have many plugins running this can often lead to warning overload as even themes and plugins which are working well can often generate a lot of warnings and errors. You should only do this on development versions of your site as many of the errors will be shown on the front-end which user's would see.
The way you turn on wp_debug is to add the line:
define( 'WP_DEBUG', true );
to your WordPress wp-config.php file. If that line already exists in your config file, switch it from false to true. You may also find a line:
define( 'WP_DEBUG_DISPLAY', true );
make sure that is also set to true so as to display the errors and not just log them. If this line is not already in your config file don't worry about adding it.
Once this is done go through the process to create your bug. It may be easier to narrow down the relevant issues with only WooCommerce and the relevant plugin activated. Errors will display at the top of your pages.
5. Check that the underlying action is working without our plugin
For some plugins for example, Email Customizer, we'll get support requests from people saying they can't get any email to send. However on inspection it turns out that no email could send from their WordPress installation even without our plugin. Which means that the error is not with our plugin at all. Always make sure that the underlying action is working without our plugin.