Wordfence Security – Firewall & Malware Scan - Version 1.4.3

Version Description

  • Improved diagnistic information on binary and regular API calls for better debugging.
  • Changed ticker to only show activity with level < 3
Download this release

Release Info

Developer mmaunder
Plugin Icon 128x128 Wordfence Security – Firewall & Malware Scan
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

Files changed (4) hide show
  1. lib/wfAPI.php +11 -0
  2. lib/wordfenceClass.php +1 -1
  3. readme.txt +5 -1
  4. wordfence.php +1 -1
lib/wfAPI.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  require_once('wordfenceConstants.php');
 
3
  class wfAPI {
4
  public $errorMsg = false;
5
  public $lastURLError = '';
@@ -14,6 +15,7 @@ class wfAPI {
14
  $this->wordpressVersion = $wordpressVersion;
15
  }
16
  public function call($action, $getParams = array(), $postParams = array()){
 
17
  $this->errorMsg = false;
18
  $json = $this->getURL(WORDFENCE_API_URL . '/v' . WORDFENCE_VERSION . '/?' . $this->makeAPIQueryString() . '&' . http_build_query(
19
  array_merge(
@@ -26,6 +28,7 @@ class wfAPI {
26
  } else {
27
  $this->errorMsg = "We could not fetch data from the API when calling '$action': " . $this->lastURLError;
28
  }
 
29
  return false;
30
  }
31
 
@@ -36,6 +39,11 @@ class wfAPI {
36
  if($dat['errorMsg']){
37
  $this->errorMsg = $dat['errorMsg'];
38
  }
 
 
 
 
 
39
  return $dat;
40
  }
41
  public function curlWrite($h, $d){
@@ -88,6 +96,7 @@ class wfAPI {
88
 
89
  }
90
  public function binCall($func, $postData){
 
91
  $this->errorMsg = false;
92
  $url = WORDFENCE_API_URL . '/v' . WORDFENCE_VERSION . '/?' . $this->makeAPIQueryString() . '&action=' . $func;
93
  $curl = curl_init($url);
@@ -112,9 +121,11 @@ class wfAPI {
112
  $jdat = @json_decode($data, true);
113
  if(is_array($jdat) && $jdat['errorMsg']){
114
  $this->errorMsg = $jdat['errorMsg'];
 
115
  return false;
116
  }
117
  }
 
118
  return array('code' => $httpStatus, 'data' => $data);
119
  }
120
  public function makeAPIQueryString(){
1
  <?php
2
  require_once('wordfenceConstants.php');
3
+ require_once('wordfenceClass.php');
4
  class wfAPI {
5
  public $errorMsg = false;
6
  public $lastURLError = '';
15
  $this->wordpressVersion = $wordpressVersion;
16
  }
17
  public function call($action, $getParams = array(), $postParams = array()){
18
+ wordfence::status(3, 'info', "Starting API call: $action");
19
  $this->errorMsg = false;
20
  $json = $this->getURL(WORDFENCE_API_URL . '/v' . WORDFENCE_VERSION . '/?' . $this->makeAPIQueryString() . '&' . http_build_query(
21
  array_merge(
28
  } else {
29
  $this->errorMsg = "We could not fetch data from the API when calling '$action': " . $this->lastURLError;
30
  }
31
+ wordfence::status(3, 'error', "API Error: " . $this->errorMsg);
32
  return false;
33
  }
34
 
39
  if($dat['errorMsg']){
40
  $this->errorMsg = $dat['errorMsg'];
41
  }
42
+ if($this->errorMsg){
43
+ wordfence::status(3, 'error', "API Error: " . $this->errorMsg);
44
+ } else {
45
+ wordfence::status(3, 'info', "Completed API call: $action");
46
+ }
47
  return $dat;
48
  }
49
  public function curlWrite($h, $d){
96
 
97
  }
98
  public function binCall($func, $postData){
99
+ wordfence::status(3, 'info', "Starting binary API call: $func");
100
  $this->errorMsg = false;
101
  $url = WORDFENCE_API_URL . '/v' . WORDFENCE_VERSION . '/?' . $this->makeAPIQueryString() . '&action=' . $func;
102
  $curl = curl_init($url);
121
  $jdat = @json_decode($data, true);
122
  if(is_array($jdat) && $jdat['errorMsg']){
123
  $this->errorMsg = $jdat['errorMsg'];
124
+ wordfence::status(3, 'error', "Error in binary API call $func: " . $this->errorMsg);
125
  return false;
126
  }
127
  }
128
+ wordfence::status(3, 'info', "Completed binary API call $func with code: $code");
129
  return array('code' => $httpStatus, 'data' => $data);
130
  }
131
  public function makeAPIQueryString(){
lib/wordfenceClass.php CHANGED
@@ -565,7 +565,7 @@ class wordfence {
565
  $issues = new wfIssues();
566
  $jsonData = array(
567
  'serverTime' => $serverTime,
568
- 'msg' => $wfdb->querySingle("select msg from $p"."wfStatus order by ctime desc limit 1"),
569
  'currentScanID' => $issues->getScanTime()
570
  );
571
  $events = array();
565
  $issues = new wfIssues();
566
  $jsonData = array(
567
  'serverTime' => $serverTime,
568
+ 'msg' => $wfdb->querySingle("select msg from $p"."wfStatus where level < 3 order by ctime desc limit 1"),
569
  'currentScanID' => $issues->getScanTime()
570
  );
571
  $events = array();
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mmaunder
3
  Tags: wordpress, security, wordpress security, security plugin, secure, anti-virus, malware, firewall, antivirus, virus, google safe browsing, phishing, scrapers, hacking, wordfence, securty, secrity, secure
4
  Requires at least: 3.3.1
5
  Tested up to: 3.3.2
6
- Stable tag: 1.4.2
7
 
8
  Wordfence Security is a free enterprise class security plugin that includes a firewall, virus scanning, real-time traffic with geolocation and more.
9
 
@@ -134,6 +134,10 @@ or a theme, because often these have been updated to fix a security hole.
134
  5. If you're technically minded, this is the under-the-hood view of Wordfence options where you can fine-tune your security settings.
135
 
136
  == Changelog ==
 
 
 
 
137
  = 1.4.2 =
138
  * Email to send security alerts to is now configured at the same time an API key is entered.
139
  * phpinfo is emailed along with activity log when user requests to send us activity log so that we can see things like PHP max execution time and other relevant data
3
  Tags: wordpress, security, wordpress security, security plugin, secure, anti-virus, malware, firewall, antivirus, virus, google safe browsing, phishing, scrapers, hacking, wordfence, securty, secrity, secure
4
  Requires at least: 3.3.1
5
  Tested up to: 3.3.2
6
+ Stable tag: 1.4.3
7
 
8
  Wordfence Security is a free enterprise class security plugin that includes a firewall, virus scanning, real-time traffic with geolocation and more.
9
 
134
  5. If you're technically minded, this is the under-the-hood view of Wordfence options where you can fine-tune your security settings.
135
 
136
  == Changelog ==
137
+ = 1.4.3 =
138
+ * Improved diagnistic information on binary and regular API calls for better debugging.
139
+ * Changed ticker to only show activity with level < 3
140
+
141
  = 1.4.2 =
142
  * Email to send security alerts to is now configured at the same time an API key is entered.
143
  * phpinfo is emailed along with activity log when user requests to send us activity log so that we can see things like PHP max execution time and other relevant data
wordfence.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Wordfence Security
4
  Plugin URI: http://wordfence.com/
5
  Description: WordPress Security - Anti-virus and Firewall security plugin for WordPress
6
  Author: Mark Maunder
7
- Version: 1.4.2
8
  Author URI: http://wordfence.com/
9
  */
10
  require_once('lib/wordfenceConstants.php');
4
  Plugin URI: http://wordfence.com/
5
  Description: WordPress Security - Anti-virus and Firewall security plugin for WordPress
6
  Author: Mark Maunder
7
+ Version: 1.4.3
8
  Author URI: http://wordfence.com/
9
  */
10
  require_once('lib/wordfenceConstants.php');