MainWP Child - Version 4.1.6

Version Description

  • 4-15-21 =
  • Added: Support for the function to trigger Check for Abandoned plugins and themes process
  • Updated: Multiple performance improvements
Download this release

Release Info

Developer mainwp
Plugin Icon 128x128 MainWP Child
Version 4.1.6
Comparing to
See all releases

Code changes from version 4.1.5 to 4.1.6

class/class-mainwp-child-callable.php CHANGED
@@ -90,6 +90,7 @@ class MainWP_Child_Callable {
90
  'extra_excution' => 'extra_execution', // deprecated!
91
  'extra_execution' => 'extra_execution',
92
  'wpvivid_backuprestore' => 'wpvivid_backuprestore',
 
93
  );
94
 
95
  /**
@@ -603,6 +604,24 @@ class MainWP_Child_Callable {
603
  MainWP_Child_Misc::get_instance()->get_site_icon();
604
  }
605
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
606
  /**
607
  * Method get_security_stats()
608
  *
90
  'extra_excution' => 'extra_execution', // deprecated!
91
  'extra_execution' => 'extra_execution',
92
  'wpvivid_backuprestore' => 'wpvivid_backuprestore',
93
+ 'check_abandoned' => 'check_abandoned',
94
  );
95
 
96
  /**
604
  MainWP_Child_Misc::get_instance()->get_site_icon();
605
  }
606
 
607
+ /**
608
+ * Method check_abandoned()
609
+ *
610
+ * Fire off the check_abandoned() function.
611
+ */
612
+ public function check_abandoned() {
613
+ $which = sanitize_text_field( wp_unslash( $_POST['which'] ) );
614
+ $infor = array();
615
+ if ( 'plugin' == $which ) {
616
+ MainWP_Child_Plugins_Check::instance()->run_check();
617
+ $infor['success'] = 1;
618
+ } else {
619
+ MainWP_Child_Themes_Check::instance()->run_check();
620
+ $infor['success'] = 1;
621
+ }
622
+ MainWP_Helper::write( $infor );
623
+ }
624
+
625
  /**
626
  * Method get_security_stats()
627
  *
class/class-mainwp-child-ithemes-security.php CHANGED
@@ -322,7 +322,7 @@ class MainWP_Child_IThemes_Security {
322
  if ( 'wordpress-salts' == $module ) {
323
  $settings['last_generated'] = \ITSEC_Modules::get_setting( $module, 'last_generated' );
324
  } elseif ( 'global' == $module ) {
325
- $keep_olds = array( 'did_upgrade', 'log_info', 'show_new_dashboard_notice', 'show_security_check', 'nginx_file' );
326
  foreach ( $keep_olds as $key ) {
327
  $settings[ $key ] = \ITSEC_Modules::get_setting( $module, $key );
328
  }
@@ -897,10 +897,16 @@ class MainWP_Child_IThemes_Security {
897
  if ( ! class_exists( '\ITSEC_File_Change_Scanner' ) ) {
898
  require_once $mainwp_itsec_modules_path . 'file-change/scanner.php';
899
  }
900
- $result = \ITSEC_File_Change_Scanner::run_scan( false );
901
- if ( false === $result || true === $result || -1 === $result ) {
 
 
 
 
 
 
902
  $return['result'] = 'success';
903
- $return['scan_result'] = $result;
904
  }
905
  return $return;
906
  }
322
  if ( 'wordpress-salts' == $module ) {
323
  $settings['last_generated'] = \ITSEC_Modules::get_setting( $module, 'last_generated' );
324
  } elseif ( 'global' == $module ) {
325
+ $keep_olds = array( 'did_upgrade', 'log_info', 'show_new_dashboard_notice', 'show_security_check', 'nginx_file', 'manage_group' );
326
  foreach ( $keep_olds as $key ) {
327
  $settings[ $key ] = \ITSEC_Modules::get_setting( $module, $key );
328
  }
897
  if ( ! class_exists( '\ITSEC_File_Change_Scanner' ) ) {
898
  require_once $mainwp_itsec_modules_path . 'file-change/scanner.php';
899
  }
900
+
901
+ $results = \ITSEC_File_Change_Scanner::schedule_start();
902
+
903
+ if ( is_wp_error( $results ) ) {
904
+ $error = $results->get_error_message();
905
+ $return['result'] = 'failed';
906
+ $return['scan_error'] = $error;
907
+ } else {
908
  $return['result'] = 'success';
909
+ $return['scan_result'] = $results;
910
  }
911
  return $return;
912
  }
class/class-mainwp-child-woocommerce-status.php CHANGED
@@ -196,7 +196,7 @@ class MainWP_Child_WooCommerce_Status {
196
 
197
  $outofstock_count = absint( $wpdb->get_var( "SELECT COUNT( DISTINCT posts.ID ) {$query_from};" ) ); //phpcs:ignore -- safe query.
198
 
199
- $data = array(
200
  'sales' => $sales,
201
  'formated_sales' => wc_price( $sales ),
202
  'top_seller' => $top_seller,
@@ -207,6 +207,9 @@ class MainWP_Child_WooCommerce_Status {
207
  'lowstock' => $lowinstock_count,
208
  'outstock' => $outofstock_count,
209
  );
 
 
 
210
  $information['data'] = $data;
211
 
212
  return $information;
@@ -298,7 +301,7 @@ class MainWP_Child_WooCommerce_Status {
298
 
299
  $outofstock_count = absint( $wpdb->get_var( "SELECT COUNT( DISTINCT posts.ID ) {$query_from};" ) ); //phpcs:ignore -- safe query.
300
 
301
- $data = array(
302
  'sales' => $sales,
303
  'formated_sales' => wc_price( $sales ),
304
  'top_seller' => $top_seller,
@@ -309,6 +312,9 @@ class MainWP_Child_WooCommerce_Status {
309
  'lowstock' => $lowinstock_count,
310
  'outstock' => $outofstock_count,
311
  );
 
 
 
312
  $information['data'] = $data;
313
 
314
  return $information;
@@ -432,7 +438,7 @@ class MainWP_Child_WooCommerce_Status {
432
 
433
  $outofstock_count = absint( $wpdb->get_var( "SELECT COUNT( DISTINCT posts.ID ) {$query_from};" ) ); //phpcs:ignore -- safe query.
434
 
435
- $data = array(
436
  'sales' => $sales,
437
  'formated_sales' => wc_price( $sales ),
438
  'top_seller' => $top_seller,
@@ -443,7 +449,11 @@ class MainWP_Child_WooCommerce_Status {
443
  'lowstock' => $lowinstock_count,
444
  'outstock' => $outofstock_count,
445
  );
446
- $information['data'] = $data;
 
 
 
 
447
  $information['need_db_update'] = $this->check_db_update();
448
  return $information;
449
  }
196
 
197
  $outofstock_count = absint( $wpdb->get_var( "SELECT COUNT( DISTINCT posts.ID ) {$query_from};" ) ); //phpcs:ignore -- safe query.
198
 
199
+ $data = array(
200
  'sales' => $sales,
201
  'formated_sales' => wc_price( $sales ),
202
  'top_seller' => $top_seller,
207
  'lowstock' => $lowinstock_count,
208
  'outstock' => $outofstock_count,
209
  );
210
+
211
+ $data = apply_filters( 'mainwp_child_woocom_sync_data', $data );
212
+
213
  $information['data'] = $data;
214
 
215
  return $information;
301
 
302
  $outofstock_count = absint( $wpdb->get_var( "SELECT COUNT( DISTINCT posts.ID ) {$query_from};" ) ); //phpcs:ignore -- safe query.
303
 
304
+ $data = array(
305
  'sales' => $sales,
306
  'formated_sales' => wc_price( $sales ),
307
  'top_seller' => $top_seller,
312
  'lowstock' => $lowinstock_count,
313
  'outstock' => $outofstock_count,
314
  );
315
+
316
+ $data = apply_filters( 'mainwp_child_woocom_report_data', $data );
317
+
318
  $information['data'] = $data;
319
 
320
  return $information;
438
 
439
  $outofstock_count = absint( $wpdb->get_var( "SELECT COUNT( DISTINCT posts.ID ) {$query_from};" ) ); //phpcs:ignore -- safe query.
440
 
441
+ $data = array(
442
  'sales' => $sales,
443
  'formated_sales' => wc_price( $sales ),
444
  'top_seller' => $top_seller,
449
  'lowstock' => $lowinstock_count,
450
  'outstock' => $outofstock_count,
451
  );
452
+
453
+ $data = apply_filters( 'mainwp_child_woocom_get_data', $data );
454
+
455
+ $information['data'] = $data;
456
+
457
  $information['need_db_update'] = $this->check_db_update();
458
  return $information;
459
  }
class/class-mainwp-child.php CHANGED
@@ -33,7 +33,7 @@ class MainWP_Child {
33
  *
34
  * @var string MainWP Child plugin version.
35
  */
