This probably is due to your WordPress trying to do pingbacks on each link in the post. Overall pingbacks are a bad thing when combining automated posting and WordPress.
I add this to my functions.php file on my WordPress template to disable those pingbacks.
<?php
remove_action('do_pings', 'do_all_pings', 10, 1);
?>
Plugin Author
hytekk
(@hytekk)
Thanks guys for your comments and tips. I was looking for a solution for this problem too.
I just release version 1.02 but I’m not use to tortoise SVN and WP … have some hard time updating new version to WP plugin host.
v1.02 get better template interface.
Share your success with a donation to help me build a better plugin. I have a daily job, I work on CJ-Datafeed only on spare time. Already lots of hours in it… I’m slowly turning into a geek. Save me before it’s too late!
Plugin Contributor
kaspar
(@kaspar)
I’m wondering why there is a processing limit of around 200 items per feed. I’ve worked on code that processed hundreds of thousands of items from CJ feeds but it wasn’t in the WordPress environment. I’ve tried using the set_time_limit(0) function of PHP but it made no noticeable difference. It seems to be a timeout issue, though. If you upload a large feed, the script stops after X number of items and doesn’t display the upload count.
Since many CJ feeds have hundreds or thousands of items, it would be good to solve the 200-item limit somehow. I’d be willing to help if I knew where the problem is.
Plugin Author
hytekk
(@hytekk)
The problem come from the hosting server limiting memory and cpu ressources.
I need to understand how plugin like WP-DB-Backup work. It use java script to retrieve database data. It’s a long process that would timeout using my script mechanic. I’m a self learner and I didn’t get any spare time to read about this.
If you can provide a solution for this bottleneck, I would be more than happy to add it in new CJ-Datafeed update.
Thanks kasper for your time
Plugin Contributor
kaspar
(@kaspar)
I see. Those server issues can usually be resolved only by editing the php.ini file. This is not allowed unless you’re on a dedicated server, so many people will have this problem. I’ll check into possible “directives” that can be invoked from within a script to relieve the problems.
php.ini defines (for the whole hosting server), the maximum amount of memory a script can consume while it’s running. The default value is 8MB, which is very often too small.
If I can find any answers that will work on shared hosts, I will pass them on to you.
Plugin Author
hytekk
(@hytekk)
CPU time is restricted on shared hosts too. Usually you get a server timeout after 30sec. Hundreds of website can be host on one server. This is why one script can’t take over cpu resources for a long period.
PHPMyAdmin have this option when importing large MySQL db files :
Allow the interruption of an import in case the script detects it is close to the PHP timeout limit.
I can import large MySQL file via PHPMyAdmin ( 30MB + )with this option set. It monitor ressources, stop when neat timeout, restart until done.
Can be a clue
Plugin Contributor
kaspar
(@kaspar)
Thanks! I’m thinking that the answer may be to break large files into
smaller chunks and process them separately. Perhaps the delay
mechanism can be used to control it. The problem is during reading
and processing the feed file, so maybe I can make it run as several
separate processes with a delay in between chunks.
I know about the controls on phpMyAdmin, but thanks for mentioning
that. I’ve been writing PHP and MySQL code for several years. It’s
true that shared hosts do cause problems like this.
Thread Starter
darren
(@dotnetbargains)
hi
I use bigdump http://www.ozerov.de/bigdump.php to import huge databases into mysql that can take a few hours to do (1gig) without a problem.
Can we not use the same idea of staggering the import in your plugin?
Plugin Contributor
kaspar
(@kaspar)
Here’s how to remove the problem of the first line in the CJ datafeeds:
In two functions:
function cj_process_datafeed($cj_preview,$cj_time_interval,$cj_time_factor )
AND
function cj_datafeed()
Change this code:
if ( $cj_previewdone == “ok” ) {
break;
}
if(empty($v)) {
unset($cj_data[$k]);
}
else {
// Read file row
…
to this:
if ( $cj_previewdone == “ok” ) {
break;
}
if(empty($v)) {
unset($cj_data[$k]);
}
else if(!preg_match(“/[0-9]/”, $v)) {continue;}
else {
// Read file row
…
This line:
else if(!preg_match(“/[0-9]/”, $v)) {continue;}
Makes the code skip processing the first line of the file because it contains no digits. Every other line in the feed file will have at least one digit because there are prices, which contain digits!
Clearly, the first line, which looks like:
PROGRAMNAME|PROGRAMURL|CATALOGNAME|LASTUPDATED|NAME|KEYWORDS|DESCRIPTION|SKU|MANUFACTURER|MANUFACTURERID|UPC|ISBN|CURRENCY|SALEPRICE|PRICE|RETAILPRICE|FROMPRICE|BUYURL|IMPRESSIONURL|IMAGEURL|ADVERTISERCATEGORY|THIRDPARTYID|THIRDPARTYCATEGORY|AUTHOR|ARTIST|TITLE|PUBLISHER|LABEL|FORMAT|SPECIAL|GIFT|PROMOTIONALTEXT|STARTDATE|ENDDATE|OFFLINE|ONLINE|INSTOCK|CONDITION|WARRANTY|STANDARDSHIPPINGCOST
has no digits.
Enjoy!
Plugin Author
hytekk
(@hytekk)
Thanks Kasper just miss the v1.03 release by 5min ( damn ) but it sure will be in v1.04.
Plugin Contributor
kaspar
(@kaspar)
You’re welcome. I think I can re-purpose some of the code in bigdump.php to make thew script handle more than 200 lines. I’ll let you know when I get it done. That should probably qualify as version 1.1!
Plugin Contributor
kaspar
(@kaspar)
I have another concern about the CJ feeds. WordPress has “tags” and “categories” The are often used somewhat interchangeably but they are clearly different things. When processing a datafeed, it would save a huge amount of time and effort later if you could somehow specify an existing category for all the items in that feed.
So far, nothing I’ve tried had been able to do this. After a feed from a vendor selling clothing, for instance, none of the new posts can be found in admin by using “Clothing” ad a category filter. Also, in the tag cloud and in the navigation for the site, clicking “Clothing” pulls up no posts except for ones that were either entered individually or edited to be included in the “Clothing” category.
This results in the site appearing to have no (or very few) products in the clothing category – very frustrating for users!
Any suggestions would be welcome.
Plugin Author
hytekk
(@hytekk)
You can specify a existing categories, just type the exact category name separate with “,” for multiple cat
Plugin Contributor
kaspar
(@kaspar)
That’s what I thought but it has not worked. When I go to Posts after uploading a feed file and specifying an exact category name…then select that category from the dropdown list and click Filter, no posts are found.
Plugin Author
hytekk
(@hytekk)
Something must have change from 2.9.2 to 3.04, was working before.
Anyway, in the time I was working on CJ-Datafeed, I didn’t fully understand how to add categories to POST in a simple way.
I solve the problem within my new CJ-API plugin but didn’t have time to correct it in CJ-Datafeed.
Cat processing in CJ-Datafeed :
1- I create the post and retrieve post ID.
2- After that I use “wp_create_category()” to retrieve a category ID. ( the function was returning a cat ID regardless if cat exist or not )
3- Add catID to postID
Cat processing in CJ-API :
1- Check if cat exist, if exist retrieve ID, if not create it
2- Create post object and put category array in it
3- Create post