0

Is there a way to pause form submissions during the plugin/WordPress core upgrade process. The problem I am trying to solve is that when upgrading a live site at some point the default WP 'Briefly unavailable for scheduled maintenance' message appears.

In most cases this is fine, the user can simply reload their page. But a site I am working on has some complex (and long) multi-page forms. It is entirely possible that a user could be on one of these forms when the upgrade button is hit. They could then in theory press submit at the very time the database is unavailable - meaning their data is lost.

Is there anything that I could do about this? I am currently using one particular plugin to manage forms, but in theory this is a problem that could exist for any plugin, or indeed any form submission code you'd care to create.

Thoughts and theories welcomed!

0

There are a couple of ways to check if wordpress is actively running the core upgrade process. First, you could check the WP_INSTALLING constant, or use the wp_installing() function.

Wordpress will also utilize a .maintenance or maintenance.php file if you'd like to present any custom messages to users while the upgrade process is happening. Here is an example that goes beyond Wordpress's sparse documentation on the topic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.