WP Hide & Security Enhancer - Version 1.6.3.8

Version Description

  • New option for JSON REST module - "Clean the REST API response"
  • Relocated Feed tab to Rewrite module
Download this release

Release Info

Developer nsp-code
Plugin Icon 128x128 WP Hide & Security Enhancer
Version 1.6.3.8
Comparing to
See all releases

Code changes from version 1.6.3.7 to 1.6.3.8

modules/components/rewrite-json-rest.php CHANGED
@@ -12,7 +12,30 @@
12
 
13
  function get_module_settings()
14
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
 
 
16
  $this->module_settings[] = array(
17
  'id' => 'disable_json_rest_v1',
18
  'label' => __('Disable JSON REST V1 service', 'wp-hide-security-enhancer'),
@@ -193,7 +216,29 @@
193
  return $this->module_settings;
194
  }
195
 
 
 
 
 
 
 
 
 
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
  function _init_disable_json_rest_v1($saved_field_data)
199
  {
12
 
13
  function get_module_settings()
14
  {
15
+ $this->module_settings[] = array(
16
+ 'id' => 'clean_json_base_route',
17
+ 'label' => __('Clean the REST API response', 'wp-hide-security-enhancer'),
18
+ 'description' => __('As default, when calling the REST API base route ( e.g. /wp-json/ ) the service outputs all available namespaces and routes.', 'wp-hide-security-enhancer'),
19
+
20
+ 'help' => array(
21
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Clean the REST API response', 'wp-hide-security-enhancer'),
22
+ 'description' => __("When calling the site REST API base route ( e.g. /wp-json/ or ?rest_route=/ ) the service outputs all available namespaces and routes for current site. This can be a breach for the system, as outputs important information regarding certain used theme and plugins. ", 'wp-hide-security-enhancer') .
23
+ "<br /><br />" . __("Recommended selection for this option is Yes, to ensure no inside data is being exposed. ", 'wp-hide-security-enhancer'),
24
+ 'option_documentation_url' => 'https://www.wp-hide.com/documentation/rewrite-json-rest/'
25
+ ),
26
+
27
+ 'input_type' => 'radio',
28
+ 'options' => array(
29
+ 'no' => __('No', 'wp-hide-security-enhancer'),
30
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
31
+ ),
32
+ 'default_value' => 'no',
33
+
34
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
35
+ 'processing_order' => 58
36
 
37
+ );
38
+
39
  $this->module_settings[] = array(
40
  'id' => 'disable_json_rest_v1',
41
  'label' => __('Disable JSON REST V1 service', 'wp-hide-security-enhancer'),
216
  return $this->module_settings;
217
  }
218
 
219
+ function _init_clean_json_base_route( $saved_field_data )
220
+ {
221
+ if(empty($saved_field_data) || $saved_field_data == 'no')
222
+ return FALSE;
223
+
224
+ add_filter( 'rest_request_after_callbacks', array ( $this, 'rest_request_after_callbacks'), 999, 3 );
225
+
226
+ }
227
 
228
+ function rest_request_after_callbacks( $response, $handler, $request )
229
+ {
230
+
231
+ if ( $request->get_route() != '/' )
232
+ return $response;
233
+
234
+ if ( isset ( $response->data ) && isset ( $response->data['namespaces'] ) && is_array ( $response->data['namespaces'] ) )
235
+ {
236
+ $response->data['namespaces'] = array();
237
+ $response->data['routes'] = array();
238
+ }
239
+
240
+ return $response;
241
+ }
242
 
243
  function _init_disable_json_rest_v1($saved_field_data)
244
  {
modules/module-general.php CHANGED
@@ -14,10 +14,7 @@
14
 
15
  include(WPH_PATH . "/modules/components/general-admin-bar.php");
16
  $this->components[] = new WPH_module_general_admin_bar();
17
-
18
- include(WPH_PATH . "/modules/components/general-feed.php");
19
- $this->components[] = new WPH_module_general_feed();
20
-
21
  include(WPH_PATH . "/modules/components/general-robots-txt.php");
22
  $this->components[] = new WPH_module_general_robots_txt();
23
 
14
 
15
  include(WPH_PATH . "/modules/components/general-admin-bar.php");
16
  $this->components[] = new WPH_module_general_admin_bar();
17
+
 
 
 
18
  include(WPH_PATH . "/modules/components/general-robots-txt.php");
19
  $this->components[] = new WPH_module_general_robots_txt();
20
 
modules/module-rewrite.php CHANGED
@@ -42,6 +42,9 @@
42
  include(WPH_PATH . "/modules/components/rewrite-json-rest.php");
43
  $this->components[] = new WPH_module_rewrite_json_rest();
44
 
 
 
 
45
  include(WPH_PATH . "/modules/components/rewrite-root-files.php");
46
  $this->components[] = new WPH_module_rewrite_root_files();
47
 
42
  include(WPH_PATH . "/modules/components/rewrite-json-rest.php");
43
  $this->components[] = new WPH_module_rewrite_json_rest();
44
 
45
+ include(WPH_PATH . "/modules/components/general-feed.php");
46
+ $this->components[] = new WPH_module_general_feed();
47
+
48
  include(WPH_PATH . "/modules/components/rewrite-root-files.php");
49
  $this->components[] = new WPH_module_rewrite_root_files();
50
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.nsp-code.com/
4
  Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, wp-admin, admin hide, login change,
5
  Requires at least: 2.8
6
  Tested up to: 5.8
7
- Stable tag: 1.6.3.7
8
  License: GPLv2 or later
9
 
10
  Hide WordPress default paths, wp-content, wp-includes, wp-admin, login URL, plugins, themes etc. Block the defaults for being still accessible. No files and data are changed on your server.
@@ -355,6 +355,10 @@ Please get in touch with us and we'll do our best to include it for a next versi
355
 
356
  == Changelog ==
357
 
 
 
 
 
358
  = 1.6.3.7 =
359
  * Output the help title only if there's an help section available through the module settings
360
  * Fix undefined $found_issues
4
  Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, wp-admin, admin hide, login change,
5
  Requires at least: 2.8
6
  Tested up to: 5.8
7
+ Stable tag: 1.6.3.8
8
  License: GPLv2 or later
9
 
10
  Hide WordPress default paths, wp-content, wp-includes, wp-admin, login URL, plugins, themes etc. Block the defaults for being still accessible. No files and data are changed on your server.
355
 
356
  == Changelog ==
357
 
358
+ = 1.6.3.8 =
359
+ * New option for JSON REST module - "Clean the REST API response"
360
+ * Relocated Feed tab to Rewrite module
361
+
362
  = 1.6.3.7 =
363
  * Output the help title only if there's an help section available through the module settings
364
  * Fix undefined $found_issues
wp-hide.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.wp-hide.com/
5
  Description: Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
6
  Author: Nsp Code
7
  Author URI: http://www.nsp-code.com
8
- Version: 1.6.3.7
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */
5
  Description: Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
6
  Author: Nsp Code
7
  Author URI: http://www.nsp-code.com
8
+ Version: 1.6.3.8
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */