Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"require-dev": {
"automattic/vipwpcs": "^3.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"phpcompatibility/phpcompatibility-wp": "3.0.0-alpha1",
"phpcompatibility/phpcompatibility-wp": "3.0.0-alpha2",
"phpunit/phpunit": "^8.5|^9.6",
"spatie/phpunit-watcher": "^1.23",
"szepeviktor/phpstan-wordpress": "^1.3",
"wp-coding-standards/wpcs": "^3.2",
"wp-coding-standards/wpcs": "^3.3",
"yoast/phpunit-polyfills": "^4.0"
},
"scripts": {
Expand Down
131 changes: 64 additions & 67 deletions composer.lock

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

4 changes: 2 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<!-- Lint all PHP files by default. -->
<file>.</file>

<!-- Ensure all PHP code is compatible with PHP 5.6 and higher. -->
<!-- Ensure all PHP code is compatible with PHP 7.2 and higher (see upgrade policy in README). -->
<rule ref="PHPCompatibilityWP" />
<config name="testVersion" value="5.6-"/>
<config name="testVersion" value="7.2-"/>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now matches the plugin header info.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!


<rule ref="WordPress" />
<rule ref="WordPress-VIP-Go" />
Expand Down
4 changes: 2 additions & 2 deletions providers/class-two-factor-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ private function get_client_ip() {
* @return bool Whether the email contents were sent successfully.
*/
public function generate_and_email_token( $user ) {
$token = $this->generate_token( $user->ID );
$remote_ip = $this->get_client_ip();
$token = $this->generate_token( $user->ID );
$remote_ip = $this->get_client_ip();
$ttl_minutes = (int) ceil( $this->user_token_ttl( $user->ID ) / MINUTE_IN_SECONDS );

$subject = wp_strip_all_tags(
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/class-two-factor-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function test_get_code() {

$code = Two_Factor_Provider::get_code( 8, 'A' );
$this->assertEquals( 'AAAAAAAA', $code );

$code = Two_Factor_Provider::get_code( 30, array( 'A', 'B', 'C' ) );
$this->assertSame( 1, preg_match( '/^[ABC]{30}$/', $code ) );

Expand Down
Loading