Support » Plugin: Gravity Forms Mass Import » Import doesn't work if entries table is already large

  • Resolved eselk


    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) );

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author aryanduntley


    Thanks for finding this bug. I’ll incorporate it in a release. I no longer actively maintain this plugin, but I have no problem updating when people find important things that could improve performance.

    Sounds good, and thanks for making this plug-in, other than this one issue it worked great, and saved me a ton of time.

    For the record, I’m using WP 3.8.1 (latest version as of now), and Gravity Forms 1.7.11 — works great with those versions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Import doesn't work if entries table is already large’ is closed to new replies.