Is the Import export operation not working as expected? The Logs section gives you a detailed history of everything that has been happening in the heart of an import-export 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 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
PHP logs
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
Learn how to Fix 502 Bad Gateway Error.
Broken database tables
Broken database tables can stop the import-export operations 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.
Comments (2)
Mohammad khalil
February 7, 2024
1. Our import took around 2 1/2 hours to import ~7900 products before it failed. Is it normally this slow or is this abnormal?
2. What is the expected time to import 75K products? additionally:
– 1 scenario – Fresh import without any WooCommerce products
– 2 scenario – Import with Existing WooCommerce products
3. How can we avoid failures from occurring?
Vineetha
February 13, 2024
Hi Mohammad khalil,
Thanks for reaching out!
1. We have tested our plugin with 10k products and it took approximately 2 to 2 and half hours with our server capacity. When the number of products increases the database will automatically slows down.
If you only need to update specific fields like stock or categories, please try importing with the required fields with ID/SKU, you can unmap the rest of the fields so that the import is faster.
2. In case of fresh import, you may need to map all the fields and this may slow down the import.
3. We suggest you split your import files and import them to avoid further timeout errors.