403 ) ); } check_admin_referer( self::ACTION ); if ( ! isset( $_POST['confirm_backup'] ) || '1' !== sanitize_key( wp_unslash( $_POST['confirm_backup'] ) ) ) { $this->notice->store( ConversionResult::failure( __( 'Confirm that you have a backup first.', 'siteunfold' ) ), Notice::REVERT ); wp_safe_redirect( RevertPage::url() ); exit; } // Read the target before reverting: afterwards network_admin_url() no longer applies. $singleSiteUrl = ToolsPage::url(); $result = $this->reverter->revert(); $this->notice->store( $result, Notice::REVERT ); // On success the next request already runs as a single site: continue on the // Tools screen there (which may ask to log in again). wp_safe_redirect( $result->succeeded() ? $singleSiteUrl : RevertPage::url() ); exit; } }