MalCare WordPress Security Plugin – Malware Scanner, Cleaner, Security Firewall - Version 4.21

Version Description

  • Adding default parameter for MCWPAdmin constructor
Download this release

Release Info

Developer ritesh.soni36
Plugin Icon 128x128 MalCare WordPress Security Plugin – Malware Scanner, Cleaner, Security Firewall
Version 4.21
Comparing to
See all releases

Code changes from version 4.2 to 4.21

Files changed (7) hide show
  1. account.php +2 -0
  2. callback/wings/fs_write.php +0 -16
  3. info.php +1 -1
  4. malcare.php +2 -2
  5. readme.txt +4 -1
  6. wp_admin.php +2 -2
  7. wp_api.php +4 -4
account.php CHANGED
@@ -102,6 +102,7 @@ if (!class_exists('MCAccount')) :
102
  }
103
 
104
  public function newAuthParams($version) {
 
105
  $args = array();
106
  $time = time();
107
  $sig = sha1($this->public.$this->secret.$time.$version);
@@ -110,6 +111,7 @@ if (!class_exists('MCAccount')) :
110
  $args['bvPublic'] = $this->public;
111
  $args['bvVersion'] = $version;
112
  $args['sha1'] = '1';
 
113
  return $args;
114
  }
115
 
102
  }
103
 
104
  public function newAuthParams($version) {
105
+ $bvinfo = new MCInfo($settings);
106
  $args = array();
107
  $time = time();
108
  $sig = sha1($this->public.$this->secret.$time.$version);
111
  $args['bvPublic'] = $this->public;
112
  $args['bvVersion'] = $version;
113
  $args['sha1'] = '1';
114
+ $args['plugname'] = $bvinfo->plugname;
115
  return $args;
116
  }
117
 
callback/wings/fs_write.php CHANGED
@@ -269,17 +269,6 @@ class BVFSWriteCallback extends BVCallbackBase {
269
  return $result;
270
  }
271
 
