add wp-cli docs for two-factor - #998
Merged
Merged
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
kasparsd
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Adds a
== WP-CLI Commands ==section toreadme.txtdocumenting thewp two-factorcommand namespace, and updates an existing FAQ answer that referenced an outdated manual workaround.Why?
#905 added the
wp two-factorWP-CLI commands (status, list-providers, enable, disable, backup-codes generate, unlock), but they were never documented anywhere an end user would see them. Per-command help exists viawp help two-factor <command>(PHPDoc-generated), but that only helps someone who already knows the commands exist.readme.txtis the only surface guaranteed to reach end users, since it renders directly as the plugin's page on wordpress.org/plugins/two-factor — README.md only reaches contributors browsing GitHub.Separately, the existing FAQ entry "How do I disable 2FA for a user who is locked out?" told admins to run
wp user meta delete <user_id> _two_factor_enabled_providersas a manual workaround. That bypasses the fail-closed/cleanup logic #905 introduced, so it should point towp two-factor disableinstead.How?
== WP-CLI Commands ==section toreadme.txt, placed after the existing= Actions & Filters =subsection and before== Redirect After the Two-Factor Challenge ==, following the plugin's existing convention of arbitrary top-level sections for developer/advanced-usage content.wp two-factorcommands #905 with a one-line description each, plus a pointer towp help two-factorandwp help two-factor <command>for full options and examples.wp user meta delete ...line withwp two-factor disable <user_id> --yes, referencing the new section.Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Model(s): Claude Sonnet 5
Used for: Researched documentation conventions across other WordPress-owned plugins to decide where WP-CLI usage should live, and drafted the readme.txt section wording and FAQ replacement. Placement, wording, and final content were reviewed and edited by me before submission.
Testing Instructions
readme.txtand confirm the== WP-CLI Commands ==section is well-formed (valid readme.txt syntax — no broken section markers).wp plugin validate-readme readme.txtto confirm no new warnings are introduced.cli/class-two-factor-cli-command.phpand whatwp help two-factoroutputs.wp user meta delete _two_factor_enabled_providersand instead referenceswp two-factor disable <user_id> --yes.Screenshots or screencast
N/A — readme.txt content change only, no UI changes.
Changelog Entry
Added - Documented the
wp two-factorWP-CLI commands in readme.txt and updated the locked-out-user FAQ to referencewp two-factor disableinstead of a manual meta workaround.