Shield Security for WordPress - Version 11.2.2

Version Description

Download this release

Release Info

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

Code changes from version 11.2.1 to 11.2.2

cl.json CHANGED
@@ -68,6 +68,12 @@
68
  "title": "Some plugin SQL query syntax broke on MySQL 8.",
69
  "description": [],
70
  "patch": "11.2.1"
 
 
 
 
 
 
71
  }
72
  ]
73
  },
68
  "title": "Some plugin SQL query syntax broke on MySQL 8.",
69
  "description": [],
70
  "patch": "11.2.1"
71
+ },
72
+ {
73
+ "type": "fixed",
74
+ "title": "Fatal error when initiating WP-CLI in some cases.",
75
+ "description": [],
76
+ "patch": "11.2.2"
77
  }
78
  ]
79
  },
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: 11.2.1
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: 11.2.2
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": "11.2.1",
4
- "release_timestamp": 1622024600,
5
- "build": "202105.2602",
6
  "slug_parent": "icwp",
7
  "slug_plugin": "wpsf",
8
  "human_name": "Shield Security",
1
  {
2
  "properties": {
3
+ "version": "11.2.2",
4
+ "release_timestamp": 1622036775,
5
+ "build": "202105.2603",
6
  "slug_parent": "icwp",
7
  "slug_plugin": "wpsf",
8
  "human_name": "Shield Security",
readme.txt CHANGED
@@ -8,7 +8,7 @@ Requires at least: 3.5.2
8
  Requires PHP: 7.0
9
  Recommended PHP: 7.4
10
  Tested up to: 5.7
11
- Stable tag: 11.2.1
12
  Security against hackers and brute force bots with firewall, login security hiding and hardening, Antispam, Audit Trail, Live Traffic, and much more...
13
 
14
  == Description ==
8
  Requires PHP: 7.0
9
  Recommended PHP: 7.4
10
  Tested up to: 5.7
11
+ Stable tag: 11.2.2
12
  Security against hackers and brute force bots with firewall, login security hiding and hardening, Antispam, Audit Trail, Live Traffic, and much more...
13
 
14
  == Description ==
resources/js/shield/secadmin.js CHANGED
@@ -64,7 +64,6 @@ var iCWP_WPSF_SecurityAdmin = new function () {
64
 
65
  let pinInput = document.getElementById( 'SecAdminPinInput' );
66
  shield_vars_secadmin.ajax.sec_admin_login.sec_admin_key = pinInput.value;
67
- console.log( shield_vars_secadmin.ajax.sec_admin_login );
68
 
69
  let inputContainer = document.getElementById( 'SecAdminPinInputContainer' );
70
  inputContainer.innerHTML = '<div class="spinner"></div>';
@@ -75,6 +74,7 @@ var iCWP_WPSF_SecurityAdmin = new function () {
75
  }
76
  if ( response.data ) {
77
  inputContainer.innerHTML = response.data.html;
 
78
  }
79
  else {
80
  inputContainer.innerHTML = 'There was an unknown error';
64
 
65
  let pinInput = document.getElementById( 'SecAdminPinInput' );
66
  shield_vars_secadmin.ajax.sec_admin_login.sec_admin_key = pinInput.value;
 
67
 
68
  let inputContainer = document.getElementById( 'SecAdminPinInputContainer' );
69
  inputContainer.innerHTML = '<div class="spinner"></div>';
74
  }
75
  if ( response.data ) {
76
  inputContainer.innerHTML = response.data.html;
77
+ location.reload();
78
  }
79
  else {
80
  inputContainer.innerHTML = 'There was an unknown error';
resources/js/shield/userprofile.js CHANGED
@@ -142,7 +142,7 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
142
 
143
  var showDialog = function ( success, msg ) {
144
  jQuery( '.dialog-content', $dialog ).html( msg );
145
- Shield_Dialogs.show($dialog, {
146
  title: success ? 'Success' : 'Failure',
147
  buttons: [
148
  {
@@ -155,7 +155,7 @@ jQuery.fn.ShieldUserProfile = function ( options ) {
155
  close: function ( event, ui ) {
156
  location.reload();
157
  }
158
- });
159
  };
160
 
161
  var initialise = function () {
142
 
143
  var showDialog = function ( success, msg ) {
144
  jQuery( '.dialog-content', $dialog ).html( msg );
145
+ Shield_Dialogs.show( $dialog, {
146
  title: success ? 'Success' : 'Failure',
147
  buttons: [
148
  {
155
  close: function ( event, ui ) {
156
  location.reload();
157
  }
158
+ } );
159
  };
160
 
161
  var initialise = function () {
src/lib/src/Modules/Base/WpCli.php CHANGED
@@ -23,7 +23,7 @@ class WpCli extends ExecOnceModConsumer {
23
  protected function getAllCmdHandlers() :array {
24
  return array_map(
25
  function ( $handler ) {
26
- $handler->setMod( $this->getMod() );
27
  },
28
  array_merge(
29
  [ new ModuleStandard() ],
23
  protected function getAllCmdHandlers() :array {
24
  return array_map(
25
  function ( $handler ) {
26
+ return $handler->setMod( $this->getMod() );
27
  },
28
  array_merge(
29
  [ new ModuleStandard() ],
src/lib/src/Modules/SecurityAdmin/AjaxHandler.php CHANGED
@@ -11,27 +11,23 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
11
 
12
  switch ( $action ) {
13
  case 'sec_admin_check':
14
- $aResponse = $this->ajaxExec_SecAdminCheck();
15
  break;
16
 
17
  case 'sec_admin_login':
18
  case 'restricted_access':
19
- $aResponse = $this->ajaxExec_SecAdminLogin();
20
- break;
21
-
22
- case 'sec_admin_login_box':
23
- $aResponse = $this->ajaxExec_SecAdminLoginBox();
24
  break;
25
 
26
  case 'req_email_remove':
27
- $aResponse = $this->ajaxExec_SendEmailRemove();
28
  break;
29
 
30
  default:
31
- $aResponse = parent::processAjaxAction( $action );
32
  }
33
 
34
- return $aResponse;
35
  }
36
 
37
  private function ajaxExec_SecAdminCheck() :array {
@@ -67,7 +63,7 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
67
  else {
68
  $msg .= __( "No attempts remaining.", 'wp-simple-firewall' );
69
  }
70
- $html = $this->renderAdminAccessAjaxLoginForm( $msg );
71
  }
72
 
73
  return [
@@ -78,13 +74,6 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
78
  ];
79
  }
80
 
81
- private function ajaxExec_SecAdminLoginBox() :array {
82
- return [
83
- 'success' => true,
84
- 'html' => $this->renderAdminAccessAjaxLoginForm()
85
- ];
86
- }
87
-
88
  private function ajaxExec_SendEmailRemove() :array {
89
  ( new Lib\SecurityAdmin\Ops\RemoveSecAdmin() )
90
  ->setMod( $this->getMod() )
@@ -94,17 +83,4 @@ class AjaxHandler extends Shield\Modules\BaseShield\AjaxHandler {
94
  'message' => __( 'Email sent. Please ensure the confirmation link opens in THIS browser window.' ),
95
  ];
96
  }
97
-
98
- private function renderAdminAccessAjaxLoginForm( string $msg = '' ) :string {
99
- /** @var ModCon $mod */
100
- $mod = $this->getMod();
101
- return $mod->renderTemplate( 'snippets/admin_access_login', [
102
- 'ajax' => [
103
- 'sec_admin_login' => json_encode( $mod->getSecAdminLoginAjaxData() )
104
- ],
105
- 'strings' => [
106
- 'access_message' => empty( $msg ) ? __( 'Enter your Security Admin PIN', 'wp-simple-firewall' ) : $msg
107
- ]
108
- ] );
109
- }
110
  }
11
 
12
  switch ( $action ) {
13
  case 'sec_admin_check':
14
+ $response = $this->ajaxExec_SecAdminCheck();
15
  break;
16
 
17
  case 'sec_admin_login':
18
  case 'restricted_access':
19
+ $response = $this->ajaxExec_SecAdminLogin();
 
 
 
 
20
  break;
21
 
22
  case 'req_email_remove':
23
+ $response = $this->ajaxExec_SendEmailRemove();
24
  break;
25
 
26
  default:
27
+ $response = parent::processAjaxAction( $action );
28
  }
29
 
30
+ return $response;
31
  }
32
 
33
  private function ajaxExec_SecAdminCheck() :array {
63
  else {
64
  $msg .= __( "No attempts remaining.", 'wp-simple-firewall' );
65
  }
66
+ $html = $mod->getSecurityAdminController()->renderPinLoginForm();
67
  }
68
 
69
  return [
74
  ];
75
  }
76
 
 
 
 
 
 
 
 
77
  private function ajaxExec_SendEmailRemove() :array {
78
  ( new Lib\SecurityAdmin\Ops\RemoveSecAdmin() )
79
  ->setMod( $this->getMod() )
83
  'message' => __( 'Email sent. Please ensure the confirmation link opens in THIS browser window.' ),
84
  ];
85
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  }
src/lib/src/Modules/SecurityAdmin/Lib/SecurityAdmin/SecurityAdminController.php CHANGED
@@ -157,14 +157,12 @@ class SecurityAdminController extends ExecOnceModConsumer {
157
  ( $this->isCurrentlySecAdmin() || $this->verifyPinRequest() );
158
  }
159
 
160
- public function printPinLoginForm() {
161
  /** @var ModCon $mod */
162
  $mod = $this->getMod();
163
  /** @var Options $opts */
164
  $opts = $this->getOptions();
165
-
166
- add_thickbox();
167
- echo $mod->renderTemplate( '/components/security_admin/login_box.twig', [
168
  'flags' => [
169
  'restrict_options' => $opts->getAdminAccessArea_Options()
170
  ],
@@ -172,12 +170,16 @@ class SecurityAdminController extends ExecOnceModConsumer {
172
  'access_message' => __( 'Enter your Security Admin PIN', 'wp-simple-firewall' ),
173
  ],
174
  'ajax' => [
175
- 'sec_admin_login' => $mod->getAjaxActionData( 'sec_admin_login', true ),
176
- 'sec_admin_login_box' => $mod->getAjaxActionData( 'sec_admin_login_box', true )
177
  ]
178
  ] );
179
  }
180
 
 
 
 
 
 
181
  public function verifyPinRequest() :bool {
182
  if ( !isset( $this->validPinRequest ) ) {
183
  $this->validPinRequest = ( new Ops\VerifyPinRequest() )
157
  ( $this->isCurrentlySecAdmin() || $this->verifyPinRequest() );
158
  }
159
 
160
+ public function renderPinLoginForm() :string {
161
  /** @var ModCon $mod */
162
  $mod = $this->getMod();
163
  /** @var Options $opts */
164
  $opts = $this->getOptions();
165
+ return $mod->renderTemplate( '/components/security_admin/login_box.twig', [
 
 
166
  'flags' => [
167
  'restrict_options' => $opts->getAdminAccessArea_Options()
168
  ],
170
  'access_message' => __( 'Enter your Security Admin PIN', 'wp-simple-firewall' ),
171
  ],
172
  'ajax' => [
173
+ 'sec_admin_login' => $mod->getAjaxActionData( 'sec_admin_login', true ),
 
174
  ]
175
  ] );
176
  }
177
 
178
+ public function printPinLoginForm() {
179
+ add_thickbox();
180
+ echo $this->renderPinLoginForm();
181
+ }
182
+
183
  public function verifyPinRequest() :bool {
184
  if ( !isset( $this->validPinRequest ) ) {
185
  $this->validPinRequest = ( new Ops\VerifyPinRequest() )
templates/twig/components/security_admin/login_box.twig CHANGED
@@ -28,41 +28,4 @@
28
  vertical-align: middle;
29
  width: 180px;
30
  }
31
- </style>
32
-
33
- <script type="text/javascript">
34
-
35
- {# let $oThisAAL = jQuery( '#AdminInputHolder' );#}
36
- {# let $oInput = jQuery( 'input', $oThisAAL );#}
37
- {# jQuery( document ).ready(#}
38
- {# function () {#}
39
-
40
- {# jQuery( document ).on( 'click', '#SecAdminDialog button', submit_admin_access );#}
41
- {# jQuery( 'input', $oThisAAL ).keypress( function ( e ) {#}
42
- {# if ( e.which === 13 ) {#}
43
- {# submit_admin_access();#}
44
- {# }#}
45
- {# } );#}
46
- {# }#}
47
- {# );#}
48
-
49
- {# function submit_admin_access() {#}
50
- {# $oThisAAL.html( '<div class="spinner"></div>' );#}
51
- {# jQuery( 'input', $oThisAAL ).prop( 'disabled', true );#}
52
-
53
- {# var requestData = {{ ajax.sec_admin_login|raw }};#}
54
- {# requestData[ 'sec_admin_key' ] = $oInput.val();#}
55
-
56
- {# jQuery.post( ajaxurl, requestData, function ( oResponse ) {#}
57
- {# if ( oResponse.success ) {#}
58
- {# location.reload();#}
59
- {# }#}
60
- {# if ( oResponse.data ) {#}
61
- {# $oThisAAL.html( oResponse.data.html );#}
62
- {# }#}
63
- {# else {#}
64
- {# $oThisAAL.html( 'There was an unknown error' );#}
65
- {# }#}
66
- {# } );#}
67
- {# }#}
68
- </script>
28
  vertical-align: middle;
29
  width: 180px;
30
  }
31
+ </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/twig/components/security_admin/verify_modal.twig ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <div id="ShieldSecAdminDialog" class="shield_dialog"
2
+ style="display: none"
3
+ aria-hidden="true"
4
+ aria-labelledby="my-dialog-title"
5
+ aria-describedby="my-dialog-description">
6
+ <div class="dialog-content" role="document"></div>
7
+ </div>