WP Hide & Security Enhancer - Version 1.5.8

Version Description

  • Add reserved option names to avoid conflicts e.g. wp
  • Always clear any code plugin cache when plugin update
  • Easy Digital Downloads compatibility
  • Elementor plugin compatibility
  • Fusion Builder plugin compatibility
  • Divi theme compatibility updates
  • WP Fastest Cache plugin compatibility updates
  • Check if ob_gzhandler and zlib.output_compression before using 'ob_gzhandler' output buffering handler
Download this release

Release Info

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

Code changes from version 1.5.7 to 1.5.8

compatibility/autoptimize.php CHANGED
@@ -53,6 +53,8 @@
53
  }
54
 
55
  }
 
 
56
 
57
 
58
  ?>
53
  }
54
 
55
  }
56
+
57
+ WPH_conflict_handle_autoptimize::init();
58
 
59
 
60
  ?>
compatibility/easy-digital-downloads.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class WPH_conflict_handle_edd
5
+ {
6
+
7
+ static function init()
8
+ {
9
+ if( ! self::is_plugin_active())
10
+ return FALSE;
11
+
12
+ add_filter( 'edd_start_session', array( 'WPH_conflict_handle_edd' , 'edd_start_session' ), -1 );
13
+ }
14
+
15
+ static function is_plugin_active()
16
+ {
17
+
18
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
19
+
20
+ if(is_plugin_active( 'easy-digital-downloads/easy-digital-downloads.php' ))
21
+ return TRUE;
22
+ else
23
+ return FALSE;
24
+ }
25
+
26
+ static function edd_start_session( $start_session )
27
+ {
28
+
29
+ global $wph;
30
+
31
+ $admin_url = $wph->functions->get_module_item_setting('admin_url');
32
+ if (empty( $admin_url ))
33
+ return $start_session;
34
+
35
+ $start_session = true;
36
+
37
+ if( ! empty( $_SERVER[ 'REQUEST_URI' ] ) ) {
38
+
39
+ $blacklist = EDD()->session->get_blacklist();
40
+ $uri = ltrim( $_SERVER[ 'REQUEST_URI' ], '/' );
41
+ $uri = untrailingslashit( $uri );
42
+
43
+ if( in_array( $uri, $blacklist ) ) {
44
+ $start_session = false;
45
+ }
46
+
47
+ if( false !== strpos( $uri, 'feed=' ) ) {
48
+ $start_session = false;
49
+ }
50
+
51
+ if( is_admin() && false === strpos( $uri, $admin_url . '/admin-ajax.php' ) ) {
52
+ // We do not want to start sessions in the admin unless we're processing an ajax request
53
+ $start_session = false;
54
+ }
55
+
56
+ if( false !== strpos( $uri, 'wp_scrape_key' ) ) {
57
+ // Starting sessions while saving the file editor can break the save process, so don't start
58
+ $start_session = false;
59
+ }
60
+
61
+ }
62
+
63
+ return $start_session;
64
+
65
+ }
66
+
67
+ }
68
+
69
+ WPH_conflict_handle_edd::init();
70
+
71
+
72
+ ?>
compatibility/elementor.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Compatibility for Plugin Name: Elementor
5
+ * Compatibility checked on Version: 2.5.16
6
+ */
7
+
8
+ use Elementor\Core\Files\Manager as Files_Manager;
9
+
10
+ class WPH_conflict_elementor
11
+ {
12
+
13
+ static function init()
14
+ {
15
+ if( ! self::is_plugin_active())
16
+ return FALSE;
17
+
18
+ global $wph;
19
+
20
+ add_action( 'wph/settings_changed', array( 'WPH_conflict_elementor', 'settings_changed') );
21
+
22
+ }
23
+
24
+ static function is_plugin_active()
25
+ {
26
+
27
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
28
+
29
+ if(is_plugin_active( 'elementor/elementor.php' ))
30
+ return TRUE;
31
+ else
32
+ return FALSE;
33
+ }
34
+
35
+
36
+ static function settings_changed()
37
+ {
38
+
39
+ $files_manager = new Files_Manager();
40
+ $files_manager->clear_cache();
41
+
42
+ }
43
+
44
+
45
+
46
+
47
+
48
+ }
49
+
50
+
51
+ ?>
compatibility/fusion-builder.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Compatibility for Plugin Name: Fusion Builder
5
+ * Compatibility checked on Version: 1.4.2
6
+ */
7
+
8
+
9
+ class WPH_conflict_fusion_builder
10
+ {
11
+
12
+ static function init()
13
+ {
14
+ if( ! self::is_plugin_active())
15
+ return FALSE;
16
+
17
+ add_action('wph/settings_changed', array( 'WPH_conflict_fusion_builder', 'settings_changed'));
18
+
19
+ }
20
+
21
+ static function is_plugin_active()
22
+ {
23
+
24
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
25
+
26
+ if(is_plugin_active( 'fusion-builder/fusion-builder.php' ))
27
+ return TRUE;
28
+ else
29
+ return FALSE;
30
+ }
31
+
32
+
33
+ static function settings_changed()
34
+ {
35
+ $fusion_cache = new Fusion_Cache();
36
+ $fusion_cache->reset_all_caches();
37
+ }
38
+
39
+
40
+ }
41
+
42
+
43
+ WPH_conflict_fusion_builder::init();
44
+
45
+
46
+ ?>
compatibility/themes/divi.php CHANGED
@@ -13,26 +13,30 @@
13
 
