Import doesn't work if entries table is already large
-
I imported about 20,000 records and all was fine. Then I went to import a few more, and the import just “stopped working”. No errors, nothing, it would just reload the page when I uploaded the file.
Took about 2 hours of debugging to figure out the problem, so posting this here to hopefully save others that time/trouble.
Inside the main PHP file for this plug-in you’ll find a line of code like this:
$lastnum = $wpdb->get_col( $wpdb->prepare(“SELECT * FROM $entry_tracking_table”,0) );
That does a query of the entire entries table, which can easily cause the script to die with out of memory issues, or even just take a really long time to return. To fix the issue, I changed the line to this so that it will only query for the one row with the highest id value:
$lastnum = $wpdb->get_col( $wpdb->prepare(“SELECT * FROM $entry_tracking_table order by id desc limit 1”,0) );
- The topic ‘Import doesn't work if entries table is already large’ is closed to new replies.