NinjaFirewall (WP Edition) - Version 4.5.2

Version Description

  • Fixed several deprecated messages on websites running PHP 8.1.
  • Updated Charts.js library.
  • Small fixes and adjustments.
  • WP+ Edition (Premium): Updated GeoIP databases.
Download this release

Release Info

Developer nintechnet
Plugin Icon 128x128 NinjaFirewall (WP Edition)
Version 4.5.2
Comparing to
See all releases

Code changes from version 4.5.1 to 4.5.2

lib/firewall.php CHANGED
@@ -1045,6 +1045,8 @@ function nfw_matching( $where, $key, $nfw_rules, $rules, $subid, $id, $nfw_optio
1045
 
1046
  function nfw_operator( $val, $what, $op ) {
1047
 
 
 
1048
  if ( $op == 2 ) {
1049
  if ( $val != $what ) {
1050
  return true;
@@ -1182,6 +1184,8 @@ function nfw_html_decode( $norm ) {
1182
 
1183
  function nfw_compress_string( $string, $where = null ) {
1184
 
 
 
1185
  if ( $where == 1 ) {
1186
  $replace = ' ';
1187
  } else {
@@ -1199,6 +1203,8 @@ function nfw_compress_string( $string, $where = null ) {
1199
 
1200
  function nfw_transform_string( $string, $where ) {
1201
 
 
 
1202
  if ( $where == 1 ) {
1203
  $norm = trim( preg_replace_callback('((^([^a-z/&|#]*)|([\'"])(?:\\\\.|[^\n\3\\\\])*?\3|(?:[0-9a-z_$]+)|.)'.
1204
  '(?:\s|--[^\n]*+\n|/\*(?:[^*!]|\*(?!/))*+\*/)*'.
1045
 
1046
  function nfw_operator( $val, $what, $op ) {
1047
 
1048
+ if (! $val ) { return false; }
1049
+
1050
  if ( $op == 2 ) {
1051
  if ( $val != $what ) {
1052
  return true;
1184
 
1185
  function nfw_compress_string( $string, $where = null ) {
1186
 
1187
+ if (! $string ) { return; }
1188
+
1189
  if ( $where == 1 ) {
1190
  $replace = ' ';
1191
  } else {
1203
 
1204
  function nfw_transform_string( $string, $where ) {
1205
 
1206
+ if (! $string ) { return; }
1207
+
1208
  if ( $where == 1 ) {
1209
  $norm = trim( preg_replace_callback('((^([^a-z/&|#]*)|([\'"])(?:\\\\.|[^\n\3\\\\])*?\3|(?:[0-9a-z_$]+)|.)'.
1210
  '(?:\s|--[^\n]*+\n|/\*(?:[^*!]|\*(?!/))*+\*/)*'.
lib/firewall_options.php CHANGED
@@ -299,7 +299,7 @@ function nf_sub_options_save() {
299
  $nfw_options['debug'] = 1;
300
  }
301
 
302
- if (! ctype_digit( $_POST['nfw_options']['widgetnews']) || $_POST['nfw_options']['widgetnews'] > 30 ) {
303
  $nfw_options['widgetnews'] = 4;
304
  } else {
305
  $nfw_options['widgetnews'] = (int) $_POST['nfw_options']['widgetnews'];
299
  $nfw_options['debug'] = 1;
300
  }
301
 
302
+ if (! preg_match( '/^\d+$/', $_POST['nfw_options']['widgetnews']) || $_POST['nfw_options']['widgetnews'] > 30 ) {
303
  $nfw_options['widgetnews'] = 4;
304
  } else {
305
  $nfw_options['widgetnews'] = (int) $_POST['nfw_options']['widgetnews'];
lib/logs_firewall_log.php CHANGED
@@ -215,7 +215,7 @@ if ( empty( $nfw_options['auto_del_log'] ) ) {
215
 
216
  function nf_sub_log_save_options( $nfw_options ) {
217
 
218
- if ( empty( $_POST['nfw_options']['auto_del_log'] ) || ! ctype_digit( $_POST['nfw_options']['auto_del_log'] ) ) {
219
  $nfw_options['auto_del_log'] = 0;
220
  } else {
221
  $nfw_options['auto_del_log'] = (int) $_POST['nfw_options']['auto_del_log'];
215
 
216
  function nf_sub_log_save_options( $nfw_options ) {
217
 
218
+ if ( empty( $_POST['nfw_options']['auto_del_log'] ) || ! preg_match( '/^\d+$/', $_POST['nfw_options']['auto_del_log'] ) ) {
219
  $nfw_options['auto_del_log'] = 0;
220
  } else {
221
  $nfw_options['auto_del_log'] = (int) $_POST['nfw_options']['auto_del_log'];
lib/utils.php CHANGED
@@ -690,8 +690,8 @@ function nfw_fetch_secnews( $maxnews, $return = 1 ) {
690
  return $res['body'];
691
  }
692
 
693
- // Cache the data for 30 minutes
694
- set_transient( 'nfw_widgetnews', $res['body'], 1800 );
695
  }
696
 
697
  if ( $return ) {
690
  return $res['body'];
691
  }
692
 
693
+ // Cache the data for 3 hours
694
+ set_transient( 'nfw_widgetnews', $res['body'], 10800 );
695
  }
696
 
697
  if ( $return ) {
ninjafirewall.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: NinjaFirewall (WP Edition)
4
  Plugin URI: https://nintechnet.com/
5
  Description: A true Web Application Firewall to protect and secure WordPress.
6
- Version: 4.5.1
7
  Author: The Ninja Technologies Network
8
  Author URI: https://nintechnet.com/
9
  License: GPLv3 or later
@@ -19,7 +19,7 @@ Domain Path: /languages
19
  | (c) NinTechNet - https://nintechnet.com/ |
20
  +---------------------------------------------------------------------+
21
  */
22
- define('NFW_ENGINE_VERSION', '4.5.1');
23
  /*
24
  +---------------------------------------------------------------------+
25
  | This program is free software: you can redistribute it and/or |
3
  Plugin Name: NinjaFirewall (WP Edition)
4
  Plugin URI: https://nintechnet.com/
5
  Description: A true Web Application Firewall to protect and secure WordPress.
6
+ Version: 4.5.2
7
  Author: The Ninja Technologies Network
8
  Author URI: https://nintechnet.com/
9
  License: GPLv3 or later
19
  | (c) NinTechNet - https://nintechnet.com/ |
20
  +---------------------------------------------------------------------+
21
  */
22
+ define('NFW_ENGINE_VERSION', '4.5.2');
23
  /*
24
  +---------------------------------------------------------------------+
25
  | This program is free software: you can redistribute it and/or |
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: nintechnet, bruandet
3
  Tags: security, firewall, malware, virus, protection, hack, antispam, scanner, hacked site, brute force, seguridad, seguranca, sicherheit, sicurezza, veiligheid, classicpress
4
  Requires at least: 4.7
5
- Tested up to: 5.9
6
- Stable tag: 4.5.1
7
  Requires PHP: 5.5
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -208,6 +208,13 @@ WordPress Sicherheit Plugin.
208
 
209
  Need more security? Take the time to explore our supercharged Premium edition: [NinjaFirewall WP+ Edition](https://nintechnet.com/ninjafirewall/wp-edition/?comparison)
210
 
 
 
 
 
 
 
 
211
  = 4.5.1 =
212
 
213
  * Fixed a PHP "Cannot use object of type WP_Error as array" error.
2
  Contributors: nintechnet, bruandet
3
  Tags: security, firewall, malware, virus, protection, hack, antispam, scanner, hacked site, brute force, seguridad, seguranca, sicherheit, sicurezza, veiligheid, classicpress
4
  Requires at least: 4.7
5
+ Tested up to: 6.0
6
+ Stable tag: 4.5.2
7
  Requires PHP: 5.5
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
208
 
209
  Need more security? Take the time to explore our supercharged Premium edition: [NinjaFirewall WP+ Edition](https://nintechnet.com/ninjafirewall/wp-edition/?comparison)
210
 
211
+ = 4.5.2 =
212
+
213
+ * Fixed several deprecated messages on websites running PHP 8.1.
214
+ * Updated Charts.js library.
215
+ * Small fixes and adjustments.
216
+ * WP+ Edition (Premium): Updated GeoIP databases.
217
+
218
  = 4.5.1 =
219
 
220
  * Fixed a PHP "Cannot use object of type WP_Error as array" error.