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

Version Description

  • Google Authenticator (2FA) : Added GDPR Compliance.
Download this release

Release Info

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

Code changes from version 5.0.10 to 5.0.12

class-customer-setup.php CHANGED
@@ -228,11 +228,11 @@ class Customer_Setup {
228
  $currentTimeInMillis = self::get_timestamp();
229
 
230
  /* Creating the Hash using SHA-512 algorithm */
231
- $stringToHash = $customerKey . number_format( $currentTimeInMillis, 0, '', '' ) . $apiKey;
232
  $hashValue = hash( "sha512", $stringToHash );
233
 
234
  $customerKeyHeader = "Customer-Key: " . $customerKey;
235
- $timestampHeader = "Timestamp: " . number_format( $currentTimeInMillis, 0, '', '' );
236
  $authorizationHeader = "Authorization: " . $hashValue;
237
 
238
 
@@ -329,8 +329,13 @@ class Customer_Setup {
329
  exit ();
330
  }
331
  curl_close( $ch );
 
 
 
 
 
332
 
333
- $currentTimeInMillis = round( microtime( true ) * 1000 );
334
 
335
  return empty( $content ) ? $currentTimeInMillis : $content;
336
  }
@@ -346,11 +351,11 @@ class Customer_Setup {
346
  $currentTimeInMillis = self::get_timestamp();
347
 
348
 
349
- $stringToHash = $customerKey . number_format( $currentTimeInMillis, 0, '', '' ) . $apiKey;
350
  $hashValue = hash( "sha512", $stringToHash );
351
 
352
  $customerKeyHeader = "Customer-Key: " . $customerKey;
353
- $timestampHeader = "Timestamp: " . number_format( $currentTimeInMillis, 0, '', '' );
354
  $authorizationHeader = "Authorization: " . $hashValue;
355
 
356
 
@@ -428,11 +433,11 @@ class Customer_Setup {
428
  $currentTimeInMillis = self::get_timestamp();
429
 
430
  /* Creating the Hash using SHA-512 algorithm */
431
- $stringToHash = $customerKey . number_format( $currentTimeInMillis, 0, '', '' ) . $apiKey;
432
  $hashValue = hash( "sha512", $stringToHash );
433
 
434
  $customerKeyHeader = "Customer-Key: " . $customerKey;
435
- $timestampHeader = "Timestamp: " . number_format( $currentTimeInMillis, 0, '', '' );
436
  $authorizationHeader = "Authorization: " . $hashValue;
437
 
438
  $fields = '';
@@ -534,7 +539,7 @@ class Customer_Setup {
534
  $customer_feature="V3";
535
  }
536
 
537
- $query = '[WordPress 2 Factor Authentication Plugin: '.$customer_feature.' - V 5.0.10]: ' . $query;
538
  $fields = array(
539
  'firstName' => $user->user_firstname,
540
  'lastName' => $user->user_lastname,
228
  $currentTimeInMillis = self::get_timestamp();
229
 
230
  /* Creating the Hash using SHA-512 algorithm */
231
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
232
  $hashValue = hash( "sha512", $stringToHash );
233
 
234
  $customerKeyHeader = "Customer-Key: " . $customerKey;
235
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
236
  $authorizationHeader = "Authorization: " . $hashValue;
237
 
238
 
329
  exit ();
330
  }
331
  curl_close( $ch );
332
+
333
+ if(empty( $content )){
334
+ $currentTimeInMillis = round( microtime( true ) * 1000 );
335
+ $currentTimeInMillis = number_format( $currentTimeInMillis, 0, '', '' );
336
+ }
337
 
338
+ // $currentTimeInMillis = round( microtime( true ) * 1000 );
339
 
340
  return empty( $content ) ? $currentTimeInMillis : $content;
341
  }
351
  $currentTimeInMillis = self::get_timestamp();
352
 
353
 
354
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
355
  $hashValue = hash( "sha512", $stringToHash );
356
 
357
  $customerKeyHeader = "Customer-Key: " . $customerKey;
358
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
359
  $authorizationHeader = "Authorization: " . $hashValue;
360
 
361
 
433
  $currentTimeInMillis = self::get_timestamp();
434
 
435
  /* Creating the Hash using SHA-512 algorithm */
436
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
437
  $hashValue = hash( "sha512", $stringToHash );
438
 
439
  $customerKeyHeader = "Customer-Key: " . $customerKey;
440
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
441
  $authorizationHeader = "Authorization: " . $hashValue;
442
 
443
  $fields = '';
539
  $customer_feature="V3";
540
  }
541
 
542
+ $query = '[WordPress 2 Factor Authentication Plugin: '.$customer_feature.' - V 5.0.12]: ' . $query;
543
  $fields = array(
544
  'firstName' => $user->user_firstname,
545
  'lastName' => $user->user_lastname,
class-rba-attributes.php CHANGED
@@ -58,11 +58,11 @@ class Miniorange_Rba_Attributes {
58
  $currentTimeInMillis = self::get_timestamp();
59
 
60
  /* Creating the Hash using SHA-512 algorithm */
61
- $stringToHash = $customerKey . number_format( $currentTimeInMillis, 0, '', '' ) . $apiKey;
62
  $hashValue = hash( "sha512", $stringToHash );
63
 
64
  $customerKeyHeader = "Customer-Key: " . $customerKey;
65
- $timestampHeader = "Timestamp: " . number_format( $currentTimeInMillis, 0, '', '' );
66
  $authorizationHeader = "Authorization: " . $hashValue;
67
 
68
  return array( "Content-Type: application/json", $customerKeyHeader, $timestampHeader, $authorizationHeader );
@@ -104,9 +104,11 @@ class Miniorange_Rba_Attributes {
104
  exit ();
105
  }
106
  curl_close( $ch );
107
-
108
- $currentTimeInMillis = round( microtime( true ) * 1000 );
109
-
 
 
110
  return empty( $content ) ? $currentTimeInMillis : $content;
111
  }
112
 
58
  $currentTimeInMillis = self::get_timestamp();
59
 
60
  /* Creating the Hash using SHA-512 algorithm */
61
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
62
  $hashValue = hash( "sha512", $stringToHash );
63
 
64
  $customerKeyHeader = "Customer-Key: " . $customerKey;
65
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
66
  $authorizationHeader = "Authorization: " . $hashValue;
67
 
68
  return array( "Content-Type: application/json", $customerKeyHeader, $timestampHeader, $authorizationHeader );
104
  exit ();
105
  }