36
- public static $version = '4.1.5';
37
 
38
  /**
39
  * Private variable containing the latest MainWP Child update version.
@@ -101,18 +101,9 @@ class MainWP_Child {
101
  }
102
 
103
  MainWP_Connect::instance()->check_other_auth();
104
-
105
- MainWP_Clone::instance()->init();
106
- MainWP_Child_Server_Information::init();
107
  MainWP_Client_Report::instance()->init();
108
- MainWP_Child_Plugins_Check::instance();
109
- MainWP_Child_Themes_Check::instance();
110
  MainWP_Utility::instance()->run_saved_snippets();
111
 
112
- if ( ! get_option( 'mainwp_child_pubkey' ) ) {
113
- MainWP_Child_Branding::instance()->save_branding_options( 'branding_disconnected', 'yes' );
114
- }
115
-
116
  if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
117
  if ( isset( $_GET['mainwp_child_run'] ) && ! empty( $_GET['mainwp_child_run'] ) ) {
118
  add_action( 'init', array( MainWP_Utility::get_class_name(), 'cron_active' ), PHP_INT_MAX );
@@ -291,6 +282,10 @@ class MainWP_Child {
291
  MainWP_Connect::instance()->register_site(); // register the site and exit.
292
  }
293
 
 
 
 
 
294
  $mainwpsignature = isset( $_POST['mainwpsignature'] ) ? rawurldecode( wp_unslash( $_POST['mainwpsignature'] ) ) : '';
295
  $function = isset( $_POST['function'] ) ? sanitize_text_field( wp_unslash( $_POST['function'] ) ) : null;
296
  $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : '';
@@ -344,6 +339,19 @@ class MainWP_Child {
344
  if ( MainWP_Helper::is_admin() && is_admin() ) {
345
  MainWP_Clone::instance()->init_ajax();
346
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  }
348
 
349
  /**
33
  *
34
  * @var string MainWP Child plugin version.
35
  */