14
  static function init()
15
  {
16
- add_action('et_divi_theme_customizer_css_output', array('WPH_conflict_theme_divi', 'process'));
17
- add_action('et_divi_fonts_css_output', array('WPH_conflict_theme_divi', 'process'));
18
- add_action('et_divi_sidebar_width_css_output', array('WPH_conflict_theme_divi', 'process'));
19
- add_action('et_divi_module_customizer_css_output', array('WPH_conflict_theme_divi', 'process'));
20
 
21
- add_action('et_builder_custom_fonts', array('WPH_conflict_theme_divi', 'process_et_builder_custom_fonts'));
 
 
22
  }
23
 
24
 
25
- static public function process( $buffer )
26
  {
27
 
28
  global $wph;
29
 
30
- $replacement_list = $wph->functions->get_replacement_list();
31
-
32
- //replace the urls
33
- $buffer = $wph->functions->content_urls_replacement( $buffer, $replacement_list );
34
-
35
- return $buffer;
 
 
 
 
 
36
 
37
  }
38
 
@@ -69,6 +73,13 @@
69
  return $all_custom_fonts;
70
 
71
  }
 
 
 
 
 
 
 
72
 
73
  }
74
 
13
 
14
  static function init()
15
  {
16
+ add_action('et_builder_custom_fonts', array('WPH_conflict_theme_divi', 'process_et_builder_custom_fonts'));
 
 
 
17
 
18
+ add_action('et_core_page_resource_get_data', array('WPH_conflict_theme_divi', 'process'), 99, 3);
19
+
20
+ add_action( 'wph/settings_changed', array( 'WPH_conflict_theme_divi', 'settings_changed') );
21
  }
22
 
23
 
24
+ static public function process( $resource_data, $context, $object )
25
  {
26
 
27
  global $wph;
28
 
29
+ $replacement_list = $wph->functions->get_replacement_list();
30
+
31
+ foreach ( $resource_data as $priority => $data_part )
32
+ {
33
+ foreach ( $data_part as $key => $data )
34
+ {
35
+ $resource_data[ $priority ][ $key ] = $wph->functions->content_urls_replacement( $data, $replacement_list );
36
+ }
37
+ }
38
+
39
+ return $resource_data;
40
 
41
  }
42
 
73
  return $all_custom_fonts;
74
 
75
  }
76
+
77
+ static function settings_changed()
78
+ {
79
+
80
+ ET_Core_PageResource::remove_static_resources( 'all', 'all' );
81
+
82
+ }
83
 
84
  }
85
 
compatibility/wp-fastest-cache.php CHANGED
@@ -6,7 +6,10 @@
6
 
7
  static function init()
8
  {
9
- add_action('plugins_loaded', array('WPH_conflict_handle_wp_fastest_cache', 'wpcache') , -1);
 
 
 
10
  }
11
 
12
  static function is_plugin_active()
@@ -20,36 +23,17 @@
20
  return FALSE;
21
  }
22
 
23
- static public function wpcache()
24
- {
25
- if( ! self::is_plugin_active())
26
- return FALSE;
27
-
28
- global $wph;
29
-
30
- add_action('plugins_loaded', array('WPH_conflict_handle_wp_fastest_cache', 'plugins_loaded'));
31
-
32
- }
33
-
34
- static function plugins_loaded()
35
- {
36
- ob_start(array('WPH_conflict_handle_wp_fastest_cache', "callback"));
37
- }
38
-
39
-
40
- static function callback($content)
41
  {
42
 
43
  global $wph;
44
 
45
- $replacement_list = $wph->functions->get_replacement_list();
46
-
47
- //replace the urls
48
- $content = $wph->functions->content_urls_replacement($content, $replacement_list );
49
 
50
- return $content;
 
51
  }
52
-
53
  }
