I'm working on a plugin which has bulk post inserts using a spreadsheet. This spreadsheet can have multiple thousand rows, each row corresponding to a post. I'm parsing this spreadsheet, looping over the parsed data and using wp_insert_post to insert the posts. I noticed that when I used a spreadsheet with around 2000 entries, only around 600 posts were inserted.
Is there a limit on the number of wp_insert_post calls in one shot? Or could it be a limit on one shot mysql inserts?
(edited title for more clarity)
wp_insert_postbeing the culprit, as it doesn't keep track on how many iterations it's gone through in a given timeframe. I can't see mySQL being the issue, as it doesn't have a limit for maximum queries, just one for maximum size of one query (see max_allowed_packet). Is it always exactly 670 successful inserts? If so, have you tried removing the 671st row from the spreadsheet, to check whether it depends on the data? Also, have you had the loop return number of iterations? Does it finish? – Johannes Pille Nov 15 '11 at 7:20