My import gives an error

During the import it can be that the importer runs in to an error. Most of the time it will send an email, you can disable that email in the plugin settings, and show it in the dashboard. In almost all cases there is nothing I can do about it and the issue lies somewhere else.

I will try to tell how you can troubleshoot the most common ones here. If you come in to a different error please leave a comment and I will update this post.

 

Known errors:

Error: Start tag expected, ‘<‘ not found

Reason:  The importer opens the XML file and expects to find a < at the beginning of the file. When it does not find that it will give this error.

Cause: 99.9% of the time there is an issue with the feed, either because the feed couldn’t be opened, is made incorrectly or your host could not reach it.

Fix: Go through all troubleshooting steps below, because it can be caused by multiple reasons

 

Error: Tradetracker cannot create the productfeed. The feed itself is empty

Reason: Tradtracker feed is empty.

Cause: Most likely it doesn’t exist anymore, it could be the company stopped the XML feed or they stopped working with Tradetracker all together. You normally would have gotten an email about it. It could also be a temporary issue , in which Tradetracker didn’t create the feed.

Fix: Step 2 and 4 from the troubleshooting steps to be sure the feed is empty.
White screen during import

Reason: 99% of the time a memory issue

Cause: It looks like the import is using too much memory, most likely because the feed has big descriptions. The white screen is caused because PHP will give a fatal error and stop running.

Fix: Step 5, this will give you a definite answer if it is memory related. You can then try step 6 to see if that gets rid of the memory limit.

If you are on a shared hosting there is not much else you can do. If you are on a VPS you can see if you can enable opcache in PHP. This will lower the memory usage drastically.

 

Troubleshooting steps:

XML provider = Tradetracker (or other network you received the XML file from)

Step 1 ) Check if it happens with all feeds or only 1 specific feed. If no items are imported go to step 4, If it is only with a specific feed go to step 2

Step 2 ) Open the url you received from the XML provider for the feed in your browser. Now check if it gives an error, takes really long to open, or it is empty. If any of these are the case then most likely this is the problem. If there are errors or when it is empty you can best contact the XML provider. If it takes really long to open it might be a really big XML file and not suitable for your hosting environment.

Step 3 ) Copy the url you received from the XML provider and past it in this site: http://validator.w3.org/ and http://www.xmlvalidation.com/ This will check if the feed is a valid one. If this gives an error (not a warning) then you should contact the XML provider

Step 4 ) Do you get the same error when you press “Update now” in de plugin settings. If there is no eror now, it could be smart to change the import time in the XML Feed options. It could be you are importing a feed at the moment it is created.

Step 5 ) Enable debugging in wordpress:
when you connect to you ftp server you will see a file called wp-config.php (located in the main folder where your wordpress in installed.
In that file you will see something like:
define('WP_DEBUG', false);

you replace that with:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

If there is no reference to WP_DEBUG in wp-config.php you can just add the above part.

When you have done this you upload the file back to your server. Try to run the update now. After the update is done you will have a file debug.log on your site. You can access it by typing http://www.websiteaddress.com/wp-content/debug.log use CTRL+F and see if you can find “tradetracker-store” or a “fatal error” This will give you a clue why the import failed. Most of the time it will be a timeout or a memory error

Step 6 ) Try a different import method. In plugin settings you can change between them (if your host support them) You can choose for “Fopen (most reliable)”, “Curl/Fwrite (can run out of memory)”, “Curl (sometimes causes issues)”

Step 7 ) Doublecheck that the folders “cache” and “splits” have chmod 777. You can find the folders on your FTP in the following directory wp-content > plugins > tradetracker-store

Step 8 ) If the error is with all feeds there is a change your host is blocking the connection to the host of the feeds. Best is to contact your host and see if this is the case

Step 9 ) If you import a feed from a different network, make sure you selected that network when you added the feed. If you have selected the wrong network it will give an error that there is an issue with the feed.

2015-04-17_10-21-27

 

If all these steps don’t help you can send me the full link to the XML file that gives an error at info @ wpaffiliatefeed . com I will then be able to test the feed and see if there is something I can do to get rid of the error.