36
+ public static $version = '4.1.6';
37
 
38
  /**
39
  * Private variable containing the latest MainWP Child update version.
101
  }
102
 
103
  MainWP_Connect::instance()->check_other_auth();
 
 
 
104
  MainWP_Client_Report::instance()->init();
 
 
105
  MainWP_Utility::instance()->run_saved_snippets();
106
 
 
 
 
 
107
  if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
108
  if ( isset( $_GET['mainwp_child_run'] ) && ! empty( $_GET['mainwp_child_run'] ) ) {
109
  add_action( 'init', array( MainWP_Utility::get_class_name(), 'cron_active' ), PHP_INT_MAX );
282
  MainWP_Connect::instance()->register_site(); // register the site and exit.
283
  }
284
 
285
+ if ( ( ! isset( $_POST['mainwpsignature'] ) && ! isset( $_POST['function'] ) ) || ! defined( 'WP_ADMIN' ) ) {
286
+ return;
287
+ }
288
+
289
  $mainwpsignature = isset( $_POST['mainwpsignature'] ) ? rawurldecode( wp_unslash( $_POST['mainwpsignature'] ) ) : '';
290
  $function = isset( $_POST['function'] ) ? sanitize_text_field( wp_unslash( $_POST['function'] ) ) : null;
291
  $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : '';
339
  if ( MainWP_Helper::is_admin() && is_admin() ) {
340
  MainWP_Clone::instance()->init_ajax();
341
  }
342
+
343
+ if ( ! get_option( 'mainwp_child_pubkey' ) ) {
344
+ MainWP_Child_Branding::instance()->save_branding_options( 'branding_disconnected', 'yes' );
345
+ }
346
+
347
+ if ( get_option( 'mainwp_child_clone_permalink' ) || get_option( 'mainwp_child_restore_permalink' ) ) {
348
+ add_action( 'admin_notices', array( MainWP_Clone_Page::get_class_name(), 'permalink_admin_notice' ) );
349
+ }
350
+
351
+ MainWP_Clone::instance()->init();
352
+ MainWP_Child_Server_Information::init();
353
+ MainWP_Child_Plugins_Check::instance();
354
+ MainWP_Child_Themes_Check::instance();
355
  }
356
 
357
  /**
class/class-mainwp-clone.php CHANGED
@@ -185,9 +185,6 @@ class MainWP_Clone {
185
  */
