Google Authenticator – WordPress Two Factor Authentication (2FA) - Version 5.1.21

Version Description

  • Google Authenticator-Two Factor Authentication (2FA) : Login Redirect.
Download this release

Release Info

Developer cyberlord92
Plugin Icon 128x128 Google Authenticator – WordPress Two Factor Authentication (2FA)
Version 5.1.21
Comparing to
See all releases

Code changes from version 5.1.20 to 5.1.21

class-customer-setup.php CHANGED
@@ -115,7 +115,7 @@ class Customer_Setup {
115
  $customer_feature = "V3";
116
  }
117
 
118
- $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.20]: ' . $message;
119
 
120
  $content = '<div >First Name :' . $user->user_firstname . '<br><br>Last Name :' . $user->user_lastname . ' <br><br>Company :<a href="' . $_SERVER['SERVER_NAME'] . '" target="_blank" >' . $_SERVER['SERVER_NAME'] . '</a><br><br>Phone Number :' . $phone . '<br><br>Email :<a href="mailto:' . $fromEmail . '" target="_blank">' . $fromEmail . '</a><br><br>Query :' . $query . '</div>';
121
 
@@ -613,7 +613,7 @@ class Customer_Setup {
613
  $customer_feature = "V3";
614
  }
615
 
616
- $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.20]: ' . $query;
617
  $fields = array(
618
  'firstName' => $user->user_firstname,
619
  'lastName' => $user->user_lastname,
115
  $customer_feature = "V3";
116
  }
117
 
118
+ $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.21]: ' . $message;
119
 
120
  $content = '<div >First Name :' . $user->user_firstname . '<br><br>Last Name :' . $user->user_lastname . ' <br><br>Company :<a href="' . $_SERVER['SERVER_NAME'] . '" target="_blank" >' . $_SERVER['SERVER_NAME'] . '</a><br><br>Phone Number :' . $phone . '<br><br>Email :<a href="mailto:' . $fromEmail . '" target="_blank">' . $fromEmail . '</a><br><br>Query :' . $query . '</div>';
121
 
613
  $customer_feature = "V3";
614
  }
615
 
616
+ $query = '[WordPress 2 Factor Authentication Plugin: ' . $customer_feature . ' - V 5.1.21]: ' . $query;
617
  $fields = array(
618
  'firstName' => $user->user_firstname,
619
  'lastName' => $user->user_lastname,
class-miniorange-2-factor-login.php CHANGED
@@ -145,8 +145,8 @@ class Miniorange_Mobile_Login {
145
  }
146
 
147
  function mo_2_factor_hide_login() {
148
- wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.20', __FILE__ ) );
149
- wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.20', __FILE__ ) );
150
  wp_enqueue_style( 'hide-login' );
151
  wp_enqueue_style( 'bootstrap' );
152
 
@@ -198,7 +198,7 @@ class Miniorange_Mobile_Login {
198
  }
199
 
200
  function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
201
- wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.20', __FILE__ ) );
202
  wp_enqueue_style( 'show-login' );
203
  }
204
 
@@ -220,9 +220,9 @@ class Miniorange_Mobile_Login {
220
 
221
  function mo_2_factor_show_login() {
222
  if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
223
- wp_register_style( 'show-login', plugins_url( 'includes/css/hide-login-form.css?version=5.1.20', __FILE__ ) );
224
  } else {
225
- wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.20', __FILE__ ) );
226
  }
227
  wp_enqueue_style( 'show-login' );
228
  }
145
  }
146
 
147
  function mo_2_factor_hide_login() {
148
+ wp_register_style( 'hide-login', plugins_url( 'includes/css/hide-login.css?version=5.1.21', __FILE__ ) );
149
+ wp_register_style( 'bootstrap', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.21', __FILE__ ) );
150
  wp_enqueue_style( 'hide-login' );
151
  wp_enqueue_style( 'bootstrap' );
152
 
198
  }
199
 
200
  function mo_2_factor_show_login_with_password_when_phonelogin_enabled() {
201
+ wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.21', __FILE__ ) );
202
  wp_enqueue_style( 'show-login' );
203
  }
204
 
220
 
221
  function mo_2_factor_show_login() {
222
  if ( get_option( 'mo2f_enable_login_with_2nd_factor' ) ) {
223
+ wp_register_style( 'show-login', plugins_url( 'includes/css/hide-login-form.css?version=5.1.21', __FILE__ ) );
224
  } else {
225
+ wp_register_style( 'show-login', plugins_url( 'includes/css/show-login.css?version=5.1.21', __FILE__ ) );
226
  }
227
  wp_enqueue_style( 'show-login' );
228
  }
class-miniorange-2-factor-pass2fa-login.php CHANGED
@@ -374,11 +374,12 @@ class Miniorange_Password_2Factor_Login {
374
  $softtoken = '';
375
  $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
376
  $attempts=get_user_meta( $user_id, 'mo2f_user_login_attempts', true );
377
-
378
  if ( MO2f_utility::mo2f_check_empty_or_null( $_POST['mo2fa_softtoken'] ) ) {
379
- if($attempts>1)
380
  {
381
- update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
 
 
382
  $mo2fa_login_message = 'Please enter OTP to proceed.';
383
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
384
  }else{
@@ -390,9 +391,11 @@ class Miniorange_Password_2Factor_Login {
390
 
391
  $softtoken = sanitize_text_field( $_POST['mo2fa_softtoken'] );
392
  if ( ! MO2f_utility::mo2f_check_number_length( $softtoken ) ) {
393
- if($attempts>1)
394
  {
 
395
  update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
 
396
  $mo2fa_login_message = 'Invalid OTP. Only digits within range 4-8 are allowed. Please try again.';
397
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
398
 
@@ -435,9 +438,11 @@ class Miniorange_Password_2Factor_Login {
435
  $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
436
  }
437
  } else {
438
- if($attempts>1)
439
  {
 
440
  update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
 
441
  $message = $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN' ? 'You have entered an invalid OTP.<br>Please click on <b>Sync Time</b> in the miniOrange Authenticator app to sync your phone time with the miniOrange servers and try again.' : 'Invalid OTP. Please try again.';
442
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $message, $redirect_to,null,$session_id_encrypt );
443
  }else{
@@ -933,7 +938,13 @@ class Miniorange_Password_2Factor_Login {
933
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
934
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
935
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
936
- update_user_meta( $currentuser->ID, 'mo2f_user_login_attempts', get_option('mo2f_allwed_login_attempts') );
 
 
 
 
 
 
937
  if ( $email && $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) { //checking if user has configured any 2nd factor method
938
  try {
939
  $mo2f_rba_status = mo2f_collect_attributes( $email, stripslashes( $attributes ) ); // Rba flow
374
  $softtoken = '';
375
  $user_id = MO2f_Utility::mo2f_retrieve_user_temp_values( 'mo2f_current_user_id',$session_id_encrypt );
376
  $attempts=get_user_meta( $user_id, 'mo2f_user_login_attempts', true );
 
377
  if ( MO2f_utility::mo2f_check_empty_or_null( $_POST['mo2fa_softtoken'] ) ) {
378
+ if($attempts>1 || $attempts=='disabled')
379
  {
380
+ if(get_option( 'mo2f_enable_brute_force' )){
381
+ update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
382
+ }
383
  $mo2fa_login_message = 'Please enter OTP to proceed.';
384
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
385
  }else{
391
 
392
  $softtoken = sanitize_text_field( $_POST['mo2fa_softtoken'] );
393
  if ( ! MO2f_utility::mo2f_check_number_length( $softtoken ) ) {
394
+ if($attempts>1|| $attempts=='disabled')
395
  {
396
+ if(get_option( 'mo2f_enable_brute_force' )){
397
  update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
398
+ }
399
  $mo2fa_login_message = 'Invalid OTP. Only digits within range 4-8 are allowed. Please try again.';
400
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $mo2fa_login_message, $redirect_to,null,$session_id_encrypt );
401
 
438
  $this->mo2fa_pass2login( $redirect_to, $session_id_encrypt );
439
  }
440
  } else {
441
+ if($attempts>1 || $attempts=='disabled')
442
  {
443
+ if(get_option( 'mo2f_enable_brute_force' )){
444
  update_user_meta( $user_id , 'mo2f_user_login_attempts', $attempts-1 );
445
+ }
446
  $message = $mo2fa_login_status == 'MO_2_FACTOR_CHALLENGE_SOFT_TOKEN' ? 'You have entered an invalid OTP.<br>Please click on <b>Sync Time</b> in the miniOrange Authenticator app to sync your phone time with the miniOrange servers and try again.' : 'Invalid OTP. Please try again.';
447
  $this->miniorange_pass2login_form_fields( $mo2fa_login_status, $message, $redirect_to,null,$session_id_encrypt );
448
  }else{
938
  $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $currentuser->ID );
939
  $mo_2factor_user_registration_status = $Mo2fdbQueries->get_user_detail( 'mo_2factor_user_registration_status', $currentuser->ID );
940
  $kba_configuration_status = $Mo2fdbQueries->get_user_detail( 'mo2f_SecurityQuestions_config_status', $currentuser->ID );
941
+
942
+ if(get_option( 'mo2f_enable_brute_force' )){
943
+ $mo2f_allwed_login_attempts=get_option('mo2f_allwed_login_attempts');
944
+ }else{
945
+ $mo2f_allwed_login_attempts= 'disabled';
946
+ }
947
+ update_user_meta( $currentuser->ID, 'mo2f_user_login_attempts', $mo2f_allwed_login_attempts );
948
  if ( $email && $mo_2factor_user_registration_status == 'MO_2_FACTOR_PLUGIN_SETTINGS' ) { //checking if user has configured any 2nd factor method
949
  try {
950
  $mo2f_rba_status = mo2f_collect_attributes( $email, stripslashes( $attributes ) ); // Rba flow
miniorange_2_factor_common_login.php CHANGED
@@ -857,10 +857,10 @@ function mo2f_customize_logo() { ?>
857
  function echo_js_css_files() {
858
  echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>';
859
  echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) . '" ></script>';
860
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/bootstrap.min.css?version=5.1.20', __FILE__ ) . '" />';
861
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/front_end_login.css?version=5.1.20', __FILE__ ) . '" />';
862
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/style_settings.css?version=5.1.20', __FILE__ ) . '" />';
863
- echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/hide-login.css?version=5.1.20', __FILE__ ) . '" />';
864
 
865
  if ( get_option( 'mo2f_personalization_ui' ) ) {
866
  echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/mo2f_login_popup_ui.css', __FILE__ ) . '" />';
857
  function echo_js_css_files() {
858
  echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>';
859
  echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) . '" ></script>';
860
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/bootstrap.min.css?version=5.1.21', __FILE__ ) . '" />';
861
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/front_end_login.css?version=5.1.21', __FILE__ ) . '" />';
862
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/style_settings.css?version=5.1.21', __FILE__ ) . '" />';
863
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/hide-login.css?version=5.1.21', __FILE__ ) . '" />';
864
 
865
  if ( get_option( 'mo2f_personalization_ui' ) ) {
866
  echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/mo2f_login_popup_ui.css', __FILE__ ) . '" />';
miniorange_2_factor_settings.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
- * Version: 5.1.20
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
@@ -416,21 +416,21 @@ class Miniorange_Authentication {
416
  }
417
 
418
  function mo_2_factor_enable_frontend_style() {
419
- wp_enqueue_style( 'mo2f_frontend_login_style', plugins_url( 'includes/css/front_end_login.css?version=5.1.20', __FILE__ ) );
420
- wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.18', __FILE__ ) );
421
- wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.18', __FILE__ ) );
422
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
423
- wp_enqueue_style( 'mo2f_login_popup_style', plugins_url( 'includes/css/mo2f_login_popup_ui.css?version=5.1.20', __FILE__ ) );
424
  }
425
 
426
  function plugin_settings_style( $mo2fa_hook_page ) {
427
  if ( 'toplevel_page_miniOrange_2_factor_settings' != $mo2fa_hook_page ) {
428
  return;
429
  }
430
- wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.1.20', __FILE__ ) );
431
- wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.20', __FILE__ ) );
432
- wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.20', __FILE__ ) );
433
- wp_enqueue_style( 'bootstrap_style_ass', plugins_url( 'includes/css/bootstrap-tour-standalone.css?version=5.1.20', __FILE__ ) );
434
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
435
  wp_enqueue_style( 'mo2f_ns_admin_settings_datatable_style', plugins_url('includes/css/jquery.dataTables.min.css', __FILE__));
436
  }
3
  * Plugin Name: miniOrange 2 Factor Authentication
4
  * Plugin URI: https://miniorange.com
5
  * Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
+ * Version: 5.1.21
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
416
  }
417
 
418
  function mo_2_factor_enable_frontend_style() {
419
+ wp_enqueue_style( 'mo2f_frontend_login_style', plugins_url( 'includes/css/front_end_login.css?version=5.1.21', __FILE__ ) );
420
+ wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.21', __FILE__ ) );
421
+ wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.21', __FILE__ ) );
422
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
423
+ wp_enqueue_style( 'mo2f_login_popup_style', plugins_url( 'includes/css/mo2f_login_popup_ui.css?version=5.1.21', __FILE__ ) );
424
  }
425
 
426
  function plugin_settings_style( $mo2fa_hook_page ) {
427
  if ( 'toplevel_page_miniOrange_2_factor_settings' != $mo2fa_hook_page ) {
428
  return;
429
  }
430
+ wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.1.21', __FILE__ ) );
431
+ wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.1.21', __FILE__ ) );
432
+ wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.1.21', __FILE__ ) );
433
+ wp_enqueue_style( 'bootstrap_style_ass', plugins_url( 'includes/css/bootstrap-tour-standalone.css?version=5.1.21', __FILE__ ) );
434
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
435
  wp_enqueue_style( 'mo2f_ns_admin_settings_datatable_style', plugins_url('includes/css/jquery.dataTables.min.css', __FILE__));
436
  }
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: cyberlord92, twofactor
3
  Tags: google authenticator, two factor authentication, two factor, 2FA, TFA, 2 factor authentication, two step verification, 1 google authenticator, login, authy, authy two factor, Clef, 2 Factor, yubico, Two-Factor Authentication, Mobile Authentication, otp, strong authentication, 2 step authentication, smartphone authentication, Multifactor authentication, multi factor authentication, multi factor, no password, passwordless login, security, website security, one time passcode, password, soft token, woocommerce, authenticate, two factor auth, two-factor, duo, QR Code, QR Code Authentication, scan QR Code, wordfence, login security, google authenticator, google , email verification, trusted device, device Id , KBA , knowledge based authentication
4
  Donate link: https://miniorange.com/
5
  Requires at least: 3.0.1
6
- Tested up to: 5.0.2
7
  Requires PHP: 5.3.0
8
- Stable tag: 5.1.20
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -232,6 +232,9 @@ miniOrange authentication service has 15+ authentication methods.One time passco
232
 
233
  == Changelog ==
234
 
 
 
 
235
  = 5.1.20 =
236
  * Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix.
237
 
@@ -593,6 +596,9 @@ More descriptive setup messages and UI changes.
593
 
594
  == Upgrade Notice ==
595
 
 
 
 
596
  = 5.1.20 =
597
  * Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix.
598
 
3
  Tags: google authenticator, two factor authentication, two factor, 2FA, TFA, 2 factor authentication, two step verification, 1 google authenticator, login, authy, authy two factor, Clef, 2 Factor, yubico, Two-Factor Authentication, Mobile Authentication, otp, strong authentication, 2 step authentication, smartphone authentication, Multifactor authentication, multi factor authentication, multi factor, no password, passwordless login, security, website security, one time passcode, password, soft token, woocommerce, authenticate, two factor auth, two-factor, duo, QR Code, QR Code Authentication, scan QR Code, wordfence, login security, google authenticator, google , email verification, trusted device, device Id , KBA , knowledge based authentication
4
  Donate link: https://miniorange.com/
5
  Requires at least: 3.0.1
6
+ Tested up to: 5.1
7
  Requires PHP: 5.3.0
8
+ Stable tag: 5.1.21
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
232
 
233
  == Changelog ==
234
 
235
+ = 5.1.21 =
236
+ * Google Authenticator-Two Factor Authentication (2FA) : Login Redirect.
237
+
238
  = 5.1.20 =
239
  * Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix.
240
 
596
 
597
  == Upgrade Notice ==
598
 
599
+ = 5.1.21 =
600
+ * Google Authenticator-Two Factor Authentication (2FA) : Login Redirect.
601
+
602
  = 5.1.20 =
603
  * Google Authenticator-Two Factor Authentication (2FA) : Minor Bug fix.
604
 
views/feedback_form.php CHANGED
@@ -10,7 +10,7 @@
10
  wp_enqueue_style( 'wp-pointer' );
11
  wp_enqueue_script( 'wp-pointer' );
12
  wp_enqueue_script( 'utils' );
13
- wp_enqueue_style( 'mo_2_factor_admin_plugins_page_style', plugins_url( '/../includes/css/mo2f_plugins_page.css?version=5.1.20', __FILE__ ) );
14
 
15
  $action = 'install-plugin';
16
  $slug = 'miniorange-google-authenticator';
10
  wp_enqueue_style( 'wp-pointer' );
11
  wp_enqueue_script( 'wp-pointer' );
12
  wp_enqueue_script( 'utils' );
13
+ wp_enqueue_style( 'mo_2_factor_admin_plugins_page_style', plugins_url( '/../includes/css/mo2f_plugins_page.css?version=5.1.21', __FILE__ ) );
14
 
15
  $action = 'install-plugin';
16
  $slug = 'miniorange-google-authenticator';