106
  curl_close( $ch );
107
+
108
+ if(empty( $content )){
109
+ $currentTimeInMillis = round( microtime( true ) * 1000 );
110
+ $currentTimeInMillis = number_format( $currentTimeInMillis, 0, '', '' );
111
+ }
112
  return empty( $content ) ? $currentTimeInMillis : $content;
113
  }
114
 
class-two-factor-setup.php CHANGED
@@ -61,11 +61,11 @@ class Two_Factor_Setup {
61
  $currentTimeInMillis = self::get_timestamp();
62
 
63
  /* Creating the Hash using SHA-512 algorithm */
64
- $stringToHash = $customerKey . number_format( $currentTimeInMillis, 0, '', '' ) . $apiKey;;
65
  $hashValue = hash( "sha512", $stringToHash );
66
 
67
  $customerKeyHeader = "Customer-Key: " . $customerKey;
68
- $timestampHeader = "Timestamp: " . number_format( $currentTimeInMillis, 0, '', '' );
69
  $authorizationHeader = "Authorization: " . $hashValue;
70
 
71
  return array( "Content-Type: application/json", $customerKeyHeader, $timestampHeader, $authorizationHeader );
@@ -106,9 +106,12 @@ class Two_Factor_Setup {
106
  exit ();
107
  }
108
  curl_close( $ch );
109
-
110
- $currentTimeInMillis = round( microtime( true ) * 1000 );
111
-
 
 
 
112
  return empty( $content ) ? $currentTimeInMillis : $content;
113
  }
114
 
61
  $currentTimeInMillis = self::get_timestamp();
62
 
63
  /* Creating the Hash using SHA-512 algorithm */
64
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;;
65
  $hashValue = hash( "sha512", $stringToHash );
66
 
67
  $customerKeyHeader = "Customer-Key: " . $customerKey;
68
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
69
  $authorizationHeader = "Authorization: " . $hashValue;
70
 
71
  return array( "Content-Type: application/json", $customerKeyHeader, $timestampHeader, $authorizationHeader );
106
  exit ();
107
  }
108
  curl_close( $ch );
109
+
110
+
111
+ if(empty( $content )){
112
+ $currentTimeInMillis = round( microtime( true ) * 1000 );
113
+ $currentTimeInMillis = number_format( $currentTimeInMillis, 0, '', '' );
114
+ }
115
  return empty( $content ) ? $currentTimeInMillis : $content;
116
  }
117
 
includes/css/mo2f_plugins_page.css ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mo2f_modal {
2
+ display: none;
3
+ position: fixed;
4
+ z-index: 1;
5
+ padding-top: 100px;
6
+ left: 100px;
7
+ top: 0;
8
+ margin-left:220px;
9
+ width: 50%;
10
+ height: 100%;
11
+
12
+ }
13
+
14
+
15
+ .mo2f_modal-content {
16
+ background-color: #fefefe;
17
+ margin: auto;
18
+ padding: 20px;
19
+ border: 1px solid #888;
20
+ width: 55%;
21
+ }
22
+
23
+ .mo2f_close {
24
+ color: #aaaaaa;
25
+ float: right;
26
+ font-size: 28px;
27
+ font-weight: bold;
28
+ }
29
+
30
+ .mo2f_close:hover,
31
+ .mo2f_close:focus {
32
+ color: #000;
33
+ text-decoration: none;
34
+ cursor: pointer;
35
+ }
36
+ .alert{
37
+ padding:5px;
38
+ margin-bottom:10px;
39
+ border:1px solid transparent;
40
+ border-radius:4px
41
+ }
42
+ .alert-info{
43
+ color:#31708f;
44
+ background-color:#d9edf7;
45
+ border-color:#bce8f1
46
+ }
miniorange_2_factor_configuration.php CHANGED
@@ -145,7 +145,11 @@ function mo_2_factor_register( $user ) {
145
  mo2f_show_verify_password_page(); //verify password page
146
  } else if ( ! mo2f_is_customer_registered() ) {
147
  delete_option( 'password_mismatch' );
 
148
  mo2f_show_registration_page( $user ); //new registration page
 
 
 
149
  }
150
  }
151
 
