WP Hide & Security Enhancer - Version 1.6

Version Description

  • New filter wp-hide/content_urls_replacement
  • Compatibility with Ultimate Member, user picture upload fix
  • Updated compatibility with W3 Cache, using postprocessorRequire option
  • Fluentform compatibility updates
  • Outputs the whole stack of errors for $wp_filesystem if exists
  • Typo fix in Uploads module
Download this release

Release Info

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

Code changes from version 1.5.9.9 to 1.6

compatibility/fluentform.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Compatibility for Plugin Name: Fluent Forms - Best Form Plugin for WordPress
6
+ * Compatibility checked on Version: 3.5.5
7
+ */
8
+
9
+ class WPH_conflict_handle_fluentform
10
+ {
11
+
12
+ static function init()
13
+ {
14
+ if( ! self::is_plugin_active() )
15
+ return FALSE;
16
+
17
+ add_action('wp-hide/content_urls_replacement', array( 'WPH_conflict_handle_fluentform', '_content_urls_replacement' ), 10, 2 );
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( 'fluentform/fluentform.php' ) )
27
+ return TRUE;
28
+ else
29
+ return FALSE;
30
+ }
31
+
32
+ static function _content_urls_replacement( $text, $_replacements )
33
+ {
34
+
35
+ global $wph;
36
+
37
+ /**
38
+ * Process Double json encoded urls
39
+ */
40
+ foreach($_replacements as $old_url => $new_url)
41
+ {
42
+ $old_url = trim(json_encode( trim(json_encode($old_url), '"') ), '"');
43
+ $new_url = trim(json_encode( trim(json_encode($new_url), '"') ), '"');
44
+
45
+ $text = str_ireplace( $old_url, $new_url ,$text );
46
+ }
47
+
48
+ return $text;
49
+
50
+ }
51
+
52
+
53
+ }
54
+
55
+
56
+ WPH_conflict_handle_fluentform::init();
57
+
58
+
59
+
60
+ ?>
compatibility/themes/buddyboss-theme.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Theme Compatibility : BuddyBoss Theme
5
+ * Introduced at version : 1.4.1
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+
11
+ class WPH_conflict_theme_buddyboss_theme
12
+ {
13
+
14
+ static function init()
15
+ {
16
+ add_filter( 'init', array ( 'WPH_conflict_theme_buddyboss_theme', 'setup_theme') );
17
+ }
18
+
19
+
20
+ static function setup_theme()
21
+ {
22
+ remove_filter('login_redirect', 'buddyboss_redirect_previous_page');
23
+ }
24
+
25
+ }
26
+
27
+
28
+ WPH_conflict_theme_buddyboss_theme::init();
29
+
30
+
31
+ ?>
compatibility/ultimate-member.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Compatibility for Plugin Name: Ultimate Member
5
+ * Compatibility checked on Version: 2.1.5
6
+ */
7
+
8
+ class WPH_conflict_handle_ultimate_member
9
+ {
10
+
11
+ static function init()
12
+ {
13
+ if( ! self::is_plugin_active() )
14
+ return FALSE;
15
+
16
+ if ( isset ( $_POST['action'] ) && $_POST['action'] == 'um_resize_image' )
17
+ self::_reverse_urls();
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( 'ultimate-member/ultimate-member.php' ) )
27
+ return TRUE;
28
+ else
29
+ return FALSE;
30
+ }
31
+
32
+ static function _reverse_urls( )
33
+ {
34
+
35
+ global $wph;
36
+
37
+ $src = $_POST['src'];
38
+
39
+ $src = $wph->functions->content_urls_replacement( $src, array_flip ( $wph->functions->get_replacement_list() ) );
40
+
41
+ $_POST['src'] = $src;
42
+ }
43
+
44
+
45
+ }
46
+
47
+
48
+ WPH_conflict_handle_ultimate_member::init();
49
+
50
+
51
+ ?>
compatibility/w3-cache.php CHANGED
@@ -6,11 +6,11 @@
6
 
7
  static function init()
8
  {
9
- add_action('plugins_loaded', array('WPH_conflict_handle_w3_cache', 'pagecache') , -1);
10
 
11
- add_filter( 'w3tc_filename_to_url', array('WPH_conflict_handle_w3_cache', 'w3tc_filename_to_url') , -1);
12
 
13
- add_filter( 'init' , array('WPH_conflict_handle_w3_cache', 'on_init') , -1);
14
  }
15
 
16
  static function is_plugin_active()
@@ -76,6 +76,29 @@
76
 
77
  }
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
 
81
 
6
 
7
  static function init()
8
  {
9
+ add_action('plugins_loaded', array('WPH_conflict_handle_w3_cache', 'pagecache') , -1);
10
 
11
+ add_filter( 'w3tc_filename_to_url', array('WPH_conflict_handle_w3_cache', 'w3tc_filename_to_url') , -1);
12
 
13
+ add_filter( 'w3tc_minify_file_handler_minify_options', array('WPH_conflict_handle_w3_cache', 'w3tc_minify_file_handler_minify_options') );
14
  }
15
 
16
  static function is_plugin_active()
76
 
77
  }
78
 
79
+
80
+ static function w3tc_minify_file_handler_minify_options( $serve_options)
81
+ {
82
+ $serve_options['postprocessor'] = array( 'WPH_conflict_handle_w3_cache', 'w3tc_process_content' );
83
+
84
+ return $serve_options;
85
+ }
86
+
87
+ static function w3tc_process_content( $content, $type )
88
+ {
89
+ global $wph;
90
+
91
+ //applay the replacements
92
+ $content = $wph->ob_start_callback( $content );
93
+
94
+ if ( preg_match( '/\/cache\/minify\/\w+\.(?:css|js)/i', $_SERVER['REQUEST_URI'] ) )
95
+ {
96
+ add_filter( 'wp-hide/ignore_ob_start_callback', '__return_true' );
97
+ }
98
+
99
+ return $content;
100
+ }
101
+
102
  }
103
 
104
 
include/class.compatibility.php CHANGED
@@ -100,6 +100,11 @@
100
  //ShortCode Image Optimizer
101
  include_once(WPH_PATH . 'compatibility/shortpixel-image-optimiser.php');
102
 
 
 
 
 
 
103
 
