Skip to content

Commit

Permalink
Merge branch 'master' into 630-fix-uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd authored Sep 19, 2024
2 parents 077c220 + 642f665 commit c152d19
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
/package-lock.json
/phpcs*
/phpunit*
/phpstan.*
/readme.md
/SECURITY.md
/SECURITY.md
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
- name: Lint PHP Compatibility
run: composer lint-compat

- name: PHPStan
run: npm run lint:phpstan

test-php:
name: Test PHP ${{ matrix.php }} ${{ matrix.wp != '' && format( ' (WP {0}) ', matrix.wp ) || '' }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/dist/
/tests/logs/
.phpunit.result.cache
phpstan.neon
Binary file modified assets/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion class-two-factor-compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ public function jetpack_rememberme( $rememberme ) {
* @return boolean
*/
public function jetpack_is_sso_active() {
return ( method_exists( 'Jetpack', 'is_module_active' ) && Jetpack::is_module_active( 'sso' ) );
return ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'is_module_active' ) && Jetpack::is_module_active( 'sso' ) );
}
}
2 changes: 1 addition & 1 deletion class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Two_Factor_Core {
* @since 0.1-dev
*/
public static function add_hooks( $compat ) {
add_action( 'init', array( __CLASS__, 'get_providers' ) );
add_action( 'init', array( __CLASS__, 'get_providers' ) ); // @phpstan-ignore return.void
add_action( 'wp_login', array( __CLASS__, 'wp_login' ), 10, 2 );
add_filter( 'wp_login_errors', array( __CLASS__, 'maybe_show_reset_password_notice' ) );
add_action( 'after_password_reset', array( __CLASS__, 'clear_password_reset_notice' ) );
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^8.5|^9.6",
"spatie/phpunit-watcher": "^1.23",
"szepeviktor/phpstan-wordpress": "^1.3",
"wp-coding-standards/wpcs": "^3.1",
"yoast/phpunit-polyfills": "^2.0"
},
"scripts": {
"lint": "phpcs",
"lint-compat": "phpcs -p --standard=PHPCompatibilityWP --runtime-set testVersion 7.2- --extensions=php --ignore='tests/,dist/,includes/Yubico/,vendor/,node_modules/' .",
"lint-phpstan": "phpstan analyse --verbose --memory-limit=1G",
"test": "vendor/bin/phpunit",
"test:watch": [
"Composer\\Config::disableProcessTimeout",
Expand Down
171 changes: 170 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build": "grunt build",
"lint": "npm-run-all lint:*",
"lint:php": "composer lint",
"lint:phpstan": "composer lint-phpstan",
"lint:css": "wp-scripts lint-style ./user-edit.css ./providers/css/",
"lint:js": "wp-scripts lint-js ./Gruntfile.js ./providers/js/",
"format": "npm-run-all format:*",
Expand Down
10 changes: 10 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon
parameters:
level: 0
paths:
- includes
- providers
- class-two-factor-compat.php
- class-two-factor-core.php
- two-factor.php
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Stable tag: 0.9.1
License: GPL-2.0-or-later
License URI: https://spdx.org/licenses/GPL-2.0-or-later.html

Enable Two-Factor Authentication using time-based one-time passwords, Universal 2nd Factor (FIDO U2F, YubiKey), email, and backup verification codes.
Enable Two-Factor Authentication (2FA) using time-based one-time passwords (TOTP), Universal 2nd Factor (U2F), email, and backup verification codes.

== Description ==

Expand Down
4 changes: 2 additions & 2 deletions two-factor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Two Factor
*
* @package Two_Factor
* @author Plugin Contributors
* @author WordPress.org Contributors
* @copyright 2020 Plugin Contributors
* @license GPL-2.0-or-later
*
Expand All @@ -14,7 +14,7 @@
* Version: 0.9.1
* Requires at least: 6.3
* Requires PHP: 7.2
* Author: Plugin Contributors
* Author: WordPress.org Contributors
* Author URI: https://github.com/wordpress/two-factor/graphs/contributors
* License: GPL-2.0-or-later
* License URI: https://spdx.org/licenses/GPL-2.0-or-later.html
Expand Down

0 comments on commit c152d19

Please sign in to comment.