Skip to content

add wp-cli docs for two-factor - #998

Merged
kasparsd merged 2 commits into
masterfrom
documentation-cli
Sep 26, 2026
Merged

kasparsd merged 2 commits into
masterfrom
documentation-cli

Conversation

@masteradhoc

@masteradhoc masteradhoc commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

What?

Adds a == WP-CLI Commands == section to readme.txt documenting the wp two-factor command namespace, and updates an existing FAQ answer that referenced an outdated manual workaround.

Why?

#905 added the wp two-factor WP-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 via wp help two-factor <command> (PHPDoc-generated), but that only helps someone who already knows the commands exist. readme.txt is 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_providers as a manual workaround. That bypasses the fail-closed/cleanup logic #905 introduced, so it should point to wp two-factor disable instead.

How?

  • Added a new == WP-CLI Commands == section to readme.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.
  • Listed all six commands from #233: Add WP-CLI support with wp two-factor commands #905 with a one-line description each, plus a pointer to wp help two-factor and wp help two-factor <command> for full options and examples.
  • Updated the FAQ entry under "How do I disable 2FA for a user who is locked out?" to replace the wp user meta delete ... line with wp two-factor disable <user_id> --yes, referencing the new section.
  • Documentation-only change; no PHP code touched.

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

  1. View the diff on readme.txt and confirm the == WP-CLI Commands == section is well-formed (valid readme.txt syntax — no broken section markers).
  2. Optionally validate with wp plugin validate-readme readme.txt to confirm no new warnings are introduced.
  3. Confirm each listed command name/description matches what's registered in cli/class-two-factor-cli-command.php and what wp help two-factor outputs.
  4. Confirm the updated FAQ answer no longer references wp user meta delete _two_factor_enabled_providers and instead references wp two-factor disable <user_id> --yes.
  5. (Optional) Preview how the readme.txt will render using the WordPress.org readme validator to sanity-check formatting.

Screenshots or screencast

N/A — readme.txt content change only, no UI changes.

Changelog Entry

Added - Documented the wp two-factor WP-CLI commands in readme.txt and updated the locked-out-user FAQ to reference wp two-factor disable instead of a manual meta workaround.

Open WordPress Playground Preview

@masteradhoc masteradhoc added this to the 0.17.0 milestone Sep 26, 2026
@masteradhoc masteradhoc self-assigned this Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

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 changed the title add docs add wp-cli docs for two-factor Sep 26, 2026
@kasparsd
kasparsd merged commit d22bedb into master Sep 26, 2026
26 checks passed
@kasparsd
kasparsd deleted the documentation-cli branch September 26, 2026 09:09
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.

2 participants