Skip to content

Conversation

@masteradhoc
Copy link
Contributor

Fixes #752

What?

Fix missing text domain arguments in translation function calls on the login header and footer, resolving WordPress Coding Standards (PHPCS) WordPress.WP.I18n.MissingArgDomain errors.

Why?

The affected files contained calls to __() and _x() without explicitly passing the text domain. While this may work at runtime, it violates WordPress i18n best practices and causes PHPCS errors in CI. Explicitly passing the two-factor text domain ensures correct translation loading and compliance with coding standards.

How?

Added the two-factor text domain to all affected internationalization function calls.

Updated the calls to include the required third $domain parameter.

No functional behavior was changed beyond improved translation correctness and standards compliance.

Testing Instructions

  1. Install Plugin Check Plugin
  2. Choose Two Factor, Categories = "General" and Types = "Error" & "Warning"
  3. see results
  4. apply fix
  5. see results

Changelog Entry

Fixed – Added missing text domain arguments to i18n function calls to comply with WordPress coding standards.

@jeffpaul jeffpaul requested a review from kasparsd January 27, 2026 00:49
@jeffpaul jeffpaul added this to the 0.15.0 milestone Jan 27, 2026
</button>

<em><?php esc_html_e( 'This invalidates all currently stored codes.' ); ?></em>
<em><?php esc_html_e( 'This invalidates all currently stored codes.', 'two-factor' ); ?></em>
Copy link
Collaborator

@kasparsd kasparsd Jan 27, 2026

Choose a reason for hiding this comment

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

Let's keep this one and remove the other changes since those are clones of WP core files due to bundling of required functions for the two-factor flow to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kasparsd thanks, feedback is done and pr is ready for another review :)

@github-actions
Copy link

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.

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

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.

@masteradhoc masteradhoc requested a review from kasparsd January 30, 2026 22:50
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.

Plugin Check: Missing $domain parameter

3 participants