@@ -226,6 +230,7 @@ function mo2f_show_registration_page( $user ) {
226
  <td><input class="mo2f_table_textbox" type="password" required name="confirmPassword"/></td>
227
  </tr>
228
 
 
229
  <tr>
230
 
231
  <td>&nbsp;</td>
@@ -253,6 +258,88 @@ function mo2f_show_registration_page( $user ) {
253
  <?php
254
  }
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  function mo2f_show_otp_validation_page( $user ) {
257
  global $Mo2fdbQueries;
258
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
@@ -605,7 +692,7 @@ function show_2_factor_proxy_setup($user){
605
  global $Mo2fdbQueries;
606
  ?>
607
 
608
-
609
  <div class="mo2f_proxy_setup">
610
  <h3>Proxy Settings</h3>
611
 
@@ -644,14 +731,14 @@ function show_2_factor_proxy_setup($user){
644
  </tr>
645
  <tr>
646
 
647
- <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Username: ' ); ?></b></td>
648
- <td style="width:70%"><input class="mo2f_table_textbox" type="text" name="proxyUsername" required
649
  value="<?php echo get_option( 'mo2f_proxy_username' ); ?>"/></td>
650
  </tr>
651
  <tr>
652
 
653
- <td style="width:30%"><b><span class="impt">*</span><?php echo mo2f_lt( 'Password: ' ); ?></b></td>
654
- <td style="width:70%"><input class="mo2f_table_textbox" type="password" name="proxyPass" required
655
  value="<?php echo get_option( 'mo2f_proxy_password' ); ?>"/></td>
656
  </tr>
657
 
@@ -962,9 +1049,12 @@ function mo2f_show_verify_password_page() {
962
  <td><b><font color="#FF0000">*</font><?php echo mo2f_lt( 'Password:' ); ?></b></td>
963
  <td><input class="mo2f_table_textbox" type="password" name="password" required/></td>
964
  </tr>
 
 
965
  <tr>
966
  <td colspan="2">&nbsp;</td>
967
  </tr>
 
968
  <tr>
969
  <td>&nbsp;</td>
970
  <td>
145
  mo2f_show_verify_password_page(); //verify password page
146
  } else if ( ! mo2f_is_customer_registered() ) {
147
  delete_option( 'password_mismatch' );
148
+ if(get_option('mo2f_gdpr_note')){
149
  mo2f_show_registration_page( $user ); //new registration page
150
+ }else{
151
+ mo2f_gdpr_note();
152
+ }
153
  }
154
  }
155
 
230
  <td><input class="mo2f_table_textbox" type="password" required name="confirmPassword"/></td>
231
  </tr>
232
 
233
+ <tr><td></td><td><input type="checkbox" id="mo2f_gdpr" name="mo2f_gdpr" required />I agree to the <a href="https://www.miniorange.com/2-factor-authentication-for-wordpress-gdpr" target="_blank"><u>terms & conditions</u></a> of the Privacy Policy of miniOrange.<br/></td></tr>
234
  <tr>
235
 
236
  <td>&nbsp;</td>
258
  <?php
259
  }
260
 
261
+ function mo2f_gdpr_note(){
262
+ ?>
263
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
264
+ integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
265
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
266
+ <?php echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/bootstrap.min.css?version=5.0.12', __FILE__ ) . '" />';
267
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/front_end_login.css?version=5.0.12', __FILE__ ) . '" />';
268
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/style_settings.css?version=5.0.12', __FILE__ ) . '" />';
269
+ echo '<link rel="stylesheet" type="text/css" href="' . plugins_url( 'includes/css/hide-login.css?version=5.0.12', __FILE__ ) . '" />';
270
+ echo '<script src="' . plugins_url( 'includes/js/bootstrap.min.js', __FILE__ ) . '" ></script>';
271
+ ?>
272
+ <div class="modal fade" id="myModal" role="dialog"
273
+ style="margin-top:40px;overflow-y: scroll;overflow-x: scroll;" data-backdrop="static"
274
+ data-keyboard="false">
275
+ <div class="modal-dialog">
276
+ <div class="modal-content">
277
+ <div class="modal-header">
278
+ <h4 class="modal-title">
279
+
280
+ Privacy Policy </h4>
281
+ </div>
282
+
283
+ <br>
284
+ <div style="margin-left:2%">
285
+ <p>
286
+ We have updated our Privacy Policy and made changes in the plugin to make it more secure for users using our plugin.
287
+ </p>
288
+ </div>
289
+
290
+
291
+
292
+ <div class="modal-footer">
293
+ <form name="f" method="post" action="" id="mo2f_gdpr">
294
+ <input type="hidden" name="mo2f_gdpr_note" value="mo2f_gdpr_note"/>
295
+ <div style="margin-left:2%">
296
+ <input type="submit" name="miniorange_gdpr_policy_note" class="button button-primary button-large" value="Okay" />
297
+
298
+ </div>
299
+ </form>
300
+
301
+ </div>
302
+ <style>
303
+ .here{
304
+ border-bottom: 1px solid;
305
+ border-left: 0px solid;
306
+ border-right: 0px solid;
307
+ border-top: 0px solid;
308
+
309
+ }
310
+ .here :focus{
311
+ border-bottom: 1px solid;
312
+
313
+ }
314
+ input[type=text]:focus {
315
+ border-bottom: 1px solid blue;
316
+ }
317
+ </style>
318
+
319
+
320
+ </div>
321
+
322
+ </div>
323
+ </div>
324
+
325
+
326
+
327
+
328
+ <script>
329
+ jQuery(function () {
330
+ jQuery('#myModal').modal('toggle');
331
+ });
332
+ jQuery('#User_student').click(function () {
333
+ jQuery('#user_is_student').submit();
334
+ });
335
+ jQuery('#User_Parent').click(function () {
336
+ jQuery('#user_is_parent').submit();
337
+ });
338
+ </script>
339
+
340
+ <?php
341
+ }
342
+
343
  function mo2f_show_otp_validation_page( $user ) {
344
  global $Mo2fdbQueries;
345
  $phone = $Mo2fdbQueries->get_user_detail( 'mo2f_user_phone', $user->ID );
692
  global $Mo2fdbQueries;
693
  ?>
694
 
695
+
696
  <div class="mo2f_proxy_setup">
697
  <h3>Proxy Settings</h3>
698
 
731
  </tr>
732
  <tr>
733
 
734
+ <td style="width:30%"><b><?php echo mo2f_lt( 'Username: ' ); ?></b></td>
735
+ <td style="width:70%"><input class="mo2f_table_textbox" type="text" name="proxyUsername"
736
  value="<?php echo get_option( 'mo2f_proxy_username' ); ?>"/></td>
737
  </tr>
738
  <tr>
739
 
740
+ <td style="width:30%"><b><?php echo mo2f_lt( 'Password: ' ); ?></b></td>
741
+ <td style="width:70%"><input class="mo2f_table_textbox" type="password" name="proxyPass"
742
  value="<?php echo get_option( 'mo2f_proxy_password' ); ?>"/></td>
743
  </tr>
744
 
1049
  <td><b><font color="#FF0000">*</font><?php echo mo2f_lt( 'Password:' ); ?></b></td>
1050
  <td><input class="mo2f_table_textbox" type="password" name="password" required/></td>
1051
  </tr>
1052
+
1053
+ <tr><td></td><td><input type="checkbox" id="mo2f_gdpr" name="mo2f_gdpr" required />I agree to <a href="https://www.miniorange.com/2-factor-authentication-for-wordpress-gdpr" target="_blank"><u>terms & conditions</u></a> of the Privacy Policy of miniOrange.<br/></td></tr>
1054
  <tr>
1055
  <td colspan="2">&nbsp;</td>
1056
  </tr>
1057
+
1058
  <tr>
1059
  <td>&nbsp;</td>
1060
  <td>
miniorange_2_factor_mobile_configuration.php CHANGED
@@ -1206,6 +1206,14 @@ function show_2_factor_pricing_page( $user ) {
1206
  </div>
1207
  <br>
1208
  <hr>
 
 
 
 
 
 
 
 
1209
  <br>
1210
  <div>
1211
  <h2>Contact Us</h2>
1206
  </div>
1207
  <br>
1208
  <hr>
1209
+ <br>
1210
+ <div>
1211
+ <h2>Privacy Policy</h2>
1212
+ <p class="mo2f_licensing_plans_ol"> <a href="https://www.miniorange.com/2-factor-authentication-for-wordpress-gdpr">Click Here</a> to read our Privacy Policy.
1213
+ </p>
1214
+ </div>
1215
+ <br>
1216
+ <hr>
1217
  <br>
1218
  <div>
1219
  <h2>Contact Us</h2>
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 Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
- * Version: 5.0.10
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
@@ -14,6 +14,7 @@ include_once dirname( __FILE__ ) . '/class-rba-attributes.php';
14
  include_once dirname( __FILE__ ) . '/class-two-factor-setup.php';
15
  include_once dirname( __FILE__ ) . '/class-customer-setup.php';
16
  include_once dirname( __FILE__ ) . '/database/database_functions.php';
 
17
  require( 'class-utility.php' );
18
  require( 'class-mo2f-constants.php' );
19
  require( 'class-miniorange-2-factor-login.php' );
@@ -49,7 +50,8 @@ class Miniorange_Authentication {
49
  add_action( 'admin_notices', array( $this, 'prompt_user_to_fix_bug' ) );
50
  add_action( 'plugins_loaded', array( $this, 'mo2fa_load_textdomain' ) );
51
  add_action( 'plugins_loaded', array( $this, 'mo2f_update_db_check' ) );
52
-
 
53
  remove_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
54
  remove_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
55
 
@@ -263,6 +265,10 @@ class Miniorange_Authentication {
263
  function mo2fa_load_textdomain() {
264
  load_plugin_textdomain( 'miniorange-2-factor-authentication', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
265
  }
 
 
 
 
266
 
267
  function get_customer_SMS_transactions() {
268
 
@@ -430,20 +436,20 @@ class Miniorange_Authentication {
430
  }
431
 
432
  function mo_2_factor_enable_frontend_style() {
433
- wp_enqueue_style( 'mo2f_frontend_login_style', plugins_url( 'includes/css/front_end_login.css?version=5.0.8', __FILE__ ) );
434
- wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.0.8', __FILE__ ) );
435
- wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.0.8', __FILE__ ) );
436
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
437
- wp_enqueue_style( 'mo2f_login_popup_style', plugins_url( 'includes/css/mo2f_login_popup_ui.css?version=5.0.8', __FILE__ ) );
438
  }
439
 
440
  function plugin_settings_style($mo2fa_hook_page) {
441
  if ( 'toplevel_page_miniOrange_2_factor_settings' != $mo2fa_hook_page ) {
442
  return;
443
  }
444
- wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.0.8', __FILE__ ) );
445
- wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.0.8', __FILE__ ) );
446
- wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.0.8', __FILE__ ) );
447
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
448
  }
449
 
@@ -502,53 +508,53 @@ class Miniorange_Authentication {
502
  $this->mo_auth_show_success_message();
503
 
504
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
505
 
 
 
 
 
506
 
507
- if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_register_customer" ) { //register the admin to miniOrange
508
- //validate and sanitize
509
- $email = '';
510
- $phone = '';
511
- $password = '';
512
- $confirmPassword = '';
513
- $company = '';
514
- $firstName = '';
515
- $lastName = '';
516
-
517
- if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['email'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['password'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['confirmPassword'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['company'] ) ) {
518
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_ENTRY" ) );
519
- $this->mo_auth_show_error_message();
520
-
521
- return;
522
- } else if ( strlen( $_POST['password'] ) < 6 || strlen( $_POST['confirmPassword'] ) < 6 ) {
523
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "MIN_PASS_LENGTH" ) );
524
- $this->mo_auth_show_error_message();
525
-
526
- return;
527
- } else {
528
- $email = sanitize_email( $_POST['email'] );
529
- $phone = sanitize_text_field( $_POST['phone'] );
530
- $password = sanitize_text_field( $_POST['password'] );
531
- $confirmPassword = sanitize_text_field( $_POST['confirmPassword'] );
532
- $company = sanitize_text_field( $_POST['company'] );
533
- $firstName = sanitize_text_field( $_POST['first_name'] );
534
- $lastName = sanitize_text_field( $_POST['last_name'] );
535
- }
536
- $email = strtolower( $email );
537
- update_option( 'mo2f_email', $email );
538
 
539
- $Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
540
- $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_user_phone' => $phone ) );
541
 
542
- update_option( 'mo2f_admin_company', $company );
543
- update_option( 'mo2f_admin_first_name', $firstName );
544
- update_option( 'mo2_admin_last_name', $lastName );
545
 
546
- if ( strcmp( $password, $confirmPassword ) == 0 ) {
547
- update_option( 'mo2f_password', $password );
548
- $customer = new Customer_Setup();
549
- $customerKey = json_decode( $customer->check_customer(), true );
550
- if ( $customerKey['status'] == 'ERROR' ) {
551
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $customerKey['message'] ) );
552
 
553
  $this->mo_auth_show_error_message();
554
  } else {
@@ -578,11 +584,18 @@ class Miniorange_Authentication {
578
  $this->mo_auth_show_success_message();
579
  }
580
 
581
- }
582
- } else {
583
- update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "PASSWORDS_MISMATCH" ) );
584
- $this->mo_auth_show_error_message();
 
 
 
 
 
 
585
  }
 
586
  }
587
 
588
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_goto_verifycustomer" ) {
@@ -594,6 +607,7 @@ class Miniorange_Authentication {
594
 
595
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_verify_customer" ) { //register the admin to miniOrange if already exist
596
 
 
597
  //validation and sanitization
598
  $email = '';
599
  $password = '';
@@ -706,6 +720,13 @@ class Miniorange_Authentication {
706
  }
707
 
708
  delete_option( 'mo2f_password' );
 
 
 
 
 
 
 
709
  }
710
 
711
  if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_phone_verification' ) { //at registration time
@@ -1127,6 +1148,65 @@ class Miniorange_Authentication {
1127
  }
1128
  }
1129
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1130
 
1131
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_resend_user_otp" ) { //resend OTP over email for additional admin and non-admin user
1132
  $customer = new Customer_Setup();
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 Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
6
+ * Version: 5.0.12
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
14
  include_once dirname( __FILE__ ) . '/class-two-factor-setup.php';
15
  include_once dirname( __FILE__ ) . '/class-customer-setup.php';
16
  include_once dirname( __FILE__ ) . '/database/database_functions.php';
17
+ include dirname( __FILE__ ) . '/views/feedback_form.php';
18
  require( 'class-utility.php' );
19
  require( 'class-mo2f-constants.php' );
20
  require( 'class-miniorange-2-factor-login.php' );
50
  add_action( 'admin_notices', array( $this, 'prompt_user_to_fix_bug' ) );
51
  add_action( 'plugins_loaded', array( $this, 'mo2fa_load_textdomain' ) );
52
  add_action( 'plugins_loaded', array( $this, 'mo2f_update_db_check' ) );
53
+ add_action( 'admin_footer', array( $this,'feedback_request' ) );
54
+
55
  remove_action( 'admin_notices', array( $this, 'mo_auth_success_message' ) );
56
  remove_action( 'admin_notices', array( $this, 'mo_auth_error_message' ) );
57
 
265
  function mo2fa_load_textdomain() {
266
  load_plugin_textdomain( 'miniorange-2-factor-authentication', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
267
  }
268
+
269
+ function feedback_request(){
270
+ display_feedback_form();
271
+ }
272
 
273
  function get_customer_SMS_transactions() {
274
 
436
  }
437
 
438
  function mo_2_factor_enable_frontend_style() {
439
+ wp_enqueue_style( 'mo2f_frontend_login_style', plugins_url( 'includes/css/front_end_login.css?version=5.0.12', __FILE__ ) );
440
+ wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.0.12', __FILE__ ) );
441
+ wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.0.12', __FILE__ ) );
442
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
443
+ wp_enqueue_style( 'mo2f_login_popup_style', plugins_url( 'includes/css/mo2f_login_popup_ui.css?version=5.0.12', __FILE__ ) );
444
  }
445
 
446
  function plugin_settings_style($mo2fa_hook_page) {
447
  if ( 'toplevel_page_miniOrange_2_factor_settings' != $mo2fa_hook_page ) {
448
  return;
449
  }
450
+ wp_enqueue_style( 'mo_2_factor_admin_settings_style', plugins_url( 'includes/css/style_settings.css?version=5.0.12', __FILE__ ) );
451
+ wp_enqueue_style( 'mo_2_factor_admin_settings_phone_style', plugins_url( 'includes/css/phone.css?version=5.0.12', __FILE__ ) );
452
+ wp_enqueue_style( 'bootstrap_style', plugins_url( 'includes/css/bootstrap.min.css?version=5.0.12', __FILE__ ) );
453
  wp_enqueue_style( 'mo_2_factor_wpb-fa', plugins_url( 'includes/css/font-awesome.min.css', __FILE__ ) );
454
  }
455
 
508
  $this->mo_auth_show_success_message();
509
 
510
  }
511
+ if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_register_customer" ) { //register the admin to miniOrange
512
+
513
+ if((isset($_POST['mo2f_gdpr']) and $_POST['mo2f_gdpr']=='on')){
514
+ //validate and sanitize
515
+ $email = '';
516
+ $phone = '';
517
+ $password = '';
518
+ $confirmPassword = '';
519
+ $company = '';
520
+ $firstName = '';
521
+ $lastName = '';
522
+
523
+ if ( MO2f_Utility::mo2f_check_empty_or_null( $_POST['email'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['password'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['confirmPassword'] ) || MO2f_Utility::mo2f_check_empty_or_null( $_POST['company'] ) ) {
524
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "INVALID_ENTRY" ) );
525
+ $this->mo_auth_show_error_message();
526
 
527
+ return;
528
+ } else if ( strlen( $_POST['password'] ) < 6 || strlen( $_POST['confirmPassword'] ) < 6 ) {
529
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "MIN_PASS_LENGTH" ) );
530
+ $this->mo_auth_show_error_message();
531
 
532
+ return;
533
+ } else {
534
+ $email = sanitize_email( $_POST['email'] );
535
+ $phone = sanitize_text_field( $_POST['phone'] );
536
+ $password = sanitize_text_field( $_POST['password'] );
537
+ $confirmPassword = sanitize_text_field( $_POST['confirmPassword'] );
538
+ $company = sanitize_text_field( $_POST['company'] );
539
+ $firstName = sanitize_text_field( $_POST['first_name'] );
540
+ $lastName = sanitize_text_field( $_POST['last_name'] );
541
+ }
542
+ $email = strtolower( $email );
543
+ update_option( 'mo2f_email', $email );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
 
545
+ $Mo2fdbQueries->insert_user( $user_id, array( 'user_id' => $user_id ) );
546
+ $Mo2fdbQueries->update_user_details( $user->ID, array( 'mo2f_user_phone' => $phone ) );
547
 
548
+ update_option( 'mo2f_admin_company', $company );
549
+ update_option( 'mo2f_admin_first_name', $firstName );
550
+ update_option( 'mo2_admin_last_name', $lastName );
551
 
552
+ if ( strcmp( $password, $confirmPassword ) == 0 ) {
553
+ update_option( 'mo2f_password', stripslashes( $password ) );
554
+ $customer = new Customer_Setup();
555
+ $customerKey = json_decode( $customer->check_customer(), true );
556
+ if ( $customerKey['status'] == 'ERROR' ) {
557
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $customerKey['message'] ) );
558
 
559
  $this->mo_auth_show_error_message();
560
  } else {
584
  $this->mo_auth_show_success_message();
585
  }
