WP Hide & Security Enhancer - Version 1.8.3

Version Description

  • New options interface - User Interactions: Disable Mouse right click, Disable Text Selection, Disable Copy / Paste, Disable Print, Disable Print Screen, Disable Developer Tools, Disable View Source, Disable Drag / Drop
  • Better accessibility for additional details regarding each of the options.
  • Improved progress score calculation for Headers.
  • A2 Optimized WP - compatibility fix.
  • WordPress 6.0.2 tag compatibility update
  • Fix CDN option external help page URL.
Download this release

Release Info

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

Code changes from version 1.8.1 to 1.8.3

assets/css/wph.css CHANGED
@@ -27,7 +27,7 @@
27
  #wph-check-headers {padding-top: 30px;}
28
  #wph-check-headers .spinner {float: none}
29
 
30
- .wph_input { border: 0 none; background: #fff; width: 50%}
31
 
32
  .wph_input .dashicons {overflow: hidden}
33
  .wph_input .options {float: right; display: flex; margin: 0px; padding-top: 5px}
@@ -56,8 +56,8 @@
56
  .wph_input .options_text .button {margin-left: 10px}
57
 
58
 
59
- .wph_input { border: 0 none; background: #fff; width: 50%}
60
- .wph_input.full_width {width: 100%;}
61
  .wph_input .row.cell { padding: 10px 12px; border-top: 1px solid #f5f5f5; border-bottom: 0 none; width: 100%;box-sizing: border-box; line-height: 1.5em;}
62
  .wph_input .row.cell.np {padding: 0px}
63
  .wph_input .row:first-child.cell,
@@ -165,13 +165,14 @@ table .select.multiple {height: 82px}
165
 
166
 
167
 
168
- .wph_help {width: 50%; background-color: #f9f9f9; padding: 0 20px; box-sizing: border-box; overflow: hidden; position:relative; border-left: 1px solid #f1f1f1}
169
  .wph_help::before { color: #ececec; content: "\f118";; display: block; font-family: dashicons; font-size: 232px; line-height: 1; position: absolute; right: 20px; text-align: center; top: 10%; width: 1em; z-index: 1}
170
  .wph_help .text {max-width: 670px; position: relative; z-index: 1;}
171
  .wph_help .text p {font-size: 12px; color: #999;}
172
  .wph_help .text p br {content: ""; margin: 3px; display: block; font-size: 24%;}
173
  .wph_help .text p a {text-decoration: none}
174
  .wph_help .text p .important {color: #d54e21;}
 
175
 
176
  .inner_table tbody tr td {padding-bottom: 12px}
177
  .inner_table .description {margin-bottom: 3px; font-style: normal;}
27
  #wph-check-headers {padding-top: 30px;}
28
  #wph-check-headers .spinner {float: none}
29
 
30
+ .wph_input { border: 0 none; background: #fff; width: 50%; flex-shrink: 0;}
31
 
32
  .wph_input .dashicons {overflow: hidden}
33
  .wph_input .options {float: right; display: flex; margin: 0px; padding-top: 5px}
56
  .wph_input .options_text .button {margin-left: 10px}
57
 
58
 
59
+ .wph_input { border: 0 none; background: #fff; width: 50%; max-width: 600px}
60
+ .wph_input.full_width {width: 100%; max-width: none;}
61
  .wph_input .row.cell { padding: 10px 12px; border-top: 1px solid #f5f5f5; border-bottom: 0 none; width: 100%;box-sizing: border-box; line-height: 1.5em;}
62
  .wph_input .row.cell.np {padding: 0px}
63
  .wph_input .row:first-child.cell,
165
 
166
 
167
 
168
+ .wph_help {background-color: #f9f9f9; padding: 0 20px; box-sizing: border-box; overflow: hidden; position:relative; border-left: 1px solid #f1f1f1; flex-grow: 1;}
169
  .wph_help::before { color: #ececec; content: "\f118";; display: block; font-family: dashicons; font-size: 232px; line-height: 1; position: absolute; right: 20px; text-align: center; top: 10%; width: 1em; z-index: 1}
170
  .wph_help .text {max-width: 670px; position: relative; z-index: 1;}
171
  .wph_help .text p {font-size: 12px; color: #999;}
172
  .wph_help .text p br {content: ""; margin: 3px; display: block; font-size: 24%;}
173
  .wph_help .text p a {text-decoration: none}
174
  .wph_help .text p .important {color: #d54e21;}
175
+ .wph_help .text .button {background-color: #FFF; font-size: 12px}
176
 
177
  .inner_table tbody tr td {padding-bottom: 12px}
178
  .inner_table .description {margin-bottom: 3px; font-style: normal;}
compatibility/a2-optimized.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Compatibility : A2 Optimized WP
6
+ * Introduced at : 2.1.4.6.2.2
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
10
+
11
+ class WPH_conflict_handle_a2_optimized_wp
12
+ {
13
+
14
+ var $wph;
15
+
16
+ function __construct()
17
+ {
18
+ if( ! $this->is_plugin_active() )
19
+ return FALSE;
20
+
21
+ global $wph;
22
+
23
+ $this->wph = $wph;
24
+
25
+ add_filter( 'a2opt_cache_page_contents_before_store', array( $this, 'proces_html_buffer'), 999 );
26
+
27
+ }
28
+
29
+ static function is_plugin_active()
30
+ {
31
+
32
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
33
+
34
+ if(is_plugin_active( 'a2-optimized-wp/a2-optimized.php' ))
35
+ return TRUE;
36
+ else
37
+ return FALSE;
38
+ }
39
+
40
+ static function proces_html_buffer( $buffer )
41
+ {
42
+
43
+ $buffer = $this->wph->ob_start_callback( $buffer );
44
+
45
+ return $buffer;
46
+
47
+ }
48
+
49
+ }
50
+
51
+
52
+ new WPH_conflict_handle_a2_optimized_wp();
53
+
54
+
55
+ ?>
include/admin-interface.class.php CHANGED
@@ -426,6 +426,7 @@
426
  <?php if ( $module_setting['help'] !== FALSE ) { ?>
427
  <h4><?php echo $module_setting['help']['title'] ?></h4>
428
  <p><?php echo $module_setting['help']['description'] ?></p>
 
429
  <?php } else { ?>
430
  <p>There is no help available for this option.</p>
431
  <?php }?>
426
  <?php if ( $module_setting['help'] !== FALSE ) { ?>
427
  <h4><?php echo $module_setting['help']['title'] ?></h4>
428
  <p><?php echo $module_setting['help']['description'] ?></p>
429
+ <?php if ( ! empty ( $module_setting['help']['option_documentation_url'] ) ) { ?> <br /> <a class="button read_more" target="_blank" href="<?php echo $module_setting['help']['option_documentation_url'] ?>">Read More</a> <br /><br /><?php } ?>
430
  <?php } else { ?>
431
  <p>There is no help available for this option.</p>
432
  <?php }?>
include/class.compatibility.php CHANGED
@@ -85,6 +85,7 @@
85
  include_once(WPH_PATH . 'compatibility/oxygen.php');
86
  include_once(WPH_PATH . 'compatibility/translatepress-multilingual.php');
87
  include_once(WPH_PATH . 'compatibility/wp-cloudflare-page-cache.php');
 
88
 
89
  /**
90
  * Themes
85
  include_once(WPH_PATH . 'compatibility/oxygen.php');
86
  include_once(WPH_PATH . 'compatibility/translatepress-multilingual.php');
87
  include_once(WPH_PATH . 'compatibility/wp-cloudflare-page-cache.php');
88
+ include_once(WPH_PATH . 'compatibility/a2-optimized.php');
89
 
90
  /**
91
  * Themes
modules/components/cdn-setup.php CHANGED
@@ -22,7 +22,7 @@
22
  "<br /><br />" . __('Sample CDN url:', 'wp-hide-security-enhancer') .
23
  "<br /><code>cdnjs.cloudflare.com</code><br /><br />" .
24
  __('Enter a CDN Url to allow the plugin to process assets provided through CDN service.', 'wp-hide-security-enhancer'),
25
- 'option_documentation_url' => 'https://wp-hide.com/documentation/admin-change-wp-admin/'
26
  ),
27
 
28
  'input_type' => 'text',
22
  "<br /><br />" . __('Sample CDN url:', 'wp-hide-security-enhancer') .
23
  "<br /><code>cdnjs.cloudflare.com</code><br /><br />" .
24
  __('Enter a CDN Url to allow the plugin to process assets provided through CDN service.', 'wp-hide-security-enhancer'),
25
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/cdn-cdn-url/'
26
  ),
27
 
28
  'input_type' => 'text',
modules/components/general-html.php CHANGED
@@ -69,30 +69,7 @@
69
  'sanitize_type' => array('sanitize_title', 'strtolower'),
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://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',
@@ -367,27 +344,7 @@
367
 
368
  }
369
 
370
-
371
-
372
- function _init_disable_mouse_right_click( $saved_field_data )
373
- {
374
- if(empty($saved_field_data) || $saved_field_data == 'no')
375
- return FALSE;
376
-
377
- add_filter( 'wp_footer' , array ( $this, 'disable_right_mouse_click' ) );
378
- }
379
-
380
-
381
- function disable_right_mouse_click()
382
- {
383
- ?>
384
- <script type="text/javascript">
385
- document.addEventListener('contextmenu', event => event.preventDefault());
386
- </script>
387
- <?php
388
-
389
- }
390
-
391
  function _init_clean_body_classes( $saved_field_data )
392
  {
393
  if(empty($saved_field_data) || $saved_field_data == 'no')
69
  'sanitize_type' => array('sanitize_title', 'strtolower'),
70
  'processing_order' => 80
71
  );
72
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  $this->module_settings[] = array(
75
  'id' => 'clean_body_classes',
344
 
345
  }
346
 
347
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  function _init_clean_body_classes( $saved_field_data )
349
  {
350
  if(empty($saved_field_data) || $saved_field_data == 'no')
modules/components/general-user-interactions.php ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ class WPH_module_general_user_interactions extends WPH_module_component
6
+ {
7
+
8
+ public $buffer = '';
9
+ public $placeholders = array();
10
+ public $placeholder_hash = '';
11
+
12
+ function get_component_title()
13
+ {
14
+ return "User Interactions";
15
+ }
16
+
17
+ function get_module_settings()
18
+ {
19
+
20
+
21
+
22
+ $this->module_settings[] = array(
23
+ 'id' => 'disable_mouse_right_click',
24
+ 'label' => __('Disable Mouse right click', 'wp-hide-security-enhancer'),
25
+ 'description' => __('Disable mouse right click on your pages.', 'wp-hide-security-enhancer'),
26
+
27
+ 'help' => array(
28
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable right Mouse click', 'wp-hide-security-enhancer'),
29
+ 'description' => __("Disable right mouse click on your pages can protect your site content from being copied.", 'wp-hide-security-enhancer') .
30
+ "<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'),
31
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
32
+ ),
33
+
34
+ 'input_type' => 'radio',
35
+ 'options' => array(
36
+ 'no' => __('No', 'wp-hide-security-enhancer'),
37
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
38
+ ),
39
+ 'default_value' => 'no',
40
+
41
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
42
+ 'processing_order' => 80
43
+ );
44
+
45
+ $this->module_settings[] = array(
46
+ 'id' => 'disable_text_selection',
47
+ 'label' => __('Disable Text Selection', 'wp-hide-security-enhancer'),
48
+ 'description' => __('Disable Text Selection on your pages.', 'wp-hide-security-enhancer'),
49
+
50
+ 'help' => array(
51
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable Text Selection', 'wp-hide-security-enhancer'),
52
+ 'description' => __("When the option is active, the text selection on pages is not possible.", 'wp-hide-security-enhancer') .
53
+ "<br />" . __("This is useful when don't want the site texts to be copied.", 'wp-hide-security-enhancer'),
54
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
55
+ ),
56
+
57
+ 'input_type' => 'radio',
58
+ 'options' => array(
59
+ 'no' => __('No', 'wp-hide-security-enhancer'),
60
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
61
+ ),
62
+ 'default_value' => 'no',
63
+
64
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
65
+ 'processing_order' => 80
66
+ );
67
+
68
+ $this->module_settings[] = array(
69
+ 'id' => 'disable_copy_paste',
70
+ 'label' => __('Disable Copy / Paste', 'wp-hide-security-enhancer'),
71
+ 'description' => __('Disable text copy and paste on your pages.', 'wp-hide-security-enhancer'),
72
+
73
+ 'help' => array(
74
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable Copy / Paste', 'wp-hide-security-enhancer'),
75
+ 'description' => __("Through the option copy and paste browser functionality is disabled.", 'wp-hide-security-enhancer') ,
76
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
77
+ ),
78
+
79
+ 'input_type' => 'radio',
80
+ 'options' => array(
81
+ 'no' => __('No', 'wp-hide-security-enhancer'),
82
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
83
+ ),
84
+ 'default_value' => 'no',
85
+
86
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
87
+ 'processing_order' => 80
88
+ );
89
+
90
+ $this->module_settings[] = array(
91
+ 'id' => 'disable_print',
92
+ 'label' => __('Disable Print', 'wp-hide-security-enhancer'),
93
+ 'description' => __('Disable Print function on your pages.', 'wp-hide-security-enhancer'),
94
+
95
+ 'help' => array(
96
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable Print', 'wp-hide-security-enhancer'),
97
+ 'description' => __("When using the option, the browser Print dialogue is not available so a site print is disabled.", 'wp-hide-security-enhancer'),
98
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
99
+ ),
100
+
101
+ 'input_type' => 'radio',
102
+ 'options' => array(
103
+ 'no' => __('No', 'wp-hide-security-enhancer'),
104
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
105
+ ),
106
+ 'default_value' => 'no',
107
+
108
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
109
+ 'processing_order' => 80
110
+ );
111
+
112
+ $this->module_settings[] = array(
113
+ 'id' => 'disable_print_screen',
114
+ 'label' => __('Disable Print Screen', 'wp-hide-security-enhancer'),
115
+ 'description' => __('Disable Print Screen function on your pages.', 'wp-hide-security-enhancer'),
116
+
117
+ 'help' => array(
118
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable Print Screen', 'wp-hide-security-enhancer'),
119
+ 'description' => __("The Print Screen function captures an image of the entire screen and copies it to the Clipboard in the computer's memory.", 'wp-hide-security-enhancer') .
120
+ "<br />" . __("If the functionality is not required, the option helps to disable it.", 'wp-hide-security-enhancer'),
121
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
122
+ ),
123
+
124
+ 'input_type' => 'radio',
125
+ 'options' => array(
126
+ 'no' => __('No', 'wp-hide-security-enhancer'),
127
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
128
+ ),
129
+ 'default_value' => 'no',
130
+
131
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
132
+ 'processing_order' => 80
133
+ );
134
+
135
+ $this->module_settings[] = array(
136
+ 'id' => 'disable_developer_tools',
137
+ 'label' => __('Disable Developer Tools', 'wp-hide-security-enhancer'),
138
+ 'description' => __('Disable the browser Developr Tools on your pages.', 'wp-hide-security-enhancer'),
139
+
140
+ 'help' => array(
141
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable Developer Tools', 'wp-hide-security-enhancer'),
142
+ 'description' => __("Every modern web browser includes a powerful tool called Developer Tools. Through the application, a user can inspect currently-loaded HTML, CSS and JavaScript.", 'wp-hide-security-enhancer') .
143
+ "<br />" . __("To prevent the user from deeply checking into your site architecture, the functionality can be disabled using this option. ", 'wp-hide-security-enhancer'),
144
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
145
+ ),
146
+
147
+ 'input_type' => 'radio',
148
+ 'options' => array(
149
+ 'no' => __('No', 'wp-hide-security-enhancer'),
150
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
151
+ ),
152
+ 'default_value' => 'no',
153
+
154
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
155
+ 'processing_order' => 80
156
+ );
157
+
158
+ $this->module_settings[] = array(
159
+ 'id' => 'disable_view_source',
160
+ 'label' => __('Disable View Source', 'wp-hide-security-enhancer'),
161
+ 'description' => __('Disable the browser view source on your pages.', 'wp-hide-security-enhancer'),
162
+
163
+ 'help' => array(
164
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable View Source', 'wp-hide-security-enhancer'),
165
+ 'description' => __("The page source is an HTML set of tags code. An HTML tag is an element that, along with CSS and JavaScript, tells the Web browser what to do and how to display the text and images.", 'wp-hide-security-enhancer') ,
166
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
167
+ ),
168
+
169
+ 'input_type' => 'radio',
170
+ 'options' => array(
171
+ 'no' => __('No', 'wp-hide-security-enhancer'),
172
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
173
+ ),
174
+ 'default_value' => 'no',
175
+
176
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
177
+ 'processing_order' => 80
178
+ );
179
+
180
+ $this->module_settings[] = array(
181
+ 'id' => 'disable_drag_drop',
182
+ 'label' => __('Disable Drag / Drop', 'wp-hide-security-enhancer'),
183
+ 'description' => __('Disable the browser drag and drop for images on your pages.', 'wp-hide-security-enhancer'),
184
+
185
+ 'help' => array(
186
+ 'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Disable Drag / Drop', 'wp-hide-security-enhancer'),
187
+ 'description' => __("The Drag and Drop operation describes the action o selecting an object or text on the page and moving it to a different area.", 'wp-hide-security-enhancer'),
188
+ 'option_documentation_url' => 'https://wp-hide.com/documentation/user-interactions/'
189
+ ),
190
+
191
+ 'input_type' => 'radio',
192
+ 'options' => array(
193
+ 'no' => __('No', 'wp-hide-security-enhancer'),
194
+ 'yes' => __('Yes', 'wp-hide-security-enhancer'),
195
+ ),
196
+ 'default_value' => 'no',
197
+
198
+ 'sanitize_type' => array('sanitize_title', 'strtolower'),
199
+ 'processing_order' => 80
200
+ );
201
+
202
+ return $this->module_settings;
203
+ }
204
+
205
+
206
+
207
+
208
+ function _init_disable_mouse_right_click( $saved_field_data )
209
+ {
210
+
211
+ add_filter( 'wp_footer' , array ( $this, 'disable_right_mouse_click' ) );
212
+ }
213
+
214
+
215
+ function disable_right_mouse_click()
216
+ {
217
+
218
+ $disable_mouse_right_click = $this->wph->functions->get_module_item_setting('disable_mouse_right_click');
219
+ $disable_text_selection = $this->wph->functions->get_module_item_setting('disable_text_selection');
220
+ $disable_copy_paste = $this->wph->functions->get_module_item_setting('disable_copy_paste');
221
+ $disable_print = $this->wph->functions->get_module_item_setting('disable_print');
222
+ $disable_print_screen = $this->wph->functions->get_module_item_setting('disable_print_screen');
223
+ $disable_developer_tools = $this->wph->functions->get_module_item_setting('disable_developer_tools');
224
+ $disable_view_source = $this->wph->functions->get_module_item_setting('disable_view_source');
225
+ $disable_drag_drop = $this->wph->functions->get_module_item_setting('disable_drag_drop');
226
+
227
+
228
+ if ( $disable_mouse_right_click == 'no' && $disable_text_selection == 'no' && $disable_copy_paste == 'no' && $disable_print == 'no' && $disable_print_screen == 'no' && $disable_developer_tools == 'no' && $disable_view_source == 'no' && $disable_drag_drop == 'no' )
229
+ return;
230
+
231
+ ?>
232
+ <script type="text/javascript">
233
+ <?php
234
+
235
+ if ( $disable_mouse_right_click == 'yes' )
236
+ {
237
+ ?>document.addEventListener('contextmenu', event => event.preventDefault());
238
+ <?php
239
+ }
240
+
241
+
242
+ if ( $disable_text_selection == 'yes' )
243
+ {
244
+ ?>
245
+ const disableselect = ( event ) => event.preventDefault();
246
+ document.onselectstart = disableselect;
247
+ document.onmousedown = disableselect;
248
+ <?php
249
+
250
+ }
251
+
252
+
253
+ $disabled_events = array();
254
+ if ( $disable_copy_paste == 'yes' )
255
+ {
256
+ $disabled_events[] = 'cut';
257
+ $disabled_events[] = 'copy';
258
+ $disabled_events[] = 'paste';
259
+ }
260
+ if ( $disable_drag_drop == 'yes' )
261
+ {
262
+ $disabled_events[] = 'drag';
263
+ $disabled_events[] = 'drop';
264
+ }
265
+ if ( count ( $disabled_events ) > 0 )
266
+ {
267
+ ?>
268
+ const disable_events = ['<?php echo implode( "', '", $disabled_events ); ?>'];
269
+ disable_events.forEach( function( event_name ) {
270
+ document.addEventListener( event_name, function (event) {
271
+ event.preventDefault()
272
+ return false;
273
+ });
274
+
275
+ });
276
+
277
+ <?php
278
+
279
+ }
280
+
281
+ ?>
282
+
283
+ document.addEventListener("keydown", function (event) {
284
+
285
+ <?php if ( $disable_developer_tools == 'yes' ) { ?>
286
+ if (
287
+ event.keyCode === 123
288
+ || event.ctrlKey && event.shiftKey && event.keyCode === 67
289
+ || event.ctrlKey && event.shiftKey && event.keyCode === 73
290
+ || event.ctrlKey && event.shiftKey && event.keyCode === 74
291
+ || event.ctrlKey && event.shiftKey && event.keyCode === 75
292
+ ) {
293
+ event.preventDefault()
294
+ return false;
295
+ }
296
+
297
+ <?php } ?>
298
+ <?php if ( $disable_view_source == 'yes' ) { ?>
299
+ if (event.ctrlKey && event.keyCode === 85) {
300
+ event.preventDefault()
301
+ return false;
302
+ }
303
+ <?php } ?>
304
+ <?php if ( $disable_print == 'yes' ) { ?>
305
+ if (event.ctrlKey && event.keyCode === 80) {
306
+ event.preventDefault()
307
+ return false;
308
+ }
309
+ <?php } ?>
310
+ <?php if ( $disable_print_screen == 'yes' ) { ?>
311
+ if (event.ctrlKey && event.keyCode === 44) {
312
+ event.preventDefault()
313
+ return false;
314
+ }
315
+ <?php } ?>
316
+
317
+ });
318
+
319
+ </script>
320
+ <?php
321
+
322
+ }
323
+
324
+
325
+
326
+ }
327
+ ?>
modules/components/rewrite-new_theme_path.php CHANGED
@@ -32,7 +32,7 @@
32
  'description' => __("This option helps to change the theme url to a custom one. As default all theme assets ( styles, JavaScript etc ) are loaded using the theme url and appear on front side html source like this:", 'wp-hide-security-enhancer') ." <br /> <br />
33
  <code>&lt;link rel='stylesheet' href='http://-domain-name-/wp-content/themes/Divi/style.css' type='text/css' media='all' /&gt;</code>
34
  <br /><br /> " . __("When using this option, if filling with `template`, all urls on front side become as follow:", 'wp-hide-security-enhancer') ." <br /> <br />
35
- <code>&lt;link rel='stylesheet' href='http://-domain-name-/template/style.css' type='text/css' media='all' /&gt;</code>",
36
  'option_documentation_url' => 'https://wp-hide.com/documentation/rewrite-theme/'
37
  ),
38
 
32
  'description' => __("This option helps to change the theme url to a custom one. As default all theme assets ( styles, JavaScript etc ) are loaded using the theme url and appear on front side html source like this:", 'wp-hide-security-enhancer') ." <br /> <br />
33
  <code>&lt;link rel='stylesheet' href='http://-domain-name-/wp-content/themes/Divi/style.css' type='text/css' media='all' /&gt;</code>
34
  <br /><br /> " . __("When using this option, if filling with `template`, all urls on front side become as follow:", 'wp-hide-security-enhancer') ." <br /> <br />
35
+ <code>&lt;link rel='stylesheet' href='http://-domain-name-/template/style.css' type='text/css' media='all' /&gt;</code>" ,
36
  'option_documentation_url' => 'https://wp-hide.com/documentation/rewrite-theme/'
37
  ),
38
 
modules/components/security-check_headers.php CHANGED
@@ -174,7 +174,7 @@
174
  $_JSON_response = array();
175
 
176
  $site_url = apply_filters( 'wp-hide/check_headers/url', home_url() );
177
- $response = wp_remote_head( $site_url, array( 'sslverify' => false, 'timeout' => 60 ) );
178
 
179
  if ( ! is_array( $response ) )
180
  {
@@ -317,12 +317,12 @@
317
 
318
  $_JSON_response['html'] = ob_get_clean();
319
 
320
- $progress = round ( count ( $found_headers ) * 180 / 12 );
321
  if ( $progress < 1 )
322
  $progress = 1;
323
- $_JSON_response['graph']['value'] = $progress;
324
 
325
- $_JSON_response['graph']['message'] = "<b>" . round ( ( $progress * 100 ) / 180 ) . '%</b>';
326
  $_JSON_response['graph']['message'] .= '<br />';
327
  if ( $progress < 20 )
328
  $_JSON_response['graph']['message'] .= 'Poor';
174
  $_JSON_response = array();
175
 
176
  $site_url = apply_filters( 'wp-hide/check_headers/url', home_url() );
177
+ $response = wp_remote_head( $site_url, array( 'sslverify' => false, 'timeout' => 40 ) );
178
 
179
  if ( ! is_array( $response ) )
180
  {
317
 
318
  $_JSON_response['html'] = ob_get_clean();
319
 
320
+ $progress = round ( count ( $found_headers ) * 100 / 12 );
321
  if ( $progress < 1 )
322
  $progress = 1;
323
+ $_JSON_response['graph']['value'] = round ( $progress * 180 / 100 );
324
 
325
+ $_JSON_response['graph']['message'] = "<b>" . $progress . '%</b>';
326
  $_JSON_response['graph']['message'] .= '<br />';
327
  if ( $progress < 20 )
328
  $_JSON_response['graph']['message'] .= 'Poor';
modules/module-general.php CHANGED
@@ -42,6 +42,9 @@
42
  include(WPH_PATH . "/modules/components/general-html.php");
43
  $this->components[] = new WPH_module_general_html();
44
 
 
 
 
45
  //action available for mu-plugins
46
  do_action('wp-hide/module_load_components', $this);
47
 
42
  include(WPH_PATH . "/modules/components/general-html.php");
43
  $this->components[] = new WPH_module_general_html();
44
 
45
+ include(WPH_PATH . "/modules/components/general-user-interactions.php");
46
+ $this->components[] = new WPH_module_general_user_interactions();
47
+
48
  //action available for mu-plugins
49
  do_action('wp-hide/module_load_components', $this);
50
 
modules/module-rewrite.php CHANGED
@@ -12,14 +12,14 @@
12
  include(WPH_PATH . "/modules/components/rewrite-default.php");
13
  $this->components[] = new WPH_module_rewrite_default();
14
 
15
- include(WPH_PATH . "/modules/components/rewrite-new_theme_path.php");
16
- $this->components[] = new WPH_module_rewrite_new_theme_path();
17
 
18
  include(WPH_PATH . "/modules/components/rewrite-new_include_path.php");
19
  $this->components[] = new WPH_module_rewrite_new_include_path();
20
 
21
- include(WPH_PATH . "/modules/components/rewrite-wp_content_path.php");
22
- $this->components[] = new WPH_module_rewrite_wp_content_path();
23
 
24
  include(WPH_PATH . "/modules/components/rewrite-new_plugin_path.php");
25
  $this->components[] = new WPH_module_rewrite_new_plugin_path();
12
  include(WPH_PATH . "/modules/components/rewrite-default.php");
13
  $this->components[] = new WPH_module_rewrite_default();
14
 
15
+ include(WPH_PATH . "/modules/components/rewrite-wp_content_path.php");
16
+ $this->components[] = new WPH_module_rewrite_wp_content_path();
17
 
18
  include(WPH_PATH . "/modules/components/rewrite-new_include_path.php");
19
  $this->components[] = new WPH_module_rewrite_new_include_path();
20
 
21
+ include(WPH_PATH . "/modules/components/rewrite-new_theme_path.php");
22
+ $this->components[] = new WPH_module_rewrite_new_theme_path();
23
 
24
  include(WPH_PATH . "/modules/components/rewrite-new_plugin_path.php");
25
  $this->components[] = new WPH_module_rewrite_new_plugin_path();
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, secuirty headers, 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: 6.0.1
7
- Stable tag: 1.8.1
8
  License: GPLv2 or later
9
 
10
  Hide WordPress, wp-content, wp-includes, wp-admin, login URL, plugins, themes etc. Block the default URLs. Security Headers etc.
@@ -218,13 +218,22 @@ Since version 1.2, WP-Hide change individual plugin URLs and made them unrecogni
218
 
219
  * Remove HTML Comments
220
  * Minify Html, CSS, JavaScript
221
- * Disable right mouse click
222
  * Remove general classes from body tag
223
  * Remove ID from Menu items
224
  * Remove class from Menu items
225
  * Remove general classes from post
226
  * Remove general classes from images
227
 
 
 
 
 
 
 
 
 
 
 
228
  **Hide -> Admin > wp-login.php**
229
 
230
  * New wp-login.php – Maps a new wp-login.php instead of the default one
@@ -378,6 +387,15 @@ Please get in touch with us and we’ll do our best to include it inthe next ver
378
 
379
  == Changelog ==
380
 
 
 
 
 
 
 
 
 
 
381
  = 1.8.1 =
382
  * Improved server environment rewrite test checking routines.
383
  * Separate rewrite tests for static files and PHP files. This avoids reporting issues for servers not supporting rewrites for php-files.
3
  Donate link: https://www.nsp-code.com/
4
  Tags: wordpress hide, hide, security, secuirty headers, 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: 6.0.2
7
+ Stable tag: 1.8.3
8
  License: GPLv2 or later
9
 
10
  Hide WordPress, wp-content, wp-includes, wp-admin, login URL, plugins, themes etc. Block the default URLs. Security Headers etc.
218
 
219
  * Remove HTML Comments
220
  * Minify Html, CSS, JavaScript
 
221
  * Remove general classes from body tag
222
  * Remove ID from Menu items
223
  * Remove class from Menu items
224
  * Remove general classes from post
225
  * Remove general classes from images
226
 
227
+ **Hide -> General / Html > User Interactions**
228
+ * Disable Mouse right click
229
+ * Disable Text Selection
230
+ * Disable Copy / Paste
231
+ * Disable Print
232
+ * Disable Print Screen
233
+ * Disable Developer Tools
234
+ * Disable View Source
235
+ * Disable Drag / Drop
236
+
237
  **Hide -> Admin > wp-login.php**
238
 
239
  * New wp-login.php – Maps a new wp-login.php instead of the default one
387
 
388
  == Changelog ==
389
 
390
+ = 1.8.3 =
391
+ * New options interface - User Interactions: Disable Mouse right click, Disable Text Selection, Disable Copy / Paste, Disable Print, Disable Print Screen, Disable Developer Tools, Disable View Source, Disable Drag / Drop
392
+ * Better accessibility for additional details regarding each of the options.
393
+ * Improved progress score calculation for Headers.
394
+ * A2 Optimized WP - compatibility fix.
395
+ * WordPress 6.0.2 tag compatibility update
396
+ * Fix CDN option external help page URL.
397
+
398
+
399
  = 1.8.1 =
400
  * Improved server environment rewrite test checking routines.
401
  * Separate rewrite tests for static files and PHP files. This avoids reporting issues for servers not supporting rewrites for php-files.
wp-hide.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://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.8.1
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.8.3
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */