Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Inline right away
  • Loading branch information
kasparsd committed Feb 13, 2026
commit 0aef4af4a6dd4533f66eb5238750673894de38e7
10 changes: 3 additions & 7 deletions providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,20 +353,16 @@ public function user_two_factor_options( $user ) {
</label>
<input type="submit" class="button totp-submit" name="two-factor-totp-submit" value="<?php esc_attr_e( 'Verify', 'two-factor' ); ?>" />
</p>
<?php
$datetime = wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) );
$tz_display = wp_timezone_string();
?>
<p class="description">
<?php
printf(
/* translators: 1: server date and time */
esc_html__( 'If the authentication code is rejected, please ensure that your server date and time %1$s is correct. Is is required for the authentication code to be accepted.', 'two-factor' ),
sprintf(
'<time class="two-factor-server-datetime-epoch" datetime="%1$s">%2$s (%3$s)</time>',
esc_attr( gmdate( 'c' ) ),
esc_html( $datetime ),
esc_html( $tz_display )
esc_attr( wp_date( 'c' ) ),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced datetime for standard timestamp string that can be useful for any dynamic updates in the future. I had it updating via JS every second from the initial timestamp but I realized that nothing was changing because we don't have the seconds in there.

esc_html( wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ) ),
esc_html( wp_timezone_string() )
)
);
?>
Expand Down