WPIntell

Source evidence

Expired transients issue

VS Contact Form · support · 2025-10-25T23:23:00+00:00

mixedsentiment
highseverity
0.95relevance
18replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 27 rows with source links

25.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
nmrockswp resolved
This is the best simple contact form I have ever found. Thank you for the great work! However, one thing bothers me: The plugin creates around 250 (and more) “expired transients” in the WP-database per day. (I don’t use caching). This bloats the database unnecessarily and could slow down the loading of the website. An example expirend transient: “_transient_vscf_2128c3dd781a62b..” Currently the only way I can solve this is to manually delete the expired transients every day. Why are so many expired transients generated and how can I solve this problem? This topic was modified 4 months, 2 weeks ago by Jan Dembowski . This topic was modified 4 months, 2 weeks ago by Yui . Reason: renamed, moved to support Hi @nmrockswp , Sorry, did not read this until today. First, thanks for the review. I use the transient to store the unique numbers for the captcha. This transient is deleted upon successful form submission or once per day if not used. WP does this removal for you. If your site has much traffic, each unique IP will create its own transient. Yes, this may cause a lot of temporary(!) transients in your DB. I’m looking into creating an alternative approach (1 transient that holds all sessions for example). Guido Thanks for your reply! Aha, so it’s due to the CAPTCHA. Unfortunately, WordPress doesn’t delete them automatically (at least not for me). I think your approach of packaging all sessions (ideally for one day) into a single transient is excellent. Perhaps you might also have an idea which command code (e.g., in wp-config.php or functions.php) could be used to automatically delete the transients daily. 😉 Hi @nmrockswp , FYI: forum moderator has moved your review to the support forum. If you’re not using caching, WP should delete them (the expired ones) once a day. I’m planning to add a force removal in my plugin, that deletes all expired transients each time a transient is created (this happens per unique IP-address). If you are willing, you can already try this.. Open main plugin file vscf.php and look for the string that starts with set_transient( (= line 156). Add this directly underneath: delete_expired_transients(); Now wait for some time and check if your expired transients are deleted. Please let me know if this works? Guido Unfortunately, WordPress doesn’t automatically delete your plugin’s transients, so I had to delete them manually (using a plugin). But I added your command code yesterday, and it works! 🙂 As of today, your plugin’s transients are no longer being saved. I also tested whether the contact form, including submission, works, and especially whether the CAPTCHA still changes automatically when the IP address changes. Everything is great! Thank you so much! Great, I will update plugin this week. Currently ALL expired transients are deleted (which is fine, because they are expired), but I did create a ticket at the Make WP Core page, to suggest an option to only delete certain transients (instead of all transients). IMO a plugin/theme should only delete its own stuff. For the captcha I need something to temporary hold the variable, that why I use transients. Using the same (one big) transient for all sessions (as mentioned earlier) may be unstable. Ah, I see you’ve now added delete_expired_transients(); . Thank you so much for your update to 18.4 and for opening a ticket about this. If it were up to me, you wouldn’t need to change anything else. 🙂 Thank you for your great work! Hello, I think your ‘fix’ created a new issue… My site became slow after your recent update. In MySQL, I found hundreds of your delete transient queries attempting to process. I had to restart my server in order to resolve the issue. So it seems that occasionally these queries run slow (have seen that too) in times of high traffic… and can also pile up. Any thoughts? Hi Jason, Thanks for informing me! The request to delete expired transients is done when new transient is created. But in case of high traffic from unique IPs, lots of new transients are created = also lots of requests to delete expired ones. Are you able to determine if you also have/had many attempts to create transients that couldn’t be processed? Or only requests to delete transients? Guido The latter.. the deletes have caused me issues. Apparently WP does not allow these piled up transient removal requests to execute. You could say, this is not something that my plugin causes, but if this can happen, I should try to fix this or find an alternative for using transients… Hi againa @nmrockswp and @jasonmk1 , I have just updated plugin and completely removed transients in favour of native PHP sessions. The sum captcha values are not stored in the database anymore. So no more “trips to the database”. Guido @guido07111975 Oh dear. Serious errors are occurring after this update! WordPress is displaying the following: An active PHP session has been detected: A PHP session was created by a session_start() function call. This is affecting REST API and loopback requests. The session should be closed by session_write_close() before any HTTP requests are made. An error occurred while testing the REST API: REST API endpoint: https://www.XXXXXX.com/wp-json/wp/v2/types/post?context=edit REST API response: (http_request_failed) cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received @nmrockswp Where are you seeing these errors? That’s not good.. Could you add this in main plugin file vscf.php at line 152 (directly above the closing bracket of the vscf_session function): session_write_close(); And let me know if this is fixing the issue? Guido Hello, Since I am experiencing the same issue with several of my projects using the VS Contact Form plugin, I tested the proposed solution right away. I can confirm that it works. After inserting the suggested line of code, the warning disappears immediately. From my side, there should be no obstacles to releasing an updated version of the plugin. Kind regards, Dirk Hi, Thank you all for informing me, just updated plugin that fixes the error at Site Health page. Guido Thank you very much! The error messages in the WordPress-Dashboard have now disappeared. 🙂 Great! Just in case, please also check if the sum changes after submission is send. It should be. Guido

Comments

18 shown
Guido 2026-01-24T19:29:00+00:00

Hi @nmrockswp , Sorry, did not read this until today. First, thanks for the review. I use the transient to store the unique numbers for the captcha. This transient is deleted upon successful form submission or once per day if not used. WP does this removal for you. If your site has much traffic, each unique IP will create its own transient. Yes, this may cause a lot of temporary(!) transients in your DB. I’m looking into creating an alternative approach (1 transient that holds all sessions for example). Guido

nmrockswp 2026-01-26T02:38:00+00:00

Thanks for your reply! Aha, so it’s due to the CAPTCHA. Unfortunately, WordPress doesn’t delete them automatically (at least not for me). I think your approach of packaging all sessions (ideally for one day) into a single transient is excellent. Perhaps you might also have an idea which command code (e.g., in wp-config.php or functions.php) could be used to automatically delete the transients daily. 😉

Guido 2026-01-26T10:41:00+00:00

Hi @nmrockswp , FYI: forum moderator has moved your review to the support forum. If you’re not using caching, WP should delete them (the expired ones) once a day. I’m planning to add a force removal in my plugin, that deletes all expired transients each time a transient is created (this happens per unique IP-address). If you are willing, you can already try this.. Open main plugin file vscf.php and look for the string that starts with set_transient( (= line 156). Add this directly underneath: delete_expired_transients(); Now wait for some time and check if your expired transients are deleted. Please let me know if this works? Guido

nmrockswp 2026-01-27T13:26:00+00:00

Unfortunately, WordPress doesn’t automatically delete your plugin’s transients, so I had to delete them manually (using a plugin). But I added your command code yesterday, and it works! 🙂 As of today, your plugin’s transients are no longer being saved. I also tested whether the contact form, including submission, works, and especially whether the CAPTCHA still changes automatically when the IP address changes. Everything is great! Thank you so much!

Guido 2026-01-27T15:20:00+00:00

Great, I will update plugin this week. Currently ALL expired transients are deleted (which is fine, because they are expired), but I did create a ticket at the Make WP Core page, to suggest an option to only delete certain transients (instead of all transients). IMO a plugin/theme should only delete its own stuff. For the captcha I need something to temporary hold the variable, that why I use transients. Using the same (one big) transient for all sessions (as mentioned earlier) may be unstable.

nmrockswp 2026-01-29T13:50:00+00:00

Ah, I see you’ve now added delete_expired_transients(); . Thank you so much for your update to 18.4 and for opening a ticket about this. If it were up to me, you wouldn’t need to change anything else. 🙂 Thank you for your great work!

jasonmk1 2026-02-18T15:05:00+00:00

Hello, I think your ‘fix’ created a new issue… My site became slow after your recent update. In MySQL, I found hundreds of your delete transient queries attempting to process. I had to restart my server in order to resolve the issue. So it seems that occasionally these queries run slow (have seen that too) in times of high traffic… and can also pile up. Any thoughts?

Guido 2026-02-19T11:02:00+00:00

Hi Jason, Thanks for informing me! The request to delete expired transients is done when new transient is created. But in case of high traffic from unique IPs, lots of new transients are created = also lots of requests to delete expired ones. Are you able to determine if you also have/had many attempts to create transients that couldn’t be processed? Or only requests to delete transients? Guido

jasonmk1 2026-02-19T14:21:00+00:00

The latter.. the deletes have caused me issues.

Guido 2026-02-19T15:09:00+00:00

Apparently WP does not allow these piled up transient removal requests to execute. You could say, this is not something that my plugin causes, but if this can happen, I should try to fix this or find an alternative for using transients…

Guido 2026-02-28T13:37:00+00:00

Hi againa @nmrockswp and @jasonmk1 , I have just updated plugin and completely removed transients in favour of native PHP sessions. The sum captcha values are not stored in the database anymore. So no more “trips to the database”. Guido

nmrockswp 2026-03-01T20:12:00+00:00

@guido07111975 Oh dear. Serious errors are occurring after this update! WordPress is displaying the following: An active PHP session has been detected: A PHP session was created by a session_start() function call. This is affecting REST API and loopback requests. The session should be closed by session_write_close() before any HTTP requests are made. An error occurred while testing the REST API: REST API endpoint: https://www.XXXXXX.com/wp-json/wp/v2/types/post?context=edit REST API response: (http_request_failed) cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

jasonmk1 2026-03-01T21:57:00+00:00

@nmrockswp Where are you seeing these errors?

Guido 2026-03-01T22:43:00+00:00

That’s not good.. Could you add this in main plugin file vscf.php at line 152 (directly above the closing bracket of the vscf_session function): session_write_close(); And let me know if this is fixing the issue? Guido

computerdirk 2026-03-02T06:31:00+00:00

Hello, Since I am experiencing the same issue with several of my projects using the VS Contact Form plugin, I tested the proposed solution right away. I can confirm that it works. After inserting the suggested line of code, the warning disappears immediately. From my side, there should be no obstacles to releasing an updated version of the plugin. Kind regards, Dirk

Guido 2026-03-02T07:31:00+00:00

Hi, Thank you all for informing me, just updated plugin that fixes the error at Site Health page. Guido

nmrockswp 2026-03-02T10:42:00+00:00

Thank you very much! The error messages in the WordPress-Dashboard have now disappeared. 🙂

Guido 2026-03-02T12:52:00+00:00

Great! Just in case, please also check if the sum changes after submission is send. It should be. Guido