diff --git a/providers/class-two-factor-email.php b/providers/class-two-factor-email.php index 3122ea1b..4bf8eff6 100644 --- a/providers/class-two-factor-email.php +++ b/providers/class-two-factor-email.php @@ -144,6 +144,17 @@ public function user_token_lifetime( $user_id ) { public function user_token_ttl( $user_id ) { $token_ttl = 15 * MINUTE_IN_SECONDS; + /** + * Number of seconds the token is considered valid + * after the generation. + * + * @deprecated 0.11.0 Use {@see 'two_factor_email_token_ttl'} instead. + * + * @param integer $token_ttl Token time-to-live in seconds. + * @param integer $user_id User ID. + */ + $token_ttl = (int) apply_filters_deprecated( 'two_factor_token_ttl', array( $token_ttl, $user_id ), '0.7.0', 'two_factor_email_token_ttl' ); + /** * Number of seconds the token is considered valid * after the generation. @@ -151,7 +162,7 @@ public function user_token_ttl( $user_id ) { * @param integer $token_ttl Token time-to-live in seconds. * @param integer $user_id User ID. */ - return (int) apply_filters( 'two_factor_token_ttl', $token_ttl, $user_id ); + return (int) apply_filters( 'two_factor_email_token_ttl', $token_ttl, $user_id ); } /** diff --git a/readme.txt b/readme.txt index d72c194d..4fd95f27 100644 --- a/readme.txt +++ b/readme.txt @@ -27,7 +27,7 @@ Here is a list of action and filter hooks provided by the plugin: - `two_factor_providers` filter overrides the available two-factor providers such as email and time-based one-time passwords. Array values are PHP classnames of the two-factor providers. - `two_factor_enabled_providers_for_user` filter overrides the list of two-factor providers enabled for a user. First argument is an array of enabled provider classnames as values, the second argument is the user ID. - `two_factor_user_authenticated` action which receives the logged in `WP_User` object as the first argument for determining the logged in user right after the authentication workflow. -- `two_factor_token_ttl` filter overrides the time interval in seconds that an email token is considered after generation. Accepts the time in seconds as the first argument and the ID of the `WP_User` object being authenticated. +- `two_factor_email_token_ttl` filter overrides the time interval in seconds that an email token is considered after generation. Accepts the time in seconds as the first argument and the ID of the `WP_User` object being authenticated. - `two_factor_email_token_length` filter overrides the default 8 character count for email tokens. - `two_factor_backup_code_length` filter overrides the default 8 character count for backup codes. Providers the `WP_User` of the associated user as the second argument.