WP Hide & Security Enhancer - Version 1.6.0.9

Version Description

  • LiteSpeed guide on Setup interface
  • New functionality - Disable mouse right click
  • Compatibility file - JobBoardWP
  • Compatibility WP-Optimize - Clean, Compress, Cache
  • WordPress 505 compatibility tag
Download this release

Release Info

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

Code changes from version 1.6.0.8 to 1.6.0.9

compatibility/jobboardwp.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Compatibility for Plugin Name: JobBoardWP
5
+ * Compatibility checked on Version: 1.0
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+ class WPH_conflict_handle_jobboardwp
11
+ {
12
+ var $wph;
13
+
14
+ function __construct()
15
+ {
16
+ if( ! $this->is_plugin_active( ))
17
+ return FALSE;
18
+
19
+ global $wph;
20
+
21
+ $this->wph = $wph;
22
+
23
+ add_filter('upload_dir', array( $this, 'upload_dir' ), 999);
24
+
25
+ }
26
+
27
+ function is_plugin_active( )
28
+ {
29
+
30
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
31
+
32
+ if( is_plugin_active( 'jobboardwp/jobboardwp.php' ) )
33
+ return TRUE;
34
+ else
35
+ return FALSE;
36
+ }
37
+
38
+
39
+ /**
40
+ * Process the upload_dir data
41
+ *
42
+ * @param mixed $data
43
+ */
44
+ function upload_dir( $data )
45
+ {
46
+
47
+ if ( ! $this->check_backtrace_for_caller( array ( array ( 'get_upload_url', 'jb\common\Filesystem') , array ('validate_fields', 'WP_Job_Manager_Form_Submit_Job') ) ) )
48
+ return $data;
49
+
50
+ global $wph;
51
+
52
+ $new_upload_path = $wph->functions->untrailingslashit_all( $wph->functions->get_module_item_setting('new_upload_path') );
53
+ $new_content_path = $wph->functions->untrailingslashit_all( $wph->functions->get_module_item_setting('new_content_path') );
54
+
55
+ if ( empty ( $new_upload_path ) && empty ( $new_content_path ) )
56
+ return $data;
57
+
58
+ if ( ! empty ( $new_upload_path ) )
59
+ {
60
+ $new_url = trailingslashit( home_url() ) . $new_upload_path;
61
+
62
+ if ( is_multisite() && ! ( is_main_network() && is_main_site() && defined( 'MULTISITE' ) ) )
63
+ {
64
+ $ms_dir = '/sites/' . get_current_blog_id();
65
+ $new_url .= $ms_dir;
66
+ }
67
+ }
68
+ else
69
+ {
70
+ $new_url = trailingslashit( home_url() ) . str_replace( '/wp-content' , $new_content_path, $wph->default_variables['uploads_directory'] );
71
+ }
72
+
73
+ $data['url'] = str_replace($data['baseurl'], $new_url, $data['url']);
74
+ $data['baseurl'] = $new_url;
75
+
76
+ return $data;
77
+ }
78
+
79
+
80
+ function check_backtrace_for_caller( $groups )
81
+ {
82
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
83
+ foreach ( $groups as $group )
84
+ {
85
+ $function_name = $group[0];
86
+ $class_name = isset ( $group[1] ) ? $group[1] : FALSE;
87
+
88
+ foreach ( $backtrace as $block )
89
+ {
90
+ if ( $block['function'] == $function_name )
91
+ {
92
+ if ( $class_name === FALSE )
93
+ return TRUE;
94
+
95
+ if ( $class_name != FALSE && !isset( $block['class'] ) )
96
+ return FALSE;
97
+
98
+ if ( $block['class'] == $class_name )
99
+ return TRUE;
100
+
101
+ return FALSE;
102
+
103
+ }
104
+
105
+ }
106
+ }
107
+
108
+ return FALSE;
109
+ }
110
+
111
+ }
112
+
113
+
114
+ new WPH_conflict_handle_jobboardwp();
115
+
116
+ ?>
include/admin-interfaces/setup.class.php CHANGED
@@ -156,6 +156,19 @@
156
  }
157
 
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  if( isset( $_GET['sample-setup-completed'] ) && $_GET['sample-setup-completed'] == 'true' )
160
  {
161
  ?>
156
  }
157
 
158
 
159
+ if( $this->wph->functions->is_litespeed() === TRUE )
160
+ {
161
+ ?>
162
+ <div class="start-container title warning">
163
+ <h2><?php _e( "System notice !", 'wp-hide-security-enhancer' ) ?></h2>
164
+ </div>
165
+ <div class="container-description">
166
+ <p><?php _e( "Your site runs on LiteSpeed ! Before starting, ensure your server is properly configured and it processes the .htaccess file properly, or there might be layout and functionality breaks.", 'wp-hide-security-enhancer' ) ?> <?php _e( "For more details check at", 'wp-hide-security-enhancer' ) ?> <a target="_blank" href="https://www.wp-hide.com/setup-wp-hide-on-litespeed/">Setup WP Hide on LiteSpeed</a></p>
167
+ </div>
168
+ <?php
169
+ }
170
+
171
+
172
  if( isset( $_GET['sample-setup-completed'] ) && $_GET['sample-setup-completed'] == 'true' )
173
  {
174
  ?>
include/class.compatibility.php CHANGED
@@ -121,6 +121,9 @@
121
  //WP Job Manager
122
  include_once(WPH_PATH . 'compatibility/wp-job-manager.php');
123
 
 
 
 
124
  //WP-Optimize - Clean, Compress, Cache
125
  include_once(WPH_PATH . 'compatibility/wp-optimize.php');
126
 
@@ -145,7 +148,7 @@
145
 
146
  foreach ( $compatibility_themes as $theme_slug => $compatibility_file )
147
  {
148
- if ( strtolower( $theme->template ) == $theme_slug || strtolower( $theme->display( 'Name' ) ) == $theme_slug )
149
  {
150
  include_once(WPH_PATH . 'compatibility/themes/' . $compatibility_file );
151
  }
121
  //WP Job Manager
122
  include_once(WPH_PATH . 'compatibility/wp-job-manager.php');
123
 
124
+ //WP Job Manager
125
+ include_once(WPH_PATH . 'compatibility/jobboardwp.php');
126
+
127
  //WP-Optimize - Clean, Compress, Cache
128
  include_once(WPH_PATH . 'compatibility/wp-optimize.php');
129
 
148
 
149
  foreach ( $compatibility_themes as $theme_slug => $compatibility_file )
150
  {
151
+ if ( strtolower( $theme->template ) == $theme_slug || strtolower( $theme->name ) == $theme_slug )
152
  {
153
  include_once(WPH_PATH . 'compatibility/themes/' . $compatibility_file );
154
  }
include/functions.class.php CHANGED
@@ -802,6 +802,22 @@
802
  }
803
 
804
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
805
  function get_write_check_string()
806
  {
807
  $home_path = $this->get_home_path();
802
  }
803
 
804
 
805
+
806
+ /**
807
+ * Return if the server run Apache
808
+ *
809
+ */
810
+ function is_litespeed()
811
+ {
812
+ $is_litespeed = FALSE;
813
+ $is_litespeed = ( stripos ( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false );
814
+
815
+ return $is_litespeed;
816
+
817
+ }
818
+
819
+
820
+
821
  function get_write_check_string()
822
  {
823
  $home_path = $this->get_home_path();
modules/components/general-html.php CHANGED
@@ -70,6 +70,30 @@
70
  'processing_order' => 80
71
  );
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  $this->module_settings[] = array(
74
  'id' => 'clean_body_classes',
75
  'label' => __('Remove general classes from body tag', 'wp-hide-security-enhancer'),
@@ -335,6 +359,26 @@
335
  }
336
 
337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  function _init_clean_body_classes( $saved_field_data )
339
  {
340
  if(empty($saved_field_data) || $saved_field_data == 'no')
70
  'processing_order' => 80
71
  );
72
 
73
+
74
+ $this->module_settings[] = array(
75
+ 'id' => 'disable_mouse_right_click',
76
+ 'label' => __('Disable mouse right click', 'wp-hide-security-enhancer'),
77
+ 'description' => __('Disable mouse right click on your pages.', 'wp-hide-security-enhancer'),
78
+
79
+ 'help' => array(
80
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable right mouse click', 'wp-hide-security-enhancer'),
81
+ 'description' => __("Disable right mouse click on your pages can protect your site content from being copied.", 'wp-hide-security-enhancer') .
82
+ "<br />" . __("Some plugins, mainly visual editors, use mouse right-click, if use such code this option should be set to No.", 'wp-hide-security-enhancer'),
83
+ 'option_documentation_url' => 'https://www.wp-hide.com/documentation/remove-classes-from-html/'
84
+ ),
85
+
86
+ 'input_type' => 'radio',
87
+ 'options' => array(
88
+ 'no' => __('No', 'wp-hide-security-enhancer'),
89
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
90
+ ),
91
+ 'default_value' => 'no',
92
+
93
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
94
+ 'processing_order' => 80
95
+ );
96
+
97
  $this->module_settings[] = array(
98
  'id' => 'clean_body_classes',
99
  'label' => __('Remove general classes from body tag', 'wp-hide-security-enhancer'),
359
  }
360
 
361
 
362
+
363
+ function _init_disable_mouse_right_click( $saved_field_data )
364
+ {
365
+ if(empty($saved_field_data) || $saved_field_data == 'no')
366
+ return FALSE;
367
+
368
+ add_filter( 'wp_footer' , array ( $this, 'disable_right_mouse_click' ) );
369
+ }
370
+
371
+
372
+ function disable_right_mouse_click()
373
+ {
374
+ ?>
375
+ <script type="text/javascript">
376
+ document.addEventListener('contextmenu', event => event.preventDefault());
377
+ </script>
378
+ <?php
379
+
380
+ }
381
+
382
  function _init_clean_body_classes( $saved_field_data )
383
  {
384
  if(empty($saved_field_data) || $saved_field_data == 'no')
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: nsp-code, tdgu
3
  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.4.2
7
- Stable tag: 1.6.0.8
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress site using smart techniques. No files are changed on your server. Change default admin and wp-login urls
@@ -212,6 +212,7 @@ Since version 1.2 Change individual plugin urls which make them unrecognizable,
212
 
213
  * Remove HTML Comments
214
  * Minify Html, Css, JavaScript
 
215
  * Remove general classes from body tag
216
  * Remove ID from Menu items
217
  * Remove class from Menu items
@@ -344,6 +345,13 @@ Please get in touch with us and we'll do our best to include it for a next versi
344
 
345
  == Changelog ==
346
 
 
 
 
 
 
 
 
347
  = 1.6.0.8 =
348
  * Avoid using domain name as replacement for any option, or might conclude to wrong replacements within the outputted HTML or wrong reversed urls.
349
  * Add system reserved words as 'wp', 'admin', 'admin-ajax.php'
3
  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.5
7
+ Stable tag: 1.6.0.9
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress site using smart techniques. No files are changed on your server. Change default admin and wp-login urls
212
 
213
  * Remove HTML Comments
214
  * Minify Html, Css, JavaScript
215
+ * Disable right mouse click
216
  * Remove general classes from body tag
217
  * Remove ID from Menu items
218
  * Remove class from Menu items
345
 
346
  == Changelog ==
347
 
348
+ = 1.6.0.9 =
349
+ * LiteSpeed guide on Setup interface
350
+ * New functionality - Disable mouse right click
351
+ * Compatibility file - JobBoardWP
352
+ * Compatibility WP-Optimize - Clean, Compress, Cache
353
+ * WordPress 505 compatibility tag
354
+
355
  = 1.6.0.8 =
356
  * Avoid using domain name as replacement for any option, or might conclude to wrong replacements within the outputted HTML or wrong reversed urls.
357
  * Add system reserved words as 'wp', 'admin', 'admin-ajax.php'
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.0.8
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.0.9
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */