Gravity Forms Mass Import
[resolved] Import doesn't work if entries table is already large (3 posts)

  1. eselk
    Posted 2 years ago #

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


  2. aryanduntley
    Plugin Author

    Posted 2 years ago #

    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.

  3. eselk
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Gravity Forms Mass Import
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic