PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Slow form render

  1. Hi,

    The contact page of a client with Gravity Form was rendering so slowly I had to remove the forms altogether.

    I am now testing the Form Preview and it's taking about 20 seconds to render a single form.

    Please let me know what is happening and how I can fix it. As you can imagine, the contact page of a client is important.

    Thanks for your quick reply,

    Dimitry

    Posted 10 years ago on Thursday September 22, 2011 | Permalink
  2. As a side note, the forms work fine on a staging site, but not in production. In production, they are slow. Any ideas?

    Posted 10 years ago on Thursday September 22, 2011 | Permalink
  3. Thanks for your support, guys.

    Posted 10 years ago on Thursday September 22, 2011 | Permalink
  4. @dimitryz,

    No need for snide remarks. You posted your request just 2 hours ago. It takes a while to get around to everyone so your patience would be appreciated. If you need priority support, you can use the priority support form to submit your request. There's still queue there, but those get answered first.

    This sounds like a server/configuration issue of some sort.. it could even be a php memory issue. Can you post a URL to a form page so we can check it out? We might also need an admin login to your site to take a look around. You can send that information via the contact form if you would like. If you choose to do so, please include a link back to this topic so we can reference it later.

    Posted 10 years ago on Thursday September 22, 2011 | Permalink
  5. I didn't see the Priority Support. Seemed like you were ignoring this request when you responded to those that came in afterward.

    The issue was with uniqid(). It takes a long time to generate an ID on certain servers. A solution was to use the microtime() function instead.

    Dimitry

    Posted 10 years ago on Friday September 23, 2011 | Permalink
  6. @dimitryz Different members of the support team handle different support issues based on the subject matter which is most likely why Kevin had not responded but you had seen him respond to other requests. He primarily responds to design and CSS related issues.

    Which uniqueid() function call are you referring to?

    There are over 200,000 unique WordPress sites running Gravity Forms with over 2 years worth of production use and this is the first time anyone has reported this issue. So we have never seen this behavior before or an encountered a server that had an issue with any of the core PHP or WordPress functions Gravity Forms uses.

    Posted 10 years ago on Friday September 23, 2011 | Permalink
  7. It's the uniqid() function call is in the Form ID generator, I believe. I don't have the code on hand. I remember an if/else statement and the entire function is 6 lines.

    I don't know why uniqid() was so slow on this server.

    In any case, the problem drove me crazy for two hours as I was print_r'ing 'here's to see where the problem lay.

    Do you have documentation for the code? I have the developer license and it would be nice to leverage the code in custom plugins for my clients without going through the Admin UI.

    Dimitry

    Posted 10 years ago on Friday September 23, 2011 | Permalink
  8. The documentation is for the functionality and how to use Gravity Forms. The code itself is commented.

    Customizations should be done via hooks and filters to change how Gravity Forms works. You should never edit or change the Gravity Forms plugin files themselves. Just like you customize WordPres via themes and plugins. All of the available hooks and filters are documented in the Developer Docs area of the Documentation.

    Hooks/filters are the WordPress way of customizing functionality in themes, plugins and WordPress itself.

    Technically we can't stop you from changing the core plugin files and editing the code directly, however we do not provide support for customized core files, meaning if you change the core Gravity Forms files we may not support it.

    Posted 10 years ago on Friday September 23, 2011 | Permalink
  9. Carl, I'm not sure you understand what I meant.

    I was wondering if you have documentation in case I wanted to use Gravity Forms in the same way I would PEAR's HTML_Quickform. In case, for instance, that I have a plugin that requires a form. It would build the form using code instead of have the form created through the admin interface of Wordpress.

    That way, I can add custom fields and additional functionality currently not available in the admin interface you provide.

    Is this something you've heard of done in the past?

    Posted 10 years ago on Monday September 26, 2011 | Permalink
  10. Gravity Forms cannot be used that way. It isn't how it's designed to be used. Forms are only created through the admin or via the form importer. There aren't any built in functions for creating forms completely on the fly via code.

    If you want to add custom fields and additional functionality it should be done using the available hooks and filters which is how all our add-ons add functionality to Gravity Forms. You can integrate with 3rd party services this way, add custom field types, etc.

    Posted 10 years ago on Monday September 26, 2011 | Permalink