54
 
55
 
6
 
7
  static function init()
8
  {
9
+ if( ! self::is_plugin_active())
10
+ return FALSE;
11
+
12
+ add_filter( 'wpfc_buffer_callback_filter', array( 'WPH_conflict_handle_wp_fastest_cache' , 'wpfc_cache_callback_filter' ), 99, 2 );
13
  }
14
 
15
  static function is_plugin_active()
23
  return FALSE;
24
  }
25
 
26
+ static function wpfc_cache_callback_filter( $buffer, $extension )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  {
28
 
29
  global $wph;
30
 
31
+ $buffer = $wph->ob_start_callback( $buffer );
 
 
 
32
 
33
+ return $buffer;
34
+
35
  }
36
+
37
  }
38
 
39
 
include/class.compatibility.php CHANGED
@@ -81,7 +81,16 @@
81
 
82
  //Autoptimize
83
  include_once(WPH_PATH . 'compatibility/autoptimize.php');
84
- WPH_conflict_handle_autoptimize::init();
 
 
 
 
 
 
 
 
 
85
 
86
  /**
87
  * Themes
@@ -102,7 +111,7 @@
102
 
103
  foreach ( $compatibility_themes as $theme_slug => $compatibility_file )
104
  {
105
- if ( strtolower( $theme->template ) == $theme_slug )
106
  {
107
  include_once(WPH_PATH . 'compatibility/themes/' . $compatibility_file );
108
  }
81
 
82
  //Autoptimize
83
  include_once(WPH_PATH . 'compatibility/autoptimize.php');
84
+
85
+ //Easy Digital Downloads
86
+ include_once(WPH_PATH . 'compatibility/easy-digital-downloads.php');
87
+
88
+ //Fusion Builder
89
+ include_once(WPH_PATH . 'compatibility/fusion-builder.php');
90
+
91
+ //Elementor
92
+ include_once(WPH_PATH . 'compatibility/fusion-builder.php');
93
+
94
 
95
  /**
96
  * Themes
111
 
112
  foreach ( $compatibility_themes as $theme_slug => $compatibility_file )
113
  {
114
+ if ( strtolower( $theme->template ) == $theme_slug || strtolower( $theme->display( 'Name' ) ) == $theme_slug )
115
  {
116
  include_once(WPH_PATH . 'compatibility/themes/' . $compatibility_file );
117
  }
include/functions.class.php CHANGED
@@ -204,6 +204,11 @@
204
  $_settings_[ $field_name ] = $data['value'];
205
  }
206
 
 
 
 
 
 
207
  //clean the just updated fields within main settings array
208
  foreach($unique_require_updated_settings as $field_name => $data)
209
  {
@@ -222,6 +227,15 @@
222
  //put the value back
223
  $_settings_[ $field_name ] = $data['value'];
224
 
 
 
 
 
 
 
 
 
 
225
  }
226
 
227
 
@@ -2477,6 +2491,9 @@
2477
 
2478
  if ( function_exists( 'rocket_clean_domain' ) )
2479
  rocket_clean_domain();
 
 
 
2480
 
2481
  global $wp_fastest_cache;
2482
  if ( method_exists( 'WpFastestCache', 'deleteCache' ) && !empty( $wp_fastest_cache ) )
@@ -2495,7 +2512,10 @@
2495
  WpeCommon::clear_maxcdn_cache();
2496
  if ( method_exists( 'WpeCommon', 'purge_varnish_cache' ) )
2497
  WpeCommon::purge_varnish_cache();
2498
- }
 
 
 
2499
  }
2500
 
2501
 
@@ -2558,9 +2578,9 @@
2558
  </div>
2559
 
2560
  </div>
2561
- <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>
2562
  <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>
2563
- <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>
2564
 
2565
  <div class="clear"></div>
2566
  </div><?php
204
  $_settings_[ $field_name ] = $data['value'];
205
  }
206
 
207
+
208
+ $reserved_values = apply_filters('wp-hide/interface/process/reserved_values', array(
209
+ 'wp'
210
+ ));
211
+
212
  //clean the just updated fields within main settings array
213
  foreach($unique_require_updated_settings as $field_name => $data)
214
  {
227
  //put the value back
228
  $_settings_[ $field_name ] = $data['value'];
229
 
230
+ //check for reserved value
231
+ if( array_search( $data['value'] , $reserved_values) !== FALSE )
232
+ {
233
+ $errors = TRUE;
234
+ $process_interface_save_errors[] = array( 'type' => 'error',
235
+ 'message' => __('Value', 'wp-hide-security-enhancer') . ' <b>' . $data['value'] .'</b> ' . __('set for', 'wp-hide-security-enhancer') . ' ' . __($data['module_name'], 'wp-hide-security-enhancer') . ' ' . __('is a system reserved.', 'wp-hide-security-enhancer')
236
+ );
237
+ }
238
+
239
  }
240
 
241
 
2491
 
2492
  if ( function_exists( 'rocket_clean_domain' ) )
2493
  rocket_clean_domain();
2494
+
2495
+ if (function_exists('wp_cache_clear_cache'))
2496
+ wp_cache_clear_cache();
2497
 
2498
  global $wp_fastest_cache;
2499
  if ( method_exists( 'WpFastestCache', 'deleteCache' ) && !empty( $wp_fastest_cache ) )
2512
  WpeCommon::clear_maxcdn_cache();
2513
  if ( method_exists( 'WpeCommon', 'purge_varnish_cache' ) )
2514
  WpeCommon::purge_varnish_cache();
2515
+ }
2516
+
2517
+ if (class_exists('Cache_Enabler_Disk') && method_exists('Cache_Enabler_Disk', 'clear_cache'))
2518
+ Cache_Enabler_Disk::clear_cache();
2519
  }
2520
 
2521
 
2578
  </div>
2579
 
2580
  </div>
2581
+ <p><?php _e('Help us to maintain this plugin by sending improvements, 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>
2582
  <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>
2583
+ <p><?php _e('Did you find this plugin useful? Please support our work by submitting a review, or 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>
2584
 
2585
  <div class="clear"></div>
2586
  </div><?php
include/update.class.php CHANGED
@@ -237,12 +237,15 @@
237
 
238
 
239
  //Always generate the environment file
240
- //$this->wph->set_static_environment_file();
 
 
 
241
 
242
 
243
  //save the last code version
244
  $this->wph->settings['version'] = WPH_CORE_VERSION;
245
- //$this->wph->functions->update_settings($this->wph->settings);
246
 
247
  }
248
 
@@ -263,8 +266,7 @@
263
  require_once(ABSPATH . 'wp-admin/includes/file.php');
264
 
265
  flush_rewrite_rules();
266
-
267
- $this->wph->functions->site_cache_clear();
268
  }
269
 
270
  }
237
 
238
 
239
  //Always generate the environment file
240
+ $this->wph->set_static_environment_file();
241
+
242
+ //clear teh site cache
243
+ $this->wph->functions->site_cache_clear();
244
 
245
 
246
  //save the last code version
247
  $this->wph->settings['version'] = WPH_CORE_VERSION;
248
+ $this->wph->functions->update_settings($this->wph->settings);
249
 
250
  }
251
 
266
  require_once(ABSPATH . 'wp-admin/includes/file.php');
267
 
268
  flush_rewrite_rules();
269
+
 
270
  }
271
 
272
  }
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.2
7
- Stable tag: 1.5.7
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
@@ -292,6 +292,17 @@ Please get in touch with us and we'll do our best to include it for a next versi
292
 
293
  == Changelog ==
294
 
 
 
 
 
 
 
 
 
 
 
 
295
  = 1.5.7 =
296
  * Autoptimize css/js cache and minify compatibility
297
  * Wp Hummingbird and WP Hummingbird PRO assets cache compatibility
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.2.2
7
+ Stable tag: 1.5.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
292
 
293
  == Changelog ==
294
 
295
+ = 1.5.8 =
296
+ * Add reserved option names to avoid conflicts e.g. wp
297
+ * Always clear any code plugin cache when plugin update
298
+ * Easy Digital Downloads compatibility
299
+ * Elementor plugin compatibility
300
+ * Fusion Builder plugin compatibility
301
+ * Divi theme compatibility updates
302
+ * WP Fastest Cache plugin compatibility updates
303
+ * Check if ob_gzhandler and zlib.output_compression before using 'ob_gzhandler' output buffering handler
304
+
305
+
306
  = 1.5.7 =
307
  * Autoptimize css/js cache and minify compatibility
308
  * Wp Hummingbird and WP Hummingbird PRO assets cache compatibility
router/class.file-processor.php CHANGED
@@ -71,7 +71,12 @@
71
 
72
  if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false)
73
  {
74
- ob_start('ob_gzhandler'); ob_start();
 
 
 
 
 
75
  }
76
  else
77
  {
71
 
72
  if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false)
73
  {
74
+ if ( function_exists('ob_gzhandler') && ini_get('zlib.output_compression'))
75
+ ob_start();
76
+ else
77
+ {
78
+ ob_start('ob_gzhandler'); ob_start();
79
+ }
80
  }
81
  else
82
  {
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.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.8
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */