Version Description
- Post-process on options interface save for unique slugs on any text inputs to prevent conflicts.
- Processing Order change for new_theme_child_path to occur before new_theme_path
- New COmponent General -> Oembed
- Remove Oembed tags from header
- Remove Remove Resource Hints tags from header
- rewrite rules update to match only non base, from (.*) to (.+)
- wph-throw-404 improvements
- BuddyPress conflict handle for uploaded gravatars
- Admin Style changes
- BuddyPress Conflict Class handler
- Separate WordPress meta Generator and Other Meta Generator
- Process Location value within sent Headers list if exists
- Replacements for https and http urls relative to domain
- Add replacements for relative paths to cover WordPress installs within a folder.
- Use untralingslashit when creating theme and child theme url replacements
- Fix for Call to a member function is_404() on a non-object within wp_redirect
Download this release
Release Info
Developer | nsp-code |
Plugin | WP Hide & Security Enhancer |
Version | 1.3.6 |
Comparing to | |
See all releases |
Code changes from version 1.3.5.1 to 1.3.6
- conflicts/buddypress.php +95 -0
- conflicts/super-cache.php +3 -3
- conflicts/w3-cache.php +2 -2
- css/wph.css +1 -1
- include/admin-interface.class.php +1 -1
- include/functions.class.php +69 -11
- include/wph.class.php +60 -7
- modules/components/admin-admin_url.php +13 -13
- modules/components/general-headers.php +2 -2
- modules/components/general-html.php +10 -11
- modules/components/general-meta.php +92 -3
- modules/components/general-oembed.php +43 -0
- modules/components/rewrite-json-rest.php +1 -1
- modules/components/rewrite-new_include_path.php +5 -5
- modules/components/rewrite-new_plugin_path.php +7 -7
- modules/components/rewrite-new_theme_path.php +12 -12
- modules/components/rewrite-new_upload_path.php +5 -5
- modules/components/rewrite-wp_content_path.php +5 -5
- modules/module-general.php +3 -0
- readme.txt +22 -2
- wp-hide.php +2 -2
conflicts/buddypress.php
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class WPH_conflict_handle_BuddyPress
|
5 |
+
{
|
6 |
+
|
7 |
+
static function init()
|
8 |
+
{
|
9 |
+
if( ! self::is_plugin_active())
|
10 |
+
return FALSE;
|
11 |
+
|
12 |
+
//add bufer filtering for sueprcache plugin
|
13 |
+
//trigger only on admin
|
14 |
+
if(is_admin())
|
15 |
+
{
|
16 |
+
add_filter('wp-hide/loaded_modules', array('WPH_conflict_handle_BuddyPress', 'loaded_modules'), 999);
|
17 |
+
}
|
18 |
+
|
19 |
+
//adjust bp_core_avatar_url
|
20 |
+
add_filter('bp_core_avatar_url', array('WPH_conflict_handle_BuddyPress', 'bp_core_avatar_url'), 999);
|
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( 'buddypress/bp-loader.php' ))
|
30 |
+
return TRUE;
|
31 |
+
else
|
32 |
+
return FALSE;
|
33 |
+
}
|
34 |
+
|
35 |
+
static public function budypress()
|
36 |
+
{
|
37 |
+
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
+
static function loaded_modules( $modules )
|
42 |
+
{
|
43 |
+
//iterate all modules and seek for "remove_other_generator_meta"
|
44 |
+
foreach($modules as $block_key => $block)
|
45 |
+
{
|
46 |
+
foreach($block->components as $module_key => $module)
|
47 |
+
{
|
48 |
+
foreach($module->module_settings as $component_key => $component)
|
49 |
+
{
|
50 |
+
|
51 |
+
if(!isset($component['id']))
|
52 |
+
continue;
|
53 |
+
|
54 |
+
if($component['id'] == 'remove_other_generator_meta')
|
55 |
+
{
|
56 |
+
$modules[$block_key]->components[$module_key]->module_settings[$component_key]['description'] .= '<div class="notice-error"><div class="dashicons dashicons-warning important" alt="f534">warning</div> <span class="important">' . __('This setting produce a conflict with BuddyPress and should be kept disabled.', 'wp-hide-security-enhancer') . '</span></div>';
|
57 |
+
}
|
58 |
+
|
59 |
+
if($component['id'] == 'styles_remove_id_attribute')
|
60 |
+
{
|
61 |
+
$modules[$block_key]->components[$module_key]->module_settings[$component_key]['description'] .= '<div class="notice-error"><div class="dashicons dashicons-warning important" alt="f534">warning</div> <span class="important">' . __('This setting produce a conflict with BuddyPress and should be kept disabled.', 'wp-hide-security-enhancer') . '</span></div>';
|
62 |
+
}
|
63 |
+
|
64 |
+
if($component['id'] == 'clean_image_classes')
|
65 |
+
{
|
66 |
+
$modules[$block_key]->components[$module_key]->module_settings[$component_key]['description'] .= '<div class="notice-error"><div class="dashicons dashicons-warning important" alt="f534">warning</div> <span class="important">' . __('This setting produce a conflict with BuddyPress and should be kept disabled.', 'wp-hide-security-enhancer') . '</span></div>';
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
return $modules;
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
static function bp_core_avatar_url( $url )
|
77 |
+
{
|
78 |
+
global $wph;
|
79 |
+
|
80 |
+
//retrieve the replacements list
|
81 |
+
$replacement_list = $wph->functions->get_replacement_list();
|
82 |
+
|
83 |
+
//do replacements for this url
|
84 |
+
$url = $wph->functions->content_urls_replacement($url, $wph->functions->get_replacement_list() );
|
85 |
+
|
86 |
+
return $url;
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
?>
|
conflicts/super-cache.php
CHANGED
@@ -4,9 +4,9 @@
|
|
4 |
class WPH_conflict_handle_super_cache
|
5 |
{
|
6 |
|
7 |
-
function
|
8 |
{
|
9 |
-
|
10 |
}
|
11 |
|
12 |
static function is_plugin_active()
|
@@ -20,7 +20,7 @@
|
|
20 |
return FALSE;
|
21 |
}
|
22 |
|
23 |
-
static public function
|
24 |
{
|
25 |
if( ! self::is_plugin_active())
|
26 |
return FALSE;
|
4 |
class WPH_conflict_handle_super_cache
|
5 |
{
|
6 |
|
7 |
+
static function init()
|
8 |
{
|
9 |
+
add_action('plugins_loaded', array('WPH_conflict_handle_super_cache', 'wpcache') , -1);
|
10 |
}
|
11 |
|
12 |
static function is_plugin_active()
|
20 |
return FALSE;
|
21 |
}
|
22 |
|
23 |
+
static public function wpcache()
|
24 |
{
|
25 |
if( ! self::is_plugin_active())
|
26 |
return FALSE;
|
conflicts/w3-cache.php
CHANGED
@@ -4,9 +4,9 @@
|
|
4 |
class WPH_conflict_handle_w3_cache
|
5 |
{
|
6 |
|
7 |
-
function
|
8 |
{
|
9 |
-
|
10 |
}
|
11 |
|
12 |
static function is_plugin_active()
|
4 |
class WPH_conflict_handle_w3_cache
|
5 |
{
|
6 |
|
7 |
+
static function init()
|
8 |
{
|
9 |
+
add_action('plugins_loaded', array('WPH_conflict_handle_w3_cache', 'pagecache') , -1);
|
10 |
}
|
11 |
|
12 |
static function is_plugin_active()
|
css/wph.css
CHANGED
@@ -43,7 +43,7 @@ table.wph_input tbody tr td.label .description span a {display: block}
|
|
43 |
table.wph_input tbody tr td.label .description span.important {color: #444}
|
44 |
table.wph_input tbody tr td.label .description .pointer {cursor:pointer}
|
45 |
table.wph_input tbody tr td.label .description .notice-success, table.wph_input tbody tr td.label .description .notice-error {padding: 10px 12px; background-color: #fff;}
|
46 |
-
table.wph_input tbody tr.submit td {
|
47 |
table.wph_input tbody tr.submit td.label {border-right: 1px solid #F9F9F9}
|
48 |
table.wph_input input[type=text],table.wph_input textarea,table.wph_input select{ width: 99.95%; outline: none;}
|
49 |
table.wph_input select { padding: 2px;}
|
43 |
table.wph_input tbody tr td.label .description span.important {color: #444}
|
44 |
table.wph_input tbody tr td.label .description .pointer {cursor:pointer}
|
45 |
table.wph_input tbody tr td.label .description .notice-success, table.wph_input tbody tr td.label .description .notice-error {padding: 10px 12px; background-color: #fff;}
|
46 |
+
table.wph_input tbody tr.submit td { text-align: right}
|
47 |
table.wph_input tbody tr.submit td.label {border-right: 1px solid #F9F9F9}
|
48 |
table.wph_input input[type=text],table.wph_input textarea,table.wph_input select{ width: 99.95%; outline: none;}
|
49 |
table.wph_input select { padding: 2px;}
|
include/admin-interface.class.php
CHANGED
@@ -112,7 +112,7 @@
|
|
112 |
<tbody>
|
113 |
<tr class="submit">
|
114 |
<td class="label"> </td>
|
115 |
-
<td>
|
116 |
<input type="submit" value="Save" class="button-primary alignright">
|
117 |
</td>
|
118 |
</tr>
|
112 |
<tbody>
|
113 |
<tr class="submit">
|
114 |
<td class="label"> </td>
|
115 |
+
<td class="label">
|
116 |
<input type="submit" value="Save" class="button-primary alignright">
|
117 |
</td>
|
118 |
</tr>
|
include/functions.class.php
CHANGED
@@ -162,6 +162,8 @@
|
|
162 |
//proces the fields
|
163 |
$module_settings = $this->filter_settings( $module->get_module_settings($tab_slug) );
|
164 |
|
|
|
|
|
165 |
foreach($module_settings as $module_setting)
|
166 |
{
|
167 |
if(isset($module_setting['type']) && $module_setting['type'] == 'split')
|
@@ -181,15 +183,58 @@
|
|
181 |
$value = call_user_func_array($sanitize, array($value));
|
182 |
}
|
183 |
|
184 |
-
//
|
185 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
-
|
188 |
-
//update the settings
|
189 |
-
$this->update_settings($wph->settings);
|
190 |
|
191 |
-
//
|
192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
|
194 |
//redirect
|
195 |
$new_admin_url = $this->get_module_item_setting('admin_url' , 'admin');
|
@@ -754,9 +799,13 @@
|
|
754 |
|
755 |
//exclude scheme to match urls without it
|
756 |
$_replacements = array();
|
757 |
-
$_relative_url_replacements
|
|
|
758 |
|
759 |
-
$home_url
|
|
|
|
|
|
|
760 |
|
761 |
foreach($replacements as $old_url => $new_url)
|
762 |
{
|
@@ -764,17 +813,26 @@
|
|
764 |
$_relative_url_replacements[ '"' . str_ireplace( $home_url, "", $old_url) ] = '"' . str_ireplace( $home_url, "", $new_url);
|
765 |
$_relative_url_replacements[ "'" . str_ireplace( $home_url, "", $old_url) ] = "'" . str_ireplace( $home_url, "", $new_url);
|
766 |
|
|
|
|
|
|
|
|
|
|
|
767 |
$old_url = str_ireplace( array('http://', 'https://'), "", $old_url);
|
768 |
$new_url = str_ireplace( array('http://', 'https://'), "", $new_url);
|
769 |
|
770 |
$_replacements[$old_url] = $new_url;
|
771 |
}
|
772 |
-
|
773 |
|
774 |
$text = str_ireplace( array_keys($_replacements), array_values($_replacements) ,$text );
|
|
|
|
|
|
|
775 |
//relative urls replacements
|
776 |
$text = str_ireplace( array_keys($_relative_url_replacements), array_values($_relative_url_replacements) ,$text );
|
777 |
|
|
|
778 |
//check for json encoded urls
|
779 |
foreach($_replacements as $old_url => $new_url)
|
780 |
{
|
@@ -783,7 +841,7 @@
|
|
783 |
|
784 |
$text = str_ireplace( $old_url, $new_url ,$text );
|
785 |
}
|
786 |
-
|
787 |
return $text;
|
788 |
}
|
789 |
|
162 |
//proces the fields
|
163 |
$module_settings = $this->filter_settings( $module->get_module_settings($tab_slug) );
|
164 |
|
165 |
+
$unique_require_updated_settings = array();
|
166 |
+
|
167 |
foreach($module_settings as $module_setting)
|
168 |
{
|
169 |
if(isset($module_setting['type']) && $module_setting['type'] == 'split')
|
183 |
$value = call_user_func_array($sanitize, array($value));
|
184 |
}
|
185 |
|
186 |
+
//held the value
|
187 |
+
if ($module_setting['input_type'] == 'text' && !empty( $value ))
|
188 |
+
{
|
189 |
+
//if require unique, save for postprocessing
|
190 |
+
$unique_require_updated_settings[ $field_name ] = array(
|
191 |
+
'module_name' => $module_setting['label'],
|
192 |
+
'value' => $value
|
193 |
+
);
|
194 |
+
}
|
195 |
+
else
|
196 |
+
$wph->settings['module_settings'][ $field_name ] = $value;
|
197 |
}
|
|
|
|
|
|
|
198 |
|
199 |
+
//delete previous errors transient
|
200 |
+
delete_transient( 'wph-process_interface_save_errors' );
|
201 |
+
|
202 |
+
$errors = FALSE;
|
203 |
+
$process_interface_save_errors = array();
|
204 |
+
|
205 |
+
//clean the just updated fields within main settings array
|
206 |
+
foreach($unique_require_updated_settings as $field_name => $data)
|
207 |
+
{
|
208 |
+
if( isset($wph->settings['module_settings'][ $field_name ]) )
|
209 |
+
$wph->settings['module_settings'][ $field_name ] = '';
|
210 |
+
|
211 |
+
//check if the value already exists in other setting
|
212 |
+
if(array_search( $data['value'] , $wph->settings['module_settings']) !== FALSE)
|
213 |
+
{
|
214 |
+
$errors = TRUE;
|
215 |
+
$process_interface_save_errors[] = __('Value', 'wp-hide-security-enhancer') . ' <b>' . $data['value'] .'</b> ' . __('set for', 'wp-hide-security-enhancer') . ' ' . __($data['module_name'], 'wp-hide-security-enhancer') . ' ' . __('already in use for another option.', 'wp-hide-security-enhancer');
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
if( $errors === FALSE)
|
220 |
+
{
|
221 |
+
//save the options list to main array
|
222 |
+
foreach($unique_require_updated_settings as $field_name => $data)
|
223 |
+
{
|
224 |
+
$wph->settings['module_settings'][ $field_name ] = $data['value'];
|
225 |
+
}
|
226 |
+
|
227 |
+
//update the settings
|
228 |
+
$this->update_settings($wph->settings);
|
229 |
+
|
230 |
+
//trigger the settings changed action
|
231 |
+
do_action('wph/settings_changed', $screen_slug, $tab_slug);
|
232 |
+
}
|
233 |
+
else
|
234 |
+
{
|
235 |
+
//store the error for display purpose
|
236 |
+
set_transient( 'wph-process_interface_save_errors', $process_interface_save_errors, HOUR_IN_SECONDS );
|
237 |
+
}
|
238 |
|
239 |
//redirect
|
240 |
$new_admin_url = $this->get_module_item_setting('admin_url' , 'admin');
|
799 |
|
800 |
//exclude scheme to match urls without it
|
801 |
$_replacements = array();
|
802 |
+
$_relative_url_replacements = array();
|
803 |
+
$_relative_domain_url_replacements = array();
|
804 |
|
805 |
+
$home_url = home_url();
|
806 |
+
$home_url_parsed = parse_url($home_url);
|
807 |
+
$domain_url = 'http://' . $home_url_parsed['host'];
|
808 |
+
$domain_url_ssl = 'https://' . $home_url_parsed['host'];
|
809 |
|
810 |
foreach($replacements as $old_url => $new_url)
|
811 |
{
|
813 |
$_relative_url_replacements[ '"' . str_ireplace( $home_url, "", $old_url) ] = '"' . str_ireplace( $home_url, "", $new_url);
|
814 |
$_relative_url_replacements[ "'" . str_ireplace( $home_url, "", $old_url) ] = "'" . str_ireplace( $home_url, "", $new_url);
|
815 |
|
816 |
+
$_relative_domain_url_replacements[ '"' . str_ireplace( $domain_url, "", $old_url) ] = '"' . str_ireplace( $domain_url, "", $new_url);
|
817 |
+
$_relative_domain_url_replacements[ "'" . str_ireplace( $domain_url, "", $old_url) ] = "'" . str_ireplace( $domain_url, "", $new_url);
|
818 |
+
$_relative_domain_url_replacements[ '"' . str_ireplace( $domain_url_ssl, "", $old_url) ] = '"' . str_ireplace( $domain_url_ssl, "", $new_url);
|
819 |
+
$_relative_domain_url_replacements[ "'" . str_ireplace( $domain_url_ssl, "", $old_url) ] = "'" . str_ireplace( $domain_url_ssl, "", $new_url);
|
820 |
+
|
821 |
$old_url = str_ireplace( array('http://', 'https://'), "", $old_url);
|
822 |
$new_url = str_ireplace( array('http://', 'https://'), "", $new_url);
|
823 |
|
824 |
$_replacements[$old_url] = $new_url;
|
825 |
}
|
826 |
+
|
827 |
|
828 |
$text = str_ireplace( array_keys($_replacements), array_values($_replacements) ,$text );
|
829 |
+
|
830 |
+
//relative tp domain urls replacements; using subfolder e.g. 127.0.0.1/wp01/wordpress_site, this will be /wp01/wordpress_site
|
831 |
+
$text = str_ireplace( array_keys($_relative_domain_url_replacements), array_values($_relative_domain_url_replacements) ,$text );
|
832 |
//relative urls replacements
|
833 |
$text = str_ireplace( array_keys($_relative_url_replacements), array_values($_relative_url_replacements) ,$text );
|
834 |
|
835 |
+
|
836 |
//check for json encoded urls
|
837 |
foreach($_replacements as $old_url => $new_url)
|
838 |
{
|
841 |
|
842 |
$text = str_ireplace( $old_url, $new_url ,$text );
|
843 |
}
|
844 |
+
|
845 |
return $text;
|
846 |
}
|
847 |
|
include/wph.class.php
CHANGED
@@ -80,6 +80,9 @@
|
|
80 |
|
81 |
$this->get_default_variables();
|
82 |
|
|
|
|
|
|
|
83 |
$this->_load_modules();
|
84 |
|
85 |
$this->add_default_replacements();
|
@@ -90,9 +93,7 @@
|
|
90 |
add_action( 'activated_plugin', array($this, 'activated_plugin'), 999, 2 );
|
91 |
|
92 |
remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
|
93 |
-
|
94 |
-
add_action('plugins_loaded', array($this, 'plugin_conflicts') , -1);
|
95 |
-
|
96 |
//change any links within email message
|
97 |
add_filter('wp_mail', array($this, 'apply_for_wp_mail') , 999);
|
98 |
|
@@ -336,7 +337,22 @@
|
|
336 |
if($this->server_web_config === TRUE && !$this->functions->is_writable_web_config_file())
|
337 |
echo "<div class='error'><p>". __('Unable to write custom rules to your web.config. Is this file writable? <br />No mod is being applied.', 'wp-hide-security-enhancer') ."</p></div>";
|
338 |
|
339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
|
341 |
$this->functions->settings_changed_check_for_cache_plugins();
|
342 |
}
|
@@ -370,9 +386,25 @@
|
|
370 |
|
371 |
$buffer = $decoded;
|
372 |
}
|
|
|
|
|
|
|
373 |
|
374 |
//replace the urls
|
375 |
-
$buffer = $this->functions->content_urls_replacement($buffer, $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
|
377 |
$buffer = apply_filters( 'wph/ob_start_callback', $buffer );
|
378 |
|
@@ -381,6 +413,7 @@
|
|
381 |
//compress the buffer
|
382 |
$buffer = gzencode($buffer);
|
383 |
}
|
|
|
384 |
|
385 |
return $buffer;
|
386 |
|
@@ -401,6 +434,7 @@
|
|
401 |
status_header(404);
|
402 |
|
403 |
add_action('request', array($this, 'change_request'), 999);
|
|
|
404 |
|
405 |
remove_action( 'template_redirect', 'wp_redirect_admin_locations', 999 );
|
406 |
|
@@ -418,6 +452,17 @@
|
|
418 |
return array();
|
419 |
|
420 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
|
422 |
|
423 |
/**
|
@@ -464,6 +509,10 @@
|
|
464 |
|
465 |
//do not replace 404 pages
|
466 |
global $wp_the_query;
|
|
|
|
|
|
|
|
|
467 |
if($wp_the_query->is_404())
|
468 |
return $location;
|
469 |
|
@@ -926,11 +975,15 @@
|
|
926 |
|
927 |
//w3-cache conflicts handle
|
928 |
include_once(WPH_PATH . 'conflicts/w3-cache.php');
|
929 |
-
WPH_conflict_handle_w3_cache::
|
930 |
|
931 |
//super-cache conflicts handle
|
932 |
include_once(WPH_PATH . 'conflicts/super-cache.php');
|
933 |
-
WPH_conflict_handle_super_cache::init();
|
|
|
|
|
|
|
|
|
934 |
|
935 |
}
|
936 |
|
80 |
|
81 |
$this->get_default_variables();
|
82 |
|
83 |
+
//handle the conflicts
|
84 |
+
$this->plugin_conflicts();
|
85 |
+
|
86 |
$this->_load_modules();
|
87 |
|
88 |
$this->add_default_replacements();
|
93 |
add_action( 'activated_plugin', array($this, 'activated_plugin'), 999, 2 );
|
94 |
|
95 |
remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
|
96 |
+
|
|
|
|
|
97 |
//change any links within email message
|
98 |
add_filter('wp_mail', array($this, 'apply_for_wp_mail') , 999);
|
99 |
|
337 |
if($this->server_web_config === TRUE && !$this->functions->is_writable_web_config_file())
|
338 |
echo "<div class='error'><p>". __('Unable to write custom rules to your web.config. Is this file writable? <br />No mod is being applied.', 'wp-hide-security-enhancer') ."</p></div>";
|
339 |
|
340 |
+
//check for interface save processing errors
|
341 |
+
$process_interface_save_errors = get_transient( 'wph-process_interface_save_errors' );
|
342 |
+
if( $process_interface_save_errors === FALSE || (is_array($process_interface_save_errors) && count($process_interface_save_errors) < 1))
|
343 |
+
echo "<div class='updated'><p>". __('Settings saved', 'wp-hide-security-enhancer') ."</p></div>";
|
344 |
+
else
|
345 |
+
{
|
346 |
+
echo "<div class='error'><p>". __('Some errors occurred, no setting has been saved!', 'wp-hide-security-enhancer') ."</p></div>";
|
347 |
+
echo "<div class='error'><p>";
|
348 |
+
|
349 |
+
foreach ($process_interface_save_errors as $error)
|
350 |
+
{
|
351 |
+
echo $error .'<br />';
|
352 |
+
}
|
353 |
+
|
354 |
+
echo "</p></div>";
|
355 |
+
}
|
356 |
|
357 |
$this->functions->settings_changed_check_for_cache_plugins();
|
358 |
}
|
386 |
|
387 |
$buffer = $decoded;
|
388 |
}
|
389 |
+
|
390 |
+
//retrieve the replacements list
|
391 |
+
$replacement_list = $this->functions->get_replacement_list();
|
392 |
|
393 |
//replace the urls
|
394 |
+
$buffer = $this->functions->content_urls_replacement($buffer, $replacement_list );
|
395 |
+
|
396 |
+
//check for redirect header and make updates
|
397 |
+
if(isset($response_headers['Location']))
|
398 |
+
{
|
399 |
+
$header_value = $response_headers['Location'];
|
400 |
+
$new_header_value = $this->functions->content_urls_replacement($header_value, $replacement_list );
|
401 |
+
|
402 |
+
if($header_value != $new_header_value)
|
403 |
+
{
|
404 |
+
header_remove("Location");
|
405 |
+
header( 'Location: ' . $new_header_value );
|
406 |
+
}
|
407 |
+
}
|
408 |
|
409 |
$buffer = apply_filters( 'wph/ob_start_callback', $buffer );
|
410 |
|
413 |
//compress the buffer
|
414 |
$buffer = gzencode($buffer);
|
415 |
}
|
416 |
+
|
417 |
|
418 |
return $buffer;
|
419 |
|
434 |
status_header(404);
|
435 |
|
436 |
add_action('request', array($this, 'change_request'), 999);
|
437 |
+
add_action('parse_request', array($this, 'change_parse_request'), 999);
|
438 |
|
439 |
remove_action( 'template_redirect', 'wp_redirect_admin_locations', 999 );
|
440 |
|
452 |
return array();
|
453 |
|
454 |
}
|
455 |
+
|
456 |
+
function change_parse_request( $object )
|
457 |
+
{
|
458 |
+
|
459 |
+
$object->request = NULL;
|
460 |
+
$object->matched_rule = NULL;
|
461 |
+
$object->matched_query = NULL;
|
462 |
+
|
463 |
+
$object->query_vars['error'] = 404;
|
464 |
+
|
465 |
+
}
|
466 |
|
467 |
|
468 |
/**
|
509 |
|
510 |
//do not replace 404 pages
|
511 |
global $wp_the_query;
|
512 |
+
|
513 |
+
if(!is_object($wp_the_query))
|
514 |
+
return $location;
|
515 |
+
|
516 |
if($wp_the_query->is_404())
|
517 |
return $location;
|
518 |
|
975 |
|
976 |
//w3-cache conflicts handle
|
977 |
include_once(WPH_PATH . 'conflicts/w3-cache.php');
|
978 |
+
WPH_conflict_handle_w3_cache::init();
|
979 |
|
980 |
//super-cache conflicts handle
|
981 |
include_once(WPH_PATH . 'conflicts/super-cache.php');
|
982 |
+
WPH_conflict_handle_super_cache::init();
|
983 |
+
|
984 |
+
//BuddyPress handle
|
985 |
+
include_once(WPH_PATH . 'conflicts/buddypress.php');
|
986 |
+
WPH_conflict_handle_BuddyPress::init();
|
987 |
|
988 |
}
|
989 |
|
modules/components/admin-admin_url.php
CHANGED
@@ -237,25 +237,25 @@
|
|
237 |
if($this->wph->server_htaccess_config === TRUE)
|
238 |
{
|
239 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
240 |
-
$text .= "RewriteRule ^wp-admin(
|
241 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
242 |
|
243 |
//theme my login usage
|
244 |
-
//$text .= "RewriteRule ^login(
|
245 |
//$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
246 |
|
247 |
-
$text .= "RewriteRule ^dashboard(
|
248 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
249 |
-
$text .= "RewriteRule ^admin(
|
250 |
|
251 |
if(!empty($path))
|
252 |
{
|
253 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
254 |
-
$text .= "RewriteRule ^".$path."wp-admin(
|
255 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
256 |
-
$text .= "RewriteRule ^".$path."dashboard(
|
257 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
258 |
-
$text .= "RewriteRule ^".$path."admin(
|
259 |
}
|
260 |
}
|
261 |
|
@@ -263,15 +263,15 @@
|
|
263 |
{
|
264 |
$text = '
|
265 |
<rule name="wph-block_default_admin_url1" stopProcessing="true">
|
266 |
-
<match url="^wp-admin(
|
267 |
<action type="Rewrite" url="'. $site_index .'" />
|
268 |
</rule>
|
269 |
<rule name="wph-block_default_admin_url2" stopProcessing="true">
|
270 |
-
<match url="^dashboard(
|
271 |
<action type="Rewrite" url="'. $site_index .'" />
|
272 |
</rule>
|
273 |
<rule name="wph-block_default_admin_url3" stopProcessing="true">
|
274 |
-
<match url="^admin(
|
275 |
<action type="Rewrite" url="'. $site_index .'" />
|
276 |
</rule>
|
277 |
';
|
@@ -279,15 +279,15 @@
|
|
279 |
{
|
280 |
$text .= '
|
281 |
<rule name="wph-block_default_admin_url4" stopProcessing="true">
|
282 |
-
<match url="^'. $path .'wp-admin(
|
283 |
<action type="Rewrite" url="'. $site_index .'" />
|
284 |
</rule>
|
285 |
<rule name="wph-block_default_admin_url5" stopProcessing="true">
|
286 |
-
<match url="^'. $path .'dashboard(
|
287 |
<action type="Rewrite" url="'. $site_index .'" />
|
288 |
</rule>
|
289 |
<rule name="wph-block_default_admin_url6" stopProcessing="true">
|
290 |
-
<match url="^'. $path .'admin(
|
291 |
<action type="Rewrite" url="'. $site_index .'" />
|
292 |
</rule>
|
293 |
';
|
237 |
if($this->wph->server_htaccess_config === TRUE)
|
238 |
{
|
239 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
240 |
+
$text .= "RewriteRule ^wp-admin(.+) $site_index [L]\n";
|
241 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
242 |
|
243 |
//theme my login usage
|
244 |
+
//$text .= "RewriteRule ^login(.+) $site_index?throw_404 [L]\n";
|
245 |
//$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
246 |
|
247 |
+
$text .= "RewriteRule ^dashboard(.+) $site_index [L]\n";
|
248 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
249 |
+
$text .= "RewriteRule ^admin(.+) $site_index [L]\n";
|
250 |
|
251 |
if(!empty($path))
|
252 |
{
|
253 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
254 |
+
$text .= "RewriteRule ^".$path."wp-admin(.+) $site_index [L]\n";
|
255 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
256 |
+
$text .= "RewriteRule ^".$path."dashboard(.+) $site_index [L]\n";
|
257 |
$text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
258 |
+
$text .= "RewriteRule ^".$path."admin(.+) $site_index [L]";
|
259 |
}
|
260 |
}
|
261 |
|
263 |
{
|
264 |
$text = '
|
265 |
<rule name="wph-block_default_admin_url1" stopProcessing="true">
|
266 |
+
<match url="^wp-admin(.+)" />
|
267 |
<action type="Rewrite" url="'. $site_index .'" />
|
268 |
</rule>
|
269 |
<rule name="wph-block_default_admin_url2" stopProcessing="true">
|
270 |
+
<match url="^dashboard(.+)" />
|
271 |
<action type="Rewrite" url="'. $site_index .'" />
|
272 |
</rule>
|
273 |
<rule name="wph-block_default_admin_url3" stopProcessing="true">
|
274 |
+
<match url="^admin(.+)" />
|
275 |
<action type="Rewrite" url="'. $site_index .'" />
|
276 |
</rule>
|
277 |
';
|
279 |
{
|
280 |
$text .= '
|
281 |
<rule name="wph-block_default_admin_url4" stopProcessing="true">
|
282 |
+
<match url="^'. $path .'wp-admin(.+)" />
|
283 |
<action type="Rewrite" url="'. $site_index .'" />
|
284 |
</rule>
|
285 |
<rule name="wph-block_default_admin_url5" stopProcessing="true">
|
286 |
+
<match url="^'. $path .'dashboard(.+)" />
|
287 |
<action type="Rewrite" url="'. $site_index .'" />
|
288 |
</rule>
|
289 |
<rule name="wph-block_default_admin_url6" stopProcessing="true">
|
290 |
+
<match url="^'. $path .'admin(.+)" />
|
291 |
<action type="Rewrite" url="'. $site_index .'" />
|
292 |
</rule>
|
293 |
';
|
modules/components/general-headers.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
'id' => 'remove_x_powered_by',
|
14 |
'label' => 'Remove X-Powered-By Header',
|
15 |
'description' => __('Remove X-Powered-By Header if being set.', 'wp-hide-security-enhancer') . ' ' .
|
16 |
-
__('More details at ', 'wp-hide-security-enhancer') . '<a target="_blank" href="http://www.wp-hide.com/request-headers/">Request Headers</a>',
|
17 |
|
18 |
'input_type' => 'radio',
|
19 |
'options' => array(
|
@@ -30,7 +30,7 @@
|
|
30 |
'id' => 'remove_x_pingback',
|
31 |
'label' => 'Remove X-Pingback Header',
|
32 |
'description' => __('Remove X-Pingback Header if being set.', 'wp-hide-security-enhancer') . ' ' .
|
33 |
-
__('More details at ', 'wp-hide-security-enhancer') . '<a target="_blank" href="http://www.wp-hide.com/request-headers/">Request Headers</a>',
|
34 |
|
35 |
'input_type' => 'radio',
|
36 |
'options' => array(
|
13 |
'id' => 'remove_x_powered_by',
|
14 |
'label' => 'Remove X-Powered-By Header',
|
15 |
'description' => __('Remove X-Powered-By Header if being set.', 'wp-hide-security-enhancer') . ' ' .
|
16 |
+
__('More details at ', 'wp-hide-security-enhancer') . '<a target="_blank" href="http://www.wp-hide.com/documentation/request-headers/">Request Headers</a>',
|
17 |
|
18 |
'input_type' => 'radio',
|
19 |
'options' => array(
|
30 |
'id' => 'remove_x_pingback',
|
31 |
'label' => 'Remove X-Pingback Header',
|
32 |
'description' => __('Remove X-Pingback Header if being set.', 'wp-hide-security-enhancer') . ' ' .
|
33 |
+
__('More details at ', 'wp-hide-security-enhancer') . '<a target="_blank" href="http://www.wp-hide.com/documentation/request-headers/">Request Headers</a>',
|
34 |
|
35 |
'input_type' => 'radio',
|
36 |
'options' => array(
|
modules/components/general-html.php
CHANGED
@@ -28,8 +28,8 @@
|
|
28 |
$this->module_settings[] = array(
|
29 |
'id' => 'clean_body_classes',
|
30 |
'label' => 'Remove general classes from body tag',
|
31 |
-
'description' => __('Remove general classes from body tag.', 'wp-hide-security-enhancer')
|
32 |
-
|
33 |
|
34 |
'input_type' => 'radio',
|
35 |
'options' => array(
|
@@ -45,8 +45,8 @@
|
|
45 |
$this->module_settings[] = array(
|
46 |
'id' => 'clean_menu_items_id',
|
47 |
'label' => 'Remove ID from Menu items',
|
48 |
-
'description' => __('Remove ID attribute from all menu items.', 'wp-hide-security-enhancer')
|
49 |
-
|
50 |
|
51 |
'input_type' => 'radio',
|
52 |
'options' => array(
|
@@ -62,8 +62,8 @@
|
|
62 |
$this->module_settings[] = array(
|
63 |
'id' => 'clean_menu_items_classes',
|
64 |
'label' => 'Remove class from Menu items',
|
65 |
-
'description' => __('Remove class attribute from all menu items. Any classes which include a "current" prefix or contain "has-children" will be preserved.', 'wp-hide-security-enhancer')
|
66 |
-
|
67 |
|
68 |
'input_type' => 'radio',
|
69 |
'options' => array(
|
@@ -79,8 +79,8 @@
|
|
79 |
$this->module_settings[] = array(
|
80 |
'id' => 'clean_post_classes',
|
81 |
'label' => 'Remove general classes from post',
|
82 |
-
'description' => __('Remove general classes from post.', 'wp-hide-security-enhancer')
|
83 |
-
|
84 |
|
85 |
'input_type' => 'radio',
|
86 |
'options' => array(
|
@@ -96,8 +96,8 @@
|
|
96 |
$this->module_settings[] = array(
|
97 |
'id' => 'clean_image_classes',
|
98 |
'label' => 'Remove general classes from images',
|
99 |
-
'description' => __('Remove general classes from media tags.', 'wp-hide-security-enhancer')
|
100 |
-
|
101 |
|
102 |
'input_type' => 'radio',
|
103 |
'options' => array(
|
@@ -294,7 +294,6 @@
|
|
294 |
|
295 |
if(is_admin())
|
296 |
return $buffer;
|
297 |
-
|
298 |
|
299 |
if ( ! class_exists( 'DOMDocument', false ) )
|
300 |
return $buffer;
|
28 |
$this->module_settings[] = array(
|
29 |
'id' => 'clean_body_classes',
|
30 |
'label' => 'Remove general classes from body tag',
|
31 |
+
'description' => __('Remove general classes from body tag.', 'wp-hide-security-enhancer'),
|
32 |
+
// . ' ' . __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/remove-classes-html/" target="_blank">Remove classes from HTML</a>',
|
33 |
|
34 |
'input_type' => 'radio',
|
35 |
'options' => array(
|
45 |
$this->module_settings[] = array(
|
46 |
'id' => 'clean_menu_items_id',
|
47 |
'label' => 'Remove ID from Menu items',
|
48 |
+
'description' => __('Remove ID attribute from all menu items.', 'wp-hide-security-enhancer'),
|
49 |
+
// . ' ' . __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/remove-classes-html/" target="_blank">Remove classes from HTML</a>',
|
50 |
|
51 |
'input_type' => 'radio',
|
52 |
'options' => array(
|
62 |
$this->module_settings[] = array(
|
63 |
'id' => 'clean_menu_items_classes',
|
64 |
'label' => 'Remove class from Menu items',
|
65 |
+
'description' => __('Remove class attribute from all menu items. Any classes which include a "current" prefix or contain "has-children" will be preserved.', 'wp-hide-security-enhancer'),
|
66 |
+
// . ' ' . __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/remove-classes-html/" target="_blank">Remove classes from HTML</a>',
|
67 |
|
68 |
'input_type' => 'radio',
|
69 |
'options' => array(
|
79 |
$this->module_settings[] = array(
|
80 |
'id' => 'clean_post_classes',
|
81 |
'label' => 'Remove general classes from post',
|
82 |
+
'description' => __('Remove general classes from post.', 'wp-hide-security-enhancer'),
|
83 |
+
// . ' ' . __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/remove-classes-html/" target="_blank">Remove classes from HTML</a>',
|
84 |
|
85 |
'input_type' => 'radio',
|
86 |
'options' => array(
|
96 |
$this->module_settings[] = array(
|
97 |
'id' => 'clean_image_classes',
|
98 |
'label' => 'Remove general classes from images',
|
99 |
+
'description' => __('Remove general classes from media tags.', 'wp-hide-security-enhancer'),
|
100 |
+
// . ' ' . __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/remove-classes-html/" target="_blank">Remove classes from HTML</a>',
|
101 |
|
102 |
'input_type' => 'radio',
|
103 |
'options' => array(
|
294 |
|
295 |
if(is_admin())
|
296 |
return $buffer;
|
|
|
297 |
|
298 |
if ( ! class_exists( 'DOMDocument', false ) )
|
299 |
return $buffer;
|
modules/components/general-meta.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
{
|
13 |
$this->module_settings[] = array(
|
14 |
'id' => 'remove_generator_meta',
|
15 |
-
'label' => 'Remove Generator Meta',
|
16 |
'description' => __('Remove the autogenerated meta generator tag within head (WordPress Version).', 'wp-hide-security-enhancer'),
|
17 |
|
18 |
'input_type' => 'radio',
|
@@ -24,6 +24,38 @@
|
|
24 |
|
25 |
'sanitize_type' => array('sanitize_title', 'strtolower')
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
);
|
28 |
|
29 |
$this->module_settings[] = array(
|
@@ -158,7 +190,7 @@
|
|
158 |
add_filter('the_generator', create_function('', 'return "";'));
|
159 |
remove_action( 'wp_head', 'wp_generator' );
|
160 |
|
161 |
-
//
|
162 |
add_filter( 'wph/ob_start_callback', array(&$this, 'ob_start_callback_remove_generator_meta'));
|
163 |
}
|
164 |
|
@@ -180,7 +212,54 @@
|
|
180 |
|
181 |
$xpath = new DOMXPath($doc);
|
182 |
|
183 |
-
$nodes = $xpath->query('//meta[@name="generator"]');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
if($nodes->length < 1)
|
185 |
return $buffer;
|
186 |
|
@@ -197,7 +276,17 @@
|
|
197 |
return $buffer;
|
198 |
|
199 |
}
|
|
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
|
202 |
function _init_remove_wlwmanifest($saved_field_data)
|
203 |
{
|
12 |
{
|
13 |
$this->module_settings[] = array(
|
14 |
'id' => 'remove_generator_meta',
|
15 |
+
'label' => 'Remove WordPress Generator Meta',
|
16 |
'description' => __('Remove the autogenerated meta generator tag within head (WordPress Version).', 'wp-hide-security-enhancer'),
|
17 |
|
18 |
'input_type' => 'radio',
|
24 |
|
25 |
'sanitize_type' => array('sanitize_title', 'strtolower')
|
26 |
|
27 |
+
);
|
28 |
+
|
29 |
+
$this->module_settings[] = array(
|
30 |
+
'id' => 'remove_other_generator_meta',
|
31 |
+
'label' => 'Remove Other Generator Meta',
|
32 |
+
'description' => __('Remove other meta generated tags within head (eg Theme Name, Theme Version).', 'wp-hide-security-enhancer'),
|
33 |
+
|
34 |
+
'input_type' => 'radio',
|
35 |
+
'options' => array(
|
36 |
+
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
37 |
+
'no' => __('No', 'wp-hide-security-enhancer'),
|
38 |
+
),
|
39 |
+
'default_value' => 'no',
|
40 |
+
|
41 |
+
'sanitize_type' => array('sanitize_title', 'strtolower')
|
42 |
+
|
43 |
+
);
|
44 |
+
|
45 |
+
$this->module_settings[] = array(
|
46 |
+
'id' => 'remove_resource_hints',
|
47 |
+
'label' => 'Remove Resource Hints',
|
48 |
+
'description' => __('Remove Resource Hints meta generated tags within head (eg dns-prefetch, preconnect).', 'wp-hide-security-enhancer'),
|
49 |
+
|
50 |
+
'input_type' => 'radio',
|
51 |
+
'options' => array(
|
52 |
+
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
53 |
+
'no' => __('No', 'wp-hide-security-enhancer'),
|
54 |
+
),
|
55 |
+
'default_value' => 'no',
|
56 |
+
|
57 |
+
'sanitize_type' => array('sanitize_title', 'strtolower')
|
58 |
+
|
59 |
);
|
60 |
|
61 |
$this->module_settings[] = array(
|
190 |
add_filter('the_generator', create_function('', 'return "";'));
|
191 |
remove_action( 'wp_head', 'wp_generator' );
|
192 |
|
193 |
+
//make sure it's being replaced
|
194 |
add_filter( 'wph/ob_start_callback', array(&$this, 'ob_start_callback_remove_generator_meta'));
|
195 |
}
|
196 |
|
212 |
|
213 |
$xpath = new DOMXPath($doc);
|
214 |
|
215 |
+
$nodes = $xpath->query('//meta[starts-with(@content, "WordPress") and @name="generator"]');
|
216 |
+
if($nodes->length < 1)
|
217 |
+
return $buffer;
|
218 |
+
|
219 |
+
foreach ($nodes as $node)
|
220 |
+
{
|
221 |
+
$parent = $node->parentNode;
|
222 |
+
$parent->removeChild($node);
|
223 |
+
}
|
224 |
+
|
225 |
+
$doc->normalizeDocument();
|
226 |
+
|
227 |
+
$buffer = $doc->saveHTML( $dom->documentElement );
|
228 |
+
|
229 |
+
return $buffer;
|
230 |
+
|
231 |
+
}
|
232 |
+
|
233 |
+
|
234 |
+
|
235 |
+
function _init_remove_other_generator_meta($saved_field_data)
|
236 |
+
{
|
237 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
238 |
+
return FALSE;
|
239 |
+
|
240 |
+
//remove other generator links
|
241 |
+
add_filter( 'wph/ob_start_callback', array(&$this, 'ob_start_callback_remove_other_generator_meta'));
|
242 |
+
}
|
243 |
+
|
244 |
+
|
245 |
+
function ob_start_callback_remove_other_generator_meta( $buffer )
|
246 |
+
{
|
247 |
+
|
248 |
+
if ( ! class_exists( 'DOMDocument', false ) )
|
249 |
+
return $buffer;
|
250 |
+
|
251 |
+
$doc = new DOMDocument();
|
252 |
+
$doc->preserveWhiteSpace = true;
|
253 |
+
|
254 |
+
if ( @$doc->loadHTML(mb_convert_encoding($buffer, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD) === false )
|
255 |
+
return $buffer;
|
256 |
+
|
257 |
+
$doc->encoding = 'UTF-8';
|
258 |
+
$doc->formatOutput = true;
|
259 |
+
|
260 |
+
$xpath = new DOMXPath($doc);
|
261 |
+
|
262 |
+
$nodes = $xpath->query('//meta[@name="generator" and not (starts-with(@content, "WordPress"))]');
|
263 |
if($nodes->length < 1)
|
264 |
return $buffer;
|
265 |
|
276 |
return $buffer;
|
277 |
|
278 |
}
|
279 |
+
|
280 |
|
281 |
+
function _init_remove_resource_hints($saved_field_data)
|
282 |
+
{
|
283 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
284 |
+
return FALSE;
|
285 |
+
|
286 |
+
remove_action( 'wp_head', 'wp_resource_hints', 2 );
|
287 |
+
|
288 |
+
}
|
289 |
+
|
290 |
|
291 |
function _init_remove_wlwmanifest($saved_field_data)
|
292 |
{
|
modules/components/general-oembed.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WPH_module_general_oembed extends WPH_module_component
|
4 |
+
{
|
5 |
+
function get_component_title()
|
6 |
+
{
|
7 |
+
return "Oembed";
|
8 |
+
}
|
9 |
+
|
10 |
+
function get_module_settings()
|
11 |
+
{
|
12 |
+
$this->module_settings[] = array(
|
13 |
+
'id' => 'remove_oembed',
|
14 |
+
'label' => 'Remove Oembed',
|
15 |
+
'description' => __('Remove Oembed tags from header.', 'wp-hide-security-enhancer') . ' ' .
|
16 |
+
__('More details at ', 'wp-hide-security-enhancer') . '<a target="_blank" href="http://www.wp-hide.com/request-headers/">Oembed</a>',
|
17 |
+
|
18 |
+
'input_type' => 'radio',
|
19 |
+
'options' => array(
|
20 |
+
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
21 |
+
'no' => __('No', 'wp-hide-security-enhancer'),
|
22 |
+
),
|
23 |
+
'default_value' => 'no',
|
24 |
+
|
25 |
+
'sanitize_type' => array('sanitize_title', 'strtolower'),
|
26 |
+
'processing_order' => 75
|
27 |
+
);
|
28 |
+
|
29 |
+
return $this->module_settings;
|
30 |
+
}
|
31 |
+
|
32 |
+
function _init_remove_oembed($saved_field_data)
|
33 |
+
{
|
34 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
35 |
+
return FALSE;
|
36 |
+
|
37 |
+
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
|
38 |
+
remove_action( 'wp_head', 'wp_oembed_add_host_js' );
|
39 |
+
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
43 |
+
?>
|
modules/components/rewrite-json-rest.php
CHANGED
@@ -164,7 +164,7 @@
|
|
164 |
|
165 |
if($this->wph->server_htaccess_config === TRUE)
|
166 |
{
|
167 |
-
$text = "\nRewriteRule ^wp-json(
|
168 |
}
|
169 |
|
170 |
if($this->wph->server_web_config === TRUE)
|
164 |
|
165 |
if($this->wph->server_htaccess_config === TRUE)
|
166 |
{
|
167 |
+
$text = "\nRewriteRule ^wp-json(.+) ". $this->wph->default_variables['site_relative_path'] ."index.php?wph-throw-404 [L]";
|
168 |
}
|
169 |
|
170 |
if($this->wph->server_web_config === TRUE)
|
modules/components/rewrite-new_include_path.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
'id' => 'new_include_path',
|
15 |
'label' => __('New Includes Path', 'wp-hide-security-enhancer'),
|
16 |
'description' => __('The default theme path is set to', 'wp-hide-security-enhancer') . ' <strong>wp-include</strong>
|
17 |
-
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.
|
18 |
|
19 |
'value_description' => __('e.g. my_includes', 'wp-hide-security-enhancer'),
|
20 |
'input_type' => 'text',
|
@@ -77,12 +77,12 @@
|
|
77 |
$path .= trailingslashit( $saved_field_data );
|
78 |
|
79 |
if($this->wph->server_htaccess_config === TRUE)
|
80 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(
|
81 |
|
82 |
if($this->wph->server_web_config === TRUE)
|
83 |
$processing_response['rewrite'] = '
|
84 |
<rule name="wph-new_include_path" stopProcessing="true">
|
85 |
-
<match url="^'. $path .'(
|
86 |
<action type="Rewrite" url="'. $include_path .'{R:1}" appendQueryString="true" />
|
87 |
</rule>
|
88 |
';
|
@@ -161,14 +161,14 @@
|
|
161 |
{
|
162 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
163 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
164 |
-
$text .= "RewriteRule ^wp-includes(
|
165 |
}
|
166 |
|
167 |
if($this->wph->server_web_config === TRUE)
|
168 |
{
|
169 |
$text = '
|
170 |
<rule name="wph-block_wpinclude_url" stopProcessing="true">
|
171 |
-
<match url="^wp-includes(
|
172 |
<conditions>
|
173 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
174 |
</conditions>
|
14 |
'id' => 'new_include_path',
|
15 |
'label' => __('New Includes Path', 'wp-hide-security-enhancer'),
|
16 |
'description' => __('The default theme path is set to', 'wp-hide-security-enhancer') . ' <strong>wp-include</strong>
|
17 |
+
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/documentation/rewrite-wp-includes/" target="_blank">Link</a>',
|
18 |
|
19 |
'value_description' => __('e.g. my_includes', 'wp-hide-security-enhancer'),
|
20 |
'input_type' => 'text',
|
77 |
$path .= trailingslashit( $saved_field_data );
|
78 |
|
79 |
if($this->wph->server_htaccess_config === TRUE)
|
80 |
+
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(.+) '. $include_path .'$1 [L,QSA]';
|
81 |
|
82 |
if($this->wph->server_web_config === TRUE)
|
83 |
$processing_response['rewrite'] = '
|
84 |
<rule name="wph-new_include_path" stopProcessing="true">
|
85 |
+
<match url="^'. $path .'(.+)" />
|
86 |
<action type="Rewrite" url="'. $include_path .'{R:1}" appendQueryString="true" />
|
87 |
</rule>
|
88 |
';
|
161 |
{
|
162 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
163 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
164 |
+
$text .= "RewriteRule ^wp-includes(.+) ". $this->wph->default_variables['site_relative_path'] ."index.php [L]";
|
165 |
}
|
166 |
|
167 |
if($this->wph->server_web_config === TRUE)
|
168 |
{
|
169 |
$text = '
|
170 |
<rule name="wph-block_wpinclude_url" stopProcessing="true">
|
171 |
+
<match url="^wp-includes(.+)" />
|
172 |
<conditions>
|
173 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
174 |
</conditions>
|
modules/components/rewrite-new_plugin_path.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
'id' => 'new_plugin_path',
|
15 |
'label' => __('New Plugins Path', 'wp-hide-security-enhancer'),
|
16 |
'description' => __('The default plugins path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' ,$this->wph->default_variables['plugins_url']) .'</strong>
|
17 |
-
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.
|
18 |
|
19 |
'value_description' => 'e.g. my_plugins',
|
20 |
'input_type' => 'text',
|
@@ -164,12 +164,12 @@
|
|
164 |
$new_url = trailingslashit( $new_url ) . $path;
|
165 |
|
166 |
if($this->wph->server_htaccess_config === TRUE)
|
167 |
-
$rewrite .= "\nRewriteRule ^" . trailingslashit( $plugin_custom_path ) . '(
|
168 |
|
169 |
if($this->wph->server_web_config === TRUE)
|
170 |
$rewrite .= '
|
171 |
<rule name="wph-new_plugin_path-'. $plugin_slug .'" stopProcessing="true">
|
172 |
-
<match url="^'. trailingslashit( $plugin_custom_path ) .'(
|
173 |
<action type="Rewrite" url="'. trailingslashit($plugin_path) . trailingslashit($active_plugin_directory) .'{R:1}" appendQueryString="true" />
|
174 |
</rule>
|
175 |
';
|
@@ -178,12 +178,12 @@
|
|
178 |
if( !empty($path) && !empty($saved_field_data))
|
179 |
{
|
180 |
if($this->wph->server_htaccess_config === TRUE)
|
181 |
-
$rewrite .= "\nRewriteRule ^" . trailingslashit( $path ) . '(
|
182 |
|
183 |
if($this->wph->server_web_config === TRUE)
|
184 |
$rewrite .= '
|
185 |
<rule name="wph-new_plugin_path" stopProcessing="true">
|
186 |
-
<match url="^'. trailingslashit( $path ) .'(
|
187 |
<action type="Rewrite" url="'. $plugin_path .'{R:1}" appendQueryString="true" />
|
188 |
</rule>
|
189 |
';
|
@@ -217,13 +217,13 @@
|
|
217 |
if($this->wph->server_htaccess_config === TRUE)
|
218 |
{
|
219 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
220 |
-
$text .= "RewriteRule ^". $default_plugin_url ."(
|
221 |
}
|
222 |
|
223 |
if($this->wph->server_web_config === TRUE)
|
224 |
$text = '
|
225 |
<rule name="wph-block_plugins_url" stopProcessing="true">
|
226 |
-
<match url="^'. $default_plugin_url .'(
|
227 |
<action type="Rewrite" url="'. $this->wph->default_variables['site_relative_path'] .'index.php" />
|
228 |
</rule>
|
229 |
';
|
14 |
'id' => 'new_plugin_path',
|
15 |
'label' => __('New Plugins Path', 'wp-hide-security-enhancer'),
|
16 |
'description' => __('The default plugins path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' ,$this->wph->default_variables['plugins_url']) .'</strong>
|
17 |
+
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/documentation/rewrite-plugins/" target="_blank">Link</a>',
|
18 |
|
19 |
'value_description' => 'e.g. my_plugins',
|
20 |
'input_type' => 'text',
|
164 |
$new_url = trailingslashit( $new_url ) . $path;
|
165 |
|
166 |
if($this->wph->server_htaccess_config === TRUE)
|
167 |
+
$rewrite .= "\nRewriteRule ^" . trailingslashit( $plugin_custom_path ) . '(.+) '. trailingslashit($plugin_path) . trailingslashit($active_plugin_directory) .'$1 [L,QSA]';
|
168 |
|
169 |
if($this->wph->server_web_config === TRUE)
|
170 |
$rewrite .= '
|
171 |
<rule name="wph-new_plugin_path-'. $plugin_slug .'" stopProcessing="true">
|
172 |
+
<match url="^'. trailingslashit( $plugin_custom_path ) .'(.+)" />
|
173 |
<action type="Rewrite" url="'. trailingslashit($plugin_path) . trailingslashit($active_plugin_directory) .'{R:1}" appendQueryString="true" />
|
174 |
</rule>
|
175 |
';
|
178 |
if( !empty($path) && !empty($saved_field_data))
|
179 |
{
|
180 |
if($this->wph->server_htaccess_config === TRUE)
|
181 |
+
$rewrite .= "\nRewriteRule ^" . trailingslashit( $path ) . '(.+) '. $plugin_path .'$1 [L,QSA]';
|
182 |
|
183 |
if($this->wph->server_web_config === TRUE)
|
184 |
$rewrite .= '
|
185 |
<rule name="wph-new_plugin_path" stopProcessing="true">
|
186 |
+
<match url="^'. trailingslashit( $path ) .'(.+)" />
|
187 |
<action type="Rewrite" url="'. $plugin_path .'{R:1}" appendQueryString="true" />
|
188 |
</rule>
|
189 |
';
|
217 |
if($this->wph->server_htaccess_config === TRUE)
|
218 |
{
|
219 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
220 |
+
$text .= "RewriteRule ^". $default_plugin_url ."(.+) ". $this->wph->default_variables['site_relative_path'] ."index.php [L]";
|
221 |
}
|
222 |
|
223 |
if($this->wph->server_web_config === TRUE)
|
224 |
$text = '
|
225 |
<rule name="wph-block_plugins_url" stopProcessing="true">
|
226 |
+
<match url="^'. $default_plugin_url .'(.+)" />
|
227 |
<action type="Rewrite" url="'. $this->wph->default_variables['site_relative_path'] .'index.php" />
|
228 |
</rule>
|
229 |
';
|
modules/components/rewrite-new_theme_path.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
'id' => 'new_theme_path',
|
16 |
'label' => __('New Theme Path', 'wp-hide-security-enhancer'),
|
17 |
'description' => __('The default theme path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' ,$this->wph->default_variables['template_url']) .'</strong>
|
18 |
-
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.
|
19 |
|
20 |
'value_description' => __('e.g. my_template', 'wp-hide-security-enhancer'),
|
21 |
'input_type' => 'text',
|
@@ -29,7 +29,7 @@
|
|
29 |
'id' => 'new_style_file_path',
|
30 |
'label' => __('New Style File Path', 'wp-hide-security-enhancer'),
|
31 |
'description' => __('The default theme style file style.css path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' , $this->wph->default_variables['template_url']) .'/style.css</strong>'
|
32 |
-
.'<div class="description"><div class="notice-error"><div alt="f534" class="dashicons dashicons-warning">warning</div> <span class="important">'. __('If style file contain relative URLs it should not include additional path, just the actual filename.', 'wp-hide-security-enhancer') .'. '. __('More details at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/new-style-file-path-along-relative-urls/" target="_blank">New Style File Path along with relative URLs</a></span></div></div>'
|
33 |
,
|
34 |
|
35 |
'value_description' => __('e.g. custom-style-file.css', 'wp-hide-security-enhancer'),
|
@@ -70,20 +70,20 @@
|
|
70 |
'id' => 'new_theme_child_path',
|
71 |
'label' => __('Child - New Theme Path', 'wp-hide-security-enhancer'),
|
72 |
'description' => __('The default theme path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' , trailingslashit($this->wph->templates_data['themes_url']) . $this->wph->templates_data['child']['folder_name']) .'</strong>
|
73 |
-
'.__('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.
|
74 |
|
75 |
'value_description' => __('e.g. my_child_template', 'wp-hide-security-enhancer'),
|
76 |
'input_type' => 'text',
|
77 |
|
78 |
'sanitize_type' => array(array($this->wph->functions, 'sanitize_file_path_name')),
|
79 |
-
'processing_order' =>
|
80 |
);
|
81 |
|
82 |
$this->module_settings[] = array(
|
83 |
'id' => 'child_style_file_path',
|
84 |
'label' => __('Child - New Style File Path', 'wp-hide-security-enhancer'),
|
85 |
-
'description' => __('The default theme style file style.css path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' , $this->wph->default_variables['stylesheet_uri']) .'</strong>'
|
86 |
-
.'<div class="description"><div class="notice-error"><div alt="f534" class="dashicons dashicons-warning">warning</div> <span class="important">'. __('If style file contain relative URLs it should not include additional path, just the actual filename.', 'wp-hide-security-enhancer') .'. '. __('More details at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/new-style-file-path-along-relative-urls/" target="_blank">New Style File Path along with relative URLs</a></span></div></div>',
|
87 |
|
88 |
'value_description' => __('e.g. custom-style-file.css', 'wp-hide-security-enhancer'),
|
89 |
'input_type' => 'text',
|
@@ -160,7 +160,7 @@
|
|
160 |
//add_filter('theme_root_uri', array(&$this, 'theme_root_uri'), 999, 3);
|
161 |
|
162 |
//add replacement url
|
163 |
-
$this->wph->functions->add_replacement(
|
164 |
|
165 |
}
|
166 |
|
@@ -184,12 +184,12 @@
|
|
184 |
$theme_path = str_replace(' ', '%20', $theme_path);
|
185 |
|
186 |
if($this->wph->server_htaccess_config === TRUE)
|
187 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(
|
188 |
|
189 |
if($this->wph->server_web_config === TRUE)
|
190 |
$processing_response['rewrite'] = '
|
191 |
<rule name="wph-new_theme_path" stopProcessing="true">
|
192 |
-
<match url="^'. $path .'(
|
193 |
<action type="Rewrite" url="'. $theme_path .'{R:1}" appendQueryString="true" />
|
194 |
</rule>
|
195 |
';
|
@@ -301,7 +301,7 @@
|
|
301 |
//add_filter('theme_root_uri', array(&$this, 'theme_root_uri'), 999, 3);
|
302 |
|
303 |
//add replacement url
|
304 |
-
$this->wph->functions->add_replacement(
|
305 |
|
306 |
}
|
307 |
|
@@ -326,12 +326,12 @@
|
|
326 |
$theme_path = str_replace(' ', '%20', $theme_path);
|
327 |
|
328 |
if($this->wph->server_htaccess_config === TRUE)
|
329 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(
|
330 |
|
331 |
if($this->wph->server_web_config === TRUE)
|
332 |
$processing_response['rewrite'] = '
|
333 |
<rule name="wph-new_theme_child_path" stopProcessing="true">
|
334 |
-
<match url="^'. $path .'(
|
335 |
<action type="Rewrite" url="'. $theme_path .'{R:1}" appendQueryString="true" />
|
336 |
</rule>
|
337 |
';
|
15 |
'id' => 'new_theme_path',
|
16 |
'label' => __('New Theme Path', 'wp-hide-security-enhancer'),
|
17 |
'description' => __('The default theme path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' ,$this->wph->default_variables['template_url']) .'</strong>
|
18 |
+
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/documentation/remove-classes-from-html/" target="_blank">Link</a>',
|
19 |
|
20 |
'value_description' => __('e.g. my_template', 'wp-hide-security-enhancer'),
|
21 |
'input_type' => 'text',
|
29 |
'id' => 'new_style_file_path',
|
30 |
'label' => __('New Style File Path', 'wp-hide-security-enhancer'),
|
31 |
'description' => __('The default theme style file style.css path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' , $this->wph->default_variables['template_url']) .'/style.css</strong>'
|
32 |
+
.'<div class="description"><div class="notice-error"><div alt="f534" class="dashicons dashicons-warning">warning</div> <span class="important">'. __('If style file contain relative URLs it should not include additional path, just the actual filename.', 'wp-hide-security-enhancer') .'. '. __('More details at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/new-style-file-path-along-with-internal-relative-urls/" target="_blank">New Style File Path along with relative URLs</a></span></div></div>'
|
33 |
,
|
34 |
|
35 |
'value_description' => __('e.g. custom-style-file.css', 'wp-hide-security-enhancer'),
|
70 |
'id' => 'new_theme_child_path',
|
71 |
'label' => __('Child - New Theme Path', 'wp-hide-security-enhancer'),
|
72 |
'description' => __('The default theme path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' , trailingslashit($this->wph->templates_data['themes_url']) . $this->wph->templates_data['child']['folder_name']) .'</strong>
|
73 |
+
'.__('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/documentation/rewrite-theme/" target="_blank">Link</a>',
|
74 |
|
75 |
'value_description' => __('e.g. my_child_template', 'wp-hide-security-enhancer'),
|
76 |
'input_type' => 'text',
|
77 |
|
78 |
'sanitize_type' => array(array($this->wph->functions, 'sanitize_file_path_name')),
|
79 |
+
'processing_order' => 9
|
80 |
);
|
81 |
|
82 |
$this->module_settings[] = array(
|
83 |
'id' => 'child_style_file_path',
|
84 |
'label' => __('Child - New Style File Path', 'wp-hide-security-enhancer'),
|
85 |
+
'description' => __('The default theme style file style.css path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' , $this->wph->default_variables['stylesheet_uri']) .'/style.css</strong>'
|
86 |
+
.'<div class="description"><div class="notice-error"><div alt="f534" class="dashicons dashicons-warning">warning</div> <span class="important">'. __('If style file contain relative URLs it should not include additional path, just the actual filename.', 'wp-hide-security-enhancer') .'. '. __('More details at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/new-style-file-path-along-with-internal-relative-urls/" target="_blank">New Style File Path along with relative URLs</a></span></div></div>',
|
87 |
|
88 |
'value_description' => __('e.g. custom-style-file.css', 'wp-hide-security-enhancer'),
|
89 |
'input_type' => 'text',
|
160 |
//add_filter('theme_root_uri', array(&$this, 'theme_root_uri'), 999, 3);
|
161 |
|
162 |
//add replacement url
|
163 |
+
$this->wph->functions->add_replacement( untrailingslashit( $this->wph->default_variables['template_url']), trailingslashit( site_url() ) . $saved_field_data );
|
164 |
|
165 |
}
|
166 |
|
184 |
$theme_path = str_replace(' ', '%20', $theme_path);
|
185 |
|
186 |
if($this->wph->server_htaccess_config === TRUE)
|
187 |
+
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(.+) '. $theme_path .'$1 [L,QSA]';
|
188 |
|
189 |
if($this->wph->server_web_config === TRUE)
|
190 |
$processing_response['rewrite'] = '
|
191 |
<rule name="wph-new_theme_path" stopProcessing="true">
|
192 |
+
<match url="^'. $path .'(.+)" />
|
193 |
<action type="Rewrite" url="'. $theme_path .'{R:1}" appendQueryString="true" />
|
194 |
</rule>
|
195 |
';
|
301 |
//add_filter('theme_root_uri', array(&$this, 'theme_root_uri'), 999, 3);
|
302 |
|
303 |
//add replacement url
|
304 |
+
$this->wph->functions->add_replacement( untrailingslashit( $this->wph->default_variables['stylesheet_uri'] ) , trailingslashit( site_url() ) . untrailingslashit( $saved_field_data ) );
|
305 |
|
306 |
}
|
307 |
|
326 |
$theme_path = str_replace(' ', '%20', $theme_path);
|
327 |
|
328 |
if($this->wph->server_htaccess_config === TRUE)
|
329 |
+
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(.+) '. $theme_path .'$1 [L,QSA]';
|
330 |
|
331 |
if($this->wph->server_web_config === TRUE)
|
332 |
$processing_response['rewrite'] = '
|
333 |
<rule name="wph-new_theme_child_path" stopProcessing="true">
|
334 |
+
<match url="^'. $path .'(.+)" />
|
335 |
<action type="Rewrite" url="'. $theme_path .'{R:1}" appendQueryString="true" />
|
336 |
</rule>
|
337 |
';
|
modules/components/rewrite-new_upload_path.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
'id' => 'new_upload_path',
|
15 |
'label' => __('New Uploads Path', 'wp-hide-security-enhancer'),
|
16 |
'description' => __('The default uploads path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' ,$this->wph->default_variables['upload_url']) .'</strong>
|
17 |
-
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.
|
18 |
|
19 |
'value_description' => __('e.g. my_uploads', 'wp-hide-security-enhancer'),
|
20 |
'input_type' => 'text',
|
@@ -103,12 +103,12 @@
|
|
103 |
$path .= trailingslashit( $saved_field_data );
|
104 |
|
105 |
if($this->wph->server_htaccess_config === TRUE)
|
106 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(
|
107 |
|
108 |
if($this->wph->server_web_config === TRUE)
|
109 |
$processing_response['rewrite'] = '
|
110 |
<rule name="wph-new_upload_path" stopProcessing="true">
|
111 |
-
<match url="^'. $path .'(
|
112 |
<action type="Rewrite" url="'. $uploads_path .'{R:1}" appendQueryString="true" />
|
113 |
</rule>
|
114 |
';
|
@@ -166,13 +166,13 @@
|
|
166 |
if($this->wph->server_htaccess_config === TRUE)
|
167 |
{
|
168 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
169 |
-
$text .= "RewriteRule ^". $path ."(
|
170 |
}
|
171 |
|
172 |
if($this->wph->server_web_config === TRUE)
|
173 |
$text = '
|
174 |
<rule name="wph-block_upload_url" stopProcessing="true">
|
175 |
-
<match url="^'. $path .'(
|
176 |
<action type="Rewrite" url="'. $this->wph->default_variables['site_relative_path'] .'index.php" />
|
177 |
</rule>
|
178 |
';
|
14 |
'id' => 'new_upload_path',
|
15 |
'label' => __('New Uploads Path', 'wp-hide-security-enhancer'),
|
16 |
'description' => __('The default uploads path is set to', 'wp-hide-security-enhancer') . ' <strong>'. str_replace(get_bloginfo('wpurl'), '' ,$this->wph->default_variables['upload_url']) .'</strong>
|
17 |
+
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/documentation/rewrite-uploads/" target="_blank">Link</a>',
|
18 |
|
19 |
'value_description' => __('e.g. my_uploads', 'wp-hide-security-enhancer'),
|
20 |
'input_type' => 'text',
|
103 |
$path .= trailingslashit( $saved_field_data );
|
104 |
|
105 |
if($this->wph->server_htaccess_config === TRUE)
|
106 |
+
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(.+) '. $uploads_path .'$1 [L,QSA]';
|
107 |
|
108 |
if($this->wph->server_web_config === TRUE)
|
109 |
$processing_response['rewrite'] = '
|
110 |
<rule name="wph-new_upload_path" stopProcessing="true">
|
111 |
+
<match url="^'. $path .'(.+)" />
|
112 |
<action type="Rewrite" url="'. $uploads_path .'{R:1}" appendQueryString="true" />
|
113 |
</rule>
|
114 |
';
|
166 |
if($this->wph->server_htaccess_config === TRUE)
|
167 |
{
|
168 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
169 |
+
$text .= "RewriteRule ^". $path ."(.+) ". $this->wph->default_variables['site_relative_path'] ."index.php [L]";
|
170 |
}
|
171 |
|
172 |
if($this->wph->server_web_config === TRUE)
|
173 |
$text = '
|
174 |
<rule name="wph-block_upload_url" stopProcessing="true">
|
175 |
+
<match url="^'. $path .'(.+)" />
|
176 |
<action type="Rewrite" url="'. $this->wph->default_variables['site_relative_path'] .'index.php" />
|
177 |
</rule>
|
178 |
';
|
modules/components/rewrite-wp_content_path.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
'id' => 'new_content_path',
|
14 |
'label' => __('New Content Path', 'wp-hide-security-enhancer'),
|
15 |
'description' => __('Your default wp-content path is set to', 'wp-hide-security-enhancer') . ' <strong>'. $this->wph->default_variables['content_directory'] .'</strong>
|
16 |
-
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.
|
17 |
|
18 |
'value_description' => __('e.g. my_content', 'wp-hide-security-enhancer'),
|
19 |
'input_type' => 'text',
|
@@ -75,12 +75,12 @@
|
|
75 |
$path .= trailingslashit( $saved_field_data );
|
76 |
|
77 |
if($this->wph->server_htaccess_config === TRUE)
|
78 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(
|
79 |
|
80 |
if($this->wph->server_web_config === TRUE)
|
81 |
$processing_response['rewrite'] = '
|
82 |
<rule name="wph-new_content_path" stopProcessing="true">
|
83 |
-
<match url="^'. $path .'(
|
84 |
<action type="Rewrite" url="'. $content_path .'{R:1}" appendQueryString="true" />
|
85 |
</rule>
|
86 |
';
|
@@ -112,7 +112,7 @@
|
|
112 |
{
|
113 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
114 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
115 |
-
$text .= "RewriteRule ^". $content_directory ."(
|
116 |
|
117 |
$processing_response['rewrite'] = $text;
|
118 |
}
|
@@ -120,7 +120,7 @@
|
|
120 |
if($this->wph->server_web_config === TRUE)
|
121 |
$processing_response['rewrite'] = '
|
122 |
<rule name="wph-block_wp_content_path" stopProcessing="true">
|
123 |
-
<match url="^'. $content_directory .'(
|
124 |
<conditions>
|
125 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
126 |
</conditions>
|
13 |
'id' => 'new_content_path',
|
14 |
'label' => __('New Content Path', 'wp-hide-security-enhancer'),
|
15 |
'description' => __('Your default wp-content path is set to', 'wp-hide-security-enhancer') . ' <strong>'. $this->wph->default_variables['content_directory'] .'</strong>
|
16 |
+
'. __('More details can be found at', 'wp-hide-security-enhancer') .' <a href="http://www.wp-hide.com/documentation/rewrite-wp-content/" target="_blank">Link</a>',
|
17 |
|
18 |
'value_description' => __('e.g. my_content', 'wp-hide-security-enhancer'),
|
19 |
'input_type' => 'text',
|
75 |
$path .= trailingslashit( $saved_field_data );
|
76 |
|
77 |
if($this->wph->server_htaccess_config === TRUE)
|
78 |
+
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . '(.+) '. $content_path .'$1 [L,QSA]';
|
79 |
|
80 |
if($this->wph->server_web_config === TRUE)
|
81 |
$processing_response['rewrite'] = '
|
82 |
<rule name="wph-new_content_path" stopProcessing="true">
|
83 |
+
<match url="^'. $path .'(.+)" />
|
84 |
<action type="Rewrite" url="'. $content_path .'{R:1}" appendQueryString="true" />
|
85 |
</rule>
|
86 |
';
|
112 |
{
|
113 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
114 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
115 |
+
$text .= "RewriteRule ^". $content_directory ."(.+) ". $this->wph->default_variables['site_relative_path'] ."index.php [L]";
|
116 |
|
117 |
$processing_response['rewrite'] = $text;
|
118 |
}
|
120 |
if($this->wph->server_web_config === TRUE)
|
121 |
$processing_response['rewrite'] = '
|
122 |
<rule name="wph-block_wp_content_path" stopProcessing="true">
|
123 |
+
<match url="^'. $content_directory .'(.+)" />
|
124 |
<conditions>
|
125 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
126 |
</conditions>
|
modules/module-general.php
CHANGED
@@ -20,6 +20,9 @@
|
|
20 |
include(WPH_PATH . "/modules/components/general-scripts.php");
|
21 |
$this->components[] = new WPH_module_general_scripts();
|
22 |
|
|
|
|
|
|
|
23 |
include(WPH_PATH . "/modules/components/general-headers.php");
|
24 |
$this->components[] = new WPH_module_general_headers();
|
25 |
|
20 |
include(WPH_PATH . "/modules/components/general-scripts.php");
|
21 |
$this->components[] = new WPH_module_general_scripts();
|
22 |
|
23 |
+
include(WPH_PATH . "/modules/components/general-oembed.php");
|
24 |
+
$this->components[] = new WPH_module_general_oembed();
|
25 |
+
|
26 |
include(WPH_PATH . "/modules/components/general-headers.php");
|
27 |
$this->components[] = new WPH_module_general_headers();
|
28 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: nsp-code
|
|
3 |
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
|
7 |
-
Stable tag: 1.3.
|
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.
|
@@ -15,6 +15,8 @@ The **easy way to completely hide your WordPress** core files, theme and plugins
|
|
15 |
|
16 |
Change the default WordPress login urls from wp-admin and wp-login.php to something totally arbitrary. No one will ever know where to try to guess a login and hack into your site. Totally invisible !!
|
17 |
|
|
|
|
|
18 |
When testing with WordPress theme and plugins detector services/sites, any setting change may not reflect right away on their reports, since they use cache. So you may want to check again later, or try a different inner url, homepage url usage is not mandatory.
|
19 |
|
20 |
Being the best content management system, widely used, WordPress is susceptible to a large range of hacking attacks including brute-force, SQL injections, XSS, XSRF etc. Despite the fact the WordPress core is a very secure code maintained by a team of professional enthusiast, the additional plugins and themes makes the vulnerable spot of every website. In many cases, those are created by pseudo-developers who do not follow the best coding practices or simply do not own the experience to create a secure plugin.
|
@@ -221,6 +223,24 @@ Please get in touch with us and we'll do our best to include it for a next versi
|
|
221 |
|
222 |
== Changelog ==
|
223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
= 1.3.5.1 =
|
225 |
* Fix the Remove general classes from images component when within admin dashboard
|
226 |
|
3 |
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.
|
15 |
|
16 |
Change the default WordPress login urls from wp-admin and wp-login.php to something totally arbitrary. No one will ever know where to try to guess a login and hack into your site. Totally invisible !!
|
17 |
|
18 |
+
[vimeo http://vimeo.com/185046480]
|
19 |
+
|
20 |
When testing with WordPress theme and plugins detector services/sites, any setting change may not reflect right away on their reports, since they use cache. So you may want to check again later, or try a different inner url, homepage url usage is not mandatory.
|
21 |
|
22 |
Being the best content management system, widely used, WordPress is susceptible to a large range of hacking attacks including brute-force, SQL injections, XSS, XSRF etc. Despite the fact the WordPress core is a very secure code maintained by a team of professional enthusiast, the additional plugins and themes makes the vulnerable spot of every website. In many cases, those are created by pseudo-developers who do not follow the best coding practices or simply do not own the experience to create a secure plugin.
|
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
|
229 |
+
* New COmponent General -> Oembed
|
230 |
+
* Remove Oembed tags from header
|
231 |
+
* Remove Remove Resource Hints tags from header
|
232 |
+
* rewrite rules update to match only non base, from (.*) to (.+)
|
233 |
+
* wph-throw-404 improvements
|
234 |
+
* BuddyPress conflict handle for uploaded gravatars
|
235 |
+
* Admin Style changes
|
236 |
+
* BuddyPress Conflict Class handler
|
237 |
+
* Separate WordPress meta Generator and Other Meta Generator
|
238 |
+
* Process Location value within sent Headers list if exists
|
239 |
+
* Replacements for https and http urls relative to domain
|
240 |
+
* Add replacements for relative paths to cover WordPress installs within a folder.
|
241 |
+
* Use untralingslashit when creating theme and child theme url replacements
|
242 |
+
* Fix for Call to a member function is_404() on a non-object within wp_redirect
|
243 |
+
|
244 |
= 1.3.5.1 =
|
245 |
* Fix the Remove general classes from images component when within admin dashboard
|
246 |
|
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.
|
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.
|
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
|
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');
|