{"id":24731477,"url":"https://github.com/timnashcouk/two-factor-enforced","last_synced_at":"2026-05-04T19:38:01.019Z","repository":{"id":270496715,"uuid":"910452006","full_name":"timnashcouk/two-factor-enforced","owner":"timnashcouk","description":"WordPress Plugin that enables Two-Factor Authentication for all newly registered users","archived":false,"fork":false,"pushed_at":"2024-12-31T16:15:11.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T21:57:13.275Z","etag":null,"topics":["wordpress","wordpress-plugin","wordpress-security"],"latest_commit_sha":null,"homepage":"https://timnash.co.uk","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timnashcouk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-31T10:05:06.000Z","updated_at":"2024-12-31T16:15:14.000Z","dependencies_parsed_at":"2024-12-31T17:33:22.391Z","dependency_job_id":null,"html_url":"https://github.com/timnashcouk/two-factor-enforced","commit_stats":null,"previous_names":["timnashcouk/two-factor-enforced"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftwo-factor-enforced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftwo-factor-enforced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftwo-factor-enforced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnashcouk%2Ftwo-factor-enforced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timnashcouk","download_url":"https://codeload.github.com/timnashcouk/two-factor-enforced/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244981293,"owners_count":20542288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-plugin","wordpress-security"],"created_at":"2025-01-27T16:50:38.111Z","updated_at":"2026-05-04T19:37:55.972Z","avatar_url":"https://github.com/timnashcouk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Two-Factor Enforced\n\nA WordPress plugin that extends, the WordPress plugin [Two-Factor](https://wordpress.org/plugins/two-factor/) to automatically enable Two-Factor for newly registered users.\n\n\n\n\n## Requirements\n- PHP 8.1+\n- WordPress 6.7+\n- Two-Factor 0.10.0+\n## Installation\n\n### Manual Installation\n\nDownload the plugin ZIP file from this repository.\n1. Upload the ZIP file via the Plugins \u003e Add New \u003e Upload Plugin section of your WordPress dashboard.\n2. Activate the plugin from the Plugins menu.\n\n### WP-CLI Installation\nRun the following via WP-CLI\n```\nwp cli plugin install https://github.com/timnashcouk/two-factor-enforced/releases/latest/two-factor-enforced.zip --activate \n```\n\n    \n## Usage/Examples\nOnce activated, the plugin will set all newly registered users to use the default Two-Factor Email Provider which uses the email they registered with.\n\n### Enabling for specific roles\nIf you wish to only have specifical roles such as administrator enforced then this can be set:\n\n- Through a define\n- Through a filter\n\n#### Defining roles\nWithin wp-config.php or similar config adding the following:\n```\ndefine( 'TWO_FACTOR_ENFORCED_ROLES', [ 'administrator' ] );\n```\nThis will limit the enforcement to just admin users\n\n#### Using a filter\nThe following can be used to filter the roles \n\n``` add_filter('two_factor_enabled_roles', function (): array {\n    return ['administrator'];\n});\n```\n### Changing Default Provider\nBy default the plugin will enable email as the default provider for a user. This can be changed via filters. \n\n\u003e [!NOTE] \n\u003e You need to change **BOTH** filters adding the new provider as the Primary and adding it into the list enabled for users.\n\n```\nadd_filter('two_factor_enforced_default_providers', function (array $default_providers, int $user_id): array { return ['Two_Factor_Email', 'Two_Factor_Debug']; }, 10, 2); \n```\nand \n```\nphp add_filter('two_factor_enforced_primary_provider', function (string $default_primary_provider, int $user_id): string { return 'Two_Factor_Debug'; }, 10, 2); \n```\n\n\n\n## Support\n\nIssues with code please do open a Github Issue. \nThe plugin is supplied as is with no formal support.\n\n## Changelog\nSee [CHANGELOG.md](https://github.com/timnashcouk/two-factor-enforced/blob/main/CHANGELOG.md) for notable changes per version.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnashcouk%2Ftwo-factor-enforced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimnashcouk%2Ftwo-factor-enforced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnashcouk%2Ftwo-factor-enforced/lists"}