Skip Navigation

[Closed] Form timing out from submission but data is transferring

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 1 month, 2 weeks ago.

Assigned support staff: Nigel.

Author
Posts
#2084481

We have a toolset form for data entry that creates a custom post type entry. The form used to work perfectly but in the last few weeks every time a user enters data and submits the form they get a time out.

Originally we thought it was due to imagery and videos being too large and timing out but we have subsequently tested without any images or videos, purely text input and we encounter the same issue.

The data submitted transfers and is recorded in the back end but the front end user gets an error message as if it has failed.

#2084699

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

Do you have a staging site we can test this on to see the issue and perform some debugging, such as deactivating other plugins to see if there are any conflicts, checking the browser console for errors etc.?

Let me set up a private reply to get credentials from you. You may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.

Can you also confirm the url of where we can see the problem.

#2088511

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Paul

I just tried the workflow you described, and on the brand form at some point while I was completing it a JS error appeared in the console, and the form would not submit.

I'll try again in the morning and get back to you.

#2090275

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Sorry Paul, I had forgotten that I'd arranged yesterday off at short notice for a vaccine appointment.

I've been testing this on the staging site this morning.

The JS errors I saw in the console are something of a red herring, they have no effect on submitting the form.

I tried deactivating all non-Toolset plugins and gradually adding them back a few at a time, to see if I could see what was provoking the issue, to no avail.

In fact, I couldn't actually reproduce the issue as described in the opening post at all. The form submits successfully and reasonably promptly when not including any images in the form fields, even after re-activating all the plugins (perhaps you could verify I re-activated everything that was active before).

I did find that the form submissions were very slow when including multiple image attachments.

There are a couple of things to comment on here.

Firstly, you are not using the setting to use the WP Media Uploader, which means that rather than the images being uploaded while the user completes the form, they are all left to the end and uploaded together with the form submission. The available server resources will influence how long it takes to handle the uploads. When the images are uploaded, WordPress will generate the various registered image sizes, and you are also using the Smushit plugin, which I think also intervenes in the process to optimise images (I'm not entirely sure about when that occurs).

The thing is, you said at the outset that the problem also happens when submitting the forms with no images.

But I cannot see such an issue, you'll not that I've created quite a few submissions, and the ones with text only all happened pretty smoothly and promptly.

#2092465

Ok thanks for the work you have done.

You mention the WP Media Uploader setting. How do I enable that setting as uploading the images prior to submission should improve the situation.

You also mention that WordPress creates the images at various sizes, therefore, doing the same job as Smushit so should I disable Smushit for the time being as it is doing the same thing?

Third question, is there a way of restricting the image upload size to say 2mb (or a better image size?)

#2092491

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2021-06-18 at 14.02.27.png

To use the built-in WP media uploader, check the settings near the top of your form, as shown in the screenshot.

I think the smushit plugin is to compress images, isn't it?

That's distinct from generating the various image sizes which WordPress does automatically, but it does add load to the server. It may be a question of balance between the two that determines whether you think it worth using or not.

As for limiting the size of uploaded images, as for what's possible using Toolset APIs, the answer is yes and no.

Yes, you could use the cred_form_validate filter to check the image file size and reject large images, but the problem with that is that the validation occurs on the server, meaning that the image has to be uploaded to the server before it can determine whether it is larger than the recommended size for uploading to the server. To check the file size before uploading it to the server would require a custom JS implementation, but I don't have any pointers for that I'm afraid.

The topic ‘[Closed] Form timing out from submission but data is transferring’ is closed to new replies.