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

Version Description

  • Google Authenticator-Two Factor Authentication (2FA) : Anti-Virus : Stop Scan.
Download this release

Release Info

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

Code changes from version 5.3.15 to 5.3.16

controllers/malware_scan_ajax.php CHANGED
@@ -30,6 +30,9 @@ class Mo_wpns_scan_malware
30
  case "malware_scan_last_result":
31
  $this->mo_wpns_get_scan_result();
32
  break;
 
 
 
33
  }
34
  }
35
 
@@ -87,6 +90,11 @@ class Mo_wpns_scan_malware
87
  include_once $dirName. DIRECTORY_SEPARATOR.'handler'.DIRECTORY_SEPARATOR.'malware_scanner.php';
88
  $mo_wpns_scan_handler = new Mo_wpns_Scan_Handler();
89
 
 
 
 
 
 
90
  update_option('mo_wpns_last_scan_time', time());
91
  $plugin_current= get_plugins();
92
  update_option('mo_wpns_last_plugins', $plugin_current);
@@ -189,6 +197,19 @@ class Mo_wpns_scan_malware
189
  wp_send_json($result);
190
  }
191
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  function mo_wpns_get_scan_result(){
193
  $status= get_option('mo_wpns_malware_scan_in_progress');
194
  $mo_wpns_db_handler = new MoWpnsDB();
30
  case "malware_scan_last_result":
31
  $this->mo_wpns_get_scan_result();
32
  break;
33
+ case "malware_scan_terminate":
34
+ $this->mo_wpns_stop_scan();
35
+ break;
36
  }
37
  }
38
 
90
  include_once $dirName. DIRECTORY_SEPARATOR.'handler'.DIRECTORY_SEPARATOR.'malware_scanner.php';
91
  $mo_wpns_scan_handler = new Mo_wpns_Scan_Handler();
92
 
93
+ update_option('mo2f_scan_initialize', 0);
94
+ update_option('mo_wpns_malware_scan_in_progress','IN PROGRESS');
95
+ update_option('mo_wpns_files_scanned',0);
96
+ update_option('mo_wpns_infected_files',0);
97
+
98
  update_option('mo_wpns_last_scan_time', time());
99
  $plugin_current= get_plugins();
100
  update_option('mo_wpns_last_plugins', $plugin_current);
197
  wp_send_json($result);
198
  }
199
  }
