承接 stutzmedien/2fa 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stutzmedien/2fa

最新稳定版本:26.0.1

Composer 安装命令:

composer require stutzmedien/2fa

包简介

Authenticator compatible 2FA for WordPress

README 文档

README

A lightweight WordPress plugin that adds Time‑based One‑Time Password (TOTP) two‑factor authentication to user accounts. Compatible with common authenticator apps like Google Authenticator, Authy, and 1Password.

✨ Features

  • TOTP Authentication – Secure time-based one-time passwords
  • Recovery Codes – One-time fallback codes with regenerate and download options
  • User Control – Per-user enable/disable functionality
  • Quick Setup – QR code provisioning for easy configuration
  • Login Flow Integration – 2FA challenge injected into wp-login
  • Tested – Comprehensive PHPUnit test suite

📋 Requirements

  • PHP: 8.4 or higher
  • WordPress: 6.8 or higher
  • Composer: For dependency management

🚀 Quick Start

Installation

composer require stutzmedien/2fa

Activation

  1. Navigate to wp-admin → Plugins
  2. Find "Andromeda Two‑Factor Authentication"
  3. Click Activate

User Setup

  1. Go to Users → Your Profile
  2. Find the "Two‑Factor Authentication" section
  3. Scan the QR code with your authenticator app
  4. Enter the 6-digit code to verify setup
  5. Check "Enable 2FA" and save your profile
  6. Store your recovery codes in a safe place
  7. Use Generate Recovery Codes when you run out

🛠️ Development

Project Structure

andromeda-2fa.php          # Plugin bootstrap
inc/                       # Core plugin classes
├── helpers.php
├── UserSettings.php
├── TotpManager.php  
├── QrCodeGenerator.php
├── RecoveryManager.php
├── LoginHandler.php
└── Plugin.php
src/                       # Admin/login assets
├── css/
└── js/
tests/                     # PHPUnit tests
└── Unit/                  # Test suites

Available Scripts

Command Description
composer test Run test suite
composer test:coverage Run tests with HTML coverage report
composer lint Check code style
composer lint:fix Auto-fix code style issues

Code Coverage

  • Requires Xdebug installed and enabled.
  • The coverage script sets XDEBUG_MODE=coverage automatically.
  • After composer test:coverage, open the HTML report in the coverage/ directory.

⚙️ Technical Details

Login Flow

  • A 2FA challenge is triggered after primary credential validation for users with 2FA enabled.
  • The login form accepts either a 6-digit TOTP or a recovery code.
  • Challenge state is tracked via a short-lived cookie (andromeda_2fa_token) and transient (andromeda_2fa_auth_{token}).

Data Storage

  • Secret Key: andromeda_2fa_secret (user meta)
  • Status: andromeda_2fa_enabled (user meta)
  • Recovery Codes: andromeda_2fa_recovery_codes (user meta, hashed)
  • QR Codes: Generated as data URIs (no file system writes)
  • Recovery Codes Preview: transient andromeda_2fa_plain_codes_{user_id} (shown once)

Dependencies

  • Managed via composer.json
  • PSR-4 autoloading for clean architecture

🔒 Security

Found a security issue? Please contact us privately at development@stutz-medien.ch instead of filing a public issue.

📄 License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

统计信息

  • 总下载量: 62
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-01-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固