186
  public function init() {
187
  add_action( 'check_admin_referer', array( self::get_class_name(), 'permalink_changed' ) );
188
- if ( get_option( 'mainwp_child_clone_permalink' ) || get_option( 'mainwp_child_restore_permalink' ) ) {
189
- add_action( 'admin_notices', array( MainWP_Clone_Page::get_class_name(), 'permalink_admin_notice' ) );
190
- }
191
  }
192
 
193
  /**
185
  */
186
  public function init() {
187
  add_action( 'check_admin_referer', array( self::get_class_name(), 'permalink_changed' ) );
 
 
 
188
  }
189
 
190
  /**
mainwp-child.php CHANGED
@@ -12,7 +12,7 @@
12
  * Author: MainWP
13
  * Author URI: https://mainwp.com
14
  * Text Domain: mainwp-child
15
- * Version: 4.1.5
16
  * Requires at least: 5.4
17
  * Requires PHP: 7.0
18
  */
12
  * Author: MainWP
13
  * Author URI: https://mainwp.com
14
  * Text Domain: mainwp-child
15
+ * Version: 4.1.6
16
  * Requires at least: 5.4
17
  * Requires PHP: 7.0
18
  */
readme.txt CHANGED
@@ -5,9 +5,9 @@ Author: mainwp
5
  Author URI: https://mainwp.com
6
  Plugin URI: https://mainwp.com
7
  Requires at least: 5.4
8
- Tested up to: 5.7
9
  Requires PHP: 7.0
10
- Stable tag: 4.1.5
11
  License: GPLv3 or later
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -107,6 +107,10 @@ Sure we have a quick FAQ with a lot more questions and answers [here](https://ma
107
 
108
  == Changelog ==
109
 
 
 
 
 
110
  = 4.1.5 - 3-18-21 =
111
  * Fixed: An issue with uploading files with underscore in the file name
112
  * Fixed: Multiple PHP Warnings
5
  Author URI: https://mainwp.com
6
  Plugin URI: https://mainwp.com
7
  Requires at least: 5.4
8
+ Tested up to: 5.7.1
9
  Requires PHP: 7.0
10
+ Stable tag: 4.1.6
11
  License: GPLv3 or later
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
107
 
108
  == Changelog ==
109
 
110
+ = 4.1.6 - 4-15-21 =
111
+ * Added: Support for the function to trigger Check for Abandoned plugins and themes process
112
+ * Updated: Multiple performance improvements
113
+
114
  = 4.1.5 - 3-18-21 =
115
  * Fixed: An issue with uploading files with underscore in the file name
116
  * Fixed: Multiple PHP Warnings