200
+
201
+ function mo_wpns_stop_scan(){
202
+
203
+ global $wpdb;
204
+ update_option('mo_wpns_malware_scan_in_progress','COMPLETE');
205
+ update_option('mo_wpns_files_scanned',0);
206
+ update_option('mo_wpns_infected_files',0);
207
+ $query="UPDATE `".$wpdb->base_prefix."options` SET `option_value` = '1' WHERE `option_name` = 'mo_stop_scan'";
208
+ $test= $wpdb->get_results($query);
209
+ wp_send_json('success');
210
+
211
+ }
212
+
213
  function mo_wpns_get_scan_result(){
214
  $status= get_option('mo_wpns_malware_scan_in_progress');
215
  $mo_wpns_db_handler = new MoWpnsDB();
handler/malware_scanner.php CHANGED
@@ -7,10 +7,8 @@ class Mo_wpns_Scan_Handler{
7
 
8
  }
9
  function mo2f_scan_all_files($scan_config){
10
- update_option('mo2f_scan_initialize', 0);
11
- update_option('mo_wpns_malware_scan_in_progress','IN PROGRESS');
12
- update_option('mo_wpns_files_scanned',0);
13
- update_option('mo_wpns_infected_files',0);
14
  ini_set('memory_limit', '-1');
15
  ini_set('max_execution_time', 0);
16
  $result = array();
@@ -277,13 +275,35 @@ class Mo_wpns_Scan_Handler{
277
  array_push($skip_path_array, $folder);
278
  }
279
  $enable_extns = $scan_config['type_scan'] == "Custom Scan" && !empty($file_ext) ? false : true;
 
280
  foreach ($folderpaths as $value) {
281
  $onearr = array();
282
  if (is_dir($value)) {
 
283
  foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($value, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
284
  if ($item->isFile()) {
285
  $scanresult=array();
286
  $source_file_path = $value . DIRECTORY_SEPARATOR . $iterator->getSubPathName();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  if ($value == $base && ($scan_config['core_scan'] == 1)){
288
  $arr = explode(DIRECTORY_SEPARATOR, $iterator->getSubPathName());
289
  if(($arr[count($arr)-1]== 'index.php' && (count($arr)==1 || in_array($arr[count($arr)-2], array('wp-content', 'plugins', 'themes'))) && !in_array('miniorangescan', $arr)) || (!in_array('plugins', $arr) && !in_array('themes', $arr) && !in_array('miniorangescan', $arr))){
@@ -353,7 +373,7 @@ class Mo_wpns_Scan_Handler{
353
 
354
  if($scan_config['check_repo'] == 1 && $repocheck && $extns){
355
  if(!in_array('wp-config.php', $arr) && !in_array($ext, array('zip', 'log', 'htaccess','sitx','7z','rar','gz','tar.gz','jpg','jpeg','png','gif','svg','tiff','raw'))){
356
- if(($arr[count($arr)-1]== 'index.php' && (count($arr)==1 || in_array($arr[count($arr)-2], array('wp-content', 'plugins', 'themes'))) && !in_array('uploads', $arr)) || !in_array('wp-content', $arr)){
357
  $repo_status = 1;
358
  if($value==$base){
359
  $repo_file_path=$repo_folder_path['base'];
7
 
8
  }
9
  function mo2f_scan_all_files($scan_config){
10
+
11
+ update_option('mo_stop_scan','0');
 
 
12
  ini_set('memory_limit', '-1');
13
  ini_set('max_execution_time', 0);
14
  $result = array();
275
  array_push($skip_path_array, $folder);
276
  }
277
  $enable_extns = $scan_config['type_scan'] == "Custom Scan" && !empty($file_ext) ? false : true;
278
+ $iterat=0;
279
  foreach ($folderpaths as $value) {
280
  $onearr = array();
281
  if (is_dir($value)) {
282
+
283
  foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($value, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
284
  if ($item->isFile()) {
285
  $scanresult=array();
286
  $source_file_path = $value . DIRECTORY_SEPARATOR . $iterator->getSubPathName();
287
+ $arr = array();
288
+ global $wpdb;
289
+ if($iterat>100){
290
+ $query="SELECT `option_value` from `".$wpdb->base_prefix."options` WHERE `option_name` = 'mo_stop_scan'";
291
+ $stop_scan= $wpdb->get_results($query);
292
+ $stop_scan_process=$stop_scan[0]->option_value;
293
+ if($stop_scan_process=="1"){
294
+
295
+
296
+ error_log("Scan Stopped");
297
+ wp_send_json('aborted');
298
+ exit;
299
+ }else{
300
+ $iterat=0;
301
+ }
302
+ }else{
303
+ $iterat++;
304
+ }
305
+
306
+
307
  if ($value == $base && ($scan_config['core_scan'] == 1)){
308
  $arr = explode(DIRECTORY_SEPARATOR, $iterator->getSubPathName());
309
  if(($arr[count($arr)-1]== 'index.php' && (count($arr)==1 || in_array($arr[count($arr)-2], array('wp-content', 'plugins', 'themes'))) && !in_array('miniorangescan', $arr)) || (!in_array('plugins', $arr) && !in_array('themes', $arr) && !in_array('miniorangescan', $arr))){
373
 
374
  if($scan_config['check_repo'] == 1 && $repocheck && $extns){
375
  if(!in_array('wp-config.php', $arr) && !in_array($ext, array('zip', 'log', 'htaccess','sitx','7z','rar','gz','tar.gz','jpg','jpeg','png','gif','svg','tiff','raw'))){
376
+ if(!empty($arr) && ($arr[count($arr)-1]== 'index.php' && (count($arr)==1 || in_array($arr[count($arr)-2], array('wp-content', 'plugins', 'themes'))) && !in_array('uploads', $arr)) || !in_array('wp-content', $arr)){
377
  $repo_status = 1;
378
  if($value==$base){
379
  $repo_file_path=$repo_folder_path['base'];
miniorange_2_factor_settings.php CHANGED
@@ -3,13 +3,13 @@
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.3.15
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
10
  */
11
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
12
- define( 'MO2F_VERSION', '5.3.15' );
13
  define( 'MO2F_TEST_MODE', false );
14
  class Miniorange_twoFactor{
15
 
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.3.16
7
  * Author: miniOrange
8
  * Author URI: https://miniorange.com
9
  * License: GPL2
10
  */
11
  define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
12
+ define( 'MO2F_VERSION', '5.3.16' );
13
  define( 'MO2F_TEST_MODE', false );
14
  class Miniorange_twoFactor{
15
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://miniorange.com/
6
  Requires at least: 3.0.1
7
  Tested up to: 5.3
8
  Requires PHP: 5.3.0
9
- Stable tag: 5.3.15
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -272,6 +272,9 @@ miniOrange authentication service has 15+ authentication methods.One time passco
272
 
273
  == Changelog ==
274
 
 
 
 
275
  = 5.3.15 =
276
  * Google Authenticator-Two Factor Authentication (2FA) : Anti-Malware : schedule scan.
277
 
@@ -709,6 +712,9 @@ More descriptive setup messages and UI changes.
709
 
710
  == Upgrade Notice ==
711
 
 
 
 
712
  = 5.3.15 =
713
  * Google Authenticator-Two Factor Authentication (2FA) : Anti-Malware : schedule scan.
714
 
6
  Requires at least: 3.0.1
7
  Tested up to: 5.3
8
  Requires PHP: 5.3.0
9
+ Stable tag: 5.3.16
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
272
 
273
  == Changelog ==
274
 
275
+ = 5.3.16 =
276
+ * Google Authenticator-Two Factor Authentication (2FA) : Anti-Virus : Stop Scan.
277
+
278
  = 5.3.15 =
279
  * Google Authenticator-Two Factor Authentication (2FA) : Anti-Malware : schedule scan.
280
 
712
 
713
  == Upgrade Notice ==
714
 
715
+ = 5.3.16 =
716
+ * Google Authenticator-Two Factor Authentication (2FA) : Anti-Virus : Stop Scan.
717
+
718
  = 5.3.15 =
719
  * Google Authenticator-Two Factor Authentication (2FA) : Anti-Malware : schedule scan.
720
 
views/scan_summary_view.php CHANGED
@@ -55,6 +55,7 @@ add_action('admin_footer','mo_wpns_start_scan');
55
  <div id="mo_wpns_progress" class="mo_wpns_progress">
56
  <div id="mo_wpns_progress_bar" class="mo_wpns_progress_bar">0%</div>
57
  </div>
 
58
  </div>
59
 
60
  <?php
@@ -93,7 +94,7 @@ function mo_wpns_start_scan(){
93
  }
94
  status_var = 1;
95
  document.getElementById("mo_progress").style.display="block";
96
- progress_bar = setInterval(status_progress, 1000);
97
  }
98
  jQuery('input[name="quick_scan_button"]').click(function(){
99
  document.getElementById("quick_scan_button").value = "Scanning...";
@@ -102,7 +103,7 @@ function mo_wpns_start_scan(){
102
  document.getElementById("progress_message").innerHTML = "Scan progress...";
103
  document.getElementById("mo_wpns_progress_bar").style.width= 0 + "%";
104
  document.getElementById("mo_wpns_progress_bar").innerHTML= 0 + "%";
105
- progress_bar= setInterval(status_progress, 1000);
106
 
107
  jQuery('input[name="quick_scan_button"]').attr('disabled', true);
108
  jQuery('input[name="custom_scan_button"]').attr('disabled', true);
@@ -132,6 +133,8 @@ function mo_wpns_start_scan(){
132
  jQuery("#mo_scan_message").addClass("notice notice-error is-dismissible");
133
  jQuery("#mo_scan_message").append("Nonce did not match.");
134
  window.scrollTo({ top: 0, behavior: "smooth"});
 
 
135
  }else{
136
  jQuery("#mo_scan_message").addClass("notice notice-success is-dismissible");
137
  jQuery("#mo_scan_message").append("Scan has been completed. You can see the results in the Scan Reports tab.");
@@ -162,7 +165,7 @@ function mo_wpns_start_scan(){
162
  document.getElementById("progress_message").innerHTML = "Scan progress...";
163
  document.getElementById("mo_wpns_progress_bar").style.width= 0 + "%";
164
  document.getElementById("mo_wpns_progress_bar").innerHTML= 0 + "%";
165
- progress_bar= setInterval(status_progress, 1000);
166
 
167
  jQuery('input[name="quick_scan_button"]').attr('disabled', true);
168
  jQuery('input[name="custom_scan_button"]').attr('disabled', true);
@@ -192,6 +195,8 @@ function mo_wpns_start_scan(){
192
  jQuery("#mo_scan_message").addClass("notice notice-error is-dismissible");
193
  jQuery("#mo_scan_message").append("Nonce did not match.");
194
  window.scrollTo({ top: 0, behavior: "smooth"});
 
 
195
  }else{
196
  jQuery("#mo_scan_message").addClass("notice notice-success is-dismissible");
197
  jQuery("#mo_scan_message").append("Scan has been completed. You can see the results in the Scan Reports tab.");
@@ -221,7 +226,7 @@ function mo_wpns_start_scan(){
221
  document.getElementById("progress_message").innerHTML = "Scan progress...";
222
  document.getElementById("mo_wpns_progress_bar").style.width= 0 + "%";
223
  document.getElementById("mo_wpns_progress_bar").innerHTML= 0 + "%";
224
- progress_bar= setInterval(status_progress, 1000);
225
 
226
  jQuery('input[name="quick_scan_button"]').attr('disabled', true);
227
  jQuery('input[name="custom_scan_button"]').attr('disabled', true);
@@ -251,6 +256,8 @@ function mo_wpns_start_scan(){
251
  jQuery("#mo_scan_message").addClass("notice notice-error is-dismissible");
252
  jQuery("#mo_scan_message").append("Nonce did not match.");
253
  window.scrollTo({ top: 0, behavior: "smooth"});
 
 
254
  }else{
255
  jQuery("#mo_scan_message").addClass("notice notice-success is-dismissible");
256
  jQuery("#mo_scan_message").append("Scan has been completed. You can see the results in the Scan Reports tab.");
@@ -272,6 +279,30 @@ function mo_wpns_start_scan(){
272
 
273
  });
274
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  });
276
 
277
  function status_progress(){
@@ -303,8 +334,12 @@ function mo_wpns_start_scan(){
303
  }
304
  clearInterval(progress_bar);
305
  }else{
306
- var width= (response['scanned']/response['total'])*100;
307
- width = Math.round(width);
 
 
 
 
308
  bar.style.width= width + "%";
309
  if(response['repo_scan']==1 && width==0){
310
  document.getElementById("progress_message").innerHTML= "Downloading plugins/themes/wordpress files from repository...";
55
  <div id="mo_wpns_progress" class="mo_wpns_progress">
56
  <div id="mo_wpns_progress_bar" class="mo_wpns_progress_bar">0%</div>
57
  </div>
58
+ <input type="button" name="mo_stop_button" id="mo_stop_button" class="mo_wpns_scan_button" value="Stop Scan" style="margin-left: 45%;">
59
  </div>
60
 
61
  <?php
94
  }
95
  status_var = 1;
96
  document.getElementById("mo_progress").style.display="block";
97
+ progress_bar = setInterval(status_progress, 2000);
98
  }
99
  jQuery('input[name="quick_scan_button"]').click(function(){
100
  document.getElementById("quick_scan_button").value = "Scanning...";
103
  document.getElementById("progress_message").innerHTML = "Scan progress...";
104
  document.getElementById("mo_wpns_progress_bar").style.width= 0 + "%";
105
  document.getElementById("mo_wpns_progress_bar").innerHTML= 0 + "%";
106
+ progress_bar= setInterval(status_progress, 2000);
107
 
108
  jQuery('input[name="quick_scan_button"]').attr('disabled', true);
109
  jQuery('input[name="custom_scan_button"]').attr('disabled', true);
133
  jQuery("#mo_scan_message").addClass("notice notice-error is-dismissible");
134
  jQuery("#mo_scan_message").append("Nonce did not match.");
135
  window.scrollTo({ top: 0, behavior: "smooth"});
136
+ }else if(response=='aborted'){
137
+ jQuery('#mo_scan_message').hide();
138
  }else{
139
  jQuery("#mo_scan_message").addClass("notice notice-success is-dismissible");
140
  jQuery("#mo_scan_message").append("Scan has been completed. You can see the results in the Scan Reports tab.");
165
  document.getElementById("progress_message").innerHTML = "Scan progress...";
166
  document.getElementById("mo_wpns_progress_bar").style.width= 0 + "%";
167
  document.getElementById("mo_wpns_progress_bar").innerHTML= 0 + "%";
168
+ progress_bar= setInterval(status_progress, 2000);
169
 
170
  jQuery('input[name="quick_scan_button"]').attr('disabled', true);
171
  jQuery('input[name="custom_scan_button"]').attr('disabled', true);
195
  jQuery("#mo_scan_message").addClass("notice notice-error is-dismissible");
196
  jQuery("#mo_scan_message").append("Nonce did not match.");
197
  window.scrollTo({ top: 0, behavior: "smooth"});
198
+ }else if(response=='aborted'){
199
+ jQuery('#mo_scan_message').hide();
200
  }else{
201
  jQuery("#mo_scan_message").addClass("notice notice-success is-dismissible");
202
  jQuery("#mo_scan_message").append("Scan has been completed. You can see the results in the Scan Reports tab.");
226
  document.getElementById("progress_message").innerHTML = "Scan progress...";
227
  document.getElementById("mo_wpns_progress_bar").style.width= 0 + "%";
228
  document.getElementById("mo_wpns_progress_bar").innerHTML= 0 + "%";
229
+ progress_bar= setInterval(status_progress, 2000);
230
 
231
  jQuery('input[name="quick_scan_button"]').attr('disabled', true);
232
  jQuery('input[name="custom_scan_button"]').attr('disabled', true);
256
  jQuery("#mo_scan_message").addClass("notice notice-error is-dismissible");
257
  jQuery("#mo_scan_message").append("Nonce did not match.");
258
  window.scrollTo({ top: 0, behavior: "smooth"});
259
+ }else if(response=='aborted'){
260
+ jQuery('#mo_scan_message').hide();
261
  }else{
262
  jQuery("#mo_scan_message").addClass("notice notice-success is-dismissible");
263
  jQuery("#mo_scan_message").append("Scan has been completed. You can see the results in the Scan Reports tab.");
279
 
280
  });
281
  });
282
+
283
+ jQuery('input[name="mo_stop_button"]').click(function(){
284
+ jQuery('input[name="quick_scan_button"]').removeAttr('disabled');
285
+ document.getElementById('quick_scan_button').style.backgroundColor = '#20b2aa';
286
+ document.getElementById("quick_scan_button").value = "Quick Scan";
287
+ jQuery('input[name="standard_scan_button"]').removeAttr('disabled');
288
+ document.getElementById('standard_scan_button').style.backgroundColor = '#20b2aa';
289
+ document.getElementById("standard_scan_button").value = "Standard Scan";
290
+ jQuery('input[name="custom_scan_button"]').removeAttr('disabled');
291
+ document.getElementById('custom_scan_button').style.backgroundColor = '#20b2aa';
292
+ document.getElementById("custom_scan_button").value = "Custom Scan";
293
+ document.getElementById("mo_progress").style.display="none";
294
+ var data={
295
+ 'action':'mo_wpns_malware_redirect',
296
+ 'call_type':'malware_scan_terminate'
297
+ };
298
+ jQuery.post(ajaxurl, data, function(response){
299
+ jQuery('#mo_scan_message').show();
300
+ jQuery('#mo_scan_message').empty();
301
+ jQuery("#mo_scan_message").addClass("notice notice-success is-dismissible");
302
+ jQuery("#mo_scan_message").append("Scan has been aborted.");
303
+ window.scrollTo({ top: 0, behavior: "smooth" });
304
+ });
305
+ });
306
  });
307
 
308
  function status_progress(){
334
  }
335
  clearInterval(progress_bar);
336
  }else{
337
+ if(response['total'] == 0 || response['total'] == false){
338
+ var width= 0;
339
+ }else{
340
+ var width= (response['scanned']/response['total'])*100;
341
+ width = Math.round(width);
342
+ }
343
  bar.style.width= width + "%";
344
  if(response['repo_scan']==1 && width==0){
345
  document.getElementById("progress_message").innerHTML= "Downloading plugins/themes/wordpress files from repository...";
views/twofa/setup/setup_miniorange_authenticator.php CHANGED
@@ -86,7 +86,7 @@ function download_instruction_for_mobile_app( $mobile_reg_status){ ?>
86
  </li>
87
  </ol>
88
  <br>
89
- <a style="margin-left:10%" target="_blank" href="https://itunes.apple.com/us/app/miniorange-authenticator/id796303566?ls=1"><img src="<?php echo plugins_url( 'includes/images/appstore.png' , dirname(dirname(dirname(__FILE__))) );?>" style="width:120px; height:45px; margin-left:6px;">
90
  </a>
91
  </td>
92
  <td style="padding:10px;">
86
  </li>
87
  </ol>
88
  <br>
89
+ <a style="margin-left:10%" target="_blank" href="https://apps.apple.com/app/id1482362759"><img src="<?php echo plugins_url( 'includes/images/appstore.png' , dirname(dirname(dirname(__FILE__))) );?>" style="width:120px; height:45px; margin-left:6px;">
90
  </a>
91
  </td>
92
  <td style="padding:10px;">