272
- public function wgetFile($ifile_url, $ofile) {
273
- $result = array();
274
- system("wget -nv -O $ofile $ifile_url 2>&1 > /dev/null", $retval);
275
-
276
- if ($retval !== 0) {
277
- $result['error'] = "WGET_ERROR";
278
- }
279
-
280
- return $result;
281
- }
282
-
283
  public function streamCopyFile($ifile_url, $ofile) {
284
  $result = array();
285
  $handle = fopen($ifile_url, "rb");
@@ -379,11 +368,6 @@ class BVFSWriteCallback extends BVCallbackBase {
379
 
380
  $resp = $this->curlFile($ifile_url, $ofile, $timeout);
381
  break;
382
- case "wget":
383
- $ifile_url = isset($params['ifileurl']) ? $params['ifileurl'] : null;
384
-
385
- $resp = $this->wgetFile($ifile_url, $ofile);
386
- break;
387
  case "streamcopy":
388
  $ifile_url = isset($params['ifileurl']) ? $params['ifileurl'] : null;
389
 
269
  return $result;
270
  }
271
 
 
 
 
 
 
 
 
 
 
 
 
272
  public function streamCopyFile($ifile_url, $ofile) {
273
  $result = array();
274
  $handle = fopen($ifile_url, "rb");
368
 
369
  $resp = $this->curlFile($ifile_url, $ofile, $timeout);
370
  break;
 
 
 
 
 
371
  case "streamcopy":
372
  $ifile_url = isset($params['ifileurl']) ? $params['ifileurl'] : null;
373
 
info.php CHANGED
@@ -9,7 +9,7 @@ if (!class_exists('MCInfo')) :
9
  public $badgeinfo = 'mcbadge';
10
  public $ip_header_option = 'mcipheader';
11
  public $brand_option = 'mcbrand';
12
- public $version = '4.2';
13
  public $webpage = 'https://www.malcare.com';
14
  public $appurl = 'https://app.malcare.com';
15
  public $slug = 'malcare-security/malcare.php';
9
  public $badgeinfo = 'mcbadge';
10
  public $ip_header_option = 'mcipheader';
11
  public $brand_option = 'mcbrand';
12
+ public $version = '4.21';
13
  public $webpage = 'https://www.malcare.com';
14
  public $appurl = 'https://app.malcare.com';
15
  public $slug = 'malcare-security/malcare.php';
malcare.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.malcare.com
5
  Description: WordPress Security, Firewall and Malware Scanner
6
  Author: MalCare Security
7
  Author URI: https://www.malcare.com
8
- Version: 4.2
9
  Network: True
10
  */
11
 
@@ -61,7 +61,7 @@ if (defined('WP_CLI') && WP_CLI) {
61
 
62
  if (is_admin()) {
63
  require_once dirname( __FILE__ ) . '/wp_admin.php';
64
- $wpadmin = new MCWPAdmin($bvsettings, $bvsiteinfo, $bvapi);
65
  add_action('admin_init', array($wpadmin, 'initHandler'));
66
  add_filter('all_plugins', array($wpadmin, 'initBranding'));
67
  add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2);
5
  Description: WordPress Security, Firewall and Malware Scanner
6
  Author: MalCare Security
7
  Author URI: https://www.malcare.com
8
+ Version: 4.21
9
  Network: True
10
  */
11
 
61
 
62
  if (is_admin()) {
63
  require_once dirname( __FILE__ ) . '/wp_admin.php';
64
+ $wpadmin = new MCWPAdmin($bvsettings, $bvsiteinfo);
65
  add_action('admin_init', array($wpadmin, 'initHandler'));
66
  add_filter('all_plugins', array($wpadmin, 'initBranding'));
67
  add_filter('plugin_row_meta', array($wpadmin, 'hidePluginDetails'), 10, 2);
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://www.malcare.com
6
  Requires at least: 4.0
7
  Tested up to: 5.4
8
  Requires PHP: 5.4.0
9
- Stable tag: 4.2
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
@@ -218,6 +218,9 @@ FTP details input into MalCare is processed on our servers. We need your FTP cre
218
  8. With BlogVault's White-Label Solution you can showcase our service under your own brilliant brand.
219
 
220
  == CHANGELOG ==
 
 
 
221
  = 4.2 =
222
  * Robust write callbacks
223
  * Improved and Robust prepend in Firewall Support
6
  Requires at least: 4.0
7
  Tested up to: 5.4
8
  Requires PHP: 5.4.0
9
+ Stable tag: 4.21
10
  License: GPLv2 or later
11
  License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)
12
 
218
  8. With BlogVault's White-Label Solution you can showcase our service under your own brilliant brand.
219
 
220
  == CHANGELOG ==
221
+ = 4.21 =
222
+ * Adding default parameter for MCWPAdmin constructor
223
+
224
  = 4.2 =
225
  * Robust write callbacks
226
  * Improved and Robust prepend in Firewall Support
wp_admin.php CHANGED
@@ -9,10 +9,10 @@ class MCWPAdmin {
9
  public $bvapi;
10
  public $bvinfo;
11
 
12
- function __construct($settings, $siteinfo, $bvapi) {
13
  $this->settings = $settings;
14
  $this->siteinfo = $siteinfo;
15
- $this->bvapi = $bvapi;
16
  $this->bvinfo = new MCInfo($this->settings);
17
  }
18
 
9
  public $bvapi;
10
  public $bvinfo;
11
 
12
+ function __construct($settings, $siteinfo, $bvapi = null) {
13
  $this->settings = $settings;
14
  $this->siteinfo = $siteinfo;
15
+ $this->bvapi = new MCWPAPI($settings);
16
  $this->bvinfo = new MCInfo($this->settings);
17
  }
18
 
wp_api.php CHANGED
@@ -8,14 +8,14 @@ if (!class_exists('MCWPAPI')) :
8
  public function __construct($settings) {
9
  $this->settings = $settings;
10
  }
11
-
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
  $this->create_request_params($method, $body, $public);
15
  } else {
16
- $accounts = MCAccount::allAccounts($this->settings);
17
- foreach ($accounts as $pubkey => $value ) {
18
- $this->create_request_params($method, $body, $pubkey);
19
  }
20
  }
21
  }
8
  public function __construct($settings) {
9
  $this->settings = $settings;
10
  }
11
+
12
  public function pingbv($method, $body, $public = false) {
13
  if ($public) {
14
  $this->create_request_params($method, $body, $public);
15
  } else {
16
+ $api_public_key = $this->settings->getOption('bvApiPublic');
17
+ if (!empty($api_public_key) && (strlen($api_public_key) >= 32)) {
18
+ $this->create_request_params($method, $body, $api_public_key);
19
  }
20
  }
21
  }