Version Description
- Replaced "Remove description header from Style file" and "Child - Remove description header from Style file" functionality
Download this release
Release Info
Developer | nsp-code |
Plugin | WP Hide & Security Enhancer |
Version | 1.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.1 to 1.4.2
- include/update.class.php +24 -2
- include/wph.class.php +1 -80
- modules/components/rewrite-new_theme_path.php +4 -211
- readme.txt +4 -1
- router/file-process.php +0 -137
- wp-hide.php +1 -1
include/update.class.php
CHANGED
@@ -112,7 +112,6 @@
|
|
112 |
if(version_compare($version, '1.4', '<'))
|
113 |
{
|
114 |
|
115 |
-
$this->wph->set_static_environemnt_file( FALSE );
|
116 |
|
117 |
//copy over the new mu-loader version
|
118 |
WPH_functions::copy_mu_loader( TRUE );
|
@@ -133,13 +132,36 @@
|
|
133 |
if(version_compare($version, '1.4.1', '<'))
|
134 |
{
|
135 |
|
136 |
-
$this->wph->set_static_environemnt_file( FALSE );
|
137 |
|
138 |
//copy over the new mu-loader version
|
139 |
WPH_functions::copy_mu_loader( TRUE );
|
140 |
|
141 |
|
142 |
$version = '1.4.1';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
}
|
144 |
|
145 |
|
112 |
if(version_compare($version, '1.4', '<'))
|
113 |
{
|
114 |
|
|
|
115 |
|
116 |
//copy over the new mu-loader version
|
117 |
WPH_functions::copy_mu_loader( TRUE );
|
132 |
if(version_compare($version, '1.4.1', '<'))
|
133 |
{
|
134 |
|
|
|
135 |
|
136 |
//copy over the new mu-loader version
|
137 |
WPH_functions::copy_mu_loader( TRUE );
|
138 |
|
139 |
|
140 |
$version = '1.4.1';
|
141 |
+
}
|
142 |
+
|
143 |
+
if(version_compare($version, '1.4.2', '<'))
|
144 |
+
{
|
145 |
+
|
146 |
+
//unlink the router folder and inner files
|
147 |
+
if( file_exists(WPH_PATH . '/router' ))
|
148 |
+
{
|
149 |
+
if( file_exists(WPH_PATH . '/router/file-process.php' ))
|
150 |
+
@unlink ( WPH_PATH . '/router/file-process.php' );
|
151 |
+
if( file_exists(WPH_PATH . '/router/environment.php' ))
|
152 |
+
@unlink ( WPH_PATH . '/router/environment.php' );
|
153 |
+
|
154 |
+
@rmdir( WPH_PATH . '/router' );
|
155 |
+
}
|
156 |
+
|
157 |
+
if( ! $_triggered_flush_rules )
|
158 |
+
{
|
159 |
+
add_action('wp_loaded', array($this, 'flush_rules') , -1);
|
160 |
+
$_triggered_flush_rules = TRUE;
|
161 |
+
}
|
162 |
+
|
163 |
+
|
164 |
+
$version = '1.4.2';
|
165 |
}
|
166 |
|
167 |
|
include/wph.class.php
CHANGED
@@ -121,10 +121,7 @@
|
|
121 |
|
122 |
//rebuild and change uppon settings modified
|
123 |
add_action('wph/settings_changed', array($this, 'settings_changed'));
|
124 |
-
|
125 |
-
//create the static file which contain different environment variables which will be used on router
|
126 |
-
add_action('wph/settings_changed', array($this, 'set_static_environemnt_file'), 999);
|
127 |
-
|
128 |
//apache
|
129 |
add_filter('mod_rewrite_rules', array($this, 'mod_rewrite_rules'), 999);
|
130 |
//IIS7 server
|
@@ -588,83 +585,7 @@
|
|
588 |
}
|
589 |
|
590 |
|
591 |
-
/**
|
592 |
-
* Create a staitc file which will be used in router
|
593 |
-
*
|
594 |
-
*/
|
595 |
-
function set_static_environemnt_file()
|
596 |
-
{
|
597 |
-
|
598 |
-
$environment_variable = array();
|
599 |
-
|
600 |
-
$environment_variable['theme'] = array(
|
601 |
-
'folder_name' => $this->templates_data['main']['folder_name'],
|
602 |
-
'mapped_name' => $this->settings['module_settings']['new_theme_path']
|
603 |
-
);
|
604 |
-
|
605 |
-
if(isset($this->templates_data['child']))
|
606 |
-
{
|
607 |
-
$environment_variable['child_theme'] = array(
|
608 |
-
'folder_name' => $this->templates_data['child']['folder_name'],
|
609 |
-
'mapped_name' => $this->settings['module_settings']['new_theme_child_path']
|
610 |
-
);
|
611 |
-
}
|
612 |
-
|
613 |
-
$themes_url = untrailingslashit($this->templates_data['themes_url']);
|
614 |
-
$themes_url = str_replace(array("http://", "https://"), "", $themes_url);
|
615 |
-
|
616 |
-
|
617 |
-
$site_url = site_url();
|
618 |
-
$site_url = str_replace(array("http://", "https://"), "", $site_url);
|
619 |
-
|
620 |
-
$themes_url = str_replace($site_url, "", $themes_url);
|
621 |
-
|
622 |
-
//set the allowe paths
|
623 |
-
$environment_variable['allowed_paths'] = array( $themes_url );
|
624 |
-
|
625 |
-
global $wp_filesystem;
|
626 |
-
|
627 |
-
if (empty($wp_filesystem))
|
628 |
-
{
|
629 |
-
require_once (ABSPATH . '/wp-admin/includes/file.php');
|
630 |
-
WP_Filesystem();
|
631 |
-
}
|
632 |
-
|
633 |
-
ob_start();
|
634 |
-
|
635 |
-
echo "<?php ";
|
636 |
-
?>
|
637 |
-
//this can be accesses only from file-process.php
|
638 |
-
$backtrace = debug_backtrace(); if(!is_array($backtrace) || !isset($backtrace[0]) || strpos($backtrace[0]['file'], 'file-process.php') === FALSE || $backtrace[0]['function'] != 'include') die();
|
639 |
-
<?php
|
640 |
-
echo '$environment_variable = \''. json_encode($environment_variable) .'\'';
|
641 |
-
echo " ?>";
|
642 |
-
|
643 |
-
$file_data = ob_get_contents();
|
644 |
-
ob_end_clean();
|
645 |
-
|
646 |
-
if( ! $wp_filesystem->put_contents( WPH_PATH . 'router/environment.php', $file_data , 0644) )
|
647 |
-
{
|
648 |
-
$process_interface_save_errors = get_transient( 'wph-process_interface_save_errors' );
|
649 |
-
delete_transient( 'wph-process_interface_save_errors' );
|
650 |
|
651 |
-
$process_interface_save_errors[] = __('Unable to create environemnt static file. Is ', 'wp-hide-security-enhancer') . WPH_PATH . 'router/ ' . __('writable', 'wp-hide-security-enhancer') . '? <b>Remove description header from Style file</b> and <b>Child - Remove description header from Style file</b> ' . __('will not work correctly, so where turned off.', 'wp-hide-security-enhancer');
|
652 |
-
|
653 |
-
//disable certain options
|
654 |
-
$this->settings['module_settings']['style_file_clean'] = 'no';
|
655 |
-
$this->settings['module_settings']['child_style_file_clean'] = 'no';
|
656 |
-
|
657 |
-
//save the new options
|
658 |
-
$this->functions->update_settings($this->settings);
|
659 |
-
|
660 |
-
//regenerate permalinks
|
661 |
-
$this->settings_changed();
|
662 |
-
|
663 |
-
set_transient( 'wph-process_interface_save_errors', $process_interface_save_errors, HOUR_IN_SECONDS );
|
664 |
-
}
|
665 |
-
|
666 |
-
}
|
667 |
-
|
668 |
|
669 |
function mod_rewrite_rules( $rules )
|
670 |
{
|
121 |
|
122 |
//rebuild and change uppon settings modified
|
123 |
add_action('wph/settings_changed', array($this, 'settings_changed'));
|
124 |
+
|
|
|
|
|
|
|
125 |
//apache
|
126 |
add_filter('mod_rewrite_rules', array($this, 'mod_rewrite_rules'), 999);
|
127 |
//IIS7 server
|
585 |
}
|
586 |
|
587 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
|
590 |
function mod_rewrite_rules( $rules )
|
591 |
{
|
modules/components/rewrite-new_theme_path.php
CHANGED
@@ -42,23 +42,7 @@
|
|
42 |
'processing_order' => 5
|
43 |
);
|
44 |
|
45 |
-
|
46 |
-
'id' => 'style_file_clean',
|
47 |
-
'label' => __('Remove description header from Style file', 'wp-hide-security-enhancer'),
|
48 |
-
'description' => __('Strip out all meta data from style file e.g. Theme Name, Theme URI, Author etc. Those are important information to find out possible theme security breaches.', 'wp-hide-security-enhancer')
|
49 |
-
. '<br />' . __('This feature may not work if style file url not available on html (being concatenated).', 'wp-hide-security-enhancer'),
|
50 |
-
|
51 |
-
'input_type' => 'radio',
|
52 |
-
'options' => array(
|
53 |
-
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
54 |
-
'no' => __('No', 'wp-hide-security-enhancer'),
|
55 |
-
),
|
56 |
-
'default_value' => 'no',
|
57 |
-
|
58 |
-
'sanitize_type' => array('sanitize_title', 'strtolower'),
|
59 |
-
'processing_order' => 3
|
60 |
-
|
61 |
-
);
|
62 |
|
63 |
|
64 |
if($this->wph->templates_data['use_child_theme'])
|
@@ -94,24 +78,7 @@
|
|
94 |
|
95 |
'processing_order' => 5
|
96 |
);
|
97 |
-
|
98 |
-
$this->module_settings[] = array(
|
99 |
-
'id' => 'child_style_file_clean',
|
100 |
-
'label' => __('Child - Remove description header from Style file', 'wp-hide-security-enhancer'),
|
101 |
-
'description' => __('Strip out all meta data from style file e.g. Theme Name, Theme URI, Author etc. Those are important information to find out possible theme security breaches.', 'wp-hide-security-enhancer')
|
102 |
-
. '<br />' . __('This feature may not work if style file url not available on html (being concatenated).', 'wp-hide-security-enhancer'),
|
103 |
-
|
104 |
-
'input_type' => 'radio',
|
105 |
-
'options' => array(
|
106 |
-
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
107 |
-
'no' => __('No', 'wp-hide-security-enhancer'),
|
108 |
-
),
|
109 |
-
'default_value' => 'no',
|
110 |
-
|
111 |
-
'sanitize_type' => array('sanitize_title', 'strtolower'),
|
112 |
-
'processing_order' => 3
|
113 |
-
|
114 |
-
);
|
115 |
}
|
116 |
|
117 |
return $this->module_settings;
|
@@ -425,95 +392,7 @@
|
|
425 |
}
|
426 |
|
427 |
|
428 |
-
|
429 |
-
function _callback_saved_style_file_clean($saved_field_data)
|
430 |
-
{
|
431 |
-
|
432 |
-
if(empty($saved_field_data) || $saved_field_data == 'no')
|
433 |
-
return FALSE;
|
434 |
-
|
435 |
-
$processing_response = array();
|
436 |
-
|
437 |
-
//actual style file path
|
438 |
-
$current_stylesheet_uri = $this->wph->default_variables['template_url'];
|
439 |
-
$current_stylesheet_uri = $this->wph->functions->get_url_path( $current_stylesheet_uri );
|
440 |
-
$current_stylesheet_uri = trailingslashit( $current_stylesheet_uri ) . 'style.css';
|
441 |
-
|
442 |
-
//current style file path
|
443 |
-
$path = '';
|
444 |
-
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_path');
|
445 |
-
$new_style_file_path = $this->wph->functions->get_module_item_setting('new_style_file_path');
|
446 |
-
if(!empty($new_style_file_path))
|
447 |
-
{
|
448 |
-
/*
|
449 |
-
if(!empty($this->wph->default_variables['wordpress_directory']))
|
450 |
-
$path = trailingslashit($this->wph->default_variables['wordpress_directory']);
|
451 |
-
*/
|
452 |
-
|
453 |
-
|
454 |
-
if(!empty($new_theme_path))
|
455 |
-
{
|
456 |
-
$path .= trailingslashit($new_theme_path) . $new_style_file_path;
|
457 |
-
}
|
458 |
-
else
|
459 |
-
{
|
460 |
-
$template_relative_url = $this->wph->functions->get_url_path_relative_to_domain_root($this->wph->default_variables['template_url']);
|
461 |
-
$path .= trailingslashit($template_relative_url) . $new_style_file_path;
|
462 |
-
}
|
463 |
-
|
464 |
-
}
|
465 |
-
else if(!empty($new_theme_path))
|
466 |
-
{
|
467 |
-
$path = trailingslashit( $new_theme_path ) . 'style.css';
|
468 |
-
}
|
469 |
-
else
|
470 |
-
{
|
471 |
-
//use the default
|
472 |
-
// cont/themes/twentyfifteen/style.css
|
473 |
-
|
474 |
-
$default_path = get_template_directory_uri();
|
475 |
-
|
476 |
-
//check for modified wp-content folder
|
477 |
-
$new_content_path = $this->wph->functions->get_module_item_setting('new_content_path');
|
478 |
-
if(!empty($new_content_path))
|
479 |
-
{
|
480 |
-
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
481 |
-
$path = $new_content_path . $path;
|
482 |
-
}
|
483 |
-
else
|
484 |
-
{
|
485 |
-
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
486 |
-
|
487 |
-
$wp_content_folder = str_replace( site_url() , '' , WP_CONTENT_URL);
|
488 |
-
$wp_content_folder = trim($wp_content_folder, '/');
|
489 |
-
|
490 |
-
$path = $wp_content_folder . $path;
|
491 |
-
}
|
492 |
-
|
493 |
-
//$path = $this->wph->functions->get_url_path( get_template_directory_uri() );
|
494 |
-
$path = trailingslashit( $path ) . 'style.css';
|
495 |
-
}
|
496 |
-
|
497 |
-
//plugin File Processor router path
|
498 |
-
$file_processor = $this->wph->functions->get_url_path( WP_PLUGIN_URL );
|
499 |
-
$file_processor = trailingslashit( $file_processor ) . 'wp-hide-security-enhancer/router/file-process.php';
|
500 |
-
|
501 |
-
$current_stylesheet_uri = str_replace(' ', '%20', $current_stylesheet_uri);
|
502 |
-
|
503 |
-
if($this->wph->server_htaccess_config === TRUE)
|
504 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . ' '. $file_processor . '?action=style-clean&file_path=' . $current_stylesheet_uri .' [L,QSA]';
|
505 |
-
|
506 |
-
if($this->wph->server_web_config === TRUE)
|
507 |
-
$processing_response['rewrite'] = '
|
508 |
-
<rule name="wph-style_file_clean" stopProcessing="true">
|
509 |
-
<match url="^'. $path .'" />
|
510 |
-
<action type="Rewrite" url="'. $file_processor .'?action=style-clean&file_path=' . $current_stylesheet_uri .'" appendQueryString="true" />
|
511 |
-
</rule>
|
512 |
-
';
|
513 |
-
|
514 |
-
return $processing_response;
|
515 |
-
|
516 |
-
}
|
517 |
|
518 |
|
519 |
|
@@ -602,92 +481,6 @@
|
|
602 |
}
|
603 |
|
604 |
|
605 |
-
|
606 |
-
{
|
607 |
-
|
608 |
-
if(empty($saved_field_data) || $saved_field_data == 'no')
|
609 |
-
return FALSE;
|
610 |
-
|
611 |
-
$processing_response = array();
|
612 |
-
|
613 |
-
//actual style file path
|
614 |
-
$current_stylesheet_uri = trailingslashit ( $this->wph->templates_data['themes_url'] ) . $this->wph->templates_data['child']['folder_name'];
|
615 |
-
$current_stylesheet_uri = $this->wph->functions->get_url_path( $current_stylesheet_uri );
|
616 |
-
$current_stylesheet_uri = trailingslashit( $current_stylesheet_uri ) . 'style.css';
|
617 |
-
|
618 |
-
//current style file path
|
619 |
-
$path = '';
|
620 |
-
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_child_path');
|
621 |
-
$new_style_file_path = $this->wph->functions->get_module_item_setting('child_style_file_path');
|
622 |
-
if(!empty($new_style_file_path))
|
623 |
-
{
|
624 |
-
/*
|
625 |
-
if(!empty($this->wph->default_variables['wordpress_directory']))
|
626 |
-
$path = trailingslashit($this->wph->default_variables['wordpress_directory']);
|
627 |
-
*/
|
628 |
-
|
629 |
-
if(!empty($new_theme_path))
|
630 |
-
{
|
631 |
-
$path .= trailingslashit($new_theme_path) . $new_style_file_path;
|
632 |
-
}
|
633 |
-
else
|
634 |
-
{
|
635 |
-
$template_relative_url = $this->wph->functions->get_url_path_relative_to_domain_root($this->wph->default_variables['stylesheet_uri']);
|
636 |
-
$path .= trailingslashit($template_relative_url) . $new_style_file_path;
|
637 |
-
}
|
638 |
-
}
|
639 |
-
else if(!empty($new_theme_path))
|
640 |
-
{
|
641 |
-
$path = trailingslashit( $new_theme_path ) . 'style.css';
|
642 |
-
}
|
643 |
-
else
|
644 |
-
{
|
645 |
-
//use the default
|
646 |
-
// cont/themes/twentyfifteen/style.css
|
647 |
-
|
648 |
-
$default_path = trailingslashit ( $this->wph->templates_data['themes_url'] ) . $this->wph->templates_data['child']['folder_name'];
|
649 |
-
|
650 |
-
//check for modified wp-content folder
|
651 |
-
$new_content_path = $this->wph->functions->get_module_item_setting('new_content_path');
|
652 |
-
if(!empty($new_content_path))
|
653 |
-
{
|
654 |
-
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
655 |
-
$path = $new_content_path . $path;
|
656 |
-
}
|
657 |
-
else
|
658 |
-
{
|
659 |
-
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
660 |
-
|
661 |
-
$wp_content_folder = str_replace( site_url() , '' , WP_CONTENT_URL);
|
662 |
-
$wp_content_folder = trim($wp_content_folder, '/');
|
663 |
-
|
664 |
-
$path = $wp_content_folder . $path;
|
665 |
-
}
|
666 |
-
|
667 |
-
//$path = $this->wph->functions->get_url_path( get_template_directory_uri() );
|
668 |
-
$path = trailingslashit( $path ) . 'style.css';
|
669 |
-
}
|
670 |
-
|
671 |
-
//plugin File Processor router path
|
672 |
-
$file_processor = $this->wph->functions->get_url_path( WP_PLUGIN_URL );
|
673 |
-
$file_processor = trailingslashit( $file_processor ) . 'wp-hide-security-enhancer/router/file-process.php';
|
674 |
-
|
675 |
-
$current_stylesheet_uri = str_replace(' ', '%20', $current_stylesheet_uri);
|
676 |
-
|
677 |
-
if($this->wph->server_htaccess_config === TRUE)
|
678 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $path . ' '. $file_processor . '?action=style-clean&file_path=' . $current_stylesheet_uri .' [L,QSA]';
|
679 |
-
|
680 |
-
|
681 |
-
if($this->wph->server_web_config === TRUE)
|
682 |
-
$processing_response['rewrite'] = '
|
683 |
-
<rule name="wph-child-style_file_clean" stopProcessing="true">
|
684 |
-
<match url="^'. $path .'" />
|
685 |
-
<action type="Rewrite" url="'. $file_processor .'?action=style-clean&file_path=' . $current_stylesheet_uri .'" appendQueryString="true" />
|
686 |
-
</rule>
|
687 |
-
';
|
688 |
-
|
689 |
-
return $processing_response;
|
690 |
-
|
691 |
-
}
|
692 |
}
|
693 |
?>
|
42 |
'processing_order' => 5
|
43 |
);
|
44 |
|
45 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
|
48 |
if($this->wph->templates_data['use_child_theme'])
|
78 |
|
79 |
'processing_order' => 5
|
80 |
);
|
81 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
|
84 |
return $this->module_settings;
|
392 |
}
|
393 |
|
394 |
|
395 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
|
397 |
|
398 |
|
481 |
}
|
482 |
|
483 |
|
484 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
}
|
486 |
?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.nsp-code.com/donate.php
|
|
4 |
Tags: hide, security, improve security, hacking, wp hide, wordpress hide, custom login url, wp-loging.php, ap-admin
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 4.7.2
|
7 |
-
Stable tag: 1.4.
|
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.
|
@@ -239,6 +239,9 @@ Please get in touch with us and we'll do our best to include it for a next versi
|
|
239 |
|
240 |
== Changelog ==
|
241 |
|
|
|
|
|
|
|
242 |
= 1.4.1 =
|
243 |
* Security improvments
|
244 |
|
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.7.2
|
7 |
+
Stable tag: 1.4.2
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
|
239 |
|
240 |
== Changelog ==
|
241 |
|
242 |
+
= 1.4.2 =
|
243 |
+
* Replaced "Remove description header from Style file" and "Child - Remove description header from Style file" functionality
|
244 |
+
|
245 |
= 1.4.1 =
|
246 |
* Security improvments
|
247 |
|
router/file-process.php
DELETED
@@ -1,137 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$action = isset($_GET['action']) ? filter_var ( $_GET['action'], FILTER_SANITIZE_STRING) : '';
|
4 |
-
$file_path = isset($_GET['file_path']) ? filter_var ( $_GET['file_path'], FILTER_SANITIZE_STRING) : '';
|
5 |
-
|
6 |
-
if(empty($action) || empty($file_path))
|
7 |
-
die();
|
8 |
-
|
9 |
-
//append doc root to path
|
10 |
-
$full_file_path = $_SERVER["DOCUMENT_ROOT"] . $file_path;
|
11 |
-
|
12 |
-
//check if file exists
|
13 |
-
if (!file_exists($full_file_path))
|
14 |
-
die();
|
15 |
-
|
16 |
-
//allow only style files
|
17 |
-
$pathinfo = pathinfo($full_file_path);
|
18 |
-
if(!isset($pathinfo['extension']) || strtolower($pathinfo['extension']) != 'css')
|
19 |
-
die();
|
20 |
-
|
21 |
-
$WPH_FileProcess = new WPH_FileProcess($action, $file_path);
|
22 |
-
$WPH_FileProcess->run();
|
23 |
-
|
24 |
-
class WPH_FileProcess
|
25 |
-
{
|
26 |
-
var $action;
|
27 |
-
var $file_path;
|
28 |
-
var $full_file_path;
|
29 |
-
|
30 |
-
var $environemnt;
|
31 |
-
|
32 |
-
function __construct( $action, $file_path )
|
33 |
-
{
|
34 |
-
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false)
|
35 |
-
{
|
36 |
-
ob_start('ob_gzhandler'); ob_start();
|
37 |
-
}
|
38 |
-
else
|
39 |
-
{
|
40 |
-
ob_start();
|
41 |
-
}
|
42 |
-
|
43 |
-
$this->action = $action;
|
44 |
-
$this->file_path = $file_path;
|
45 |
-
$this->full_file_path = $_SERVER["DOCUMENT_ROOT"] . $file_path;
|
46 |
-
|
47 |
-
//load the environemtn data
|
48 |
-
$this->environment = new stdClass();
|
49 |
-
|
50 |
-
if(file_exists('environment.php'))
|
51 |
-
{
|
52 |
-
include('environment.php');
|
53 |
-
$this->environment = json_decode($environment_variable);
|
54 |
-
}
|
55 |
-
|
56 |
-
//check for allowed paths
|
57 |
-
if(!isset($this->environment->allowed_paths) || !is_array($this->environment->allowed_paths) || count($this->environment->allowed_paths) < 1)
|
58 |
-
die();
|
59 |
-
|
60 |
-
//check if the file is in allowed path
|
61 |
-
$found = FALSE;
|
62 |
-
foreach($this->environment->allowed_paths as $allowed_path)
|
63 |
-
{
|
64 |
-
if(strpos($this->file_path, $allowed_path) === 0)
|
65 |
-
{
|
66 |
-
$found = TRUE;
|
67 |
-
break;
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
if(! $found )
|
72 |
-
die();
|
73 |
-
|
74 |
-
}
|
75 |
-
|
76 |
-
function __destruct()
|
77 |
-
{
|
78 |
-
$out = ob_get_contents();
|
79 |
-
ob_end_clean();
|
80 |
-
|
81 |
-
echo $out;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Process the action
|
86 |
-
*
|
87 |
-
*/
|
88 |
-
function run()
|
89 |
-
{
|
90 |
-
|
91 |
-
switch($this->action)
|
92 |
-
{
|
93 |
-
case 'style-clean' :
|
94 |
-
$this->style_clean();
|
95 |
-
break;
|
96 |
-
|
97 |
-
}
|
98 |
-
|
99 |
-
}
|
100 |
-
|
101 |
-
|
102 |
-
function style_clean()
|
103 |
-
{
|
104 |
-
//output headers
|
105 |
-
$expires_offset = 31536000;
|
106 |
-
|
107 |
-
header('Content-Type: text/css; charset=UTF-8');
|
108 |
-
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
|
109 |
-
header("Cache-Control: public, max-age=$expires_offset");
|
110 |
-
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($this->full_file_path)).' GMT', true);
|
111 |
-
|
112 |
-
$handle = fopen($this->full_file_path, "r");
|
113 |
-
$file_data = fread($handle, filesize($this->full_file_path));
|
114 |
-
fclose($handle);
|
115 |
-
|
116 |
-
$file_data = preg_replace('!/\*.*?\*/!s', '', $file_data);
|
117 |
-
$file_data = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $file_data);
|
118 |
-
|
119 |
-
|
120 |
-
if(isset($this->environment->theme))
|
121 |
-
{
|
122 |
-
$var_theme = $this->environment->theme;
|
123 |
-
$file_data = str_replace('../' . $var_theme->folder_name .'/', '../' . $var_theme->mapped_name .'/', $file_data);
|
124 |
-
}
|
125 |
-
if(isset($this->environment->child_theme))
|
126 |
-
{
|
127 |
-
$var_theme = $this->environment->child_theme;
|
128 |
-
$file_data = str_replace('../' . $var_theme->folder_name .'/', '../' . $var_theme->mapped_name .'/', $file_data);
|
129 |
-
}
|
130 |
-
|
131 |
-
echo $file_data;
|
132 |
-
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
|
137 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wp-hide.php
CHANGED
@@ -5,7 +5,7 @@ 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.4.
|
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.4.2
|
9 |
Text Domain: wp-hide-security-enhancer
|
10 |
Domain Path: /languages/
|
11 |
*/
|