586
 
587
+ }
588
+ } else {
589
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "PASSWORDS_MISMATCH" ) );
590
+ $this->mo_auth_show_error_message();
591
+ }
592
+ }else{
593
+
594
+ update_site_option( 'mo2f_message', 'Please Accept the Terms and Conditions of our Privacy Policy.');
595
+ $this->mo_auth_show_error_message();
596
+
597
  }
598
+
599
  }
600
 
601
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo2f_goto_verifycustomer" ) {
607
 
608
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_auth_verify_customer" ) { //register the admin to miniOrange if already exist
609
 
610
+ if((isset($_POST['mo2f_gdpr']) and $_POST['mo2f_gdpr']=='on')){
611
  //validation and sanitization
612
  $email = '';
613
  $password = '';
720
  }
721
 
722
  delete_option( 'mo2f_password' );
723
+
724
+ }else{
725
+
726
+ update_site_option( 'mo2f_message', 'Please Accept the Terms and Conditions of our Privacy Policy.');
727
+ $this->mo_auth_show_error_message();
728
+
729
+ }
730
  }
731
 
732
  if ( isset( $_POST['option'] ) and $_POST['option'] == 'mo_2factor_phone_verification' ) { //at registration time
1148
  }
1149
  }
1150
  }
1151
+
1152
+
1153
+ if(isset($_POST['mo2f_gdpr_note']) and $_POST['mo2f_gdpr_note']=='mo2f_gdpr_note'){
1154
+ update_option('mo2f_gdpr_note',1);
1155
+ }
1156
+
1157
+ if(isset($_POST['option']) and $_POST['option']=='mo2f_skip_feedback'){
1158
+
1159
+ update_option('mo2f_feedback_form',1);
1160
+ deactivate_plugins( '/miniorange-2-factor-authentication/miniorange_2_factor_settings.php' );
1161
+
1162
+ }
1163
+ if(isset($_POST['mo2f_feedback']) and $_POST['mo2f_feedback']=='mo2f_feedback'){
1164
+ $message='Plugin Deactivated:';
1165
+ if(isset($_POST['deactivate_plugin']) ){
1166
+ if($_POST['query_feedback']=='' and $_POST['deactivate_plugin']=='Other Reasons:'){
1167
+ // feedback add
1168
+ update_option('mo2f_message','Please let us know the reason for deactivation so that we improve the user experience.');
1169
+ }else{
1170
+
1171
+ $message.=$_POST['deactivate_plugin'];
1172
+ if($_POST['query_feedback']!=''){
1173
+ $message.=':'.$_POST['query_feedback'];
1174
+ }
1175
+ $email = $Mo2fdbQueries->get_user_detail( 'mo2f_user_email', $user->ID );
1176
+ if($email==''){
1177
+ $email=$user->user_email;
1178
+ }
1179
+ //only reason
1180
+ $phone='';
1181
+
1182
+ $contact_us = new Customer_Setup();
1183
+ $submited = json_decode( $contact_us->submit_contact_us( $email, $phone, $message ), true );
1184
+ if ( json_last_error() == JSON_ERROR_NONE ) {
1185
+ if ( is_array( $submited ) && array_key_exists( 'status', $submited ) && $submited['status'] == 'ERROR' ) {
1186
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( $submited['message'] ) );
1187
+ $this->mo_auth_show_error_message();
1188
+ } else {
1189
+ if ( $submited == false ) {
1190
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "ERROR_WHILE_SUBMITTING_QUERY" ) );
1191
+ $this->mo_auth_show_error_message();
1192
+ } else {
1193
+ update_option( 'mo2f_message', Mo2fConstants:: langTranslate( "QUERY_SUBMITTED_SUCCESSFULLY" ) );
1194
+ $this->mo_auth_show_success_message();
1195
+ update_option('mo2f_feedback_form',1);
1196
+ }
1197
+ }
1198
+ }
1199
+ update_option('mo2f_feedback_form',1);
1200
+ deactivate_plugins( '/miniorange-2-factor-authentication/miniorange_2_factor_settings.php' );
1201
+
1202
+ }
1203
+
1204
+ }else{
1205
+ update_option('mo2f_message','Please Select one of the reasons if your reason isnot mention please select Other Reasons');
1206
+
1207
+ }
1208
+
1209
+ }
1210
 
