Skip to content

Conversation

@masteradhoc
Copy link
Contributor

Fixes #357

What?

Adds a one-line server date/time display to the TOTP setup UI so users can verify the server clock and timezone when registering an authenticator app.

Why?

TOTP relies on timestamps; a misconfigured server clock or timezone causes OTPs to be invalid. Showing the current server date/time helps site administrators and users quickly confirm the server time is correct and avoid TOTP failures.

How?

Inserted a single translatable line above the QR/secret instructions in user_two_factor_options():
Uses date format and time format set in wordpress settings to format it appropriately.

Testing Instructions

  1. go to edit a user
  2. you can see the TOTP setup in the usual way
  3. apply changes
  4. refresh the page and see the server date/time formatted in your local site format

Screenshots or screencast

  1. Version with timezone associated to a city and date format F j, Y and timeformat g:i a
image
  1. Version with timezone associated set to UTC+1 and date format d.m.Y and timeformat H:i
image

Changelog Entry

Added - Show server date/time on TOTP setup so administrators can verify timezone/clock to avoid invalid OTPs

@github-actions
Copy link

github-actions bot commented Feb 1, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @My1.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: My1.

Co-authored-by: masteradhoc <masteradhoc@git.wordpress.org>
Co-authored-by: kasparsd <kasparsd@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display the current server date and time when attempting to register OTP

2 participants