From 793ce261a9addd5735a8f0293baa9b95bee2db4b Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 13 Feb 2026 13:18:12 +0200 Subject: [PATCH 1/8] Group styles, scripts and remove extra leftover markup --- providers/class-two-factor-totp.php | 104 ++++++++++++---------------- 1 file changed, 46 insertions(+), 58 deletions(-) diff --git a/providers/class-two-factor-totp.php b/providers/class-two-factor-totp.php index d2549efb..bfcf897e 100644 --- a/providers/class-two-factor-totp.php +++ b/providers/class-two-factor-totp.php @@ -311,12 +311,53 @@ public function user_two_factor_options( $user ) { if ( empty( $key ) ) : $key = $this->generate_key(); $totp_url = $this->generate_qr_code_url( $user, $key ); - + ?> +

+ +

+
    +
  1. + +
  2. +
  3. + +

    + + + + +

    +

    + + +

    +
  4. +
  5. + +
  6. +
+

+ + + +

+ -

+

-

- -

- -
    -
  1. - -
  2. -
  3. - - -

    - - - - -

    - -

    - -
    - -

    -
  4. -
- -
-
    -
  1. - -
  2. -
-

- - - -

- - -

@@ -724,7 +712,7 @@ protected static function pad_secret( $secret, $length ) { * @param int $digits The number of digits in the returned code. * @param string $hash The hash used to calculate the code. * @param int $time_step The size of the time step. - * + * * @throws InvalidArgumentException If the hash type is invalid. * * @return string The totp code @@ -744,7 +732,7 @@ public static function calc_totp( $key, $step_count = false, $digits = self::DEF break; default: throw new InvalidArgumentException( 'Invalid hash type specified!' ); - } + } if ( false === $step_count ) { $step_count = floor( self::time() / $time_step ); From 423abae2cf40cd2fc429bdd44a9e24059198c2de Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 13 Feb 2026 13:28:44 +0200 Subject: [PATCH 2/8] Additional markup to allow dynamic time updates --- providers/class-two-factor-totp.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/providers/class-two-factor-totp.php b/providers/class-two-factor-totp.php index bfcf897e..afb0a31f 100644 --- a/providers/class-two-factor-totp.php +++ b/providers/class-two-factor-totp.php @@ -357,13 +357,17 @@ public function user_two_factor_options( $user ) { $datetime = wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ); $tz_display = wp_timezone_string(); ?> -

+

%2$s (%3$s)', + esc_attr( gmdate( 'c' ) ), + esc_html( $datetime ), + esc_html( $tz_display ) + ) ); ?>

From 30cbe1e4b40e7366e61e11a53e1a13efdd2a4811 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 13 Feb 2026 13:34:11 +0200 Subject: [PATCH 3/8] Group the input as step 3 --- providers/class-two-factor-totp.php | 66 +++++++++++++++-------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/providers/class-two-factor-totp.php b/providers/class-two-factor-totp.php index afb0a31f..6508717e 100644 --- a/providers/class-two-factor-totp.php +++ b/providers/class-two-factor-totp.php @@ -330,47 +330,49 @@ public function user_two_factor_options( $user ) {

+

+

  • - -
  • - -

    - -

    +

    + + + +

    - - - -

    - -

    - %2$s (%3$s)', - esc_attr( gmdate( 'c' ) ), - esc_html( $datetime ), - esc_html( $tz_display ) - ) - ); - ?> -

    +

    + %2$s (%3$s)', + esc_attr( gmdate( 'c' ) ), + esc_html( $datetime ), + esc_html( $tz_display ) + ) + ); + ?> +

    + +