1211
  if ( isset( $_POST['option'] ) and $_POST['option'] == "mo_2factor_resend_user_otp" ) { //resend OTP over email for additional admin and non-admin user
1212
  $customer = new Customer_Setup();
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === Google Authenticator - Two Factor Authentication (2FA) ===
2
  Contributors: cyberlord92
3
  Donate link: https://miniorange.com/
4
  Tags: google authenticator, two factor authentication, two factor, 2FA, 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
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9.4
7
  Requires PHP: 5.3.0
8
- Stable tag: 5.0.10
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -13,8 +13,10 @@ Google Authenticator and Best Enterprise Grade Two Factor Authentication (2FA).
13
 
14
  == Description ==
15
 
16
- Secure your Wordpress login with an additional layer of security from us! The setup takes minutes, yet protects your site forever!
17
 
 
 
 
18
  This plugin provides two factor authentication during login. If you are looking for OTP Verification of users during <b>Registration</b> then we have a separate plugin for this. <a href="https://wordpress.org/plugins/miniorange-otp-verification/"> Click Here </a> to learn more.
19
 
20
  <h4>Free Plugin Features</h4>
@@ -50,18 +52,18 @@ This plugin provides two factor authentication during login. If you are looking
50
 
51
  <h4>Add Ons [Free and Standard Plans, Inclusive in the Premium Plan]</h4>
52
 
53
- * **RBA & Trusted Devices Management Add-on Features **
54
  * Remember Device
55
  * Set Device Limit for the users to login
56
  * IP Restriction: Limit users to login from specific IPs
57
- * **Personalization Add-on Features **
58
  * Custom UI of 2FA popups
59
  * Custom Email and SMS Templates
60
  * Customize 'powered by' Logo
61
  * Customize Plugin Icon
62
  * Customize Plugin Name
63
  * Add Recaptcha on Login Page
64
- * **Short Codes Add-on Features **
65
  * Option to turn on/off 2-factor by user
66
  * Option to configure the Google Authenticator and Security Questions by user
67
  * Option to 'Enable Remember Device' from a custom login form
@@ -219,6 +221,12 @@ miniOrange authentication service has 15+ authentication methods.One time passco
219
 
220
  == Changelog ==
221
 
 
 
 
 
 
 
222
  = 5.0.10 =
223
  * Google Authenticator (2FA) : Added Proxy Setup feature.
224
 
@@ -499,6 +507,12 @@ More descriptive setup messages and UI changes.
499
 
500
  == Upgrade Notice ==
501
 
 
 
 
 
 
 
502
  = 5.0.10 =
503
  * Google Authenticator (2FA) : Added Proxy Setup feature.
504
 
1
+ === Google Authenticator - Wordpress Two Factor Authentication (2FA) ===
2
  Contributors: cyberlord92
3
  Donate link: https://miniorange.com/
4
  Tags: google authenticator, two factor authentication, two factor, 2FA, 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
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9.4
7
  Requires PHP: 5.3.0
8
+ Stable tag: 5.0.12
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
13
 
14
  == Description ==
15
 
 
16
 
17
+ **Note: The miniOrange 2-factor authentication plugin for Wordpress is GDPR Compliant now**
18
+
19
+ Secure your Wordpress login with an additional layer of security from us! The setup takes minutes, yet protects your site forever.
20
  This plugin provides two factor authentication during login. If you are looking for OTP Verification of users during <b>Registration</b> then we have a separate plugin for this. <a href="https://wordpress.org/plugins/miniorange-otp-verification/"> Click Here </a> to learn more.
21
 
22
  <h4>Free Plugin Features</h4>
52
 
53
  <h4>Add Ons [Free and Standard Plans, Inclusive in the Premium Plan]</h4>
54
 
55
+ * RBA & Trusted Devices Management Add-on Features
56
  * Remember Device
57
  * Set Device Limit for the users to login
58
  * IP Restriction: Limit users to login from specific IPs
59
+ * Personalization Add-on Features
60
  * Custom UI of 2FA popups
61
  * Custom Email and SMS Templates
62
  * Customize 'powered by' Logo
63
  * Customize Plugin Icon
64
  * Customize Plugin Name
65
  * Add Recaptcha on Login Page
66
+ * Short Codes Add-on Features
67
  * Option to turn on/off 2-factor by user
68
  * Option to configure the Google Authenticator and Security Questions by user
69
  * Option to 'Enable Remember Device' from a custom login form
221
 
222
  == Changelog ==
223
 
224
+ = 5.0.12 =
225
+ * Google Authenticator (2FA) : Added GDPR Compliance.
226
+
227
+ = 5.0.11 =
228
+ * Google Authenticator (2FA) : Readme Update.
229
+
230
  = 5.0.10 =
231
  * Google Authenticator (2FA) : Added Proxy Setup feature.
232
 
507
 
508
  == Upgrade Notice ==
509
 
510
+ = 5.0.12 =
511
+ * Google Authenticator (2FA) : Added GDPR Compliance.
512
+
513
+ = 5.0.11 =
514
+ * Google Authenticator (2FA) : Readme Update.
515
+
516
  = 5.0.10 =
517
  * Google Authenticator (2FA) : Added Proxy Setup feature.
518
 
uninstall.php CHANGED
@@ -59,6 +59,8 @@ if ( ! is_multisite() ) {
59
  delete_option( 'mo2f_existing_user_values_updated' );
60
  delete_option( 'mo2f_dbversion' );
61
  delete_option( 'mo2f_bug_fix_done' );
 
 
62
 
63
  delete_option( 'mo2f_admin_first_name' );
64
  delete_option( 'mo2_admin_last_name' );
@@ -124,7 +126,9 @@ if ( ! is_multisite() ) {
124
  delete_option( 'mo2f_phone' );
125
  delete_option( 'mo2f_existing_user_values_updated' );
126
  delete_option( 'mo2f_dbversion' );
127
-
 
 
128
  delete_option( 'mo2f_admin_first_name' );
129
  delete_option( 'mo2_admin_last_name' );
130
  delete_option( 'mo2f_admin_company' );
59
  delete_option( 'mo2f_existing_user_values_updated' );
60
  delete_option( 'mo2f_dbversion' );
61
  delete_option( 'mo2f_bug_fix_done' );
62
+ delete_option( 'mo2f_feedback_form' );
63
+ delete_option( 'mo2f_gdpr_note' );
64
 
65
  delete_option( 'mo2f_admin_first_name' );
66
  delete_option( 'mo2_admin_last_name' );
126
  delete_option( 'mo2f_phone' );
127
  delete_option( 'mo2f_existing_user_values_updated' );
128
  delete_option( 'mo2f_dbversion' );
129
+ delete_option( 'mo2f_feedback_form' );
130
+ delete_option( 'mo2f_gdpr_note' );
131
+
132
  delete_option( 'mo2f_admin_first_name' );
133
  delete_option( 'mo2_admin_last_name' );
134
  delete_option( 'mo2f_admin_company' );
views/feedback_form.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php function display_feedback_form(){
2
+ if ( 'plugins.php' != basename($_SERVER['PHP_SELF']) ) {
3
+ return;
4
+ }
5
+
6
+ $mo2f_message = get_option( 'mo2f_message');
7
+ wp_enqueue_style( 'wp-pointer' );
8
+ wp_enqueue_script( 'wp-pointer' );
9
+ wp_enqueue_script( 'utils' );
10
+ wp_enqueue_style( 'mo_2_factor_admin_plugins_page_style', plugins_url( '/../includes/css/mo2f_plugins_page.css?version=5.0.12', __FILE__ ) );
11
+ ?>
12
+
13
+ </head>
14
+ <body>
15
+
16
+
17
+
18
+
19
+
20
+ <!-- The Modal -->
21
+ <div id="myModal" class="mo2f_modal">
22
+
23
+ <!-- Modal content -->
24
+ <div class="mo2f_modal-content">
25
+ <span class="mo2f_close">&times;</span>
26
+ <h3>What Happened? </h3>
27
+
28
+ <?php if($mo2f_message!=''){?>
29
+ <div style="padding:10px;">
30
+ <div class="alert alert-info" style="margin-bottom:0px">
31
+ <p style="font-size:15px"><?php echo $mo2f_message; ?></p>
32
+ </div>
33
+ </div>
34
+ <?php } ?>
35
+ <form name="f" method="post" action="" id="mo2f_feedback">
36
+ <input type="hidden" name="mo2f_feedback" value="mo2f_feedback"/>
37
+ <div >
38
+ <p style="margin-left:2%">
39
+ <?php
40
+ $deactivate_reasons = array(
41
+ "Not Receiving OTP During Registration",
42
+ "Does not have the features I'm looking for",
43
+ "Not Working",
44
+ "Redirecting back to login page after Authentication",
45
+ "Confusing Interface",
46
+ "Bugs in the plugin",
47
+ "Other Reasons:"
48
+ );
49
+
50
+
51
+ foreach ( $deactivate_reasons as $deactivate_reasons ) {?>
52
+
53
+ <div class="radio" style="padding:1px;margin-left:2%">
54
+ <label style="font-weight:normal;font-size:14.6px" for="<?php echo $deactivate_reasons; ?>">
55
+ <input type="radio" name="deactivate_plugin" value="<?php echo $deactivate_reasons;?>" required>
56
+ <?php echo $deactivate_reasons;?></label>
57
+ </div>
58
+
59
+
60
+ <?php } ?>
61
+ <br>
62
+
63
+ <textarea id="query_feedback" name="query_feedback" rows="4" style="margin-left:2%" cols="50" placeholder="Write your query here"></textarea>
64
+ <br><br>
65
+ <div class="mo2f_modal-footer" >
66
+ <input type="submit" name="miniorange_feedback_submit" class="button button-primary button-large" value="Submit" />
67
+ </div>
68
+ </div>
69
+ </form>
70
+ <form name="f" method="post" action="" id="mo2f_feedback_form_close">
71
+ <input type="hidden" name="option" value="mo2f_skip_feedback"/>
72
+ </form>
73
+
74
+ </div>
75
+
76
+ </div>
77
+
78
+ <script>
79
+ jQuery('a[aria-label="Deactivate miniOrange 2 Factor Authentication"]').click(function(){
80
+ // Get the mo2f_modal
81
+ <?php if(!get_option('mo2f_feedback_form')){ ?>
82
+ var mo2f_modal = document.getElementById('myModal');
83
+
84
+ // Get the button that opens the mo2f_modal
85
+ var btn = document.getElementById("myBtn");
86
+
87
+ // Get the <span> element that closes the mo2f_modal
88
+ var span = document.getElementsByClassName("mo2f_close")[0];
89
+
90
+ // When the user clicks the button, open the mo2f_modal
91
+
92
+ mo2f_modal.style.display = "block";
93
+
94
+ // jQuery('#myModal').mo2f_modal('mo2f_toggle');
95
+
96
+
97
+ jQuery('input:radio[name="deactivate_plugin"]').click(function () {
98
+ var reason= jQuery(this).val();
99
+ jQuery('#query_feedback').removeAttr('required')
100
+
101
+ if(reason=='Facing issues During Registration'){
102
+ jQuery('#query_feedback').attr("placeholder", "Can you please describe the issue in detail?");
103
+ }else if(reason=="Does not have the features I'm looking for"){
104
+ jQuery('#query_feedback').attr("placeholder", "Let us know what feature are you looking for");
105
+ }else if(reason=="Other Reasons:"){
106
+ jQuery('#query_feedback').attr("placeholder", "Can you let us know the reason for deactivation");
107
+ jQuery('#query_feedback').prop('required',true);
108
+
109
+ }else if(reason=="Not Receiving OTP During Registration"){
110
+ jQuery('#query_feedback').attr("placeholder", "Can you please describe the issue in detail?");
111
+
112
+ }else if(reason=="Bugs in the plugin"){
113
+ jQuery('#query_feedback').attr("placeholder", "Can you please let us know about the bug in detail?");
114
+
115
+ }else if(reason=="Redirecting back to login page after Authentication"){
116
+ jQuery('#query_feedback').attr("placeholder", "Can you please describe the issue in detail?");
117
+
118
+ }else if(reason=="Confusing Interface"){
119
+ jQuery('#query_feedback').attr("placeholder", "Finding it confusing? let us know so that we can improve the interface");
120
+
121
+ }else if(reason=="Not Working"){
122
+ jQuery('#query_feedback').attr("placeholder", "Can you please describe what is not working?");
123
+
124
+ }else if(reason=="Not Working"){
125
+ jQuery('#query_feedback').attr("placeholder", "Can you please describe what is not working?");
126
+
127
+ }else if(reason=="Login Credentials Not Working"){
128
+ jQuery('#query_feedback').attr("placeholder", "This is not a major issue please contact info@miniorange.com to get your issue resolved.");
129
+
130
+ }
131
+ });
132
+
133
+
134
+
135
+
136
+ // When the user clicks on <span> (x), mo2f_close the mo2f_modal
137
+ span.onclick = function() {
138
+ mo2f_modal.style.display = "none";
139
+ jQuery('#mo2f_feedback_form_close').submit();
140
+ }
141
+
142
+ // When the user clicks anywhere outside of the mo2f_modal, mo2f_close it
143
+ window.onclick = function(event) {
144
+ if (event.target == mo2f_modal) {
145
+ mo2f_modal.style.display = "none";
146
+ }
147
+ }
148
+ return false;
149
+ <?php } ?>
150
+ });
151
+ </script><?php
152
+ }
153
+ ?>