WP Hide & Security Enhancer - Version 1.3.6.2

Version Description

  • W3 Total Cache - Page Cache compatibility fix
  • Canonical tag replacement improvements
  • Pingback tag replacement improvements
  • Fix custom Background Images for body on themes which support that feature
Download this release

Release Info

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

Code changes from version 1.3.6 to 1.3.6.2

conflicts/w3-cache.php CHANGED
@@ -28,12 +28,12 @@
28
  $GLOBALS['WPH_w3tc_ob_callbacks']['pagecache'] = $GLOBALS['_w3tc_ob_callbacks']['pagecache'];
29
 
30
  //hijackthe callback
31
- $GLOBALS['_w3tc_ob_callbacks']['pagecache'] = array('WPH_conflict_handle_w3_cache', 'pagecache_callback');
32
  }
33
 
34
  }
35
 
36
- static function pagecache_callback(&$value)
37
  {
38
  global $wph;
39
 
28
  $GLOBALS['WPH_w3tc_ob_callbacks']['pagecache'] = $GLOBALS['_w3tc_ob_callbacks']['pagecache'];
29
 
30
  //hijackthe callback
31
+ $GLOBALS['_w3tc_ob_callbacks']['pagecache'] = array( 'WPH_conflict_handle_w3_cache', 'pagecache_callback');
32
  }
33
 
34
  }
35
 
36
+ static public function pagecache_callback($value)
37
  {
38
  global $wph;
39
 
modules/components/general-html.php CHANGED
@@ -161,7 +161,8 @@
161
  'category',
162
  'tag',
163
  'rtl',
164
- 'author'
 
165
  );
166
 
167
  if(!empty( $class ))
161
  'category',
162
  'tag',
163
  'rtl',
164
+ 'author',
165
+ 'custom-background'
166
  );
167
 
168
  if(!empty( $class ))
modules/components/general-meta.php CHANGED
@@ -381,13 +381,42 @@
381
  }
382
 
383
 
384
- function remove_canonical_tag($html)
385
  {
386
 
387
- $html = preg_replace('/(<link.*?rel=("|\')canonical("|\').*?href=("|\')(.*?)("|\')(.*?)?\/?>|<link.*?href=("|\')(.*?)("|\').*?rel=("|\')canonical("|\')(.*?)?\/?>)/i', '', $html);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
 
389
- return $html;
390
 
 
 
 
 
391
  }
392
 
393
 
381
  }
382
 
383
 
384
+ function remove_canonical_tag( $buffer )
385
  {
386
 
387
+ if(is_admin())
388
+ return $buffer;
389
+
390
+ if ( ! class_exists( 'DOMDocument', false ) )
391
+ return $buffer;
392
+
393
+ $doc = new DOMDocument();
394
+ $doc->preserveWhiteSpace = true;
395
+
396
+ if ( @$doc->loadHTML(mb_convert_encoding($buffer, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD) === false )
397
+ return $buffer;
398
+
399
+ $doc->encoding = 'UTF-8';
400
+ $doc->formatOutput = true;
401
+
402
+ $xpath = new DOMXPath($doc);
403
+
404
+ $nodes = $xpath->query('//link[@rel="canonical"]');
405
+ if($nodes->length < 1)
406
+ return $buffer;
407
+
408
+ foreach ($nodes as $node)
409
+ {
410
+ $parent = $node->parentNode;
411
+ $parent->removeChild($node);
412
+ }
413
 
414
+ $doc->normalizeDocument();
415
 
416
+ $buffer = $doc->saveHTML( $dom->documentElement );
417
+
418
+ return $buffer;
419
+
420
  }
421
 
422
 
modules/components/rewrite-new_xml-rpc-path.php CHANGED
@@ -165,12 +165,40 @@
165
  }
166
 
167
 
168
- function remove_xml_rpc_tag($html)
169
  {
 
 
170
 
171
- $html = preg_replace('/(<link.*?rel=("|\')pingback("|\').*?href=("|\')(.*?)("|\')(.*?)?\/?>|<link.*?href=("|\')(.*?)("|\').*?rel=("|\')pingback("|\')(.*?)?\/?>)/i', '', $html);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
- return $html;
 
 
174
  }
175
 
176
 
165
  }
166
 
167
 
168
+ function remove_xml_rpc_tag( $buffer )
169
  {
170
+ if(is_admin())
171
+ return $buffer;
172
 
173
+ if ( ! class_exists( 'DOMDocument', false ) )
174
+ return $buffer;
175
+
176
+ $doc = new DOMDocument();
177
+ $doc->preserveWhiteSpace = true;
178
+
179
+ if ( @$doc->loadHTML(mb_convert_encoding($buffer, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD) === false )
180
+ return $buffer;
181
+
182
+ $doc->encoding = 'UTF-8';
183
+ $doc->formatOutput = true;
184
+
185
+ $xpath = new DOMXPath($doc);
186
+
187
+ $nodes = $xpath->query('//link[@rel="pingback"]');
188
+ if($nodes->length < 1)
189
+ return $buffer;
190
+
191
+ foreach ($nodes as $node)
192
+ {
193
+ $parent = $node->parentNode;
194
+ $parent->removeChild($node);
195
+ }
196
+
197
+ $doc->normalizeDocument();
198
 
199
+ $buffer = $doc->saveHTML( $dom->documentElement );
200
+
201
+ return $buffer;
202
  }
203
 
204
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.nsp-code.com/donate.php
4
  Tags: hide, security, improve security, hacking, wp hide, wordpress hide, custom login url, wp-loging.php, ap-admin
5
  Requires at least: 2.8
6
  Tested up to: 4.6.1
7
- Stable tag: 1.3.6
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
@@ -134,9 +134,12 @@ Since version 1.2 Change individual plugin urls which make them unrecognizable,
134
 
135
  **General / Html > Meta**
136
 
137
- * Remove Generator Meta
 
 
138
  * Remove wlwmanifest Meta
139
  * Remove feed_links Meta
 
140
  * Remove rsd_link Meta
141
  * Remove adjacent_posts_rel Meta
142
  * Remove profile link
@@ -156,6 +159,10 @@ Since version 1.2 Change individual plugin urls which make them unrecognizable,
156
 
157
  * Remove Version
158
 
 
 
 
 
159
  **General / Html > Headers**
160
 
161
  * Remove X-Powered-By Header
@@ -223,6 +230,12 @@ Please get in touch with us and we'll do our best to include it for a next versi
223
 
224
  == Changelog ==
225
 
 
 
 
 
 
 
226
  = 1.3.6 =
227
  * Post-process on options interface save for unique slugs on any text inputs to prevent conflicts.
228
  * Processing Order change for new_theme_child_path to occur before new_theme_path
4
  Tags: hide, security, improve security, hacking, wp hide, wordpress hide, custom login url, wp-loging.php, ap-admin
5
  Requires at least: 2.8
6
  Tested up to: 4.6.1
7
+ Stable tag: 1.3.6.2
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
134
 
135
  **General / Html > Meta**
136
 
137
+ * Remove WordPress Generator Meta
138
+ * Remove Other Generator Meta
139
+ * Remove Resource Hints
140
  * Remove wlwmanifest Meta
141
  * Remove feed_links Meta
142
+ * Disable output the REST API link tag into page header
143
  * Remove rsd_link Meta
144
  * Remove adjacent_posts_rel Meta
145
  * Remove profile link
159
 
160
  * Remove Version
161
 
162
+ **General / Html > Oembed**
163
+
164
+ * Remove Oembed
165
+
166
  **General / Html > Headers**
167
 
168
  * Remove X-Powered-By Header
230
 
231
  == Changelog ==
232
 
233
+ = 1.3.6.2 =
234
+ * W3 Total Cache - Page Cache compatibility fix
235
+ * Canonical tag replacement improvements
236
+ * Pingback tag replacement improvements
237
+ * Fix custom Background Images for body on themes which support that feature
238
+
239
  = 1.3.6 =
240
  * Post-process on options interface save for unique slugs on any text inputs to prevent conflicts.
241
  * Processing Order change for new_theme_child_path to occur before new_theme_path
wp-hide.php CHANGED
@@ -5,14 +5,14 @@ Plugin URI: http://www.nsp-code.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.3.6
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */
12
 
13
 
14
  define('WPH_PATH', plugin_dir_path(__FILE__));
15
- define('WPH_VERSION', '1.3.6');
16
 
17
  //load language files
18
  add_action( 'plugins_loaded', 'WPH_load_textdomain');
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.3.6.2
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */
12
 
13
 
14
  define('WPH_PATH', plugin_dir_path(__FILE__));
15
+ define('WPH_VERSION', '1.3.6.2');
16
 
17
  //load language files
18
  add_action( 'plugins_loaded', 'WPH_load_textdomain');