MainWP Child - Version 4.1.9

Version Description

  • 12-28-2021 =
  • Fixed: Problem with saving UpdraftPlus settings
  • Fixed: Error with posting images
  • Fixed: Error with recording Wordfence scans for reports
  • Fixed: Version comparison issue for OpenSSL version
  • Updated: PHP 8 compatibility
  • Updated: Added authorEmail to the sync output (PR284 - thanks Kim Vinberg)
Download this release

Release Info

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

Code changes from version 4.1.8 to 4.1.9

class/class-mainwp-child-posts.php CHANGED
@@ -115,7 +115,7 @@ class MainWP_Child_Posts {
115
  * @uses MainWP_WordPress_SEO::instance()->parse_column_score_readability()
116
  * @uses \MainWP\Child\MainWP_Child_Posts::get_out_post()
117
  */
118
- public function get_recent_posts_int( $status, $pCount, $type = 'post', &$allPosts, $extra = null ) {
119
 
120
  $args = array(
121
  'post_status' => $status,
@@ -215,10 +215,11 @@ class MainWP_Child_Posts {
215
  $outPost['dts'] = strtotime( $post->post_date_gmt );
216
  }
217
 
218
- $usr = get_user_by( 'id', $post->post_author );
219
- $outPost['author'] = ! empty( $usr ) ? $usr->user_nicename : 'removed';
220
- $categoryObjects = get_the_category( $post->ID );
221
- $categories = '';
 
222
  foreach ( $categoryObjects as $cat ) {
223
  if ( '' !== $categories ) {
224
  $categories .= ', ';
@@ -562,6 +563,7 @@ class MainWP_Child_Posts {
562
  'post_excerpt' => $post->post_excerpt,
563
  'comment_status' => $post->comment_status,
564
  'ping_status' => $post->ping_status,
 
565
  );
566
 
567
  if ( null != $post_featured_image ) { // Featured image is set, retrieve URL.
@@ -745,6 +747,7 @@ class MainWP_Child_Posts {
745
  if ( empty( $new_post_id ) ) {
746
  return array( 'error' => 'Empty post id' );
747
  }
 
748
  if ( ! $edit_post_id ) {
749
  wp_update_post(
750
  array(
@@ -753,6 +756,21 @@ class MainWP_Child_Posts {
753
  )
754
  );
755
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
756
  $this->update_post_data( $new_post_id, $post_custom, $post_category, $post_featured_image, $check_image_existed, $is_post_plus, $others );
757
  // unlock if edit post.
758
  if ( $edit_post_id ) {
@@ -832,6 +850,7 @@ class MainWP_Child_Posts {
832
  * @param string $post_featured_image Post featured image.
833
  * @param bool $check_image_existed TRUE|FALSE, Whether or not featured image already exists.
834
  * @param bool $is_post_plus TRUE|FALSE, Whether or not this came from MainWP Post Plus Extension.
 
835
  *
836
  * @uses \MainWP\Child\MainWP_Child_Posts::set_custom_post_fields()
837
  * @uses \MainWP\Child\MainWP_Child_Posts::update_seo_meta()
@@ -840,7 +859,7 @@ class MainWP_Child_Posts {
840
  * @uses \MainWP\Child\MainWP_Child_Posts::post_plus_update_author()
841
  * @uses \MainWP\Child\MainWP_Child_Posts::post_plus_update_categories()
842
  */
843
- private function update_post_data( $new_post_id, $post_custom, $post_category, $post_featured_image, $check_image_existed, $is_post_plus ) {
844
 
845
  $seo_ext_activated = false;
846
  if ( class_exists( '\WPSEO_Meta' ) && class_exists( '\WPSEO_Admin' ) ) {
@@ -1211,6 +1230,9 @@ class MainWP_Child_Posts {
1211
  '_mainwp_edit_post_site_id',
1212
  '_mainwp_edit_post_id',
1213
  '_edit_post_status',
 
 
 
1214
  );
1215
 
1216
  if ( is_array( $post_custom ) ) {
115
  * @uses MainWP_WordPress_SEO::instance()->parse_column_score_readability()
116
  * @uses \MainWP\Child\MainWP_Child_Posts::get_out_post()
117
  */
118
+ public function get_recent_posts_int( $status, $pCount, $type, &$allPosts, $extra = null ) {
119
 
120
  $args = array(
121
  'post_status' => $status,
215
  $outPost['dts'] = strtotime( $post->post_date_gmt );
216
  }
217
 
218
+ $usr = get_user_by( 'id', $post->post_author );
219
+ $outPost['author'] = ! empty( $usr ) ? $usr->user_nicename : 'removed';
220
+ $outPost['authorEmail'] = ! empty( $usr ) ? $usr->user_email : 'removed';
221
+ $categoryObjects = get_the_category( $post->ID );
222
+ $categories = '';
223
  foreach ( $categoryObjects as $cat ) {
224
  if ( '' !== $categories ) {
225
  $categories .= ', ';
563
  'post_excerpt' => $post->post_excerpt,
564
  'comment_status' => $post->comment_status,
565
  'ping_status' => $post->ping_status,
566
+ 'post_type' => $post->post_type,
567
  );
568
 
569
  if ( null != $post_featured_image ) { // Featured image is set, retrieve URL.
747
  if ( empty( $new_post_id ) ) {
748
  return array( 'error' => 'Empty post id' );
749
  }
750
+
751
  if ( ! $edit_post_id ) {
752
  wp_update_post(
753
  array(
756
  )
757
  );
758
  }
759
+
760
+ if ( is_array( $post_custom ) && isset( $post_custom['_mainwp_edit_post_save_to_post_type'] ) ) {
761
+ $saved_post_type = $post_custom['_mainwp_edit_post_save_to_post_type'];
762
+ $saved_post_type = is_array( $saved_post_type ) ? current( $saved_post_type ) : $saved_post_type;
763
+ if ( ! empty( $saved_post_type ) ) {
764
+ wp_update_post(
765
+ array(
766
+ 'ID' => $new_post_id,
767
+ 'post_type' => $saved_post_type,
768
+ )
769
+ );
770
+ }
771
+ unset( $post_custom['_mainwp_edit_post_save_to_post_type'] );
772
+ }
773
+
774
  $this->update_post_data( $new_post_id, $post_custom, $post_category, $post_featured_image, $check_image_existed, $is_post_plus, $others );
775
  // unlock if edit post.
776
  if ( $edit_post_id ) {
850
  * @param string $post_featured_image Post featured image.
851
  * @param bool $check_image_existed TRUE|FALSE, Whether or not featured image already exists.
852
  * @param bool $is_post_plus TRUE|FALSE, Whether or not this came from MainWP Post Plus Extension.
853
+ * @param array $others Others data.
854
  *
855
  * @uses \MainWP\Child\MainWP_Child_Posts::set_custom_post_fields()
856
  * @uses \MainWP\Child\MainWP_Child_Posts::update_seo_meta()
859
  * @uses \MainWP\Child\MainWP_Child_Posts::post_plus_update_author()
860
  * @uses \MainWP\Child\MainWP_Child_Posts::post_plus_update_categories()
861
  */
862
+ private function update_post_data( $new_post_id, $post_custom, $post_category, $post_featured_image, $check_image_existed, $is_post_plus, $others ) {
863
 
864
  $seo_ext_activated = false;
865
  if ( class_exists( '\WPSEO_Meta' ) && class_exists( '\WPSEO_Admin' ) ) {
1230
  '_mainwp_edit_post_site_id',
1231
  '_mainwp_edit_post_id',
1232
  '_edit_post_status',
1233
+ '_mainwp_edit_post_type',
1234
+ '_mainwp_edit_post_status',
1235
+ '_mainwp_edit_post_save_to_post_type',
1236
  );
1237
 
1238
  if ( is_array( $post_custom ) ) {
class/class-mainwp-child-server-information-base.php CHANGED
@@ -204,18 +204,18 @@ class MainWP_Child_Server_Information_Base {
204
  /**
205
  * Compare current cURL & SSL versions to required values.
206
  *
207
- * @param string $value Required values to compare to.
208
  * @param string $operator Comparison operator.
209
  *
210
  * @return bool|int When using the optional operator argument, the function will return TRUE if the
211
  * relationship is the one specified by the operator, FALSE otherwise. Returns -1 if the first version
212
  * is lower than the second, 0 if they are equal, and 1 if the second is lower.
213
  */
214
- protected static function curlssl_compare( $value, $operator = null ) {
215
- if ( isset( $value['version_number'] ) && defined( 'OPENSSL_VERSION_NUMBER' ) ) {
216
- return version_compare( OPENSSL_VERSION_NUMBER, $value['version_number'], $operator );
 
217
  }
218
-
219
  return false;
220
  }
221
 
204
  /**
205
  * Compare current cURL & SSL versions to required values.
206
  *
207
+ * @param string $version Required values to compare to.
208
  * @param string $operator Comparison operator.
209
  *
210
  * @return bool|int When using the optional operator argument, the function will return TRUE if the
211
  * relationship is the one specified by the operator, FALSE otherwise. Returns -1 if the first version
212
  * is lower than the second, 0 if they are equal, and 1 if the second is lower.
213
  */
214
+ public static function curlssl_compare( $version, $operator ) {
215
+ if ( function_exists( 'curl_version' ) ) {
216
+ $ver = self::get_curl_ssl_version();
217
+ return version_compare( $ver, $version, $operator );
218
  }
 
219
  return false;
220
  }
221
 
class/class-mainwp-child-updraft-plus-backups.php CHANGED
@@ -745,7 +745,7 @@ class MainWP_Child_Updraft_Plus_Backups {
745
 
746
  if ( is_array( $opts ) && isset( $opts['settings'] ) ) {
747
  $settings_key = key( $opts['settings'] );
748
- $opts['settings'][ $settings_key ]['url'] = $this->replace_tokens( $settings[ $key ]['url'] );
749
  \UpdraftPlus_Options::update_updraft_option( 'updraft_webdav', $opts );
750
  }
751
  } elseif ( 'updraft_backblaze' === $key ) {
@@ -3579,6 +3579,7 @@ ENDHERE;
3579
  * @global object $updraftplus UpdraftPlus object.
3580
  */
3581
  global $updraftplus_admin, $updraftplus;
 
3582
 
3583
  $messages = null;
3584
 
745
 
746
  if ( is_array( $opts ) && isset( $opts['settings'] ) ) {
747
  $settings_key = key( $opts['settings'] );
748
+ $opts['settings'][ $settings_key ]['path'] = $this->replace_tokens( $settings[ $key ]['path'] );
749
  \UpdraftPlus_Options::update_updraft_option( 'updraft_webdav', $opts );
750
  }
751
  } elseif ( 'updraft_backblaze' === $key ) {
3579
  * @global object $updraftplus UpdraftPlus object.
3580
  */
3581
  global $updraftplus_admin, $updraftplus;
3582
+ if (empty($updraftplus_admin)) include_once(UPDRAFTPLUS_DIR.'/admin.php');
3583
 
3584
  $messages = null;
3585
 
class/class-mainwp-child-vulnerability-checker.php CHANGED
@@ -126,7 +126,7 @@ class MainWP_Child_Vulnerability_Checker {
126
  *
127
  * @return array Return $result array.
128
  */
129
- public function check_plugins( $force = false, $service ) {
130
  $result = array();
131
  $active_plugins = get_option( 'active_plugins' );
132
 
@@ -201,7 +201,7 @@ class MainWP_Child_Vulnerability_Checker {
201
  * @param bool $service Selected service.
202
  * @return bool|string|null
203
  */
204
- public function check_wp( $force = false, $service ) {
205
  $wp_vuln = get_transient( 'mainwp_vulnche_trans_wp_json' );
206
  $wp_version = get_bloginfo( 'version' );
207
  $number_version = str_replace( '.', '', $wp_version );
@@ -230,7 +230,7 @@ class MainWP_Child_Vulnerability_Checker {
230
  *
231
  * @return array Return $result array.
232
  */
233
- public function check_themes( $force = false, $service ) { // phpcs:ignore -- ignore complex method notice.
234
 
235
  include_once ABSPATH . '/wp-admin/includes/update.php';
236
  require_once ABSPATH . 'wp-admin/includes/misc.php';
@@ -478,7 +478,7 @@ class MainWP_Child_Vulnerability_Checker {
478
  *
479
  * @return bool|string|null
480
  */
481
- public function vulnche_get_content( $url, $service ) {
482
 
483
  // phpcs:disable WordPress.WP.AlternativeFunctions -- Required to achieve desired results, pull request solutions appreciated.
484
  $ch = curl_init();
@@ -493,7 +493,9 @@ class MainWP_Child_Vulnerability_Checker {
493
  $output = curl_exec( $ch );
494
  $info = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
495
 
496
- curl_close( $ch );
 
 
497
  // phpcs:enable
498
 
499
  if ( false === $output || 200 != $info ) {
126
  *
127
  * @return array Return $result array.
128
  */
129
+ public function check_plugins( $force = false, $service = '' ) {
130
  $result = array();
131
  $active_plugins = get_option( 'active_plugins' );
132
 
201
  * @param bool $service Selected service.
202
  * @return bool|string|null
203
  */
204
+ public function check_wp( $force = false, $service = '' ) {
205
  $wp_vuln = get_transient( 'mainwp_vulnche_trans_wp_json' );
206
  $wp_version = get_bloginfo( 'version' );
207
  $number_version = str_replace( '.', '', $wp_version );
230
  *
231
  * @return array Return $result array.
232
  */
233
+ public function check_themes( $force = false, $service = '' ) { // phpcs:ignore -- ignore complex method notice.
234
 
235
  include_once ABSPATH . '/wp-admin/includes/update.php';
236
  require_once ABSPATH . 'wp-admin/includes/misc.php';
478
  *
479
  * @return bool|string|null
480
  */
481
+ public function vulnche_get_content( $url, $service = '' ) {
482
 
483
  // phpcs:disable WordPress.WP.AlternativeFunctions -- Required to achieve desired results, pull request solutions appreciated.
484
  $ch = curl_init();
493
  $output = curl_exec( $ch );
494
  $info = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
495
 
496
+ if ( 'resource' === gettype( $ch ) ) {
497
+ curl_close( $ch );
498
+ }
499
  // phpcs:enable
500
 
501
  if ( false === $output || 200 != $info ) {
class/class-mainwp-child-wordfence.php CHANGED
@@ -64,6 +64,9 @@ class MainWP_Child_Wordfence {
64
  */
65
  public static $options_filter = array(
66
  'alertEmails',
 
 
 
67
  'alertOn_adminLogin',
68
  'alertOn_firstAdminLoginOnly',
69
  'alertOn_scanIssues', // new.
@@ -140,8 +143,6 @@ class MainWP_Child_Wordfence {
140
  'maxRequestsHumans_action',
141
  'max404Humans',
142
  'max404Humans_action',
143
- 'maxScanHits',
144
- 'maxScanHits_action',
145
  'blockedTime',
146
  'liveTraf_ignorePublishers',
147
  'liveTraf_displayExpandedRecords',
@@ -149,6 +150,7 @@ class MainWP_Child_Wordfence {
149
  'liveTraf_ignoreIPs',
150
  'liveTraf_ignoreUA',
151
  'liveTraf_maxRows',
 
152
  'displayTopLevelLiveTraffic',
153
  'whitelisted',
154
  'bannedURLs',
@@ -180,8 +182,10 @@ class MainWP_Child_Wordfence {
180
  'other_bypassLitespeedNoabort',
181
  'disableWAFIPBlocking',
182
  'other_blockBadPOST',
 
183
  'displayTopLevelBlocking',
184
  'betaThreatDefenseFeed',
 
185
  'avoid_php_input',
186
  'scanType',
187
  'schedMode',
@@ -200,6 +204,7 @@ class MainWP_Child_Wordfence {
200
  'startScansRemotely',
201
  'ssl_verify',
202
  'betaThreatDefenseFeed',
 
203
  'avoid_php_input',
204
  );
205
 
@@ -765,6 +770,9 @@ class MainWP_Child_Wordfence {
765
  'apiKey',
766
  'autoUpdate',
767
  'alertEmails',
 
 
 
768
  'howGetIPs',
769
  'howGetIPs_trusted_proxies',
770
  'other_hideWPVersion',
@@ -808,6 +816,7 @@ class MainWP_Child_Wordfence {
808
  'liveTraf_ignoreIPs',
809
  'liveTraf_ignoreUA',
810
  'liveTraf_maxRows',
 
811
  'displayTopLevelLiveTraffic',
812
  );
813
 
@@ -829,8 +838,6 @@ class MainWP_Child_Wordfence {
829
  'maxRequestsHumans_action',
830
  'max404Humans',
831
  'max404Humans_action',
832
- 'maxScanHits',
833
- 'maxScanHits_action',
834
  'blockedTime',
835
  'allowed404s',
836
  'loginSecurityEnabled',
@@ -848,6 +855,7 @@ class MainWP_Child_Wordfence {
848
  'loginSec_blockAdminReg',
849
  'loginSec_disableAuthorScan',
850
  'other_blockBadPOST',
 
851
  'other_pwStrengthOnUpdate',
852
  'other_WFNet',
853
  'wafStatus',
@@ -896,6 +904,7 @@ class MainWP_Child_Wordfence {
896
  'startScansRemotely',
897
  'ssl_verify',
898
  'betaThreatDefenseFeed',
 
899
  'avoid_php_input',
900
  );
901
 
@@ -1619,6 +1628,12 @@ SQL
1619
  if (method_exists(\wfWAF::getInstance()->getStorageEngine(), 'purgeIPBlocks')) {
1620
  \wfWAF::getInstance()->getStorageEngine()->purgeIPBlocks(\wfWAFStorageInterface::IP_BLOCKS_BLACKLIST);
1621
  }
 
 
 
 
 
 
1622
  } else {
1623
  \wfConfig::set( $key, $val ); // save it!
1624
  }
64
  */
65
  public static $options_filter = array(
66
  'alertEmails',
67
+ 'displayTopLevelOptions',
68
+ 'displayTopLevelBlocking',
69
+ 'displayTopLevelLiveTraffic',
70
  'alertOn_adminLogin',
71
  'alertOn_firstAdminLoginOnly',
72
  'alertOn_scanIssues', // new.
143
  'maxRequestsHumans_action',
144
  'max404Humans',
145
  'max404Humans_action',
 
 
146
  'blockedTime',
147
  'liveTraf_ignorePublishers',
148
  'liveTraf_displayExpandedRecords',
150
  'liveTraf_ignoreIPs',
151
  'liveTraf_ignoreUA',
152
  'liveTraf_maxRows',
153
+ 'liveTraf_maxAge',
154
  'displayTopLevelLiveTraffic',
155
  'whitelisted',
156
  'bannedURLs',
182
  'other_bypassLitespeedNoabort',
183
  'disableWAFIPBlocking',
184
  'other_blockBadPOST',
185
+ 'blockCustomText',
186
  'displayTopLevelBlocking',
187
  'betaThreatDefenseFeed',
188
+ 'wordfenceI18n',
189
  'avoid_php_input',
190
  'scanType',
191
  'schedMode',
204
  'startScansRemotely',
205
  'ssl_verify',
206
  'betaThreatDefenseFeed',
207
+ 'wordfenceI18n',
208
  'avoid_php_input',
209
  );
210
 
770
  'apiKey',
771
  'autoUpdate',
772
  'alertEmails',
773
+ 'displayTopLevelOptions',
774
+ 'displayTopLevelBlocking',
775
+ 'displayTopLevelLiveTraffic',
776
  'howGetIPs',
777
  'howGetIPs_trusted_proxies',
778
  'other_hideWPVersion',
816
  'liveTraf_ignoreIPs',
817
  'liveTraf_ignoreUA',
818
  'liveTraf_maxRows',
819
+ 'liveTraf_maxAge',
820
  'displayTopLevelLiveTraffic',
821
  );
822
 
838
  'maxRequestsHumans_action',
839
  'max404Humans',
840
  'max404Humans_action',
 
 
841
  'blockedTime',
842
  'allowed404s',
843
  'loginSecurityEnabled',
855
  'loginSec_blockAdminReg',
856
  'loginSec_disableAuthorScan',
857
  'other_blockBadPOST',
858
+ 'blockCustomText',
859
  'other_pwStrengthOnUpdate',
860
  'other_WFNet',
861
  'wafStatus',
904
  'startScansRemotely',
905
  'ssl_verify',
906
  'betaThreatDefenseFeed',
907
+ 'wordfenceI18n',
908
  'avoid_php_input',
909
  );
910
 
1628
  if (method_exists(\wfWAF::getInstance()->getStorageEngine(), 'purgeIPBlocks')) {
1629
  \wfWAF::getInstance()->getStorageEngine()->purgeIPBlocks(\wfWAFStorageInterface::IP_BLOCKS_BLACKLIST);
1630
  }
1631
+ } elseif ( 'betaThreatDefenseFeed' == $key ) {
1632
+ $val = \wfUtils::truthyToBoolean($val);
1633
+ \wfConfig::set($key, $val);
1634
+ if (class_exists('\wfWAFConfig')) {
1635
+ \wfWAFConfig::set('betaThreatDefenseFeed', $val, 'synced');
1636
+ }
1637
  } else {
1638
  \wfConfig::set( $key, $val ); // save it!
1639
  }
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.8';
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.9';
37
 
38
  /**
39
  * Private variable containing the latest MainWP Child update version.
class/class-mainwp-client-report-base.php CHANGED
@@ -323,9 +323,9 @@ class MainWP_Client_Report_Base {
323
  'post_type' => 'post',
324
  'post_status' => 'publish',
325
  'date_query' => array(
326
- 'column' => 'post_date',
327
- 'after' => $args['date_from'],
328
- 'before' => $args['date_to'],
329
  ),
330
  );
331
 
@@ -917,21 +917,25 @@ class MainWP_Client_Report_Base {
917
  $tok_value = $this->get_mainwp_maintenance_token_value( $record, $data );
918
  } elseif ( 'wordfence_scan' === $context || 'mainwp_maintenance' === $context ) {
919
  $meta_value = $this->get_stream_meta_data( $record, $data );
920
- if ( 'wordfence_scan' === $context && 'result' == $data ) {
921
- $completed_log = __( 'Scan complete. Congratulations, no new problems found.', 'wordfence' );
922
- $str_loc1 = MainWP_Child_Wordfence::instance()->get_substr( $completed_log, 2 ); // loc string.
923
- $str_loc2 = MainWP_Child_Wordfence::instance()->get_substr( $completed_log, 3 ); // loc string.
924
- $congra_str_loc = str_replace( $str_loc1, '', $str_loc2 );
925
- $congra_str_loc = trim( $congra_str_loc, ' ,' );
926
-
927
- // SUM_FINAL:Scan complete. You have xxx new issues to fix. See below.
928
- // SUM_FINAL:Scan complete. Congratulations, no new problems found.
929
- if ( stripos( $meta_value, 'Congratulations' ) || stripos( $meta_value, $congra_str_loc ) ) {
930
- $meta_value = 'No issues detected';
931
- } elseif ( stripos( $meta_value, 'You have' ) ) {
932
- $meta_value = 'Issues Detected';
933
- } else {
934
- $meta_value = '';
 
 
 
 
935
  }
936
  }
937
  $tok_value = $meta_value;
323
  'post_type' => 'post',
324
  'post_status' => 'publish',
325
  'date_query' => array(
326
+ 'column' => 'post_date',
327
+ 'after' => $args['date_from'],
328
+ 'before' => $args['date_to'],
329
  ),
330
  );
331
 
917
  $tok_value = $this->get_mainwp_maintenance_token_value( $record, $data );
918
  } elseif ( 'wordfence_scan' === $context || 'mainwp_maintenance' === $context ) {
919
  $meta_value = $this->get_stream_meta_data( $record, $data );
920
+ if ( 'wordfence_scan' === $context ) {
921
+ if ( 'result' == $data ) {
922
+ $completed_log = __( 'Scan complete. Congratulations, no new problems found.', 'wordfence' );
923
+ $str_loc1 = MainWP_Child_Wordfence::instance()->get_substr( $completed_log, 2 ); // loc string.
924
+ $str_loc2 = MainWP_Child_Wordfence::instance()->get_substr( $completed_log, 3 ); // loc string.
925
+ $congra_str_loc = str_replace( $str_loc1, '', $str_loc2 );
926
+ $congra_str_loc = trim( $congra_str_loc, ' ,' );
927
+
928
+ // SUM_FINAL:Scan complete. You have xxx new issues to fix. See below.
929
+ // SUM_FINAL:Scan complete. Congratulations, no new problems found.
930
+ if ( stripos( $meta_value, 'Congratulations' ) || stripos( $meta_value, $congra_str_loc ) ) {
931
+ $meta_value = 'No issues detected';
932
+ } elseif ( stripos( $meta_value, 'You have' ) ) {
933
+ $meta_value = 'Issues Detected';
934
+ } else {
935
+ $meta_value = '';
936
+ }
937
+ } elseif ( 'details' == $data ) {
938
+ $meta_value = str_replace( 'SUM_FINAL:', '', $meta_value );
939
  }
940
  }
941
  $tok_value = $meta_value;
class/class-mainwp-utility.php CHANGED
@@ -655,7 +655,9 @@ class MainWP_Utility {
655
  $data = curl_exec( $ch );
656
  $http_status = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
657
  $err = curl_error( $ch );
658
- curl_close( $ch );
 
 
659
 
660
  if ( ( false === $data ) && ( 0 === $http_status ) ) {
661
  throw new \Exception( 'Http Error: ' . $err );
655
  $data = curl_exec( $ch );
656
  $http_status = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
657
  $err = curl_error( $ch );
658
+ if ( 'resource' === gettype( $ch ) ) {
659
+ curl_close( $ch );
660
+ }
661
 
662
  if ( ( false === $data ) && ( 0 === $http_status ) ) {
663
  throw new \Exception( 'Http Error: ' . $err );
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.8
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.9
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.8.1
9
  Requires PHP: 7.0
10
- Stable tag: 4.1.8
11
  License: GPLv3 or later
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -107,6 +107,14 @@ Sure we have a quick FAQ with a lot more questions and answers [here](https://ma
107
 
108
  == Changelog ==
109
 
 
 
 
 
 
 
 
 
110
  = 4.1.8 - 10-21-2021 =
111
  * Fixed: An error with missing metadata in the posting process
112
  * Fixed: An error with logging Wordfence scans
5
  Author URI: https://mainwp.com
6
  Plugin URI: https://mainwp.com
7
  Requires at least: 5.4
8
+ Tested up to: 5.9
9
  Requires PHP: 7.0
10
+ Stable tag: 4.1.9
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.9 - 12-28-2021 =
111
+ * Fixed: Problem with saving UpdraftPlus settings
112
+ * Fixed: Error with posting images
113
+ * Fixed: Error with recording Wordfence scans for reports
114
+ * Fixed: Version comparison issue for OpenSSL version
115
+ * Updated: PHP 8 compatibility
116
+ * Updated: Added `authorEmail` to the sync output ([PR284](https://github.com/mainwp/mainwp-child/pull/284) - thanks [Kim Vinberg](https://github.com/websitecareio))
117
+
118
  = 4.1.8 - 10-21-2021 =
119
  * Fixed: An error with missing metadata in the posting process
120
  * Fixed: An error with logging Wordfence scans