MainWP Child - Version 4.1.5

Version Description

  • 3-18-21 =
  • Fixed: An issue with uploading files with underscore in the file name
  • Fixed: Multiple PHP Warnings
  • Updated: Compatibility with the latest UpdraftPlus plugin version
  • Updated: Compatibility with the latest BackWPup plugin version
  • Updated: Compatibility with the latest WP Rocket plugin version
Download this release

Release Info

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

Code changes from version 4.1.4 to 4.1.5

class/class-mainwp-child-misc.php CHANGED
@@ -467,7 +467,7 @@ class MainWP_Child_Misc {
467
  * @uses \MainWP\Child\MainWP_Child_Misc::uploader_upload_file() Upload file from the MainWP Dashboard.
468
  */
469
  public function uploader_action() {
470
- $file_url = isset( $_POST['url'] ) ? base64_decode( wp_unslash( $_POST['url'] ) ) : ''; // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- Required for backwards compatibility.
471
  $path = isset( $_POST['path'] ) ? wp_unslash( $_POST['path'] ) : '';
472
  $filename = isset( $_POST['filename'] ) ? wp_unslash( $_POST['filename'] ) : '';
473
  $information = array();
@@ -569,10 +569,19 @@ class MainWP_Child_Misc {
569
  unlink( $full_file_name );
570
  throw new \Exception( 'Error 404: ' . trim( wp_remote_retrieve_response_message( $response ) ) );
571
  }
 
572
  if ( '.phpfile.txt' === substr( $file_name, - 12 ) ) {
573
  $new_file_name = substr( $file_name, 0, - 12 ) . '.php';
574
  $new_file_name = $path . DIRECTORY_SEPARATOR . $new_file_name;
575
- $moved = rename( $full_file_name, $new_file_name );
 
 
 
 
 
 
 
 
576
  if ( $moved ) {
577
  return array( 'path' => $new_file_name );
578
  } else {
467
  * @uses \MainWP\Child\MainWP_Child_Misc::uploader_upload_file() Upload file from the MainWP Dashboard.
468
  */
469
  public function uploader_action() {
470
+ $file_url = isset( $_POST['url'] ) ? MainWP_Utility::instance()->maybe_base64_decode( wp_unslash( $_POST['url'] ) ) : '';
471
  $path = isset( $_POST['path'] ) ? wp_unslash( $_POST['path'] ) : '';
472
  $filename = isset( $_POST['filename'] ) ? wp_unslash( $_POST['filename'] ) : '';
473
  $information = array();
569
  unlink( $full_file_name );
570
  throw new \Exception( 'Error 404: ' . trim( wp_remote_retrieve_response_message( $response ) ) );
571
  }
572
+ $fix_name = true;
573
  if ( '.phpfile.txt' === substr( $file_name, - 12 ) ) {
574
  $new_file_name = substr( $file_name, 0, - 12 ) . '.php';
575
  $new_file_name = $path . DIRECTORY_SEPARATOR . $new_file_name;
576
+ } elseif ( 0 === strpos( $file_name, 'fix_underscore' ) ) {
577
+ $new_file_name = str_replace( 'fix_underscore', '', $file_name );
578
+ $new_file_name = $path . DIRECTORY_SEPARATOR . $new_file_name;
579
+ } else {
580
+ $fix_name = false;
581
+ }
582
+
583
+ if ( $fix_name ) {
584
+ $moved = rename( $full_file_name, $new_file_name );
585
  if ( $moved ) {
586
  return array( 'path' => $new_file_name );
587
  } else {
class/class-mainwp-child-timecapsule.php CHANGED
@@ -161,10 +161,14 @@ class MainWP_Child_Timecapsule {
161
  MainWP_Helper::write( array( 'error' => $error ) );
162
  }
163
 
164
- if ( method_exists( 'wptc_load_files' ) ) {
165
- wptc_load_files();
 
166
  }
167
 
 
 
 
168
  $information = array();
169
 
170
  $options_helper = new \Wptc_Options_Helper();
@@ -1149,17 +1153,39 @@ class MainWP_Child_Timecapsule {
1149
  $config->set_option( 'wptc_main_acc_pwd_temp', base64_encode( md5( trim( wp_unslash( $pwd ) ) ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for http encode compatible..
1150
  $config->set_option( 'wptc_token', false );
1151
 
1152
- $options->request_service(
1153
  array(
1154
  'email' => $email,
1155
  'pwd' => trim( wp_unslash( $pwd ) ),
1156
- 'return_response' => false,
1157
  'sub_action' => false,
1158
  'login_request' => true,
1159
  'reset_login_if_failed' => true,
1160
  )
1161
  );
1162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1163
  $is_user_logged_in = $options->get_option( 'is_user_logged_in' );
1164
 
1165
  if ( ! $is_user_logged_in ) {
@@ -1171,6 +1197,236 @@ class MainWP_Child_Timecapsule {
1171
  );
1172
  }
1173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1174
  /**
1175
  * Get the list of installed plugins.
1176
  *
161
  MainWP_Helper::write( array( 'error' => $error ) );
162
  }
163
 
164
+ // to fix.
165
+ if ( isset( $_POST['mwp_action'] ) && ! defined( 'WP_ADMIN' ) ) {
166
+ define( 'WP_ADMIN', true );
167
  }
168
 
169
+ if ( function_exists( '\wptc_load_files' ) ) {
170
+ \wptc_load_files();
171
+ }
172
  $information = array();
173
 
174
  $options_helper = new \Wptc_Options_Helper();
1153
  $config->set_option( 'wptc_main_acc_pwd_temp', base64_encode( md5( trim( wp_unslash( $pwd ) ) ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for http encode compatible..
1154
  $config->set_option( 'wptc_token', false );
1155
 
1156
+ $cust_info = $options->request_service(
1157
  array(
1158
  'email' => $email,
1159
  'pwd' => trim( wp_unslash( $pwd ) ),
1160
+ 'return_response' => true,
1161
  'sub_action' => false,
1162
  'login_request' => true,
1163
  'reset_login_if_failed' => true,
1164
  )
1165
  );
1166
 
1167
+ if ( ! empty( $cust_info->error ) ) {
1168
+ if ( ! empty( $cust_info->true_err_msg ) ) {
1169
+ return array( 'error' => $cust_info->true_err_msg );
1170
+ }
1171
+
1172
+ return array( 'error' => $cust_info->error );
1173
+ }
1174
+
1175
+ $options->reset_plans();
1176
+
1177
+ $main_account_email = $email;
1178
+ $main_account_pwd = $pwd;
1179
+
1180
+ $options->set_option( 'main_account_email', strtolower( $main_account_email ) );
1181
+ $options->set_option( 'main_account_pwd', $this->hash_pwd( $main_account_pwd ) );
1182
+
1183
+ $result = $this->proccess_cust_info( $options, $cust_info );
1184
+
1185
+ if ( is_array( $result ) && ! empty( $result['error'] ) ) {
1186
+ return array( 'error' => $result['error'] );
1187
+ }
1188
+
1189
  $is_user_logged_in = $options->get_option( 'is_user_logged_in' );
1190
 
1191
  if ( ! $is_user_logged_in ) {
1197
  );
1198
  }
1199
 
1200
+ /**
1201
+ * Hash password.
1202
+ *
1203
+ * @param string $str String to hash.
1204
+ *
1205
+ * @return string Hashed password.
1206
+ */
1207
+ public function hash_pwd( $str ) {
1208
+ return md5( $str );
1209
+ }
1210
+
1211
+ /**
1212
+ * Process the sigin response info.
1213
+ *
1214
+ * @param object $options Options object.
1215
+ * @param object $cust_info Custon info.
1216
+ *
1217
+ * @return bool Action result.
1218
+ */
1219
+ public function proccess_cust_info( $options, $cust_info ) {
1220
+
1221
+ if ( $this->process_service_info( $options, $cust_info ) ) {
1222
+
1223
+ if ( empty( $cust_info->success ) ) {
1224
+ return false;
1225
+ }
1226
+
1227
+ $cust_req_info = $cust_info->success[0];
1228
+ $this_d_name = $cust_req_info->cust_display_name;
1229
+ $this_token = $cust_req_info->wptc_token;
1230
+
1231
+ $options->set_option( 'uuid', $cust_req_info->uuid );
1232
+ $options->set_option( 'wptc_token', $this_token );
1233
+ $options->set_option( 'main_account_name', $this_d_name );
1234
+
1235
+ do_action( 'update_white_labling_settings_wptc', $cust_req_info );
1236
+
1237
+ if ( isset( $cust_req_info->connected_sites_count ) ) {
1238
+ $options->set_option( 'connected_sites_count', $cust_req_info->connected_sites_count );
1239
+ } else {
1240
+ $options->set_option( 'connected_sites_count', 1 );
1241
+ }
1242
+
1243
+ if ( ! empty( $cust_info->logged_in_but_no_plans_yet ) ) {
1244
+ $options->do_options_for_no_plans_yet( $cust_info );
1245
+ return false;
1246
+ }
1247
+
1248
+ $options->process_subs_info_wptc( $cust_req_info );
1249
+ $this->process_privilege_wptc( $options, $cust_req_info );
1250
+ $this->save_plan_info_limited( $options, $cust_req_info );
1251
+
1252
+ $is_cron_service = $this->check_if_cron_service_exists( $options );
1253
+ wptc_log( $is_cron_service, '--------$is_cron_service--------' );
1254
+
1255
+ if ( $is_cron_service ) {
1256
+ $options->set_option( 'is_user_logged_in', true );
1257
+ return true;
1258
+ }
1259
+ }
1260
+ }
1261
+
1262
+
1263
+ /**
1264
+ * Save the plan info.
1265
+ *
1266
+ * @param object $options Options object.
1267
+ * @param object $cust_info Custon info.
1268
+ *
1269
+ * @return bool Action result.
1270
+ */
1271
+ private function save_plan_info_limited( $options, &$cust_info ) {
1272
+ wptc_log( func_get_args(), '--------' . __FUNCTION__ . '--------' );
1273
+ if ( empty( $cust_info ) || empty( $cust_info->plan_info_limited ) ) {
1274
+ return $options->set_option( 'plan_info_limited', false );
1275
+ } else {
1276
+ $plans = json_decode( json_encode( $cust_info->plan_info_limited ), true );
1277
+ wptc_log( $plans, '----------$plans----------------' );
1278
+ return $options->set_option( 'plan_info_limited', serialize( $plans ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- Required for backwards compatibility.
1279
+ }
1280
+ }
1281
+
1282
+ /**
1283
+ * Process privilege wptc.
1284
+ *
1285
+ * @param object $options Options object.
1286
+ * @param object $cust_req_info Custon info.
1287
+ *
1288
+ * @return bool Returns false on failure.
1289
+ */
1290
+ private function process_privilege_wptc( $options, $cust_req_info = null ) {
1291
+
1292
+ if ( empty( $cust_req_info->subscription_features ) ) {
1293
+ $options->reset_privileges();
1294
+ return false;
1295
+ }
1296
+
1297
+ $sub_features = (array) $cust_req_info->subscription_features;
1298
+
1299
+ $privileged_feature = array();
1300
+ $privileges_args = array();
1301
+
1302
+ foreach ( $sub_features as $plan_id => $single_sub ) {
1303
+ foreach ( $single_sub as $key => $v ) {
1304
+ $privileged_feature[ $v->type ][] = 'Wptc_' . ucfirst( $v->feature );
1305
+ $privileges_args[ 'Wptc_' . ucfirst( $v->feature ) ] = ( ! empty( $v->args ) ) ? $v->args : array();
1306
+ }
1307
+ }
1308
+
1309
+ // Remove on production!
1310
+ array_push( $privileges_args, 'Wptc_Rollback' );
1311
+ array_push( $privileged_feature['pro'], 'Wptc_Rollback' );
1312
+
1313
+ $options->set_option( 'privileges_wptc', json_encode( $privileged_feature ) );
1314
+ $options->set_option( 'privileges_args', json_encode( $privileges_args ) );
1315
+ $revision_limit = new \Wptc_Revision_Limit();
1316
+ $revision_limit->update_eligible_revision_limit( $privileges_args );
1317
+ }
1318
+
1319
+ /**
1320
+ * Process service info.
1321
+ *
1322
+ * @param object $options Options object.
1323
+ * @param object $cust_info Custon info.
1324
+ *
1325
+ * @return bool result.
1326
+ */
1327
+ private function process_service_info( $options, &$cust_info ) {
1328
+ if ( empty( $cust_info ) || ! empty( $cust_info->error ) ) {
1329
+ $err_msg = $options->process_wptc_error_msg_then_take_action( $cust_info );
1330
+
1331
+ $options->set_option( 'card_added', false );
1332
+
1333
+ if ( 'logged_in_but_no_plans_yet' == $err_msg ) {
1334
+ $options->do_options_for_no_plans_yet( $cust_info );
1335
+
1336
+ return true;
1337
+ }
1338
+ return false;
1339
+ } else {
1340
+ return true;
1341
+ }
1342
+ }
1343
+
1344
+ /**
1345
+ * Process service info.
1346
+ *
1347
+ * @param object $options Options object.
1348
+ *
1349
+ * @return bool Result.
1350
+ */
1351
+ public function check_if_cron_service_exists( $options ) {
1352
+ if ( ! $options->get_option( 'wptc_server_connected' ) || ! $options->get_option( 'appID' ) || $options->get_option( 'signup' ) != 'done' ) {
1353
+ if ( $options->get_option( 'main_account_email' ) ) {
1354
+ $this->signup_wptc_server_wptc();
1355
+ }
1356
+ }
1357
+ return true;
1358
+ }
1359
+
1360
+
1361
+ /**
1362
+ * Function for wptc cron service signup
1363
+ *
1364
+ * @return bool result.
1365
+ */
1366
+ public function signup_wptc_server_wptc() {
1367
+
1368
+ $config = \WPTC_Factory::get( 'config' );
1369
+
1370
+ $email = trim( $config->get_option( 'main_account_email', true ) );
1371
+ $emailhash = md5( $email );
1372
+ $email_encoded = base64_encode( $email ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- Required for backwards compatibility.
1373
+
1374
+ $pwd = trim( $config->get_option( 'main_account_pwd', true ) );
1375
+ $pwd_encoded = base64_encode( $pwd ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- Required for backwards compatibility.
1376
+
1377
+ if ( empty( $email ) || empty( $pwd ) ) {
1378
+ return false;
1379
+ }
1380
+
1381
+ wptc_log( $email, '--------email--------' );
1382
+
1383
+ $name = trim( $config->get_option( 'main_account_name' ) );
1384
+
1385
+ $cron_url = get_wptc_cron_url();
1386
+
1387
+ $app_id = 0;
1388
+ if ( $config->get_option( 'appID' ) ) {
1389
+ $app_id = $config->get_option( 'appID' );
1390
+ }
1391
+
1392
+ $post_arr = array(
1393
+ 'email' => $email_encoded,
1394
+ 'pwd' => $pwd_encoded,
1395
+ 'cron_url' => $cron_url,
1396
+ 'site_url' => home_url(),
1397
+ 'name' => $name,
1398
+ 'emailhash' => $emailhash,
1399
+ 'app_id' => $app_id,
1400
+ );
1401
+
1402
+ $result = do_cron_call_wptc( 'signup', $post_arr );
1403
+
1404
+ $resarr = json_decode( $result );
1405
+
1406
+ wptc_log( $resarr, '--------resarr-node reply--------' );
1407
+
1408
+ if ( ! empty( $resarr ) && 'success' == $resarr->status ) {
1409
+ $config->set_option( 'wptc_server_connected', true );
1410
+ $config->set_option( 'signup', 'done' );
1411
+ $config->set_option( 'appID', $resarr->appID );
1412
+
1413
+ init_auto_backup_settings_wptc( $config );
1414
+ $set = push_settings_wptc_server( $resarr->appID, 'signup' );
1415
+
1416
+ $to_url = network_admin_url() . 'admin.php?page=wp-time-capsule';
1417
+ return true;
1418
+ } else {
1419
+ $config->set_option( 'last_service_error', $result );
1420
+ $config->set_option( 'appID', false );
1421
+
1422
+ if ( 'production' !== WPTC_ENV ) {
1423
+ echo 'Creating Cron service failed';
1424
+ }
1425
+
1426
+ return false;
1427
+ }
1428
+ }
1429
+
1430
  /**
1431
  * Get the list of installed plugins.
1432
  *
class/class-mainwp-child-updraft-plus-backups.php CHANGED
@@ -311,6 +311,8 @@ class MainWP_Child_Updraft_Plus_Backups {
311
  'updraft_ssl_disableverify',
312
  'updraft_report_warningsonly',
313
  'updraft_report_wholebackup',
 
 
314
  'updraft_log_syslog',
315
  'updraft_extradatabases',
316
  'updraft_split_every',
311
  'updraft_ssl_disableverify',
312
  'updraft_report_warningsonly',
313
  'updraft_report_wholebackup',
314
+ 'updraft_report_dbbackup',
315
+ 'updraft_auto_updates',
316
  'updraft_log_syslog',
317
  'updraft_extradatabases',
318
  'updraft_split_every',
class/class-mainwp-child-wp-rocket.php CHANGED
@@ -103,7 +103,6 @@ class MainWP_Child_WP_Rocket {
103
  'cache_mobile' => 1,
104
  'do_caching_mobile_files' => 0,
105
  'cache_logged_user' => 0,
106
- 'cache_ssl' => 0,
107
  'emoji' => 0,
108
  'embeds' => 1,
109
  'control_heartbeat' => 0,
@@ -114,7 +113,7 @@ class MainWP_Child_WP_Rocket {
114
  'manual_preload' => 0,
115
  'automatic_preload' => 0,
116
  'sitemap_preload' => 0,
117
- 'sitemap_preload_url_crawl' => 500000,
118
  'sitemaps' => array(),
119
  'database_revisions' => 0,
120
  'database_auto_drafts' => 0,
@@ -138,22 +137,23 @@ class MainWP_Child_WP_Rocket {
138
  'exclude_inline_js' => array(),
139
  'async_css' => 0,
140
  'defer_all_js' => 0,
141
- 'defer_all_js_safe' => 1,
142
  'critical_css' => '',
143
- 'deferred_js_files' => array(),
 
 
144
  'lazyload' => 0,
145
  'lazyload_iframes' => 0,
 
146
  'lazyload_youtube' => 0,
147
  'minify_css' => 0,
 
 
148
  'minify_concatenate_css' => 0,
149
  'minify_css_legacy' => 0,
150
  'minify_js' => 0,
151
- 'minify_js_in_footer' => array(),
152
  'minify_concatenate_js' => 0,
153
  'minify_js_combine_all' => 0,
154
- 'minify_google_fonts' => 0,
155
- 'minify_html' => 0,
156
- 'remove_query_strings' => 0,
157
  'dns_prefetch' => 0,
158
  'cdn' => 0,
159
  'cdn_cnames' => array(),
@@ -167,8 +167,18 @@ class MainWP_Child_WP_Rocket {
167
  'cloudflare_protocol_rewrite' => 0,
168
  'cloudflare_auto_settings' => 0,
169
  'cloudflare_old_settings' => 0,
170
- 'do_beta' => 0,
171
- 'analytics_enabled' => 1,
 
 
 
 
 
 
 
 
 
 
172
  );
173
  }
174
 
103
  'cache_mobile' => 1,
104
  'do_caching_mobile_files' => 0,
105
  'cache_logged_user' => 0,
 
106
  'emoji' => 0,
107
  'embeds' => 1,
108
  'control_heartbeat' => 0,
113
  'manual_preload' => 0,
114
  'automatic_preload' => 0,
115
  'sitemap_preload' => 0,
116
+ 'preload_links' => 0,
117
  'sitemaps' => array(),
118
  'database_revisions' => 0,
119
  'database_auto_drafts' => 0,
137
  'exclude_inline_js' => array(),
138
  'async_css' => 0,
139
  'defer_all_js' => 0,
 
140
  'critical_css' => '',
141
+ 'exclude_defer_js' => array(),
142
+ 'delay_js' => 0,
143
+ 'delay_js_scripts' => array(),
144
  'lazyload' => 0,
145
  'lazyload_iframes' => 0,
146
+ 'exclude_lazyload' => array(),
147
  'lazyload_youtube' => 0,
148
  'minify_css' => 0,
149
+ 'image_dimensions' => 0,
150
+ 'cache_webp' => 0,
151
  'minify_concatenate_css' => 0,
152
  'minify_css_legacy' => 0,
153
  'minify_js' => 0,
 
154
  'minify_concatenate_js' => 0,
155
  'minify_js_combine_all' => 0,
156
+ 'preload_fonts' => array(),
 
 
157
  'dns_prefetch' => 0,
158
  'cdn' => 0,
159
  'cdn_cnames' => array(),
167
  'cloudflare_protocol_rewrite' => 0,
168
  'cloudflare_auto_settings' => 0,
169
  'cloudflare_old_settings' => 0,
170
+ 'analytics_enabled' => 0,
171
+ 'google_analytics_cache' => 0,
172
+ 'facebook_pixel_cache' => 0,
173
+ 'do_cloudflare' => 0,
174
+ 'sucury_waf_cache_sync' => 0,
175
+ 'cloudflare_api_key' => '',
176
+ 'cloudflare_email' => '',
177
+ 'cloudflare_zone_id' => '',
178
+ 'cloudflare_devmode' => 0,
179
+ 'cloudflare_protocol_rewrite' => 0,
180
+ 'sucury_waf_cache_sync' => 0,
181
+ 'sucury_waf_api_key' => '',
182
  );
183
  }
184
 
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.4';
37
 
38
  /**
39
  * Private variable containing the latest MainWP Child update version.
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.
class/class-mainwp-security.php CHANGED
@@ -102,9 +102,10 @@ class MainWP_Security {
102
  foreach ( self::$listingDirectories as $directory ) {
103
  $file = $directory . DIRECTORY_SEPARATOR . 'index.php';
104
  if ( ! $wp_filesystem->exists( $file ) ) {
105
- $wp_filesystem->put_contents( $file, "<?php \n" );
106
- $wp_filesystem->put_contents( $file, "header(\$_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden' );\n" );
107
- $wp_filesystem->put_contents( $file, "die( '403 Forbidden' );\n" );
 
108
  }
109
  }
110
  }
@@ -266,7 +267,7 @@ class MainWP_Security {
266
  if ( $force || self::get_security_option( 'generator_version' ) ) {
267
  $types = array( 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export' );
268
  foreach ( $types as $type ) {
269
- add_filter( 'get_the_generator_' . $type, array( 'MainWP_Security', 'custom_the_generator' ), 10, 2 );
270
  }
271
  }
272
  }
102
  foreach ( self::$listingDirectories as $directory ) {
103
  $file = $directory . DIRECTORY_SEPARATOR . 'index.php';
104
  if ( ! $wp_filesystem->exists( $file ) ) {
105
+ $content = "<?php \n";
106
+ $content .= "header(\$_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden' );\n";
107
+ $content .= "die( '403 Forbidden' );\n";
108
+ $wp_filesystem->put_contents( $file, $content );
109
  }
110
  }
111
  }
267
  if ( $force || self::get_security_option( 'generator_version' ) ) {
268
  $types = array( 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export' );
269
  foreach ( $types as $type ) {
270
+ add_filter( 'get_the_generator_' . $type, array( self::get_class_name(), 'custom_the_generator' ), 10, 2 );
271
  }
272
  }
273
  }
class/class-mainwp-utility.php CHANGED
@@ -885,4 +885,22 @@ class MainWP_Utility {
885
 
886
  return get_option( 'mainwp_lasttime_backup_' . $by, 0 );
887
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
888
  }
885
 
886
  return get_option( 'mainwp_lasttime_backup_' . $by, 0 );
887
  }
888
+
889
+ /**
890
+ * Method maybe_base64_decode()
891
+ *
892
+ * Maybe base64 decode string.
893
+ *
894
+ * @param string $str input string.
895
+ *
896
+ * @return string $decoded Maybe base64 decode string.
897
+ */
898
+ public function maybe_base64_decode( $str ) {
899
+ $decoded = base64_decode( $str ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- Required for backwards compatibility.
900
+ $Str1 = preg_replace( '/[\x00-\x1F\x7F-\xFF]/', '', $decoded );
901
+ if ( $Str1 != $decoded || '' == $Str1 ) {
902
+ return $str;
903
+ }
904
+ return $decoded;
905
+ }
906
  }
mainwp-child.php CHANGED
@@ -12,8 +12,8 @@
12
  * Author: MainWP
13
  * Author URI: https://mainwp.com
14
  * Text Domain: mainwp-child
15
- * Version: 4.1.4
16
- * Requires at least: 3.6
17
  * Requires PHP: 7.0
18
  */
19
 
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
  */
19
 
readme.txt CHANGED
@@ -4,10 +4,10 @@ Tags: WordPress management, WordPress Manager, WordPress controller, multiple Wo
4
  Author: mainwp
5
  Author URI: https://mainwp.com
6
  Plugin URI: https://mainwp.com
7
- Requires at least: 3.6
8
  Tested up to: 5.7
9
  Requires PHP: 7.0
10
- Stable tag: 4.1.4
11
  License: GPLv3 or later
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -107,6 +107,13 @@ Sure we have a quick FAQ with a lot more questions and answers [here](https://ma
107
 
108
  == Changelog ==
109
 
 
 
 
 
 
 
 
110
  = 4.1.4 - 1-21-21 =
111
  * Updated: Compatibility with the latest WP Staging plugin version
112
  * Updated: Compatibility with the latest WP Time Capsule plugin version
4
  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
 
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
113
+ * Updated: Compatibility with the latest UpdraftPlus plugin version
114
+ * Updated: Compatibility with the latest BackWPup plugin version
115
+ * Updated: Compatibility with the latest WP Rocket plugin version
116
+
117
  = 4.1.4 - 1-21-21 =
118
  * Updated: Compatibility with the latest WP Staging plugin version
119
  * Updated: Compatibility with the latest WP Time Capsule plugin version