Shield Security for WordPress - Version 12.0.5

Version Description

Download this release

Release Info

Developer paultgoodchild
Plugin Icon 128x128 Shield Security for WordPress
Version 12.0.5
Comparing to
See all releases

Code changes from version 12.0.4 to 12.0.5

cl.json CHANGED
@@ -113,6 +113,16 @@
113
  "When the Chained/MFA option is enabled, when U2F is supplied, this can be done alone without the need for other factors."
114
  ]
115
  },
 
 
 
 
 
 
 
 
 
 
116
  {
117
  "type": "fixed",
118
  "title": "Prevent PHP exception being thrown in certain cases.",
113
  "When the Chained/MFA option is enabled, when U2F is supplied, this can be done alone without the need for other factors."
114
  ]
115
  },
116
+ {
117
+ "type": "changed",
118
+ "pro_only": false,
119
+ "title": "Minimum Required MySQL Version",
120
+ "description": [
121
+ "Shield processed IPv4 and IPv6 addresses and stores them in the MySQL database.",
122
+ "With this upgrade, the minimum required MySQL database engine is moving to 5.6."
123
+ ],
124
+ "href": "https://shsec.io/shieldsystemrequirements"
125
+ },
126
  {
127
  "type": "fixed",
128
  "title": "Prevent PHP exception being thrown in certain cases.",
icwp-wpsf.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Shield Security
4
  * Plugin URI: https://shsec.io/2f
5
  * Description: Powerful, Easy-To-Use #1 Rated WordPress Security System
6
- * Version: 12.0.4
7
  * Text Domain: wp-simple-firewall
8
  * Domain Path: /languages
9
  * Author: Shield Security
3
  * Plugin Name: Shield Security
4
  * Plugin URI: https://shsec.io/2f
5
  * Description: Powerful, Easy-To-Use #1 Rated WordPress Security System
6
+ * Version: 12.0.5
7
  * Text Domain: wp-simple-firewall
8
  * Domain Path: /languages
9
  * Author: Shield Security
plugin-spec.php CHANGED
@@ -1,8 +1,8 @@
1
  {
2
  "properties": {
3
- "version": "12.0.4",
4
- "release_timestamp": 1632324000,
5
- "build": "202109.2203",
6
  "slug_parent": "icwp",
7
  "slug_plugin": "wpsf",
8
  "human_name": "Shield Security",
@@ -20,12 +20,19 @@
20
  },
21
  "requirements": {
22
  "php": "7.0",
23
- "wordpress": "3.7"
 
24
  },
25
  "upgrade_reqs": {
26
  "10.0": {
27
- "php": "7.0",
28
- "wp": "3.5.2"
 
 
 
 
 
 
29
  }
30
  },
31
  "paths": {
1
  {
2
  "properties": {
3
+ "version": "12.0.5",
4
+ "release_timestamp": 1632387382,
5
+ "build": "202109.2301",
6
  "slug_parent": "icwp",
7
  "slug_plugin": "wpsf",
8
  "human_name": "Shield Security",
20
  },
21
  "requirements": {
22
  "php": "7.0",
23
+ "wordpress": "3.7",
24
+ "mysql": "5.6"
25
  },
26
  "upgrade_reqs": {
27
  "10.0": {
28
+ "php": "7.0",
29
+ "wp": "3.5.2",
30
+ "mysql": "5.5"
31
+ },
32
+ "12.0": {
33
+ "php": "7.0",
34
+ "wp": "3.7",
35
+ "mysql": "5.6"
36
  }
37
  },
38
  "paths": {
plugin.json CHANGED
@@ -1,8 +1,8 @@
1
  {
2
  "properties": {
3
- "version": "12.0.4",
4
- "release_timestamp": 1632324000,
5
- "build": "202109.2203",
6
  "slug_parent": "icwp",
7
  "slug_plugin": "wpsf",
8
  "human_name": "Shield Security",
@@ -20,12 +20,19 @@
20
  },
21
  "requirements": {
22
  "php": "7.0",
23
- "wordpress": "3.7"
 
24
  },
25
  "upgrade_reqs": {
26
  "10.0": {
27
- "php": "7.0",
28
- "wp": "3.5.2"
 
 
 
 
 
 
29
  }
30
  },
31
  "paths": {
1
  {
2
  "properties": {
3
+ "version": "12.0.5",
4
+ "release_timestamp": 1632387382,
5
+ "build": "202109.2301",
6
  "slug_parent": "icwp",
7
  "slug_plugin": "wpsf",
8
  "human_name": "Shield Security",
20
  },
21
  "requirements": {
22
  "php": "7.0",
23
+ "wordpress": "3.7",
24
+ "mysql": "5.6"
25
  },
26
  "upgrade_reqs": {
27
  "10.0": {
28
+ "php": "7.0",
29
+ "wp": "3.5.2",
30
+ "mysql": "5.5"
31
+ },
32
+ "12.0": {
33
+ "php": "7.0",
34
+ "wp": "3.7",
35
+ "mysql": "5.6"
36
  }
37
  },
38
  "paths": {
readme.txt CHANGED
@@ -8,7 +8,7 @@ Requires at least: 3.7
8
  Requires PHP: 7.0
9
  Recommended PHP: 7.4
10
  Tested up to: 5.8
11
- Stable tag: 12.0.4
12
 
13
  No-Nonsense Security Hardening that protects WordPress against hackers, malicious bots, and spammers (no captchas!). Now with exclusive ShieldNET Technology.
14
 
8
  Requires PHP: 7.0
9
  Recommended PHP: 7.4
10
  Tested up to: 5.8
11
+ Stable tag: 12.0.5
12
 
13
  No-Nonsense Security Hardening that protects WordPress against hackers, malicious bots, and spammers (no captchas!). Now with exclusive ShieldNET Technology.
14
 
src/lib/src/Controller/Config/ConfigVO.php CHANGED
@@ -60,6 +60,14 @@ class ConfigVO extends DynPropertiesClass {
60
  }
61
  break;
62
 
 
 
 
 
 
 
 
 
63
  default:
64
  break;
65
  }
60
  }
61
  break;
62
 
63
+ case 'meta':
64
+ case 'plugin_meta':
65
+ case 'upgrade_reqs':
66
+ if ( !is_array( $val ) ) {
67
+ $val = [];
68
+ }
69
+ break;
70
+
71
  default:
72
  break;
73
  }
src/lib/src/Controller/Controller.php CHANGED
@@ -221,6 +221,12 @@ class Controller extends DynPropertiesClass {
221
  $reqsMsg[] = sprintf( 'WordPress does not meet minimum version. Required Version: %s.', $wp );
222
  }
223
 
 
 
 
 
 
 
224
  if ( !empty( $reqsMsg ) ) {
225
  $this->reqs_not_met = $reqsMsg;
226
  add_action( 'admin_notices', [ $this, 'adminNoticeDoesNotMeetRequirements' ] );
@@ -234,6 +240,7 @@ class Controller extends DynPropertiesClass {
234
  if ( !empty( $this->reqs_not_met ) ) {
235
  $this->getRenderer()
236
  ->setTemplate( 'notices/does-not-meet-requirements.twig' )
 
237
  ->setRenderVars( [
238
  'strings' => [
239
  'not_met' => 'Shield Security Plugin - minimum site requirements are not met',
@@ -242,7 +249,7 @@ class Controller extends DynPropertiesClass {
242
  'more_information' => 'Click here for more information on requirements'
243
  ],
244
  'hrefs' => [
245
- 'more_information' => sprintf( 'https://wordpress.org/plugins/%s/faq', $this->getTextDomain() )
246
  ]
247
  ] )
248
  ->display();
@@ -614,13 +621,16 @@ class Controller extends DynPropertiesClass {
614
  if ( !empty( $updates->response ) && isset( $updates->response[ $file ] ) ) {
615
  $reqs = $this->cfg->upgrade_reqs;
616
  if ( is_array( $reqs ) ) {
617
- foreach ( $reqs as $sShieldVer => $aReqs ) {
618
- $bNeedsHidden = version_compare( $updates->response[ $file ]->new_version, $sShieldVer, '>=' )
619
- && (
620
- !Services::Data()->getPhpVersionIsAtLeast( $aReqs[ 'php' ] )
621
- || !Services::WpGeneral()->getWordpressIsAtLeastVersion( $aReqs[ 'wp' ] )
622
- );
623
- if ( $bNeedsHidden ) {
 
 
 
624
  unset( $updates->response[ $file ] );
625
  break;
626
  }
221
  $reqsMsg[] = sprintf( 'WordPress does not meet minimum version. Required Version: %s.', $wp );
222
  }
223
 
224
+ $mysql = $this->cfg->requirements[ 'mysql' ];
225
+ if ( !empty( $mysql ) && version_compare( Services::WpDb()->loadWpdb()->db_version(), $mysql, '<' ) ) {
226
+ $reqsMsg[] = sprintf( "Your MySQL database server doesn't support IPv6 addresses. Your Version: %s; Required MySQL Version: %s;",
227
+ Services::WpDb()->loadWpdb()->db_version(), $mysql );
228
+ }
229
+
230
  if ( !empty( $reqsMsg ) ) {
231
  $this->reqs_not_met = $reqsMsg;
232
  add_action( 'admin_notices', [ $this, 'adminNoticeDoesNotMeetRequirements' ] );
240
  if ( !empty( $this->reqs_not_met ) ) {
241
  $this->getRenderer()
242
  ->setTemplate( 'notices/does-not-meet-requirements.twig' )
243
+ ->setTemplateEngineTwig()
244
  ->setRenderVars( [
245
  'strings' => [
246
  'not_met' => 'Shield Security Plugin - minimum site requirements are not met',
249
  'more_information' => 'Click here for more information on requirements'
250
  ],
251
  'hrefs' => [
252
+ 'more_information' => 'https://shsec.io/shieldsystemrequirements'
253
  ]
254
  ] )
255
  ->display();
621
  if ( !empty( $updates->response ) && isset( $updates->response[ $file ] ) ) {
622
  $reqs = $this->cfg->upgrade_reqs;
623
  if ( is_array( $reqs ) ) {
624
+ $DB = Services::WpDb();
625
+ foreach ( $reqs as $shieldVer => $verReqs ) {
626
+ $toHide = version_compare( $updates->response[ $file ]->new_version, $shieldVer, '>=' )
627
+ && (
628
+ !Services::Data()->getPhpVersionIsAtLeast( $verReqs[ 'php' ] )
629
+ || !Services::WpGeneral()->getWordpressIsAtLeastVersion( $verReqs[ 'wp' ] )
630
+ || ( !empty( $verReqs[ 'mysql' ] ) &&
631
+ version_compare( $DB->loadWpdb()->db_version(), $verReqs[ 'mysql' ], '<' ) )
632
+ );
633
+ if ( $toHide ) {
634
  unset( $updates->response[ $file ] );
635
  break;
636
  }
src/lib/src/Databases/Base/Traits/Select_IPTable.php CHANGED
@@ -12,12 +12,12 @@ trait Select_IPTable {
12
  public function getDistinctIps() :array {
13
  $ips = $this->getDistinctForColumn( 'ip' );
14
  if ( $this->getDbH()->getTableSchema()->is_ip_binary ) {
15
- $ips = array_map(
16
  function ( $binaryIP ) {
17
- return inet_ntop( $binaryIP );
18
  },
19
  $ips
20
- );
21
  }
22
  return IpListSort::Sort( $ips );
23
  }
12
  public function getDistinctIps() :array {
13
  $ips = $this->getDistinctForColumn( 'ip' );
14
  if ( $this->getDbH()->getTableSchema()->is_ip_binary ) {
15
+ $ips = array_filter( array_map(
16
  function ( $binaryIP ) {
17
+ return empty( $binaryIP ) ? '' : inet_ntop( $binaryIP );
18
  },
19
  $ips
20
+ ) );
21
  }
22
  return IpListSort::Sort( $ips );
23
  }
src/lib/src/Modules/IPs/ModCon.php CHANGED
@@ -164,6 +164,13 @@ class ModCon extends BaseShield\ModCon {
164
  if ( $dbhIPs->isReady() ) {
165
  $dbhIPs->autoCleanDb();
166
  }
 
 
 
 
 
 
 
167
  }
168
 
169
  /**
164
  if ( $dbhIPs->isReady() ) {
165
  $dbhIPs->autoCleanDb();
166
  }
167
+ $this->getDbH_BotSignal()
168
+ ->getQueryDeleter()
169
+ ->addWhereOlderThan(
170
+ Services::Request()->carbon()->subWeeks( 1 )->timestamp,
171
+ 'updated_at'
172
+ )
173
+ ->query();
174
  }
175
 
176
  /**
src/lib/src/Modules/Plugin/Lib/Debug/Collate.php CHANGED
@@ -33,7 +33,7 @@ class Collate {
33
  'Capabilities' => $this->getShieldCapabilities(),
34
  ],
35
  'System Info' => [
36
- 'PHP' => $this->getPHP(),
37
  'Environment' => $this->getEnv(),
38
  ],
39
  'WordPress Info' => [
@@ -102,6 +102,7 @@ class Collate {
102
  $root = $req->server( 'DOCUMENT_ROOT' );
103
  return [
104
  'PHP' => $phpV,
 
105
  'Memory Limit' => sprintf( '%s (Constant <code>WP_MEMORY_LIMIT: %s</code>)', ini_get( 'memory_limit' ),
106
  defined( 'WP_MEMORY_LIMIT' ) ? WP_MEMORY_LIMIT : 'not defined' ),
107
  '32/64-bit' => ( PHP_INT_SIZE === 4 ) ? 32 : 64,
33
  'Capabilities' => $this->getShieldCapabilities(),
34
  ],
35
  'System Info' => [
36
+ 'PHP & MySQL' => $this->getPHP(),
37
  'Environment' => $this->getEnv(),
38
  ],
39
  'WordPress Info' => [
102
  $root = $req->server( 'DOCUMENT_ROOT' );
103
  return [
104
  'PHP' => $phpV,
105
+ 'MySQL' => Services::WpDb()->loadWpdb()->db_version(),
106
  'Memory Limit' => sprintf( '%s (Constant <code>WP_MEMORY_LIMIT: %s</code>)', ini_get( 'memory_limit' ),
107
  defined( 'WP_MEMORY_LIMIT' ) ? WP_MEMORY_LIMIT : 'not defined' ),
108
  '32/64-bit' => ( PHP_INT_SIZE === 4 ) ? 32 : 64,
src/lib/src/Scans/Base/Utilities/IgnoreItem.php CHANGED
@@ -27,7 +27,7 @@ class IgnoreItem {
27
  $updated = $mod->getDbHandler_ScanResults()
28
  ->getQueryUpdater()
29
  ->setUpdateWheres( [
30
- 'hash' => $this->getScanItem()->generateHash()
31
  ] )
32
  ->setUpdateData( [
33
  'ignored_at' => Services::Request()->ts()
27
  $updated = $mod->getDbHandler_ScanResults()
28
  ->getQueryUpdater()
29
  ->setUpdateWheres( [
30
+ 'hash' => $this->getScanItem()->hash
31
  ] )
32
  ->setUpdateData( [
33
  'ignored_at' => Services::Request()->ts()
src/lib/src/Scans/Mal/Utilities/ItemActionHandler.php CHANGED
@@ -3,8 +3,6 @@
3
  namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Mal\Utilities;
4
 
5
  use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base;
6
- use FernleafSystems\Wordpress\Plugin\Shield\Scans\Mal;
7
- use FernleafSystems\Wordpress\Services\Utilities\WpOrg;
8
 
9
  class ItemActionHandler extends Base\Utilities\ItemActionHandler {
10
 
3
  namespace FernleafSystems\Wordpress\Plugin\Shield\Scans\Mal\Utilities;
4
 
5
  use FernleafSystems\Wordpress\Plugin\Shield\Scans\Base;
 
 
6
 
7
  class ItemActionHandler extends Base\Utilities\ItemActionHandler {
8
 
templates/twig/notices/base.twig CHANGED
@@ -1,8 +1,12 @@
1
  {% import "/common/macros.twig" as icwp_macros %}
 
 
 
 
2
  {% block notice_wrapper %}
3
 
4
  <div id="{{ unique_render_id }}"
5
- class="{{ notice_classes }} odp-admin-notice notice is-dismissible">
6
 
7
  <div class="notice-icon">
8
  <span class="dashicons dashicons-shield"></span>&nbsp;
@@ -36,17 +40,19 @@
36
  {% endblock %}
37
 
38
  {% block notice_js %}
39
- <script type="text/javascript">
40
- jQuery( document ).on(
41
- 'click',
42
- '#{{ unique_render_id }} button.notice-dismiss, #{{ unique_render_id }} a.icwp-notice-dismiss',
43
- function () {
44
- var $oContainer = jQuery( '#{{ unique_render_id }}' );
45
- jQuery.get( ajaxurl, {{ ajax.dismiss_admin_notice|raw }} );
46
- $oContainer.fadeOut( 500, function () {
47
- $oContainer.remove();
48
- } );
49
- }
50
- );
51
- </script>
 
 
52
  {% endblock %}
1
  {% import "/common/macros.twig" as icwp_macros %}
2
+
3
+ {% if unique_render_id|default('') is empty %}
4
+ {% set unique_render_id= random() %}
5
+ {% endif %}
6
  {% block notice_wrapper %}
7
 
8
  <div id="{{ unique_render_id }}"
9
+ class="{{ notice_classes|default('info') }} odp-admin-notice notice is-dismissible">
10
 
11
  <div class="notice-icon">
12
  <span class="dashicons dashicons-shield"></span>&nbsp;
40
  {% endblock %}
41
 
42
  {% block notice_js %}
43
+ {% if ajax|default([]) is not empty %}
44
+ <script type="text/javascript">
45
+ jQuery( document ).on(
46
+ 'click',
47
+ '#{{ unique_render_id }} button.notice-dismiss, #{{ unique_render_id }} a.icwp-notice-dismiss',
48
+ function () {
49
+ var $oContainer = jQuery( '#{{ unique_render_id }}' );
50
+ jQuery.get( ajaxurl, {{ ajax.dismiss_admin_notice|raw }} );
51
+ $oContainer.fadeOut( 500, function () {
52
+ $oContainer.remove();
53
+ } );
54
+ }
55
+ );
56
+ </script>
57
+ {% endif %}
58
  {% endblock %}