This commit is contained in:
Javier Casares 2026-09-18 04:36:07 +00:00
commit c3f0eac50c

View file

@ -858,6 +858,20 @@ class Profile_Settings {
$nonce = sanitize_text_field( wp_unslash( $_POST[ self::NONCE_FIELD ] ) );
if ( ! wp_verify_nonce( $nonce, self::NONCE_ACTION ) ) {
/*
* A stale form (nonce expired) previously returned silently, which
* left wizard-trapped users clicking Save with no visible result
* while the setup-required redirect kept bouncing them back to the
* profile. Fail loudly so the user knows to try again.
*/
$this->focus_section = true;
add_settings_error(
'robotstxt-2fa',
'robotstxt-2fa-nonce-expired',
__( 'Your form session expired and nothing was saved. Please try saving again.', 'robotstxt-2fa' ),
'error'
);
return;
}