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

Version Description

  • Firewall Logging Improvements
Download this release

Release Info

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

Code changes from version 4.59 to 4.61

Files changed (5) hide show
  1. info.php +2 -2
  2. malcare.php +1 -1
  3. protect/fw/fw.php +2 -2
  4. protect/fw/request.php +12 -1
  5. readme.txt +4 -1
info.php CHANGED
@@ -10,7 +10,7 @@ if (!class_exists('MCInfo')) :
10
  public $badgeinfo = 'mcbadge';
11
  public $ip_header_option = 'mcipheader';
12
  public $brand_option = 'mcbrand';
13
- public $version = '4.59';
14
  public $webpage = 'https://www.malcare.com';
15
  public $appurl = 'https://app.malcare.com';
16
  public $slug = 'malcare-security/malcare.php';
@@ -19,7 +19,7 @@ if (!class_exists('MCInfo')) :
19
  public $brand_icon = '/img/icon.png';
20
  public $services_option_name = 'mcconfig';
21
 
22
- const DB_VERSION = '2';
23
 
24
  public function __construct($settings) {
25
  $this->settings = $settings;
10
  public $badgeinfo = 'mcbadge';
11
  public $ip_header_option = 'mcipheader';
12
  public $brand_option = 'mcbrand';
13
+ public $version = '4.61';
14
  public $webpage = 'https://www.malcare.com';
15
  public $appurl = 'https://app.malcare.com';
16
  public $slug = 'malcare-security/malcare.php';
19
  public $brand_icon = '/img/icon.png';
20
  public $services_option_name = 'mcconfig';
21
 
22
+ const DB_VERSION = '3';
23
 
24
  public function __construct($settings) {
25
  $this->settings = $settings;
malcare.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.malcare.com
5
  Description: MalCare Security - Free Malware Scanner, Protection & Security for WordPress
6
  Author: MalCare Security
7
  Author URI: https://www.malcare.com
8
- Version: 4.59
9
  Network: True
10
  */
11
 
5
  Description: MalCare Security - Free Malware Scanner, Protection & Security for WordPress
6
  Author: MalCare Security
7
  Author URI: https://www.malcare.com
8
+ Version: 4.61
9
  Network: True
10
  */
11
 
protect/fw/fw.php CHANGED
@@ -252,7 +252,7 @@ class BVFW {
252
  $this->terminateRequest(BVWPRequest::BLACKLISTED);
253
  }
254
  if ($this->config->isRulesModeEnabled()) {
255
- if ($this->ruleSet) {
256
  $this->evaluateRules($this->ruleSet);
257
  } else {
258
  $this->request->updateRulesInfo('errors', 'ruleset', 'Invalid RuleSet');
@@ -395,7 +395,7 @@ class BVFW {
395
 
396
  if (BVFWRuleEvaluator::VERSION >= $min_rule_engine_ver) {
397
  if ($this->ruleEvaluator->evaluateRule($ruleLogic) && empty($this->ruleEvaluator->getErrors())) {
398
- $this->request->updateRulesInfo('matched_rules', $id, null);
399
  $this->executeActions($actions);
400
  } elseif (!empty($this->ruleEvaluator->getErrors())) {
401
  $this->request->updateRulesInfo("errors", (string) $id, $this->ruleEvaluator->getErrors());
252
  $this->terminateRequest(BVWPRequest::BLACKLISTED);
253
  }
254
  if ($this->config->isRulesModeEnabled()) {
255
+ if (is_array($this->ruleSet)) {
256
  $this->evaluateRules($this->ruleSet);
257
  } else {
258
  $this->request->updateRulesInfo('errors', 'ruleset', 'Invalid RuleSet');
395
 
396
  if (BVFWRuleEvaluator::VERSION >= $min_rule_engine_ver) {
397
  if ($this->ruleEvaluator->evaluateRule($ruleLogic) && empty($this->ruleEvaluator->getErrors())) {
398
+ $this->request->updateMatchedRules($id);
399
  $this->executeActions($actions);
400
  } elseif (!empty($this->ruleEvaluator->getErrors())) {
401
  $this->request->updateRulesInfo("errors", (string) $id, $this->ruleEvaluator->getErrors());
protect/fw/request.php CHANGED
@@ -20,6 +20,7 @@ class BVWPRequest {
20
  private $status;
21
  private $rulesInfo;
22
  private $reqInfo;
 
23
 
24
  #status
25
  const ALLOWED = 1;
@@ -44,6 +45,7 @@ class BVWPRequest {
44
  $path = '';
45
  $this->ip = $ip;
46
  $this->rulesInfo = array();
 
47
  $this->reqInfo = array();
48
  $this->setRespCode(0);
49
  $this->setCategory(BVWPRequest::NORMAL);
@@ -160,6 +162,10 @@ class BVWPRequest {
160
  $this->uri = $uri;
161
  }
162
 
 
 
 
 
163
  public function updateRulesInfo($category, $sub_category, $value) {
164
  $rule_info = (array_key_exists($category, $this->rulesInfo)) ? $this->rulesInfo[$category] : array();
165
  $rule_info[$sub_category] = $value;
@@ -170,6 +176,10 @@ class BVWPRequest {
170
  return $this->rulesInfo;
171
  }
172
 
 
 
 
 
173
  public function updateReqInfo($info) {
174
  if (is_array($info)) {
175
  $this->reqInfo = $this->reqInfo + $info;
@@ -213,7 +223,8 @@ class BVWPRequest {
213
  "status" => $this->getStatus(),
214
  "category" => $this->getCategory(),
215
  "rules_info" => $rules_info,
216
- "request_id" => $this->getRequestID()
 
217
  );
218
  return $data;
219
  }
20
  private $status;
21
  private $rulesInfo;
22
  private $reqInfo;
23
+ private $matchedRules;
24
 
25
  #status
26
  const ALLOWED = 1;
45
  $path = '';
46
  $this->ip = $ip;
47
  $this->rulesInfo = array();
48
+ $this->matchedRules = array();
49
  $this->reqInfo = array();
50
  $this->setRespCode(0);
51
  $this->setCategory(BVWPRequest::NORMAL);
162
  $this->uri = $uri;
163
  }
164
 
165
+ public function updateMatchedRules($matched_rule_id) {
166
+ $this->matchedRules[] = $matched_rule_id;
167
+ }
168
+
169
  public function updateRulesInfo($category, $sub_category, $value) {
170
  $rule_info = (array_key_exists($category, $this->rulesInfo)) ? $this->rulesInfo[$category] : array();
171
  $rule_info[$sub_category] = $value;
176
  return $this->rulesInfo;
177
  }
178
 
179
+ public function getMatchedRules() {
180
+ return $this->matchedRules;
181
+ }
182
+
183
  public function updateReqInfo($info) {
184
  if (is_array($info)) {
185
  $this->reqInfo = $this->reqInfo + $info;
223
  "status" => $this->getStatus(),
224
  "category" => $this->getCategory(),
225
  "rules_info" => $rules_info,
226
+ "request_id" => $this->getRequestID(),
227
+ "matched_rules"=> serialize($this->getMatchedRules())
228
  );
229
  return $data;
230
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://www.malcare.com
6
  Requires at least: 4.0
7
  Tested up to: 5.7
8
  Requires PHP: 5.4.0
9
- Stable tag: 4.59
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
 
@@ -397,6 +397,9 @@ These are available on our website: [Terms of Service](https://www.malcare.com/t
397
  8. MalCare’s Uptime Monitoring notifies if a website goes down so that you can handle the situation before starting to lose visitors.
398
 
399
  == CHANGELOG ==
 
 
 
400
  = 4.59 =
401
  * Improved host info
402
  * Re-enabled plugin deactivation functionality from wp-admin for botprotection sites
6
  Requires at least: 4.0
7
  Tested up to: 5.7
8
  Requires PHP: 5.4.0
9
+ Stable tag: 4.61
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
 
397
  8. MalCare’s Uptime Monitoring notifies if a website goes down so that you can handle the situation before starting to lose visitors.
398
 
399
  == CHANGELOG ==
400
+ = 4.61 =
401
+ * Firewall Logging Improvements
402
+
403
  = 4.59 =
404
  * Improved host info
405
  * Re-enabled plugin deactivation functionality from wp-admin for botprotection sites