Is the Import operation not working as expected? The Import Logs section in the WooCommerce Import Export plugin by WebToffee gives you a detailed history of everything that has been happening in the heart of an import operation.
So, if anything goes wrong, they give a useful overview of the events in order to help you, the developer, seek out the culprits.
We can access the PHP error logs through:
1. WooCommerce logs
2. PHP logs
WooCommerce introduced a log that displays PHP fatal errors. This log can contain information that would otherwise be contained in PHP error logs. It’s a good place to start before looking for PHP logs on the server.
How to reach WooCommerce logs?
To access the WooCommerce Fatal Errors log:
- Go to WooCommerce > Status > Logs
- Choose a log from the drop-down labeled fatal-errors.log
- Click View
The types of errors caught in this log are:
- PHP fatal errors
- Runtime errors
- Errors purposely triggered in the code by a PHP function.
Fatal errors occur when the action in the code cannot be completed. Examples of a fatal error include:
- Calling an undefined function
- Using an undefined variable
- Calling a function on a null or otherwise unusable variable
The log will include the:
- Timestamp when the error occurred
- Error that occurred
- File and line in the code for the origination of the error
- Stack trace: a snapshot of the history of the function calls and files leading up to the error
The PHP error logs can be useful when investigating an issue with a site. These may vary depending on the OS platforms(Cent OS, Linux).
How to reach PHP logs?
You can find the PHP error logs in a few possible places on the server:
- in your server’s root folder, called error.log
- in public_html or similar folder, called error.log
- in var/logs or similar, called error.log
- Additionally, if you have debugging enabled in WordPress and you have it saved to a file, it will be in the wp-content folder, and called debug.log
Finding with PHP
If you can’t find the file, you can have PHP tell you where it is:
- In the root of your WordPress’s directory, create a file named phpinfo.php .
- Open the phpinfo.php file in a text editor.
- Insert <?php phpinfo(); ?> into the file.
- Open the file on your site. For example, if your site’s URL is example.com, you can open the file by visiting http://example.com/phpinfo.php
- Search the page for the error_log value.
- The file path listed here is the absolute file path of the PHP error log. Visit that address on your server to find the PHP error log.
- If the value is empty, you must set a value to log errors on your site.
Any other strange behaviours?
WordPress 502 Bad Gateway Error
This error can break your website and consume hours of troubleshooting. When the server fails to respond accurately and returns the request with some invalid information, we get the error: “502 Bad Gateway”. This error can occur if:
- Your server is busy with other tasks or is experiencing high traffic from a specific website (in case of shared hosting).
- The origin servers are not responding or are inaccessible.
- Errors in the database.
- There is an issue with the reverse proxy server.
- Corrupt PHP scripts in files such as WordPress themes and plugins.
- CDN is acting up
- DNS issues
Broken database tables
Broken database tables can stop the import operation from working correctly.
- Try restoring the database tables from a backup, or deleting the plugin database tables and reinstalling the plugin(In this action, you may lose all of the data associated with your previous imports).
- Deactivate and reactivate the plugin.
- Test on a fresh WordPress installation with a newly created MySQL database.
Refer other troubleshoot articles by WebToffee :
If the problem persists, contact WebToffee support for assistance.