I’m having an issue with a form taking a very long time to validate before showing the next form.
I do not know if it’s a GravityForm fix or a server side issue but I’m running into 2 issues:
Sometimes the form takes a long time to validate before showing the next part of the form
A user can hit “Next” twice with the correct code and then it shows - which is great, but shouldn’t have to hit next twice.
Mind you, the code list contains about 2.7 million unique codes but wondering if there is a way to speed the process up. It was working fine before but not sure what’s going on now and running out of ideas.
If anyone wants to test - they can use the code 12345 (there are no duplicates so if I see it in the back-end I will remove it and it can be used again)
Another note - so when it takes a very long time to validate, I click the next button a second time, after like 5-7 seconds after my first next attempt (sometimes it just spins forever), and then it goes through. Not sure why it works that way.
Going through 2.7m codes in a file, one by one, is not going to be very efficient. I recommend storing those in a database table and then querying the table for the code that is submitted.
Just replace the part taken from your link… $codes = file('http://garritonbar.live/wp-content/uploads/2018/11/test.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
…with simple wp query fct