104
  /**
105
  * Themes
@@ -113,7 +118,8 @@
113
  $compatibility_themes = array(
114
  'avada' => 'avada.php',
115
  'divi' => 'divi.php',
116
- 'woodmart' => 'woodmart.php'
 
117
  );
118
 
119
  if (isset( $theme->template ) )
100
  //ShortCode Image Optimizer
101
  include_once(WPH_PATH . 'compatibility/shortpixel-image-optimiser.php');
102
 
103
+ //Fluentform
104
+ include_once(WPH_PATH . 'compatibility/fluentform.php');
105
+
106
+ //Ultimate Member
107
+ include_once(WPH_PATH . 'compatibility/ultimate-member.php');
108
 
109
  /**
110
  * Themes
118
  $compatibility_themes = array(
119
  'avada' => 'avada.php',
120
  'divi' => 'divi.php',
121
+ 'woodmart' => 'woodmart.php',
122
+ 'buddyboss-theme' => 'buddyboss-theme.php',
123
  );
124
 
125
  if (isset( $theme->template ) )
include/class.environment.php CHANGED
@@ -141,7 +141,7 @@
141
 
142
  $error_messages[] = array(
143
  'type' => 'error',
144
- 'message' => __('<b>WP Hide</b> - Unable to create environment static file. The system returned the following error: ', 'wp-hide-security-enhancer') . $wp_filesystem->errors->get_error_messages()
145
  );
146
 
147
  update_option( 'wph-process_set_static_environment_errors', $error_messages);
141
 
142
  $error_messages[] = array(
143
  'type' => 'error',
144
+ 'message' => __('<b>WP Hide</b> - Unable to create environment static file. The system returned the following error: ', 'wp-hide-security-enhancer') . implode("," , (array)$wp_filesystem->errors->get_error_messages() )
145
  );
146
 
147
  update_option( 'wph-process_set_static_environment_errors', $error_messages);
include/functions.class.php CHANGED
@@ -1579,6 +1579,8 @@
1579
 
1580
  $text = str_ireplace( trim( urlencode(trim( $old_url, '"')), '"' ) , trim( urlencode(trim ( $new_url, '"')), '"' ) ,$text );
1581
  }
 
 
1582
 
1583
  /**
1584
  * Restore absolute paths
@@ -2167,7 +2169,7 @@
2167
  return $phpmailer->Send();
2168
  } catch ( phpmailerException $e ) {
2169
 
2170
- $mail_error_data = compact( $to, $subject, $message, $headers, $attachments );
2171
 
2172
  /**
2173
  * Fires after a phpmailerException is caught.
1579
 
1580
  $text = str_ireplace( trim( urlencode(trim( $old_url, '"')), '"' ) , trim( urlencode(trim ( $new_url, '"')), '"' ) ,$text );
1581
  }
1582
+
1583
+ $text = apply_filters( 'wp-hide/content_urls_replacement', $text, $_replacements );
1584
 
1585
  /**
1586
  * Restore absolute paths
2169
  return $phpmailer->Send();
2170
  } catch ( phpmailerException $e ) {
2171
 
2172
+ $mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
2173
 
2174
  /**
2175
  * Fires after a phpmailerException is caught.
include/wph.class.php CHANGED
@@ -925,7 +925,7 @@
925
  }
926
  }
927
 
928
- $rules = apply_filters('wp-hide/mod_rewrite_rules', $rules);
929
 
930
 
931
  $home_root = parse_url(home_url());
925
  }
926
  }
927
 
928
+ $rules = apply_filters('wp-hide/mod_rewrite_rules', $rules, 'apache');
929
 
930
 
931
  $home_root = parse_url(home_url());
modules/components/rewrite-new_upload_path.php CHANGED
@@ -38,7 +38,7 @@
38
 
39
  'help' => array(
40
  'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Block default uploads URL', 'wp-hide-security-enhancer'),
41
- 'description' => __("This blocks the default wp-content/plugins/ url.<br />The functionality apply only if <b>New Plugins Path</b> option is filled in.", 'wp-hide-security-enhancer'),
42
  'option_documentation_url' => 'https://www.wp-hide.com/documentation/rewrite-uploads/'
43
  ),
44
 
38
 
39
  'help' => array(
40
  'title' => __('Help', 'wp-hide-security-enhancer') . ' - ' . __('Block default uploads URL', 'wp-hide-security-enhancer'),
41
+ 'description' => __("This blocks the default wp-content/uploads/ url.<br />The functionality apply only if <b>New Plugins Path</b> option is filled in.", 'wp-hide-security-enhancer'),
42
  'option_documentation_url' => 'https://www.wp-hide.com/documentation/rewrite-uploads/'
43
  ),
44
 
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
7
- Stable tag: 1.5.9.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
@@ -336,6 +336,15 @@ Please get in touch with us and we'll do our best to include it for a next versi
336
 
337
  == Changelog ==
338
 
 
 
 
 
 
 
 
 
 
339
  = 1.5.9.9 =
340
  * Updated procedure for server type identification
341
  * Add new type text/plain for filterable content
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.1
7
+ Stable tag: 1.6
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
336
 
337
  == Changelog ==
338
 
339
+ = 1.6 =
340
+ * New filter wp-hide/content_urls_replacement
341
+ * Compatibility with Ultimate Member, user picture upload fix
342
+ * Updated compatibility with W3 Cache, using postprocessorRequire option
343
+ * Fluentform compatibility updates
344
+ * Outputs the whole stack of errors for $wp_filesystem if exists
345
+ * Typo fix in Uploads module
346
+
347
+
348
  = 1.5.9.9 =
349
  * Updated procedure for server type identification
350
  * Add new type text/plain for filterable content
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.9.9
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
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */