WP Hide & Security Enhancer - Version 1.5.5.9

Version Description

  • Compatibility module for ShortPixel Adaptive Image plugin
  • Add support for texarea fields within plugin options interface
  • Fixed urls for minified files when using WP Rocket cache plugin
Download this release

Release Info

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

Code changes from version 1.5.5.7 to 1.5.5.9

compatibility/shortpixel-adaptive-images.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Compatibility for Plugin Name: ShortPixel Adaptive Images
5
+ * Compatibility checked on Version: 0.9.2
6
+ */
7
+
8
+
9
+ class WPH_conflict_shortpixel_ai
10
+ {
11
+
12
+ static function init()
13
+ {
14
+ add_action('wp_calculate_image_srcset', array( 'WPH_conflict_shortpixel_ai', 'wp_calculate_image_srcset') , -1, 5);
15
+
16
+ add_action( 'init', array( 'WPH_conflict_shortpixel_ai', 'init_ob'), 2 );
17
+ }
18
+
19
+ static function is_plugin_active()
20
+ {
21
+
22
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
23
+
24
+ if(is_plugin_active( 'shortpixel-adaptive-images/short-pixel-ai.php' ))
25
+ return TRUE;
26
+ else
27
+ return FALSE;
28
+ }
29
+
30
+ static public function wp_calculate_image_srcset( $sources, $size_array, $image_src, $image_meta, $attachment_id )
31
+ {
32
+ //replace the urls
33
+ global $wph;
34
+
35
+ //retrieve the replacements list
36
+ $replacement_list = $wph->functions->get_replacement_list();
37
+
38
+ //replace the urls
39
+ foreach ( $sources as $size => $data )
40
+ {
41
+ $sources[$size]['url'] = $wph->functions->content_urls_replacement( $sources[$size]['url'], $replacement_list );
42
+ }
43
+
44
+ return $sources;
45
+
46
+ }
47
+
48
+
49
+ static public function init_ob()
50
+ {
51
+
52
+ if (is_feed()
53
+ || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
54
+ || (defined('DOING_CRON') && DOING_CRON)
55
+ || (defined('WP_CLI') && WP_CLI)
56
+ || (is_admin() && function_exists("is_user_logged_in") && is_user_logged_in()
57
+ && !(function_exists("wp_doing_ajax") && wp_doing_ajax())
58
+ && !(defined( 'DOING_AJAX' ) && DOING_AJAX))
59
+ ) {
60
+ return;
61
+ }
62
+
63
+ ob_start( array ( 'WPH_conflict_shortpixel_ai', 'maybe_replace_images_src' ) );
64
+
65
+ }
66
+
67
+ static function maybe_replace_images_src( $content )
68
+ {
69
+ global $wph;
70
+
71
+ //retrieve the replacements list
72
+ $replacement_list = $wph->functions->get_replacement_list();
73
+
74
+ $content = $wph->functions->content_urls_replacement($content, $replacement_list );
75
+
76
+ return $content;
77
+ }
78
+
79
+
80
+ }
81
+
82
+
83
+ ?>
compatibility/wp-rocket.php CHANGED
@@ -12,6 +12,7 @@
12
  add_filter( 'wp-hide/ignore_ob_start_callback', array( 'WPH_conflict_handle_wp_rocket', 'ignore_ob_start_callback'), 999, 2);
13
  add_filter( 'rocket_buffer', array( 'WPH_conflict_handle_wp_rocket', 'rocket_buffer'), 999 );
14
 
 
15
  }
16
 
17
  static function is_plugin_active()
@@ -133,7 +134,7 @@
133
  return FALSE;
134
  }
135
 
136
- $ip = rocket_get_ip();
137
  $allowed_ips = array(
138
  '85.17.131.209' => 0, // Pingdom Tools - Amsterdam
139
  '173.208.58.138' => 1, // Pingdom Tools - New-York
@@ -209,6 +210,54 @@
209
  return $buffer;
210
 
211
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
 
213
 
214
  }
12
  add_filter( 'wp-hide/ignore_ob_start_callback', array( 'WPH_conflict_handle_wp_rocket', 'ignore_ob_start_callback'), 999, 2);
13
  add_filter( 'rocket_buffer', array( 'WPH_conflict_handle_wp_rocket', 'rocket_buffer'), 999 );
14
 
15
+ add_filter( 'rocket_js_url', array( 'WPH_conflict_handle_wp_rocket', 'rocket_js_url'), 999 );
16
  }
17
 
18
  static function is_plugin_active()
134
  return FALSE;
135
  }
136
 
137
+ $ip = self::get_ip();
138
  $allowed_ips = array(
139
  '85.17.131.209' => 0, // Pingdom Tools - Amsterdam
140
  '173.208.58.138' => 1, // Pingdom Tools - New-York
210
  return $buffer;
211
 
212
  }
213
+
214
+
215
+ static function get_ip()
216
+ {
217
+ $keys = array(
218
+ 'HTTP_CF_CONNECTING_IP', // CF = CloudFlare.
219
+ 'HTTP_CLIENT_IP',
220
+ 'HTTP_X_FORWARDED_FOR',
221
+ 'HTTP_X_FORWARDED',
222
+ 'HTTP_X_CLUSTER_CLIENT_IP',
223
+ 'HTTP_X_REAL_IP',
224
+ 'HTTP_FORWARDED_FOR',
225
+ 'HTTP_FORWARDED',
226
+ 'REMOTE_ADDR',
227
+ );
228
+
229
+ foreach ( $keys as $key ) {
230
+ if ( array_key_exists( $key, $_SERVER ) ) {
231
+ $ip = explode( ',', $_SERVER[ $key ] );
232
+ $ip = end( $ip );
233
+
234
+ if ( false !== filter_var( $ip, FILTER_VALIDATE_IP ) ) {
235
+ return $ip;
236
+ }
237
+ }
238
+ }
239
+
240
+ return '0.0.0.0';
241
+ }
242
+
243
+
244
+ /**
245
+ * Replace static inline cached file urls
246
+ *
247
+ * @param mixed $url
248
+ */
249
+ static function rocket_js_url( $url )
250
+ {
251
+ global $wph;
252
+
253
+ //retrieve the replacements list
254
+ $replacement_list = $wph->functions->get_replacement_list();
255
+
256
+ //replace the urls
257
+ $url = $wph->functions->content_urls_replacement($url, $replacement_list );
258
+
259
+ return $url ;
260
+ }
261
 
262
 
263
  }
include/admin-interface.class.php CHANGED
@@ -193,6 +193,13 @@
193
 
194
  break;
195
 
 
 
 
 
 
 
 
196
  case 'radio' :
197
  $class = 'radio';
198
 
193
 
194
  break;
195
 
196
+ case 'textarea' :
197
+ $class = 'textarea';
198
+
199
+ ?><textarea rows="7" name="<?php echo $module_setting['id'] ?>" class="<?php echo $class ?>"><?php echo stripslashes ( esc_html($value) ) ?></textarea><?php
200
+
201
+ break;
202
+
203
  case 'radio' :
204
  $class = 'radio';
205
 
include/class.compatibility.php CHANGED
@@ -63,6 +63,10 @@
63
  include_once(WPH_PATH . 'compatibility/woo-global-cart.php');
64
  WPH_conflict_handle_wgc::init();
65
 
 
 
 
 
66
  /**
67
  * Themes
68
  */
63
  include_once(WPH_PATH . 'compatibility/woo-global-cart.php');
64
  WPH_conflict_handle_wgc::init();
65
 
66
+ //ShortPixel Adaptive Images
67
+ include_once(WPH_PATH . 'compatibility/shortpixel-adaptive-images.php');
68
+ WPH_conflict_shortpixel_ai::init();
69
+
70
  /**
71
  * Themes
72
  */
include/functions.class.php CHANGED
@@ -2511,7 +2511,7 @@
2511
  </div>
2512
 
2513
  </div>
2514
- <p><?php _e('Help us to improve this plugin by sending any improvement suggestions and reporting any issues at ', 'wp-hide-security-enhancer') ?><a target="_blank" href="https://www.wp-hide.com/">www.wp-hide.com</a></p>
2515
  <h4><?php _e('Did you know there is a', 'wp-hide-security-enhancer') ?> <span class="wph-pro">PRO</span> <?php _e('version of this plug-in?', 'wp-hide-security-enhancer') ?> <a target="_blank" href="https://www.wp-hide.com/wp-hide-pro-now-available/">Read more</a></h4>
2516
  <p><?php _e('Did you find this plugin useful? Please support our work by spread the word about the code, or write an article about the plugin in your blog with a link to development site', 'wp-hide-security-enhancer') ?> <a href="https://www.wp-hide.com/" target="_blank"><strong>https://www.wp-hide.com/</strong></a></p>
2517
 
2511
  </div>
2512
 
2513
  </div>
2514
+ <p><?php _e('Help us to upgrade this plugin by sending improvement suggestions and reporting any issues at ', 'wp-hide-security-enhancer') ?><a target="_blank" href="https://www.wp-hide.com/">www.wp-hide.com</a></p>
2515
  <h4><?php _e('Did you know there is a', 'wp-hide-security-enhancer') ?> <span class="wph-pro">PRO</span> <?php _e('version of this plug-in?', 'wp-hide-security-enhancer') ?> <a target="_blank" href="https://www.wp-hide.com/wp-hide-pro-now-available/">Read more</a></h4>
2516
  <p><?php _e('Did you find this plugin useful? Please support our work by spread the word about the code, or write an article about the plugin in your blog with a link to development site', 'wp-hide-security-enhancer') ?> <a href="https://www.wp-hide.com/" target="_blank"><strong>https://www.wp-hide.com/</strong></a></p>
2517
 
modules/components/general-headers.php CHANGED
@@ -44,6 +44,7 @@
44
  'sanitize_type' => array('sanitize_title', 'strtolower'),
45
  'processing_order' => 70
46
  );
 
47
 
48
  return $this->module_settings;
49
  }
44
  'sanitize_type' => array('sanitize_title', 'strtolower'),
45
  'processing_order' => 70
46
  );
47
+
48
 
49
  return $this->module_settings;
50
  }
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.1
7
- Stable tag: 1.5.5.7
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress site instance using smart techniques. No files are changed on your server.
@@ -285,6 +285,11 @@ Please get in touch with us and we'll do our best to include it for a next versi
285
 
286
  == Changelog ==
287
 
 
 
 
 
 
288
  = 1.5.5.7 =
289
  * Filter remove fix
290
 
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.1.1
7
+ Stable tag: 1.5.5.9
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress site instance using smart techniques. No files are changed on your server.
285
 
286
  == Changelog ==
287
 
288
+ = 1.5.5.9 =
289
+ * Compatibility module for ShortPixel Adaptive Image plugin
290
+ * Add support for texarea fields within plugin options interface
291
+ * Fixed urls for minified files when using WP Rocket cache plugin
292
+
293
  = 1.5.5.7 =
294
  * Filter remove fix
295
 
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.5.5.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.5.5.9
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */