I've noticed that auto-draft posts for my custom post types are generated whenever someone visits a page containing a CRED form even without entering any details or submitting the form. Is this expected?
Hi Julie,
Thanks for asking! I'd be happy to help.
This isn't the expected behavior and during the initial testing on my website, I couldn't reproduce this on a clean install.
Can you please share temporary admin login details, so that I can see how this form is configured so that it can be reproduced?
If sharing admin access is not possible, you can test this on a clean install and share the steps of how the form was configured.
In case the issue is limited only to a particular website, make sure that all active plugins, theme, and WordPress are updated to the latest versions. Please also test without the extra (non-Toolset) plugins and any custom code, to narrow down to a possible conflict.
Your next reply will be private and please let me know how it goes.
regards,
Waqar
Hi Julie,
Thank you for sharing further details.
I wasn't able to access the admin area of the website that you've shared since it kept on showing the message "Sorry, your request cannot be accepted."
But I performed some further tests on my own website and the results will further clarify how auto-draft posts work.
1. When a new post is created using a Toolset Form, it creates two entries in WordPress' post table ( "_posts" ).
a). One for the newly added post.
b). Another one for the next future post starting with the title "CRED Auto Draft......"
( this can be seen in the database through a tool like phpMyAdmin but not in the WordPress admin's post list )
When the next post is added through the Toolset Form, it replaces the last "CRED Auto Draft..." post entry and another "CRED Auto Draft..." is generated and the cycle continues.
It is important, to note that this happens when the Toolset Form is submitted and not when a page with the form is visited.
2. Any post entries with "Auto Draft" are added by WordPress, as part of its post revision feature.
lien caché
You're welcome to perform tests on your website(s) to confirm this and if you still notice something different than what is shared here, please let me know.
regards,
Waqar
Hi Waqar
Thank you for clarifying how post creation works - I did double check the process when I spotted what was happening. I had wondered whether a user was entering data but not actually submitting the form but taking long enough for auto-save to trigger but a draft post doesn't appear in wp-admin and I've visited the page myself without entering anything and an auto-draft post has been created in the database.
I'm so sorry you couldn't log in - I completely forgot that I have country blocking enabled. What country codes should I unblock for you (you can give me a few so you're not giving too much away??).
Hi Julie,
Thanks for writing back.
When you say "auto-draft post has been created in the database.", do you mean Toolset Form's "CRED Auto Draft" post ( point 1 from my last message ) or WordPress's "Auto Draft" revision post ( point 2 from my last message )?
When you'll check the title of the generated post in the database, this will become clearer.
Since now it is clear that these draft posts can only be seen through the database, I'm afraid, the WordPress admin access alone won't be enough for this troubleshooting.
Can you please share clone/snapshot of the website where this behavior can be seen?
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )
Your next reply will be private and please also share the information about the page(s) and form(s) which results in auto-draft posts, without form's submissions.
regards,
Waqar
Hi Julie,
Thank you for sharing these details and the website's backup.
I have downloaded the zip files and will restore them on my server to perform some troubleshooting.
Will update you with my findings, as soon as it completes.
regards,
Waqar
Hi Julie,
Thank you for waiting, while I performed some further tests on my own website and your website's clone.
Your observation about the "CRED Auto Draft..." post created on a visit to a form with Toolset Form is correct and it is linked to visitor's IP.
When a visitor with a unique/new IP visits a page with a Toolset Form, a "CRED Auto Draft..." post is generated.
( this title is generated in a way that it stays unique with respect to IP ).
If anyone with the same IP will visit a page with a Toolset Form for that specific post type, no new "CRED Auto Draft..." post will be created.
( since the draft post with that same title will exist in the database against that post type ).
If a visitor with the same IP then submits the form, that existing "CRED Auto Draft..." post is converted to an actual post and a new "CRED Auto Draft..." post is created for a future post.
Note: System also deletes all "CRED Auto Draft..." posts which are older than 4 hours and were never converted into the actual posts.
I hope these findings will help.
regards,
Waqar
hi Waqar
Many thanks for checking this out. To ensure I've understood you correctly, are you saying that in fact this IS expected behaviour then? Only in your first reply you indicated it wasn't and that you couldn't replicate the behaviour either so I'm a bit puzzled now!
Hi Julie,
Yes, this is the expected behavior, and I apologize I couldn't catch this during the initial testing since the IP address that was being used for the page visits and form submissions remained the same.
After reviewing the Toolset Form's plugin code that actually sets those "CRED Auto Draft..." posts, observations that you shared and testing with different IP addresses, I was able to confirm that this is dependant on visitor's IP address and can happen on page visit, without form submission.
Hope this clarifies.
regards,
Waqar
Yes, that makes sense. Thank you for your help with this.