Version Description
- New component : Robots.txt to control the outputed data
- Check if any environment variable has changed before Update static environment file
- Improved Default constants map
- File-processing check WordPress wp-load.php down the path, for custom install directory.
- Templates style clean
- Use cache for cleaned styles files
- Set HTTP_MOD_REWRITE environment variable through mod_rewrite
- Separate rewrite rules from Wordpress and use distinct block with specific marker
- Add relative .htaccess file manipulation to avoid accessing permissions when WordPress installed within a subfolder.
- Updated .po language file
Download this release
Release Info
Developer | nsp-code |
Plugin | WP Hide & Security Enhancer |
Version | 1.4.4 |
Comparing to | |
See all releases |
Code changes from version 1.4.3 to 1.4.4
- css/wph.css +1 -0
- include/functions.class.php +342 -27
- include/update.class.php +40 -3
- include/wph.class.php +215 -31
- languages/wp-hide-security-enhancer.mo +0 -0
- languages/wp-hide-security-enhancer.po +830 -648
- modules/components/admin-new_wp_login_php.php +2 -2
- modules/components/general-html.php +1 -1
- modules/components/general-tobots-txt.php +68 -0
- modules/components/general-wpemoji.php +2 -2
- modules/components/rewrite-comments.php +2 -2
- modules/components/rewrite-json-rest.php +2 -2
- modules/components/rewrite-new_include_path.php +2 -2
- modules/components/rewrite-new_plugin_path.php +3 -3
- modules/components/rewrite-new_theme_path.php +393 -131
- modules/components/rewrite-new_upload_path.php +2 -2
- modules/components/rewrite-new_xml-rpc-path.php +4 -4
- modules/components/rewrite-root-files.php +13 -13
- modules/components/rewrite-wp_content_path.php +2 -2
- modules/module-general.php +3 -0
- mu-loader/wp-hide-loader.php +2 -1
- readme.txt +18 -2
- router/class.file-processor.php +214 -0
- router/environment.php +2 -0
- router/file-process.php +46 -0
- wp-hide.php +4 -2
css/wph.css
CHANGED
@@ -43,6 +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 { 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;}
|
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 td.label .description a.button {display: inline-block; vertical-align: middle;}
|
47 |
table.wph_input tbody tr.submit td { text-align: right}
|
48 |
table.wph_input tbody tr.submit td.label {border-right: 1px solid #F9F9F9}
|
49 |
table.wph_input input[type=text],table.wph_input textarea,table.wph_input select{ width: 99.95%; outline: none;}
|
include/functions.class.php
CHANGED
@@ -414,7 +414,12 @@
|
|
414 |
$home_path = ABSPATH;
|
415 |
}
|
416 |
|
417 |
-
|
|
|
|
|
|
|
|
|
|
|
418 |
|
419 |
return $home_path;
|
420 |
|
@@ -427,9 +432,7 @@
|
|
427 |
*/
|
428 |
function server_use_htaccess_config_file()
|
429 |
{
|
430 |
-
|
431 |
-
|
432 |
-
$htaccess_file = $home_path.'.htaccess';
|
433 |
if ($this->apache_mod_loaded('mod_rewrite', true))
|
434 |
return TRUE;
|
435 |
|
@@ -451,7 +454,10 @@
|
|
451 |
*/
|
452 |
function apache_mod_loaded($mod, $default = false)
|
453 |
{
|
454 |
-
|
|
|
|
|
|
|
455 |
if ( function_exists( 'apache_get_modules' ) )
|
456 |
{
|
457 |
$mods = apache_get_modules();
|
@@ -483,9 +489,8 @@
|
|
483 |
*/
|
484 |
function is_writable_htaccess_config_file()
|
485 |
{
|
486 |
-
$home_path
|
487 |
-
|
488 |
-
$htaccess_file = $home_path.'.htaccess';
|
489 |
|
490 |
if ((!file_exists($htaccess_file) && $this->is_permalink_enabled()) || is_writable($htaccess_file))
|
491 |
return TRUE;
|
@@ -500,14 +505,20 @@
|
|
500 |
*/
|
501 |
function server_use_web_config_file()
|
502 |
{
|
503 |
-
$home_path = $this->get_home_path();
|
504 |
|
505 |
-
$
|
506 |
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
|
512 |
}
|
513 |
|
@@ -530,38 +541,95 @@
|
|
530 |
}
|
531 |
|
532 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
function get_write_check_string()
|
534 |
{
|
535 |
-
$home_path
|
536 |
|
537 |
global $wp_rewrite;
|
538 |
|
539 |
$result = FALSE;
|
540 |
-
|
541 |
//check for .htaccess
|
542 |
-
if ( $this->server_use_htaccess_config_file()
|
543 |
{
|
544 |
-
|
545 |
-
if
|
546 |
{
|
547 |
-
|
548 |
{
|
549 |
-
|
550 |
{
|
551 |
-
|
552 |
-
|
|
|
|
|
|
|
553 |
}
|
554 |
}
|
555 |
}
|
556 |
}
|
557 |
|
558 |
//check for web.config
|
559 |
-
if ( $this->server_use_web_config_file()
|
560 |
{
|
561 |
-
$
|
562 |
-
if(
|
563 |
{
|
564 |
-
if ( $markerdata = explode( "\n", implode( '', $
|
565 |
{
|
566 |
foreach ( $markerdata as $markerline )
|
567 |
{
|
@@ -611,6 +679,189 @@
|
|
611 |
}
|
612 |
|
613 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
/**
|
615 |
* Check if the plugin started through MU plugin loader
|
616 |
*
|
@@ -726,6 +977,8 @@
|
|
726 |
if(isset($url_parse['query']))
|
727 |
$path .= '?' . $url_parse['query'];
|
728 |
|
|
|
|
|
729 |
return $path;
|
730 |
|
731 |
}
|
@@ -1845,6 +2098,68 @@
|
|
1845 |
return $url;
|
1846 |
|
1847 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1848 |
|
1849 |
|
1850 |
function get_ad_banner()
|
414 |
$home_path = ABSPATH;
|
415 |
}
|
416 |
|
417 |
+
|
418 |
+
$home_path = trim($home_path, '\\/ ');
|
419 |
+
|
420 |
+
//not for windows
|
421 |
+
if ( DIRECTORY_SEPARATOR != '\\')
|
422 |
+
$home_path = DIRECTORY_SEPARATOR . $home_path;
|
423 |
|
424 |
return $home_path;
|
425 |
|
432 |
*/
|
433 |
function server_use_htaccess_config_file()
|
434 |
{
|
435 |
+
|
|
|
|
|
436 |
if ($this->apache_mod_loaded('mod_rewrite', true))
|
437 |
return TRUE;
|
438 |
|
454 |
*/
|
455 |
function apache_mod_loaded($mod, $default = false)
|
456 |
{
|
457 |
+
|
458 |
+
if ( !$this->is_apache() )
|
459 |
+
return false;
|
460 |
+
|
461 |
if ( function_exists( 'apache_get_modules' ) )
|
462 |
{
|
463 |
$mods = apache_get_modules();
|
489 |
*/
|
490 |
function is_writable_htaccess_config_file()
|
491 |
{
|
492 |
+
$home_path = $this->get_home_path();
|
493 |
+
$htaccess_file = $home_path . DIRECTORY_SEPARATOR . '.htaccess';
|
|
|
494 |
|
495 |
if ((!file_exists($htaccess_file) && $this->is_permalink_enabled()) || is_writable($htaccess_file))
|
496 |
return TRUE;
|
505 |
*/
|
506 |
function server_use_web_config_file()
|
507 |
{
|
|
|
508 |
|
509 |
+
$is_iis7 = $this->is_IIS7();
|
510 |
|
511 |
+
$supports_permalinks = false;
|
512 |
+
if ( $is_iis7 )
|
513 |
+
{
|
514 |
+
|
515 |
+
$supports_permalinks = class_exists( 'DOMDocument', false ) && isset($_SERVER['IIS_UrlRewriteModule']) && ( PHP_SAPI == 'cgi-fcgi' );
|
516 |
+
}
|
517 |
+
|
518 |
+
|
519 |
+
$supports_permalinks = apply_filters( 'iis7_supports_permalinks', $supports_permalinks );
|
520 |
+
|
521 |
+
return $supports_permalinks;
|
522 |
|
523 |
}
|
524 |
|
541 |
}
|
542 |
|
543 |
|
544 |
+
/**
|
545 |
+
* Return if the server run Apache
|
546 |
+
*
|
547 |
+
*/
|
548 |
+
function is_apache()
|
549 |
+
{
|
550 |
+
$is_apache = FALSE;
|
551 |
+
$is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);
|
552 |
+
|
553 |
+
return $is_apache;
|
554 |
+
|
555 |
+
}
|
556 |
+
|
557 |
+
|
558 |
+
/**
|
559 |
+
* Return if the server run on nginx
|
560 |
+
*
|
561 |
+
*/
|
562 |
+
function is_nginx()
|
563 |
+
{
|
564 |
+
$is_nginx = FALSE;
|
565 |
+
$is_nginx = (strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
|
566 |
+
|
567 |
+
return $is_nginx;
|
568 |
+
|
569 |
+
}
|
570 |
+
|
571 |
+
/**
|
572 |
+
* Return if the server run on IIS
|
573 |
+
*
|
574 |
+
*/
|
575 |
+
function is_IIS()
|
576 |
+
{
|
577 |
+
$is_IIS = FALSE;
|
578 |
+
$is_IIS = !$this->is_apache() && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false);
|
579 |
+
|
580 |
+
return $is_IIS;
|
581 |
+
|
582 |
+
}
|
583 |
+
|
584 |
+
|
585 |
+
/**
|
586 |
+
* Return if the server run on IIS version 7 and up
|
587 |
+
*
|
588 |
+
*/
|
589 |
+
function is_IIS7()
|
590 |
+
{
|
591 |
+
$is_iis7 = FALSE;
|
592 |
+
$is_iis7 = $this->is_IIS() && intval( substr( $_SERVER['SERVER_SOFTWARE'], strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/' ) + 14 ) ) >= 7;
|
593 |
+
|
594 |
+
return $is_iis7;
|
595 |
+
}
|
596 |
+
|
597 |
+
|
598 |
function get_write_check_string()
|
599 |
{
|
600 |
+
$home_path = $this->get_home_path();
|
601 |
|
602 |
global $wp_rewrite;
|
603 |
|
604 |
$result = FALSE;
|
605 |
+
|
606 |
//check for .htaccess
|
607 |
+
if ( $this->server_use_htaccess_config_file())
|
608 |
{
|
609 |
+
$file_path = $home_path . DIRECTORY_SEPARATOR . '.htaccess';
|
610 |
+
if(file_exists( $file_path ))
|
611 |
{
|
612 |
+
if ( $markerdata = explode( "\n", implode( '', file( $file_path ) ) ));
|
613 |
{
|
614 |
+
foreach ( $markerdata as $markerline )
|
615 |
{
|
616 |
+
if (strpos($markerline, '#WriteCheckString:') !== false)
|
617 |
+
{
|
618 |
+
$result = trim(str_replace( '#WriteCheckString:', '', $markerline));
|
619 |
+
break;
|
620 |
+
}
|
621 |
}
|
622 |
}
|
623 |
}
|
624 |
}
|
625 |
|
626 |
//check for web.config
|
627 |
+
if ( $this->server_use_web_config_file())
|
628 |
{
|
629 |
+
$file_path = $home_path . DIRECTORY_SEPARATOR . 'web.config';
|
630 |
+
if(file_exists( $file_path ))
|
631 |
{
|
632 |
+
if ( $markerdata = explode( "\n", implode( '', file( $file_path ) ) ));
|
633 |
{
|
634 |
foreach ( $markerdata as $markerline )
|
635 |
{
|
679 |
}
|
680 |
|
681 |
|
682 |
+
|
683 |
+
|
684 |
+
function insert_with_markers_on_top( $filename, $marker, $insertion)
|
685 |
+
{
|
686 |
+
|
687 |
+
if ( ! file_exists( $filename ) ) {
|
688 |
+
if ( ! is_writable( dirname( $filename ) ) ) {
|
689 |
+
return false;
|
690 |
+
}
|
691 |
+
if ( ! touch( $filename ) ) {
|
692 |
+
return false;
|
693 |
+
}
|
694 |
+
} elseif ( ! is_writeable( $filename ) ) {
|
695 |
+
return false;
|
696 |
+
}
|
697 |
+
|
698 |
+
if ( ! is_array( $insertion ) ) {
|
699 |
+
$insertion = explode( "\n", $insertion );
|
700 |
+
}
|
701 |
+
|
702 |
+
$start_marker = "# BEGIN {$marker}";
|
703 |
+
$end_marker = "# END {$marker}";
|
704 |
+
|
705 |
+
$fp = fopen( $filename, 'r+' );
|
706 |
+
if ( ! $fp ) {
|
707 |
+
return false;
|
708 |
+
}
|
709 |
+
|
710 |
+
// Attempt to get a lock. If the filesystem supports locking, this will block until the lock is acquired.
|
711 |
+
flock( $fp, LOCK_EX );
|
712 |
+
|
713 |
+
$lines = array();
|
714 |
+
while ( ! feof( $fp ) ) {
|
715 |
+
$lines[] = rtrim( fgets( $fp ), "\r\n" );
|
716 |
+
}
|
717 |
+
|
718 |
+
// Split out the existing file into the preceding lines, and those that appear after the marker
|
719 |
+
$pre_lines = $post_lines = $existing_lines = array();
|
720 |
+
$found_marker = $found_end_marker = false;
|
721 |
+
foreach ( $lines as $line ) {
|
722 |
+
if ( ! $found_marker && false !== strpos( $line, $start_marker ) ) {
|
723 |
+
$found_marker = true;
|
724 |
+
continue;
|
725 |
+
} elseif ( ! $found_end_marker && false !== strpos( $line, $end_marker ) ) {
|
726 |
+
$found_end_marker = true;
|
727 |
+
continue;
|
728 |
+
}
|
729 |
+
if ( ! $found_marker ) {
|
730 |
+
$pre_lines[] = $line;
|
731 |
+
} elseif ( $found_marker && $found_end_marker ) {
|
732 |
+
$post_lines[] = $line;
|
733 |
+
} else {
|
734 |
+
$existing_lines[] = $line;
|
735 |
+
}
|
736 |
+
}
|
737 |
+
|
738 |
+
// Check to see if there was a change
|
739 |
+
if ( $existing_lines === $insertion ) {
|
740 |
+
flock( $fp, LOCK_UN );
|
741 |
+
fclose( $fp );
|
742 |
+
|
743 |
+
return true;
|
744 |
+
}
|
745 |
+
|
746 |
+
|
747 |
+
// Generate the new file data
|
748 |
+
if($found_marker && $found_end_marker)
|
749 |
+
{
|
750 |
+
$new_file_data = implode( "\n", array_merge(
|
751 |
+
$pre_lines,
|
752 |
+
array( $start_marker ),
|
753 |
+
$insertion,
|
754 |
+
array( $end_marker ),
|
755 |
+
$post_lines
|
756 |
+
) );
|
757 |
+
}
|
758 |
+
else
|
759 |
+
{
|
760 |
+
|
761 |
+
$new_file_data = implode( "\n", array_merge(
|
762 |
+
array( $start_marker ),
|
763 |
+
$insertion,
|
764 |
+
array( $end_marker ),
|
765 |
+
$pre_lines
|
766 |
+
) );
|
767 |
+
|
768 |
+
}
|
769 |
+
|
770 |
+
// Write to the start of the file, and truncate it to that length
|
771 |
+
fseek( $fp, 0 );
|
772 |
+
$bytes = fwrite( $fp, $new_file_data );
|
773 |
+
if ( $bytes ) {
|
774 |
+
ftruncate( $fp, ftell( $fp ) );
|
775 |
+
}
|
776 |
+
fflush( $fp );
|
777 |
+
flock( $fp, LOCK_UN );
|
778 |
+
fclose( $fp );
|
779 |
+
|
780 |
+
return (bool) $bytes;
|
781 |
+
|
782 |
+
|
783 |
+
}
|
784 |
+
|
785 |
+
|
786 |
+
function clean_with_markers( $filename, $markers)
|
787 |
+
{
|
788 |
+
|
789 |
+
if ( ! file_exists( $filename ) ) {
|
790 |
+
if ( ! is_writable( dirname( $filename ) ) ) {
|
791 |
+
return false;
|
792 |
+
}
|
793 |
+
if ( ! touch( $filename ) ) {
|
794 |
+
return false;
|
795 |
+
}
|
796 |
+
} elseif ( ! is_writeable( $filename ) ) {
|
797 |
+
return false;
|
798 |
+
}
|
799 |
+
|
800 |
+
$start_marker = $markers['start'];
|
801 |
+
$end_marker = $markers['end'];
|
802 |
+
|
803 |
+
$fp = fopen( $filename, 'r+' );
|
804 |
+
if ( ! $fp ) {
|
805 |
+
return false;
|
806 |
+
}
|
807 |
+
|
808 |
+
// Attempt to get a lock. If the filesystem supports locking, this will block until the lock is acquired.
|
809 |
+
flock( $fp, LOCK_EX );
|
810 |
+
|
811 |
+
$lines = array();
|
812 |
+
while ( ! feof( $fp ) ) {
|
813 |
+
$lines[] = rtrim( fgets( $fp ), "\r\n" );
|
814 |
+
}
|
815 |
+
|
816 |
+
// Split out the existing file into the preceding lines, and those that appear after the marker
|
817 |
+
$pre_lines = $post_lines = $existing_lines = array();
|
818 |
+
$found_marker = $found_end_marker = false;
|
819 |
+
foreach ( $lines as $line ) {
|
820 |
+
if ( ! $found_marker && false !== strpos( $line, $start_marker ) ) {
|
821 |
+
$found_marker = true;
|
822 |
+
continue;
|
823 |
+
} elseif ( ! $found_end_marker && false !== strpos( $line, $end_marker ) ) {
|
824 |
+
$found_end_marker = true;
|
825 |
+
continue;
|
826 |
+
}
|
827 |
+
if ( ! $found_marker ) {
|
828 |
+
$pre_lines[] = $line;
|
829 |
+
} elseif ( $found_marker && $found_end_marker ) {
|
830 |
+
$post_lines[] = $line;
|
831 |
+
} else {
|
832 |
+
$existing_lines[] = $line;
|
833 |
+
}
|
834 |
+
}
|
835 |
+
|
836 |
+
// Generate the new file data
|
837 |
+
if($found_marker && $found_end_marker)
|
838 |
+
{
|
839 |
+
$new_file_data = implode( "\n", array_merge(
|
840 |
+
$pre_lines,
|
841 |
+
$post_lines
|
842 |
+
) );
|
843 |
+
|
844 |
+
// Write to the start of the file, and truncate it to that length
|
845 |
+
fseek( $fp, 0 );
|
846 |
+
$bytes = fwrite( $fp, $new_file_data );
|
847 |
+
if ( $bytes ) {
|
848 |
+
ftruncate( $fp, ftell( $fp ) );
|
849 |
+
}
|
850 |
+
fflush( $fp );
|
851 |
+
flock( $fp, LOCK_UN );
|
852 |
+
fclose( $fp );
|
853 |
+
|
854 |
+
return (bool) $bytes;
|
855 |
+
|
856 |
+
}
|
857 |
+
|
858 |
+
return FALSE;
|
859 |
+
|
860 |
+
|
861 |
+
}
|
862 |
+
|
863 |
+
|
864 |
+
|
865 |
/**
|
866 |
* Check if the plugin started through MU plugin loader
|
867 |
*
|
977 |
if(isset($url_parse['query']))
|
978 |
$path .= '?' . $url_parse['query'];
|
979 |
|
980 |
+
$path = str_replace( '\\', '/', $path);
|
981 |
+
|
982 |
return $path;
|
983 |
|
984 |
}
|
2098 |
return $url;
|
2099 |
|
2100 |
}
|
2101 |
+
|
2102 |
+
|
2103 |
+
|
2104 |
+
/**
|
2105 |
+
* Init the cache directory where static files will be saved
|
2106 |
+
*
|
2107 |
+
*/
|
2108 |
+
function init_cache_dir()
|
2109 |
+
{
|
2110 |
+
|
2111 |
+
if ( ! is_dir( WPH_CACHE_PATH ) )
|
2112 |
+
{
|
2113 |
+
wp_mkdir_p( WPH_CACHE_PATH );
|
2114 |
+
}
|
2115 |
+
|
2116 |
+
|
2117 |
+
}
|
2118 |
+
|
2119 |
+
|
2120 |
+
/**
|
2121 |
+
* Clear the cache content
|
2122 |
+
*
|
2123 |
+
*/
|
2124 |
+
function cache_clear()
|
2125 |
+
{
|
2126 |
+
|
2127 |
+
do_action('wp-hide/before_cache_clear');
|
2128 |
+
|
2129 |
+
$this->rrmdir( WPH_CACHE_PATH, TRUE );
|
2130 |
+
|
2131 |
+
do_action('wp-hide/after_cache_clear');
|
2132 |
+
|
2133 |
+
}
|
2134 |
+
|
2135 |
+
|
2136 |
+
/**
|
2137 |
+
* Recursivelly remove all fodlers and files within a directory
|
2138 |
+
*
|
2139 |
+
* @param mixed $dir
|
2140 |
+
*/
|
2141 |
+
function rrmdir( $dir, $xclude_parent = FALSE )
|
2142 |
+
{
|
2143 |
+
if (is_dir($dir))
|
2144 |
+
{
|
2145 |
+
$objects = scandir($dir);
|
2146 |
+
|
2147 |
+
foreach ($objects as $object)
|
2148 |
+
{
|
2149 |
+
if ($object != "." && $object != "..")
|
2150 |
+
{
|
2151 |
+
if (filetype($dir."/".$object) == "dir")
|
2152 |
+
$this->rrmdir($dir."/".$object);
|
2153 |
+
else unlink ($dir."/".$object);
|
2154 |
+
}
|
2155 |
+
}
|
2156 |
+
|
2157 |
+
reset($objects);
|
2158 |
+
|
2159 |
+
if($xclude_parent !== TRUE)
|
2160 |
+
rmdir($dir);
|
2161 |
+
}
|
2162 |
+
}
|
2163 |
|
2164 |
|
2165 |
function get_ad_banner()
|
include/update.class.php
CHANGED
@@ -18,11 +18,11 @@
|
|
18 |
private function _run()
|
19 |
{
|
20 |
$version = isset($this->wph->settings['version']) ? $this->wph->settings['version'] : 1;
|
21 |
-
|
22 |
//make sure the WPH_VERSION constant is being defined,
|
23 |
//this issue occoured in version 1.3.9
|
24 |
//We set this for 1.3.9 as this is the code version whcih included the issue, all other version include the correnct data
|
25 |
-
if(!defined('WPH_VERSION') && defined('WPH_MULOADER'))
|
26 |
{
|
27 |
define('WPH_VERSION', '1.3.9');
|
28 |
|
@@ -162,6 +162,42 @@
|
|
162 |
|
163 |
|
164 |
$version = '1.4.2';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
166 |
|
167 |
|
@@ -200,13 +236,14 @@
|
|
200 |
* 1) Through AJAX, plugin update - it trigger the first update so flush_rules()
|
201 |
* 2) Through regular plugin update, no new plugin files are being run
|
202 |
*/
|
|
|
203 |
if( !defined( 'DOING_AJAX' ) && $this->wph->permalinks_not_applied === FALSE && $this->wph->functions->rewrite_rules_applied() === TRUE)
|
204 |
{
|
205 |
//reload the page
|
206 |
wp_redirect($this->wph->functions->get_current_url());
|
207 |
die();
|
208 |
}
|
209 |
-
|
210 |
}
|
211 |
|
212 |
}
|
18 |
private function _run()
|
19 |
{
|
20 |
$version = isset($this->wph->settings['version']) ? $this->wph->settings['version'] : 1;
|
21 |
+
|
22 |
//make sure the WPH_VERSION constant is being defined,
|
23 |
//this issue occoured in version 1.3.9
|
24 |
//We set this for 1.3.9 as this is the code version whcih included the issue, all other version include the correnct data
|
25 |
+
if(!defined('WPH_VERSION') && defined('WPH_MULOADER') && version_compare($version, '1.3.9', '<='))
|
26 |
{
|
27 |
define('WPH_VERSION', '1.3.9');
|
28 |
|
162 |
|
163 |
|
164 |
$version = '1.4.2';
|
165 |
+
}
|
166 |
+
|
167 |
+
if(version_compare($version, '1.4.4', '<'))
|
168 |
+
{
|
169 |
+
|
170 |
+
//copy over the new mu-loader version
|
171 |
+
WPH_functions::copy_mu_loader( TRUE );
|
172 |
+
|
173 |
+
//remove previous rules from .htaccess file to use the new block type
|
174 |
+
if($this->wph->server_htaccess_config === TRUE)
|
175 |
+
{
|
176 |
+
$home_path = $this->wph->functions->get_home_path();
|
177 |
+
$htaccess_file = $home_path . DIRECTORY_SEPARATOR . '.htaccess';
|
178 |
+
|
179 |
+
//check if .htaccess file exists and is writable
|
180 |
+
if( $this->wph->functions->is_writable_htaccess_config_file( $htaccess_file ))
|
181 |
+
{
|
182 |
+
$markers = array(
|
183 |
+
'start' => '#START - WP Hide & Security Enhancer',
|
184 |
+
'end' => '#END - WP Hide & Security Enhancer'
|
185 |
+
);
|
186 |
+
$this->wph->functions->clean_with_markers( $htaccess_file, $markers);
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
//regenerate the environemnt file
|
191 |
+
$this->wph->set_static_environemnt_file();
|
192 |
+
|
193 |
+
if( ! $_triggered_flush_rules )
|
194 |
+
{
|
195 |
+
add_action('wp_loaded', array($this, 'flush_rules') , -1);
|
196 |
+
$_triggered_flush_rules = TRUE;
|
197 |
+
}
|
198 |
+
|
199 |
+
|
200 |
+
$version = '1.4.4';
|
201 |
}
|
202 |
|
203 |
|
236 |
* 1) Through AJAX, plugin update - it trigger the first update so flush_rules()
|
237 |
* 2) Through regular plugin update, no new plugin files are being run
|
238 |
*/
|
239 |
+
/*
|
240 |
if( !defined( 'DOING_AJAX' ) && $this->wph->permalinks_not_applied === FALSE && $this->wph->functions->rewrite_rules_applied() === TRUE)
|
241 |
{
|
242 |
//reload the page
|
243 |
wp_redirect($this->wph->functions->get_current_url());
|
244 |
die();
|
245 |
}
|
246 |
+
*/
|
247 |
}
|
248 |
|
249 |
}
|
include/wph.class.php
CHANGED
@@ -37,8 +37,7 @@
|
|
37 |
|
38 |
$plugin_data = $this->functions->get_plugin_data( WPH_PATH . '/wp-hide.php', $markup = true, $translate = true );
|
39 |
|
40 |
-
define('WPH_CORE_VERSION', $plugin_data['Version']);
|
41 |
-
define('WPH_CORE_MULOADER_VERSION', '1.2');
|
42 |
|
43 |
}
|
44 |
|
@@ -113,17 +112,28 @@
|
|
113 |
add_action('logout_redirect', array($this, 'logout_redirect') , 999, 3);
|
114 |
|
115 |
//check if force 404 error
|
116 |
-
add_action('init',
|
|
|
|
|
117 |
|
118 |
add_action('admin_menu', array($this, 'admin_menus'));
|
119 |
add_action('admin_init', array($this, 'admin_init'), 11);
|
120 |
|
|
|
|
|
|
|
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',
|
|
|
|
|
|
|
127 |
//IIS7 server
|
128 |
add_filter('iis7_url_rewrite_rules', array($this, 'iis7_url_rewrite_rules'), 999);
|
129 |
|
@@ -149,7 +159,12 @@
|
|
149 |
new WPH_update();
|
150 |
|
151 |
}
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
153 |
function _load_modules()
|
154 |
{
|
155 |
|
@@ -182,10 +197,7 @@
|
|
182 |
|
183 |
//filter available for mu-plugins
|
184 |
$this->modules = apply_filters('wp-hide/loaded_modules', $this->modules);
|
185 |
-
|
186 |
-
//sort the replacement urls ?? by the length
|
187 |
-
//$keys = array_map('strlen', array_keys($arr));
|
188 |
-
//array_multisort($keys, SORT_DESC, $arr);
|
189 |
|
190 |
}
|
191 |
|
@@ -234,6 +246,18 @@
|
|
234 |
|
235 |
}
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
|
239 |
/**
|
@@ -253,6 +277,10 @@
|
|
253 |
{
|
254 |
$this->functions->process_interface_save();
|
255 |
}
|
|
|
|
|
|
|
|
|
256 |
}
|
257 |
|
258 |
|
@@ -330,6 +358,13 @@
|
|
330 |
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>";
|
331 |
}
|
332 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
|
334 |
if(isset($_GET['reset_settings']))
|
335 |
{
|
@@ -368,7 +403,16 @@
|
|
368 |
|
369 |
$this->functions->settings_changed_check_for_cache_plugins();
|
370 |
}
|
371 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
373 |
|
374 |
/**
|
@@ -584,11 +628,107 @@
|
|
584 |
flush_rewrite_rules();
|
585 |
}
|
586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
587 |
|
588 |
|
589 |
|
590 |
-
function
|
591 |
{
|
|
|
|
|
|
|
592 |
if($this->uninstall === TRUE)
|
593 |
return $rules;
|
594 |
|
@@ -611,28 +751,63 @@
|
|
611 |
$write_check_string = time() . '_' . mt_rand(100, 99999);
|
612 |
$this->settings['write_check_string'] = $write_check_string;
|
613 |
$this->functions->update_settings($this->settings);
|
|
|
|
|
|
|
|
|
614 |
|
615 |
-
$new_rules = "RewriteRule ^index\.php$ - [L] \n\n#START - WP Hide & Security Enhancer\n#WriteCheckString:" . $write_check_string;
|
616 |
-
$new_rules .= "\n<IfModule mod_env.c>\nSetEnv HTTP_MOD_REWRITE On\n</IfModule>";
|
617 |
if(count($_rewrite_data) > 0)
|
618 |
{
|
619 |
foreach($_rewrite_data as $_htaccess_data_line)
|
620 |
{
|
621 |
-
$
|
622 |
}
|
623 |
}
|
624 |
-
|
625 |
-
$new_rules .= "\n#END - WP Hide & Security Enhancer\n";
|
626 |
|
627 |
-
$
|
628 |
-
|
629 |
-
|
630 |
-
$
|
631 |
-
|
632 |
-
|
633 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
634 |
}
|
635 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
636 |
|
637 |
function get_components_rules()
|
638 |
{
|
@@ -867,7 +1042,7 @@
|
|
867 |
$this->default_variables['upload_url'] = $wp_upload_dir['baseurl'];
|
868 |
|
869 |
//used across modules
|
870 |
-
$this->default_variables['
|
871 |
|
872 |
//themes url
|
873 |
$this->templates_data['themes_url'] = trailingslashit( get_theme_root_uri() );
|
@@ -898,7 +1073,10 @@
|
|
898 |
|
899 |
|
900 |
//content_directory
|
901 |
-
$
|
|
|
|
|
|
|
902 |
|
903 |
$home_url = defined('WP_HOME') ? WP_HOME : get_option('home');
|
904 |
$home_url = untrailingslashit($home_url);
|
@@ -911,15 +1089,21 @@
|
|
911 |
|
912 |
if($wp_directory != '')
|
913 |
{
|
914 |
-
$this->default_variables['wordpress_directory'] = $wp_directory;
|
915 |
|
916 |
-
$domain_ABSPATH
|
917 |
|
918 |
-
$content_directory
|
919 |
-
$content_directory
|
920 |
-
$this->default_variables['content_directory'] = $content_directory;
|
921 |
}
|
922 |
|
|
|
|
|
|
|
|
|
|
|
|
|
923 |
}
|
924 |
|
925 |
|
37 |
|
38 |
$plugin_data = $this->functions->get_plugin_data( WPH_PATH . '/wp-hide.php', $markup = true, $translate = true );
|
39 |
|
40 |
+
define('WPH_CORE_VERSION', $plugin_data['Version']);
|
|
|
41 |
|
42 |
}
|
43 |
|
112 |
add_action('logout_redirect', array($this, 'logout_redirect') , 999, 3);
|
113 |
|
114 |
//check if force 404 error
|
115 |
+
add_action('init', array($this, 'check_for_404'));
|
116 |
+
|
117 |
+
add_action('init', array($this, 'on_init'));
|
118 |
|
119 |
add_action('admin_menu', array($this, 'admin_menus'));
|
120 |
add_action('admin_init', array($this, 'admin_init'), 11);
|
121 |
|
122 |
+
//make sure to clear cache files on certain actions
|
123 |
+
add_action("after_switch_theme", array($this->functions, 'cache_clear'));
|
124 |
+
|
125 |
|
126 |
//rebuild and change uppon settings modified
|
127 |
add_action('wph/settings_changed', array($this, 'settings_changed'));
|
128 |
+
|
129 |
+
//create the static file which contain different environment variables which will be used on router
|
130 |
+
add_action('wph/settings_changed', array($this, 'set_static_environemnt_file'), 999);
|
131 |
+
|
132 |
//apache
|
133 |
+
//add_filter('mod_rewrite_rules', array($this, 'mod_rewrite_rules'), 999);
|
134 |
+
if($this->server_htaccess_config === TRUE)
|
135 |
+
add_filter('flush_rewrite_rules_hard', array($this, 'flush_rewrite_rules_hard'), 999);
|
136 |
+
|
137 |
//IIS7 server
|
138 |
add_filter('iis7_url_rewrite_rules', array($this, 'iis7_url_rewrite_rules'), 999);
|
139 |
|
159 |
new WPH_update();
|
160 |
|
161 |
}
|
162 |
+
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Load modules
|
166 |
+
*
|
167 |
+
*/
|
168 |
function _load_modules()
|
169 |
{
|
170 |
|
197 |
|
198 |
//filter available for mu-plugins
|
199 |
$this->modules = apply_filters('wp-hide/loaded_modules', $this->modules);
|
200 |
+
|
|
|
|
|
|
|
201 |
|
202 |
}
|
203 |
|
246 |
|
247 |
}
|
248 |
|
249 |
+
|
250 |
+
|
251 |
+
/**
|
252 |
+
* General Init action
|
253 |
+
*
|
254 |
+
*/
|
255 |
+
function on_init()
|
256 |
+
{
|
257 |
+
|
258 |
+
|
259 |
+
|
260 |
+
}
|
261 |
|
262 |
|
263 |
/**
|
277 |
{
|
278 |
$this->functions->process_interface_save();
|
279 |
}
|
280 |
+
|
281 |
+
//crete required additional folders
|
282 |
+
$this->functions->init_cache_dir();
|
283 |
+
|
284 |
}
|
285 |
|
286 |
|
358 |
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>";
|
359 |
}
|
360 |
}
|
361 |
+
|
362 |
+
|
363 |
+
//check if the cache dir is available
|
364 |
+
if(! is_writable( WPH_CACHE_PATH ))
|
365 |
+
{
|
366 |
+
echo "<div class='error'><p>". __('Unable to create cache folder. Is the wp-content writable? <br />No cache data will be available.', 'wp-hide-security-enhancer') ."</p></div>";
|
367 |
+
}
|
368 |
|
369 |
if(isset($_GET['reset_settings']))
|
370 |
{
|
403 |
|
404 |
$this->functions->settings_changed_check_for_cache_plugins();
|
405 |
}
|
406 |
+
|
407 |
+
if(isset($_GET['wph_cache_clear']) && $_GET['wph_cache_clear'] == 'true')
|
408 |
+
{
|
409 |
+
|
410 |
+
$this->functions->cache_clear();
|
411 |
+
|
412 |
+
echo "<div class='updated'><p>". __('Cache cleared', 'wp-hide-security-enhancer') ."</p></div>";
|
413 |
+
|
414 |
+
}
|
415 |
+
|
416 |
}
|
417 |
|
418 |
/**
|
628 |
flush_rewrite_rules();
|
629 |
}
|
630 |
|
631 |
+
|
632 |
+
|
633 |
+
|
634 |
+
/**
|
635 |
+
* Create a staitc file which contain specific variables and will be used in router
|
636 |
+
*
|
637 |
+
*/
|
638 |
+
function set_static_environemnt_file()
|
639 |
+
{
|
640 |
+
|
641 |
+
$environment_variable = array();
|
642 |
+
|
643 |
+
$environment_variable['theme'] = array(
|
644 |
+
'folder_name' => $this->templates_data['main']['folder_name'],
|
645 |
+
'mapped_name' => $this->settings['module_settings']['new_theme_path']
|
646 |
+
);
|
647 |
+
|
648 |
+
if(isset($this->templates_data['child']))
|
649 |
+
{
|
650 |
+
$environment_variable['child_theme'] = array(
|
651 |
+
'folder_name' => $this->templates_data['child']['folder_name'],
|
652 |
+
'mapped_name' => $this->settings['module_settings']['new_theme_child_path']
|
653 |
+
);
|
654 |
+
}
|
655 |
+
|
656 |
+
$themes_url = untrailingslashit($this->templates_data['themes_url']);
|
657 |
+
$themes_url = str_replace(array("http://", "https://"), "", $themes_url);
|
658 |
+
|
659 |
+
|
660 |
+
$site_url = site_url();
|
661 |
+
$site_url = str_replace(array("http://", "https://"), "", $site_url);
|
662 |
+
|
663 |
+
$themes_url = str_replace($site_url, "", $themes_url);
|
664 |
+
$themes_path = str_replace( '\\', '/', ABSPATH . ltrim($themes_url, '/'));
|
665 |
+
|
666 |
+
//set the allowe paths
|
667 |
+
$environment_variable['allowed_paths'] = apply_filters('wp-hide/environemnt_file/allowed_paths', array( $themes_path ));
|
668 |
+
|
669 |
+
$environment_variable['cache_path'] = str_replace( '\\', '/', WPH_CACHE_PATH);
|
670 |
+
|
671 |
+
$environment_variable['site_wordpress_relative_path'] = $this->default_variables['site_wordpress_relative_path'];
|
672 |
+
$environment_variable['wordpress_directory'] = $this->default_variables['wordpress_directory'];
|
673 |
+
$environment_variable['site_relative_path'] = $this->default_variables['site_relative_path'];
|
674 |
+
|
675 |
+
$previous_hash = get_option('wph_environment_hash');
|
676 |
+
if(!empty($previous_hash) && $previous_hash == md5(json_encode($environment_variable)) && file_exists(WPH_PATH . 'router/environment.php'))
|
677 |
+
return;
|
678 |
+
|
679 |
+
global $wp_filesystem;
|
680 |
+
|
681 |
+
if (empty($wp_filesystem))
|
682 |
+
{
|
683 |
+
require_once (ABSPATH . '/wp-admin/includes/file.php');
|
684 |
+
WP_Filesystem();
|
685 |
+
}
|
686 |
+
|
687 |
+
ob_start();
|
688 |
+
|
689 |
+
echo "<?php ";
|
690 |
+
echo "if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly";
|
691 |
+
echo "\n";
|
692 |
+
echo '$environment_variable = \''. json_encode($environment_variable) .'\'';
|
693 |
+
echo " ?>";
|
694 |
+
|
695 |
+
$file_data = ob_get_contents();
|
696 |
+
ob_end_clean();
|
697 |
+
|
698 |
+
if( ! $wp_filesystem->put_contents( WPH_PATH . 'router/environment.php', $file_data , 0644) )
|
699 |
+
{
|
700 |
+
$process_interface_save_errors = get_transient( 'wph-process_interface_save_errors' );
|
701 |
+
delete_transient( 'wph-process_interface_save_errors' );
|
702 |
+
|
703 |
+
$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');
|
704 |
+
|
705 |
+
//disable certain options
|
706 |
+
$this->settings['module_settings']['style_file_clean'] = 'no';
|
707 |
+
$this->settings['module_settings']['child_style_file_clean'] = 'no';
|
708 |
+
|
709 |
+
//save the new options
|
710 |
+
$this->functions->update_settings($this->settings);
|
711 |
+
|
712 |
+
//regenerate permalinks
|
713 |
+
$this->settings_changed();
|
714 |
+
|
715 |
+
set_transient( 'wph-process_interface_save_errors', $process_interface_save_errors, HOUR_IN_SECONDS );
|
716 |
+
}
|
717 |
+
else
|
718 |
+
{
|
719 |
+
update_option('wph_environment_hash', md5(json_encode($environment_variable)));
|
720 |
+
}
|
721 |
+
|
722 |
+
}
|
723 |
+
|
724 |
|
725 |
|
726 |
|
727 |
+
function get_rewrite_rules( )
|
728 |
{
|
729 |
+
|
730 |
+
$rules = "";
|
731 |
+
|
732 |
if($this->uninstall === TRUE)
|
733 |
return $rules;
|
734 |
|
751 |
$write_check_string = time() . '_' . mt_rand(100, 99999);
|
752 |
$this->settings['write_check_string'] = $write_check_string;
|
753 |
$this->functions->update_settings($this->settings);
|
754 |
+
|
755 |
+
|
756 |
+
$rules .= "#WriteCheckString:" . $write_check_string . "\n";
|
757 |
+
$rules .= "RewriteRule .* - [E=HTTP_MOD_REWRITE:On]";
|
758 |
|
|
|
|
|
759 |
if(count($_rewrite_data) > 0)
|
760 |
{
|
761 |
foreach($_rewrite_data as $_htaccess_data_line)
|
762 |
{
|
763 |
+
$rules .= "\n" . $_htaccess_data_line;
|
764 |
}
|
765 |
}
|
|
|
|
|
766 |
|
767 |
+
$rules = apply_filters('wp-hide/mod_rewrite_rules', $rules);
|
768 |
+
|
769 |
+
|
770 |
+
$home_root = parse_url(home_url());
|
771 |
+
if ( isset( $home_root['path'] ) )
|
772 |
+
$home_root = trailingslashit($home_root['path']);
|
773 |
+
else
|
774 |
+
$home_root = '/';
|
775 |
+
|
776 |
+
$rules = "<IfModule mod_rewrite.c> \n"
|
777 |
+
. "RewriteEngine On \n"
|
778 |
+
. "RewriteBase ". $home_root ." \n"
|
779 |
+
. $rules
|
780 |
+
. "\n"
|
781 |
+
. "</IfModule> \n";
|
782 |
+
|
783 |
+
return $rules;
|
784 |
+
|
785 |
}
|
786 |
|
787 |
+
|
788 |
+
|
789 |
+
function flush_rewrite_rules_hard( $continue )
|
790 |
+
{
|
791 |
+
$home_path = $this->functions->get_home_path();
|
792 |
+
$htaccess_file = $home_path . DIRECTORY_SEPARATOR . '.htaccess';
|
793 |
+
|
794 |
+
//check if .htaccess file exists and is writable
|
795 |
+
if( ! $this->functions->is_writable_htaccess_config_file( $htaccess_file ))
|
796 |
+
return TRUE;
|
797 |
+
|
798 |
+
$rules = $this->get_rewrite_rules();
|
799 |
+
|
800 |
+
//check if there's a # BEGIN WordPress and # END WordPress markers or create those to ensude plugin rules are put on top of Wordpress ones
|
801 |
+
$file_content = file( $htaccess_file );
|
802 |
+
If (array_search('# BEGIN WordPress', $file_content) === FALSE && array_search('# END WordPress', $file_content) === FALSE )
|
803 |
+
$this->functions->insert_with_markers_on_top( $htaccess_file, 'WordPress', '' );
|
804 |
+
|
805 |
+
$this->functions->insert_with_markers_on_top( $htaccess_file, 'WP Hide & Security Enhancer', $rules, 'top' );
|
806 |
+
|
807 |
+
return TRUE;
|
808 |
+
|
809 |
+
}
|
810 |
+
|
811 |
|
812 |
function get_components_rules()
|
813 |
{
|
1042 |
$this->default_variables['upload_url'] = $wp_upload_dir['baseurl'];
|
1043 |
|
1044 |
//used across modules
|
1045 |
+
$this->default_variables['site_wordpress_relative_path'] = $this->functions->get_url_path( rtrim( site_url(), '/' ));
|
1046 |
|
1047 |
//themes url
|
1048 |
$this->templates_data['themes_url'] = trailingslashit( get_theme_root_uri() );
|
1073 |
|
1074 |
|
1075 |
//content_directory
|
1076 |
+
$content_directory = str_replace(ABSPATH, "", WP_CONTENT_DIR);
|
1077 |
+
$content_directory = str_replace( '\\', '/', $content_directory );
|
1078 |
+
$content_directory = trim($content_directory, '/ ');
|
1079 |
+
$this->default_variables['content_directory'] = '/' . $content_directory;
|
1080 |
|
1081 |
$home_url = defined('WP_HOME') ? WP_HOME : get_option('home');
|
1082 |
$home_url = untrailingslashit($home_url);
|
1089 |
|
1090 |
if($wp_directory != '')
|
1091 |
{
|
1092 |
+
$this->default_variables['wordpress_directory'] = '/' . trim($wp_directory, '/');
|
1093 |
|
1094 |
+
$domain_ABSPATH = str_replace('/' . $wp_directory .'/' , "", trailingslashit( str_replace('\\', '/', realpath( ABSPATH ))));
|
1095 |
|
1096 |
+
$content_directory = str_replace($domain_ABSPATH, "" , untrailingslashit( str_replace('\\', '/', realpath( WP_CONTENT_DIR ))));
|
1097 |
+
$content_directory = trim($content_directory, '/ ');
|
1098 |
+
$this->default_variables['content_directory'] = '/' . $content_directory;
|
1099 |
}
|
1100 |
|
1101 |
+
if( !empty($this->default_variables['wordpress_directory']))
|
1102 |
+
$site_relative_path = str_replace($this->default_variables['wordpress_directory'] .'/' , "", $this->default_variables['site_wordpress_relative_path'] .'/');
|
1103 |
+
else
|
1104 |
+
$site_relative_path = $this->default_variables['site_wordpress_relative_path'] .'/';
|
1105 |
+
$this->default_variables['site_relative_path'] = rtrim($site_relative_path, '/');
|
1106 |
+
|
1107 |
}
|
1108 |
|
1109 |
|
languages/wp-hide-security-enhancer.mo
CHANGED
Binary file
|
languages/wp-hide-security-enhancer.po
CHANGED
@@ -1,648 +1,830 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: Post Types Order\n"
|
4 |
-
"POT-Creation-Date:
|
5 |
-
"PO-Revision-Date:
|
6 |
-
"Last-Translator: nsp-code
|
7 |
-
"Language-Team: \n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"X-Generator: Poedit 1.5.5\n"
|
12 |
-
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
13 |
-
"X-Poedit-Basepath: ../\n"
|
14 |
-
"X-Poedit-SearchPath-0: .\n"
|
15 |
-
|
16 |
-
#: conflicts/wp-simple-firewall.php:
|
17 |
-
msgid ""
|
18 |
-
"<b>Conflict notice</b>: The Security Firewall - Login Protection use the "
|
19 |
-
"Rename WP Login Page functionality which is the same as WP Hide - Admin "
|
20 |
-
"Login Url change. "
|
21 |
-
msgstr ""
|
22 |
-
|
23 |
-
#: include/functions.class.php:
|
24 |
-
msgid ""
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
"
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: include/functions.class.php:
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
"
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
"
|
50 |
-
"
|
51 |
-
msgstr ""
|
52 |
-
|
53 |
-
#: include/
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
"
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
"
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
msgstr ""
|
85 |
-
|
86 |
-
#:
|
87 |
-
msgid "
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
msgstr ""
|
128 |
-
|
129 |
-
#:
|
130 |
-
msgid "
|
131 |
-
msgstr ""
|
132 |
-
|
133 |
-
#: modules/
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
#: modules/
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
#: modules/
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
#: modules/
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
#: modules/
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
#: modules/
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
#: modules/components/
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
#: modules/components/
|
162 |
-
#: modules/components/
|
163 |
-
#: modules/components/rewrite-
|
164 |
-
#: modules/components/rewrite-
|
165 |
-
#: modules/components/rewrite-
|
166 |
-
#: modules/components/rewrite-
|
167 |
-
#: modules/components/rewrite-
|
168 |
-
#: modules/components/rewrite-wp_content_path.php:
|
169 |
-
msgid "
|
170 |
-
msgstr ""
|
171 |
-
|
172 |
-
#: modules/components/admin-admin_url.php:
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
#: modules/components/
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
#: modules/components/
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
#: modules/components/
|
185 |
-
#: modules/components/
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
#: modules/components/
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
#: modules/components/
|
196 |
-
#: modules/components/
|
197 |
-
#: modules/components/
|
198 |
-
#: modules/components/
|
199 |
-
#: modules/components/
|
200 |
-
#: modules/components/
|
201 |
-
#: modules/components/
|
202 |
-
#: modules/components/
|
203 |
-
#: modules/components/
|
204 |
-
#: modules/components/
|
205 |
-
#: modules/components/
|
206 |
-
#: modules/components/
|
207 |
-
#: modules/components/
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
#: modules/components/
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
#: modules/components/
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
#: modules/components/
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
#: modules/components/
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
#: modules/components/
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
#: modules/components/
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
#: modules/components/
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
#: modules/components/
|
247 |
-
msgid "
|
248 |
-
msgstr ""
|
249 |
-
|
250 |
-
#: modules/components/
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
#: modules/components/general-
|
255 |
-
#: modules/components/general-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
#: modules/components/general-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
#: modules/components/general-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
#: modules/components/general-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
#: modules/components/general-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
#: modules/components/
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
#: modules/components/
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
#: modules/components/
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
#: modules/components/
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
#: modules/components/
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
#: modules/components/
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
#: modules/components/
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
#: modules/components/
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
#: modules/components/
|
369 |
-
msgid "
|
370 |
-
msgstr ""
|
371 |
-
|
372 |
-
#: modules/components/
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
msgstr ""
|
377 |
-
|
378 |
-
#: modules/components/
|
379 |
-
msgid "
|
380 |
-
msgstr ""
|
381 |
-
|
382 |
-
#: modules/components/
|
383 |
-
msgid "
|
384 |
-
msgstr ""
|
385 |
-
|
386 |
-
#: modules/components/
|
387 |
-
msgid "
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
msgstr ""
|
405 |
-
|
406 |
-
#: modules/components/
|
407 |
-
msgid "
|
408 |
-
msgstr ""
|
409 |
-
|
410 |
-
#: modules/components/
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
#: modules/components/rewrite-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
#: modules/components/
|
429 |
-
msgid "
|
430 |
-
msgstr ""
|
431 |
-
|
432 |
-
#: modules/components/
|
433 |
-
msgid "Remove
|
434 |
-
msgstr ""
|
435 |
-
|
436 |
-
#: modules/components/
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
"
|
442 |
-
msgstr ""
|
443 |
-
|
444 |
-
#: modules/components/
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
#: modules/components/rewrite-
|
488 |
-
msgid ""
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
"
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
"
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
"
|
599 |
-
msgstr ""
|
600 |
-
|
601 |
-
#: modules/components/rewrite-
|
602 |
-
|
603 |
-
|
604 |
-
"
|
605 |
-
"
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
#: modules/components/rewrite-
|
610 |
-
msgid "
|
611 |
-
msgstr ""
|
612 |
-
|
613 |
-
#: modules/components/rewrite-
|
614 |
-
|
615 |
-
"
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Post Types Order\n"
|
4 |
+
"POT-Creation-Date: 2017-03-28 21:17+0200\n"
|
5 |
+
"PO-Revision-Date: 2017-03-28 21:17+0200\n"
|
6 |
+
"Last-Translator: NspCode <contact@nsp-code.com>\n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Generator: Poedit 1.5.5\n"
|
12 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
13 |
+
"X-Poedit-Basepath: ../\n"
|
14 |
+
"X-Poedit-SearchPath-0: .\n"
|
15 |
+
|
16 |
+
#: conflicts/wp-simple-firewall.php:97
|
17 |
+
msgid ""
|
18 |
+
"<b>Conflict notice</b>: The Security Firewall - Login Protection use the "
|
19 |
+
"Rename WP Login Page functionality which is the same as WP Hide - Admin "
|
20 |
+
"Login Url change. "
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: include/functions.class.php:231
|
24 |
+
msgid "Value"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: include/functions.class.php:231
|
28 |
+
msgid "set for"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: include/functions.class.php:231
|
32 |
+
msgid "already in use for another option."
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: include/functions.class.php:324
|
36 |
+
msgid ""
|
37 |
+
"W3 Total Cache Plugin is active, make sure you clear the cache for new "
|
38 |
+
"changes to apply"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: include/functions.class.php:328
|
42 |
+
msgid ""
|
43 |
+
"WP Super Cache Plugin is active, make sure you clear the cache for new "
|
44 |
+
"changes to apply"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: include/functions.class.php:333
|
48 |
+
msgid ""
|
49 |
+
"WP Fastest Cache Plugin is active, make sure you clear the cache for new "
|
50 |
+
"changes to apply"
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: include/functions.class.php:1832
|
54 |
+
#, php-format
|
55 |
+
msgid "The %1$s plugin header is deprecated. Use %2$s instead."
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: include/functions.class.php:1917
|
59 |
+
#, php-format
|
60 |
+
msgid "By %s."
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: include/functions.class.php:2203
|
64 |
+
msgid ""
|
65 |
+
"Help us to improve this plugin by sending any improvement suggestions and "
|
66 |
+
"reporting any issues at "
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: include/functions.class.php:2204
|
70 |
+
msgid ""
|
71 |
+
"Did you find this plugin useful? Please support our work by spread the word "
|
72 |
+
"about this, or write an article about the plugin in your blog with a link to "
|
73 |
+
"development site"
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: include/wph.class.php:303
|
77 |
+
msgid "Are you sure to reset all settings? All options will be removed."
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: include/wph.class.php:339
|
81 |
+
msgid ""
|
82 |
+
"Unable to launch WP Hide through mu-plugins/wp-hide-loader.php<br /> Please "
|
83 |
+
"make sure this location is writable so the plugin create the required file."
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: include/wph.class.php:345
|
87 |
+
msgid ""
|
88 |
+
"Permalink is required to be turned ON for WP Hide & Security Enhancer to work"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: include/wph.class.php:355 include/wph.class.php:382
|
92 |
+
msgid ""
|
93 |
+
"Unable to write custom rules to your .htaccess. Is this file writable? <br /"
|
94 |
+
">No mod is being applied."
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: include/wph.class.php:358 include/wph.class.php:385
|
98 |
+
msgid ""
|
99 |
+
"Unable to write custom rules to your web.config. Is this file writable? <br /"
|
100 |
+
">No mod is being applied."
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: include/wph.class.php:366
|
104 |
+
msgid ""
|
105 |
+
"Unable to create cache folder. Is the wp-content writable? <br />No cache "
|
106 |
+
"data will be available."
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: include/wph.class.php:371
|
110 |
+
msgid "All Settings where restored to default"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: include/wph.class.php:390
|
114 |
+
msgid "Settings saved"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: include/wph.class.php:412
|
118 |
+
msgid "Cache cleared"
|
119 |
+
msgstr ""
|
120 |
+
|
121 |
+
#: include/wph.class.php:703
|
122 |
+
msgid "Unable to create environemnt static file. Is "
|
123 |
+
msgstr ""
|
124 |
+
|
125 |
+
#: include/wph.class.php:703
|
126 |
+
msgid "writable"
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: include/wph.class.php:703
|
130 |
+
msgid "will not work correctly, so where turned off."
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: modules/module-admin.php:45
|
134 |
+
msgid "Admin"
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: modules/module-admin.php:57
|
138 |
+
msgid "WP Hide & Security Enhancer - Admin"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: modules/module-general.php:63
|
142 |
+
msgid "General / Html"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: modules/module-general.php:75
|
146 |
+
msgid "WP Hide & Security Enhancer - General / Html"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: modules/module-rewrite.php:71 modules/module-rewrite.php:82
|
150 |
+
msgid "Rewrite"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: modules/module-rewrite.php:82
|
154 |
+
msgid "WP Hide & Security Enhancer"
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: modules/components/admin-admin_url.php:18
|
158 |
+
msgid "Create a new admin url instead default /wp-admin and /login."
|
159 |
+
msgstr ""
|
160 |
+
|
161 |
+
#: modules/components/admin-admin_url.php:19
|
162 |
+
#: modules/components/admin-new_wp_login_php.php:19
|
163 |
+
#: modules/components/rewrite-new_include_path.php:19
|
164 |
+
#: modules/components/rewrite-new_plugin_path.php:19
|
165 |
+
#: modules/components/rewrite-new_theme_path.php:24
|
166 |
+
#: modules/components/rewrite-new_theme_path.php:84
|
167 |
+
#: modules/components/rewrite-new_upload_path.php:19
|
168 |
+
#: modules/components/rewrite-wp_content_path.php:18
|
169 |
+
msgid "More details can be found at"
|
170 |
+
msgstr ""
|
171 |
+
|
172 |
+
#: modules/components/admin-admin_url.php:20
|
173 |
+
msgid "Write down your new admin url, or if lost, will not be able to log-in."
|
174 |
+
msgstr ""
|
175 |
+
|
176 |
+
#: modules/components/admin-admin_url.php:20
|
177 |
+
msgid "An e-mail will be sent to"
|
178 |
+
msgstr ""
|
179 |
+
|
180 |
+
#: modules/components/admin-admin_url.php:20
|
181 |
+
msgid "with the new Login URL"
|
182 |
+
msgstr ""
|
183 |
+
|
184 |
+
#: modules/components/admin-admin_url.php:21
|
185 |
+
#: modules/components/admin-new_wp_login_php.php:21
|
186 |
+
msgid ""
|
187 |
+
"If unable to access the login / admin section anymore, use the Recovery Link "
|
188 |
+
"which reset links to default: "
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
#: modules/components/admin-admin_url.php:34
|
192 |
+
msgid "Block default admin url and files from being accesible."
|
193 |
+
msgstr ""
|
194 |
+
|
195 |
+
#: modules/components/admin-admin_url.php:38
|
196 |
+
#: modules/components/admin-new_wp_login_php.php:37
|
197 |
+
#: modules/components/general-headers.php:22
|
198 |
+
#: modules/components/general-headers.php:39
|
199 |
+
#: modules/components/general-html.php:21
|
200 |
+
#: modules/components/general-html.php:38
|
201 |
+
#: modules/components/general-html.php:55
|
202 |
+
#: modules/components/general-html.php:72
|
203 |
+
#: modules/components/general-html.php:89
|
204 |
+
#: modules/components/general-html.php:106
|
205 |
+
#: modules/components/general-meta.php:22
|
206 |
+
#: modules/components/general-meta.php:38
|
207 |
+
#: modules/components/general-meta.php:54
|
208 |
+
#: modules/components/general-meta.php:70
|
209 |
+
#: modules/components/general-meta.php:86
|
210 |
+
#: modules/components/general-meta.php:103
|
211 |
+
#: modules/components/general-meta.php:120
|
212 |
+
#: modules/components/general-meta.php:139
|
213 |
+
#: modules/components/general-meta.php:157
|
214 |
+
#: modules/components/general-meta.php:173
|
215 |
+
#: modules/components/general-meta.php:189
|
216 |
+
#: modules/components/general-oembed.php:22
|
217 |
+
#: modules/components/general-scripts.php:21
|
218 |
+
#: modules/components/general-styles.php:21
|
219 |
+
#: modules/components/general-styles.php:37
|
220 |
+
#: modules/components/general-tobots-txt.php:21
|
221 |
+
#: modules/components/general-wpemoji.php:21
|
222 |
+
#: modules/components/general-wpemoji.php:37
|
223 |
+
#: modules/components/rewrite-comments.php:34
|
224 |
+
#: modules/components/rewrite-json-rest.php:23
|
225 |
+
#: modules/components/rewrite-json-rest.php:41
|
226 |
+
#: modules/components/rewrite-json-rest.php:63
|
227 |
+
#: modules/components/rewrite-json-rest.php:87
|
228 |
+
#: modules/components/rewrite-json-rest.php:105
|
229 |
+
#: modules/components/rewrite-json-rest.php:122
|
230 |
+
#: modules/components/rewrite-new_include_path.php:34
|
231 |
+
#: modules/components/rewrite-new_plugin_path.php:35
|
232 |
+
#: modules/components/rewrite-new_theme_path.php:62
|
233 |
+
#: modules/components/rewrite-new_theme_path.php:119
|
234 |
+
#: modules/components/rewrite-new_upload_path.php:35
|
235 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:34
|
236 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:51
|
237 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:68
|
238 |
+
#: modules/components/rewrite-root-files.php:24
|
239 |
+
#: modules/components/rewrite-root-files.php:40
|
240 |
+
#: modules/components/rewrite-root-files.php:56
|
241 |
+
#: modules/components/rewrite-root-files.php:72
|
242 |
+
#: modules/components/rewrite-root-files.php:88
|
243 |
+
#: modules/components/rewrite-root-files.php:105
|
244 |
+
#: modules/components/rewrite-root-files.php:122
|
245 |
+
#: modules/components/rewrite-slash.php:21
|
246 |
+
#: modules/components/rewrite-wp_content_path.php:36
|
247 |
+
msgid "Yes"
|
248 |
+
msgstr ""
|
249 |
+
|
250 |
+
#: modules/components/admin-admin_url.php:39
|
251 |
+
#: modules/components/admin-new_wp_login_php.php:38
|
252 |
+
#: modules/components/general-headers.php:23
|
253 |
+
#: modules/components/general-headers.php:40
|
254 |
+
#: modules/components/general-html.php:22
|
255 |
+
#: modules/components/general-html.php:39
|
256 |
+
#: modules/components/general-html.php:56
|
257 |
+
#: modules/components/general-html.php:73
|
258 |
+
#: modules/components/general-html.php:90
|
259 |
+
#: modules/components/general-html.php:107
|
260 |
+
#: modules/components/general-meta.php:23
|
261 |
+
#: modules/components/general-meta.php:39
|
262 |
+
#: modules/components/general-meta.php:55
|
263 |
+
#: modules/components/general-meta.php:71
|
264 |
+
#: modules/components/general-meta.php:87
|
265 |
+
#: modules/components/general-meta.php:104
|
266 |
+
#: modules/components/general-meta.php:121
|
267 |
+
#: modules/components/general-meta.php:140
|
268 |
+
#: modules/components/general-meta.php:158
|
269 |
+
#: modules/components/general-meta.php:174
|
270 |
+
#: modules/components/general-meta.php:190
|
271 |
+
#: modules/components/general-oembed.php:23
|
272 |
+
#: modules/components/general-scripts.php:22
|
273 |
+
#: modules/components/general-styles.php:22
|
274 |
+
#: modules/components/general-styles.php:38
|
275 |
+
#: modules/components/general-tobots-txt.php:22
|
276 |
+
#: modules/components/general-wpemoji.php:22
|
277 |
+
#: modules/components/general-wpemoji.php:38
|
278 |
+
#: modules/components/rewrite-comments.php:35
|
279 |
+
#: modules/components/rewrite-json-rest.php:24
|
280 |
+
#: modules/components/rewrite-json-rest.php:42
|
281 |
+
#: modules/components/rewrite-json-rest.php:64
|
282 |
+
#: modules/components/rewrite-json-rest.php:88
|
283 |
+
#: modules/components/rewrite-json-rest.php:106
|
284 |
+
#: modules/components/rewrite-json-rest.php:123
|
285 |
+
#: modules/components/rewrite-new_include_path.php:35
|
286 |
+
#: modules/components/rewrite-new_plugin_path.php:36
|
287 |
+
#: modules/components/rewrite-new_theme_path.php:63
|
288 |
+
#: modules/components/rewrite-new_theme_path.php:120
|
289 |
+
#: modules/components/rewrite-new_upload_path.php:36
|
290 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:35
|
291 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:52
|
292 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:69
|
293 |
+
#: modules/components/rewrite-root-files.php:25
|
294 |
+
#: modules/components/rewrite-root-files.php:41
|
295 |
+
#: modules/components/rewrite-root-files.php:57
|
296 |
+
#: modules/components/rewrite-root-files.php:73
|
297 |
+
#: modules/components/rewrite-root-files.php:89
|
298 |
+
#: modules/components/rewrite-root-files.php:106
|
299 |
+
#: modules/components/rewrite-root-files.php:123
|
300 |
+
#: modules/components/rewrite-slash.php:22
|
301 |
+
#: modules/components/rewrite-wp_content_path.php:37
|
302 |
+
msgid "No"
|
303 |
+
msgstr ""
|
304 |
+
|
305 |
+
#: modules/components/admin-admin_url.php:212
|
306 |
+
msgid "Hello"
|
307 |
+
msgstr ""
|
308 |
+
|
309 |
+
#: modules/components/admin-admin_url.php:213
|
310 |
+
msgid ""
|
311 |
+
"This is an automated message to inform that your login url has been changed "
|
312 |
+
"at"
|
313 |
+
msgstr ""
|
314 |
+
|
315 |
+
#: modules/components/admin-admin_url.php:214
|
316 |
+
msgid "The new login url is"
|
317 |
+
msgstr ""
|
318 |
+
|
319 |
+
#: modules/components/admin-admin_url.php:215
|
320 |
+
msgid "Additionality you can use this to recover the old login / admin links "
|
321 |
+
msgstr ""
|
322 |
+
|
323 |
+
#: modules/components/admin-admin_url.php:216
|
324 |
+
msgid "Please keep this url safe for recover, if forgot"
|
325 |
+
msgstr ""
|
326 |
+
|
327 |
+
#: modules/components/admin-new_wp_login_php.php:18
|
328 |
+
msgid ""
|
329 |
+
"Map a new wp-login.php instead default. This also need to include <i>.php</"
|
330 |
+
"i> extension."
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
#: modules/components/admin-new_wp_login_php.php:20
|
334 |
+
msgid ""
|
335 |
+
"Make sure your log-in url is not already modified by another plugin or "
|
336 |
+
"theme. In such case, you should disable other code and take advantage of "
|
337 |
+
"these features. More details at "
|
338 |
+
msgstr ""
|
339 |
+
|
340 |
+
#: modules/components/admin-new_wp_login_php.php:33
|
341 |
+
msgid "Block default wp-login.php file from being accesible."
|
342 |
+
msgstr ""
|
343 |
+
|
344 |
+
#: modules/components/general-headers.php:17
|
345 |
+
msgid "Remove X-Powered-By Header if being set."
|
346 |
+
msgstr ""
|
347 |
+
|
348 |
+
#: modules/components/general-headers.php:18
|
349 |
+
#: modules/components/general-headers.php:35
|
350 |
+
#: modules/components/general-oembed.php:18
|
351 |
+
msgid "More details at "
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
+
#: modules/components/general-headers.php:34
|
355 |
+
msgid "Remove X-Pingback Header if being set."
|
356 |
+
msgstr ""
|
357 |
+
|
358 |
+
#: modules/components/general-html.php:17
|
359 |
+
msgid ""
|
360 |
+
"Remove all HTML Comments which usualy specify Plugins Name and Version. Any "
|
361 |
+
"Internet Explorer conditional tags are preserved."
|
362 |
+
msgstr ""
|
363 |
+
|
364 |
+
#: modules/components/general-html.php:33
|
365 |
+
msgid "Remove general classes from body tag."
|
366 |
+
msgstr ""
|
367 |
+
|
368 |
+
#: modules/components/general-html.php:50
|
369 |
+
msgid "Remove ID attribute from all menu items."
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: modules/components/general-html.php:67
|
373 |
+
msgid ""
|
374 |
+
"Remove class attribute from all menu items. Any classes which include a "
|
375 |
+
"\"current\" prefix or contain \"has-children\" will be preserved."
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
#: modules/components/general-html.php:84
|
379 |
+
msgid "Remove general classes from post."
|
380 |
+
msgstr ""
|
381 |
+
|
382 |
+
#: modules/components/general-html.php:101
|
383 |
+
msgid "Remove general classes from media tags."
|
384 |
+
msgstr ""
|
385 |
+
|
386 |
+
#: modules/components/general-meta.php:18
|
387 |
+
msgid ""
|
388 |
+
"Remove the autogenerated meta generator tag within head (WordPress Version)."
|
389 |
+
msgstr ""
|
390 |
+
|
391 |
+
#: modules/components/general-meta.php:34
|
392 |
+
msgid ""
|
393 |
+
"Remove other meta generated tags within head (eg Theme Name, Theme Version)."
|
394 |
+
msgstr ""
|
395 |
+
|
396 |
+
#: modules/components/general-meta.php:50
|
397 |
+
msgid "Remove DNS Prefetch meta generated tag."
|
398 |
+
msgstr ""
|
399 |
+
|
400 |
+
#: modules/components/general-meta.php:66
|
401 |
+
msgid ""
|
402 |
+
"Remove Resource Hints meta generated tags within head (eg dns-prefetch, "
|
403 |
+
"preconnect)."
|
404 |
+
msgstr ""
|
405 |
+
|
406 |
+
#: modules/components/general-meta.php:82
|
407 |
+
msgid "Remove the wlwmanifest tag within head."
|
408 |
+
msgstr ""
|
409 |
+
|
410 |
+
#: modules/components/general-meta.php:99
|
411 |
+
msgid "Remove the feed_links tag within head."
|
412 |
+
msgstr ""
|
413 |
+
|
414 |
+
#: modules/components/general-meta.php:115
|
415 |
+
#: modules/components/rewrite-json-rest.php:82
|
416 |
+
msgid "Disable output the REST API link tag into page header"
|
417 |
+
msgstr ""
|
418 |
+
|
419 |
+
#: modules/components/general-meta.php:116
|
420 |
+
#: modules/components/rewrite-json-rest.php:83
|
421 |
+
msgid "By default a REST API link tag is being append to HTML."
|
422 |
+
msgstr ""
|
423 |
+
|
424 |
+
#: modules/components/general-meta.php:135
|
425 |
+
msgid "Remove the rsd_link tag within head."
|
426 |
+
msgstr ""
|
427 |
+
|
428 |
+
#: modules/components/general-meta.php:153
|
429 |
+
msgid "Remove the adjacent_posts_rel tag within head."
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
#: modules/components/general-meta.php:169
|
433 |
+
msgid "Remove profile link meta tag within head."
|
434 |
+
msgstr ""
|
435 |
+
|
436 |
+
#: modules/components/general-meta.php:185
|
437 |
+
msgid "Remove canonical link meta tag within head."
|
438 |
+
msgstr ""
|
439 |
+
|
440 |
+
#: modules/components/general-oembed.php:17
|
441 |
+
msgid "Remove Oembed tags from header."
|
442 |
+
msgstr ""
|
443 |
+
|
444 |
+
#: modules/components/general-scripts.php:17
|
445 |
+
msgid "Remove version number from enqueued script files."
|
446 |
+
msgstr ""
|
447 |
+
|
448 |
+
#: modules/components/general-styles.php:17
|
449 |
+
msgid "Remove version number from enqueued style files."
|
450 |
+
msgstr ""
|
451 |
+
|
452 |
+
#: modules/components/general-styles.php:33
|
453 |
+
msgid "Remove ID attribute from all link tags which include a stylesheet."
|
454 |
+
msgstr ""
|
455 |
+
|
456 |
+
#: modules/components/general-tobots-txt.php:17
|
457 |
+
msgid ""
|
458 |
+
"Disable any admin url which is being automatically generated by WordPress "
|
459 |
+
"when called robots.txt."
|
460 |
+
msgstr ""
|
461 |
+
|
462 |
+
#: modules/components/general-wpemoji.php:17
|
463 |
+
msgid "Disable the Emoji icon library from being loaded."
|
464 |
+
msgstr ""
|
465 |
+
|
466 |
+
#: modules/components/general-wpemoji.php:33
|
467 |
+
msgid "Disable the TinyMCE Emoji icons library from being loaded into TinyMC."
|
468 |
+
msgstr ""
|
469 |
+
|
470 |
+
#: modules/components/rewrite-comments.php:17
|
471 |
+
msgid "New wp-comments-post.php Path"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
#: modules/components/rewrite-comments.php:18
|
475 |
+
msgid "The default path is set to wp-comments-post.php"
|
476 |
+
msgstr ""
|
477 |
+
|
478 |
+
#: modules/components/rewrite-comments.php:29
|
479 |
+
msgid "Block wp-comments-post.php"
|
480 |
+
msgstr ""
|
481 |
+
|
482 |
+
#: modules/components/rewrite-comments.php:30
|
483 |
+
msgid "Block default wp-comments-post.php."
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
#: modules/components/rewrite-comments.php:30
|
487 |
+
#: modules/components/rewrite-new_plugin_path.php:31
|
488 |
+
msgid "Apply only if "
|
489 |
+
msgstr ""
|
490 |
+
|
491 |
+
#: modules/components/rewrite-comments.php:30
|
492 |
+
#: modules/components/rewrite-new_plugin_path.php:31
|
493 |
+
#: modules/components/rewrite-new_upload_path.php:31
|
494 |
+
msgid "is not empty."
|
495 |
+
msgstr ""
|
496 |
+
|
497 |
+
#: modules/components/rewrite-json-rest.php:18
|
498 |
+
msgid "Disable JSON REST V1 service"
|
499 |
+
msgstr ""
|
500 |
+
|
501 |
+
#: modules/components/rewrite-json-rest.php:19
|
502 |
+
#: modules/components/rewrite-json-rest.php:37
|
503 |
+
msgid "An API service for WordPress which is active by default."
|
504 |
+
msgstr ""
|
505 |
+
|
506 |
+
#: modules/components/rewrite-json-rest.php:36
|
507 |
+
msgid "Disable JSON REST V2 service"
|
508 |
+
msgstr ""
|
509 |
+
|
510 |
+
#: modules/components/rewrite-json-rest.php:58
|
511 |
+
msgid "Block any JSON REST calls"
|
512 |
+
msgstr ""
|
513 |
+
|
514 |
+
#: modules/components/rewrite-json-rest.php:59
|
515 |
+
msgid "Any call for JSON REST API service will be blocked."
|
516 |
+
msgstr ""
|
517 |
+
|
518 |
+
#: modules/components/rewrite-json-rest.php:100
|
519 |
+
msgid "Disable JSON REST WP RSD endpoint from XML-RPC responses"
|
520 |
+
msgstr ""
|
521 |
+
|
522 |
+
#: modules/components/rewrite-json-rest.php:101
|
523 |
+
msgid "By default a WP RSD endpoint is being append to the XML respose."
|
524 |
+
msgstr ""
|
525 |
+
|
526 |
+
#: modules/components/rewrite-json-rest.php:117
|
527 |
+
msgid "Disable Sends a Link header for the REST API"
|
528 |
+
msgstr ""
|
529 |
+
|
530 |
+
#: modules/components/rewrite-json-rest.php:118
|
531 |
+
msgid "On template_redirect, disable Sends a Link header for the REST API."
|
532 |
+
msgstr ""
|
533 |
+
|
534 |
+
#: modules/components/rewrite-new_include_path.php:17
|
535 |
+
msgid "New Includes Path"
|
536 |
+
msgstr ""
|
537 |
+
|
538 |
+
#: modules/components/rewrite-new_include_path.php:18
|
539 |
+
#: modules/components/rewrite-new_theme_path.php:23
|
540 |
+
#: modules/components/rewrite-new_theme_path.php:83
|
541 |
+
msgid "The default theme path is set to"
|
542 |
+
msgstr ""
|
543 |
+
|
544 |
+
#: modules/components/rewrite-new_include_path.php:21
|
545 |
+
msgid "e.g. my_includes"
|
546 |
+
msgstr ""
|
547 |
+
|
548 |
+
#: modules/components/rewrite-new_plugin_path.php:17
|
549 |
+
msgid "New Plugins Path"
|
550 |
+
msgstr ""
|
551 |
+
|
552 |
+
#: modules/components/rewrite-new_plugin_path.php:18
|
553 |
+
msgid "The default plugins path is set to"
|
554 |
+
msgstr ""
|
555 |
+
|
556 |
+
#: modules/components/rewrite-new_plugin_path.php:30
|
557 |
+
msgid "Block plugins URL"
|
558 |
+
msgstr ""
|
559 |
+
|
560 |
+
#: modules/components/rewrite-new_plugin_path.php:31
|
561 |
+
msgid "Block plugins files from being accesible through default urls."
|
562 |
+
msgstr ""
|
563 |
+
|
564 |
+
#: modules/components/rewrite-new_plugin_path.php:70
|
565 |
+
msgid "New Path for"
|
566 |
+
msgstr ""
|
567 |
+
|
568 |
+
#: modules/components/rewrite-new_plugin_path.php:70
|
569 |
+
msgid "plugin"
|
570 |
+
msgstr ""
|
571 |
+
|
572 |
+
#: modules/components/rewrite-new_plugin_path.php:71
|
573 |
+
msgid "This setting overwrites the"
|
574 |
+
msgstr ""
|
575 |
+
|
576 |
+
#: modules/components/rewrite-new_plugin_path.php:71
|
577 |
+
msgid "New Plugin Path"
|
578 |
+
msgstr ""
|
579 |
+
|
580 |
+
#: modules/components/rewrite-new_plugin_path.php:71
|
581 |
+
msgid "setting for this plugin, if set."
|
582 |
+
msgstr ""
|
583 |
+
|
584 |
+
#: modules/components/rewrite-new_theme_path.php:22
|
585 |
+
msgid "New Theme Path"
|
586 |
+
msgstr ""
|
587 |
+
|
588 |
+
#: modules/components/rewrite-new_theme_path.php:26
|
589 |
+
msgid "e.g. my_template"
|
590 |
+
msgstr ""
|
591 |
+
|
592 |
+
#: modules/components/rewrite-new_theme_path.php:36
|
593 |
+
msgid "New Style File Path"
|
594 |
+
msgstr ""
|
595 |
+
|
596 |
+
#: modules/components/rewrite-new_theme_path.php:37
|
597 |
+
#: modules/components/rewrite-new_theme_path.php:96
|
598 |
+
msgid "The default theme style file style.css path is set to"
|
599 |
+
msgstr ""
|
600 |
+
|
601 |
+
#: modules/components/rewrite-new_theme_path.php:38
|
602 |
+
#: modules/components/rewrite-new_theme_path.php:97
|
603 |
+
msgid ""
|
604 |
+
"If style file contain relative URLs it should not include additional path, "
|
605 |
+
"just the actual filename."
|
606 |
+
msgstr ""
|
607 |
+
|
608 |
+
#: modules/components/rewrite-new_theme_path.php:38
|
609 |
+
#: modules/components/rewrite-new_theme_path.php:97
|
610 |
+
msgid "More details at"
|
611 |
+
msgstr ""
|
612 |
+
|
613 |
+
#: modules/components/rewrite-new_theme_path.php:41
|
614 |
+
#: modules/components/rewrite-new_theme_path.php:99
|
615 |
+
msgid "e.g. custom-style-file.css"
|
616 |
+
msgstr ""
|
617 |
+
|
618 |
+
#: modules/components/rewrite-new_theme_path.php:51
|
619 |
+
msgid "Remove description header from Style file"
|
620 |
+
msgstr ""
|
621 |
+
|
622 |
+
#: modules/components/rewrite-new_theme_path.php:54
|
623 |
+
#: modules/components/rewrite-new_theme_path.php:112
|
624 |
+
msgid ""
|
625 |
+
"Strip out all meta data from style file e.g. Theme Name, Theme URI, Author "
|
626 |
+
"etc. Those are important information to find out possible theme security "
|
627 |
+
"breaches."
|
628 |
+
msgstr ""
|
629 |
+
|
630 |
+
#: modules/components/rewrite-new_theme_path.php:55
|
631 |
+
#: modules/components/rewrite-new_theme_path.php:113
|
632 |
+
msgid ""
|
633 |
+
"This feature may not work if style file url not available on html (being "
|
634 |
+
"concatenated)."
|
635 |
+
msgstr ""
|
636 |
+
|
637 |
+
#: modules/components/rewrite-new_theme_path.php:57
|
638 |
+
#: modules/components/rewrite-new_theme_path.php:115
|
639 |
+
msgid ""
|
640 |
+
"This use caching. If active, cache clear is recommended on styles updated."
|
641 |
+
msgstr ""
|
642 |
+
|
643 |
+
#: modules/components/rewrite-new_theme_path.php:82
|
644 |
+
msgid "Child - New Theme Path"
|
645 |
+
msgstr ""
|
646 |
+
|
647 |
+
#: modules/components/rewrite-new_theme_path.php:86
|
648 |
+
msgid "e.g. my_child_template"
|
649 |
+
msgstr ""
|
650 |
+
|
651 |
+
#: modules/components/rewrite-new_theme_path.php:95
|
652 |
+
msgid "Child - New Style File Path"
|
653 |
+
msgstr ""
|
654 |
+
|
655 |
+
#: modules/components/rewrite-new_theme_path.php:109
|
656 |
+
msgid "Child - Remove description header from Style file"
|
657 |
+
msgstr ""
|
658 |
+
|
659 |
+
#: modules/components/rewrite-new_upload_path.php:17
|
660 |
+
msgid "New Uploads Path"
|
661 |
+
msgstr ""
|
662 |
+
|
663 |
+
#: modules/components/rewrite-new_upload_path.php:18
|
664 |
+
msgid "The default uploads path is set to"
|
665 |
+
msgstr ""
|
666 |
+
|
667 |
+
#: modules/components/rewrite-new_upload_path.php:21
|
668 |
+
msgid "e.g. my_uploads"
|
669 |
+
msgstr ""
|
670 |
+
|
671 |
+
#: modules/components/rewrite-new_upload_path.php:30
|
672 |
+
msgid "Block uploads URL"
|
673 |
+
msgstr ""
|
674 |
+
|
675 |
+
#: modules/components/rewrite-new_upload_path.php:31
|
676 |
+
msgid "Block upload files from being accesible through default urls."
|
677 |
+
msgstr ""
|
678 |
+
|
679 |
+
#: modules/components/rewrite-new_upload_path.php:31
|
680 |
+
msgid ""
|
681 |
+
"If set to Yes, all new images inserted into posts will use the new Upload "
|
682 |
+
"Url, as old url become blocked. Using the No, new images inesrted will use "
|
683 |
+
"old url, which however are being updated on front side. This may be helpfull "
|
684 |
+
"on plugin disable, so image urls can be accessible as before."
|
685 |
+
msgstr ""
|
686 |
+
|
687 |
+
#: modules/components/rewrite-new_upload_path.php:31
|
688 |
+
msgid "Apply only if"
|
689 |
+
msgstr ""
|
690 |
+
|
691 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:17
|
692 |
+
msgid "New XML-RPC Path"
|
693 |
+
msgstr ""
|
694 |
+
|
695 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:18
|
696 |
+
msgid ""
|
697 |
+
"The default XML-RPC path is set to xmlrpc.php. If not used you can leave "
|
698 |
+
"empty and block the service using the following area."
|
699 |
+
msgstr ""
|
700 |
+
|
701 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:20
|
702 |
+
msgid "e.g. my-xml-rpc.php"
|
703 |
+
msgstr ""
|
704 |
+
|
705 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:29
|
706 |
+
msgid "Block default xmlrpc.php"
|
707 |
+
msgstr ""
|
708 |
+
|
709 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:30
|
710 |
+
msgid ""
|
711 |
+
"XML-RPC gives others the ability to talk to your WordPress site. If not used "
|
712 |
+
"you should disable. Keep in mind that some plugins like Jetpack use this API."
|
713 |
+
msgstr ""
|
714 |
+
|
715 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:46
|
716 |
+
msgid "Disable XML-RPC authentication"
|
717 |
+
msgstr ""
|
718 |
+
|
719 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:47
|
720 |
+
msgid ""
|
721 |
+
"Filter whether XML-RPC methods requiring authentication, such as for "
|
722 |
+
"publishing purposes, are enabled."
|
723 |
+
msgstr ""
|
724 |
+
|
725 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:63
|
726 |
+
msgid "Remove pingback"
|
727 |
+
msgstr ""
|
728 |
+
|
729 |
+
#: modules/components/rewrite-new_xml-rpc-path.php:64
|
730 |
+
msgid "Remove pingback link tag from theme."
|
731 |
+
msgstr ""
|
732 |
+
|
733 |
+
#: modules/components/rewrite-root-files.php:19
|
734 |
+
msgid "Block license.txt"
|
735 |
+
msgstr ""
|
736 |
+
|
737 |
+
#: modules/components/rewrite-root-files.php:20
|
738 |
+
msgid "Block access to license.txt root file"
|
739 |
+
msgstr ""
|
740 |
+
|
741 |
+
#: modules/components/rewrite-root-files.php:35
|
742 |
+
msgid "Block readme.html"
|
743 |
+
msgstr ""
|
744 |
+
|
745 |
+
#: modules/components/rewrite-root-files.php:36
|
746 |
+
msgid "Block access to readme.html root file"
|
747 |
+
msgstr ""
|
748 |
+
|
749 |
+
#: modules/components/rewrite-root-files.php:51
|
750 |
+
msgid "Block wp-activate.php"
|
751 |
+
msgstr ""
|
752 |
+
|
753 |
+
#: modules/components/rewrite-root-files.php:52
|
754 |
+
msgid ""
|
755 |
+
"Block access to wp-activate.php file. This file confirms that the activation "
|
756 |
+
"key that is sent in an email after a user signs up for a new blog matches "
|
757 |
+
"the key for that user. If <b>anyone can register</b> on your site, you shold "
|
758 |
+
"keep this off."
|
759 |
+
msgstr ""
|
760 |
+
|
761 |
+
#: modules/components/rewrite-root-files.php:67
|
762 |
+
msgid "Block wp-cron.php"
|
763 |
+
msgstr ""
|
764 |
+
|
765 |
+
#: modules/components/rewrite-root-files.php:68
|
766 |
+
msgid ""
|
767 |
+
"Block access to wp-cron.php file. If remote cron calls not being used this "
|
768 |
+
"can be set to Yes."
|
769 |
+
msgstr ""
|
770 |
+
|
771 |
+
#: modules/components/rewrite-root-files.php:84
|
772 |
+
msgid ""
|
773 |
+
"Block default wp-signup.php file. If <b>anyone can register</b> on your "
|
774 |
+
"site, you shold keep this off."
|
775 |
+
msgstr ""
|
776 |
+
|
777 |
+
#: modules/components/rewrite-root-files.php:101
|
778 |
+
msgid ""
|
779 |
+
"Block default wp-register.php file. This file is now deprecated however "
|
780 |
+
"still exists within code and redirected to /register page."
|
781 |
+
msgstr ""
|
782 |
+
|
783 |
+
#: modules/components/rewrite-root-files.php:118
|
784 |
+
msgid ""
|
785 |
+
"Block other wp-*.php files. E.g. wp-blog-header.php, wp-config.php, wp-cron."
|
786 |
+
"php. Those files are used internally, blocking those will not affect any "
|
787 |
+
"functionality. Other root files (wp-activate.php, wp-login.php, wp-signup."
|
788 |
+
"php) are ignored, they can be controlled through own setting."
|
789 |
+
msgstr ""
|
790 |
+
|
791 |
+
#: modules/components/rewrite-slash.php:16
|
792 |
+
msgid "URL's add Slash"
|
793 |
+
msgstr ""
|
794 |
+
|
795 |
+
#: modules/components/rewrite-slash.php:17
|
796 |
+
msgid ""
|
797 |
+
"Add an end slash to any links without. This disguise any existance uppon a "
|
798 |
+
"file, folder or a wrong url, they will be all slashed."
|
799 |
+
msgstr ""
|
800 |
+
|
801 |
+
#: modules/components/rewrite-slash.php:17
|
802 |
+
msgid ""
|
803 |
+
"On certain systems this can produce a small lag measured in milliseconds."
|
804 |
+
msgstr ""
|
805 |
+
|
806 |
+
#: modules/components/rewrite-wp_content_path.php:16
|
807 |
+
msgid "New Content Path"
|
808 |
+
msgstr ""
|
809 |
+
|
810 |
+
#: modules/components/rewrite-wp_content_path.php:17
|
811 |
+
msgid "Your default wp-content path is set to"
|
812 |
+
msgstr ""
|
813 |
+
|
814 |
+
#: modules/components/rewrite-wp_content_path.php:20
|
815 |
+
msgid "e.g. my_content"
|
816 |
+
msgstr ""
|
817 |
+
|
818 |
+
#: modules/components/rewrite-wp_content_path.php:30
|
819 |
+
msgid "Block wp-content URL"
|
820 |
+
msgstr ""
|
821 |
+
|
822 |
+
#: modules/components/rewrite-wp_content_path.php:31
|
823 |
+
msgid "Block default content path. Your default wp-content path is set to"
|
824 |
+
msgstr ""
|
825 |
+
|
826 |
+
#: modules/components/rewrite-wp_content_path.php:32
|
827 |
+
msgid ""
|
828 |
+
"Apply only if <b>New Content Path</b> is not empty. It block only for non "
|
829 |
+
"loged-in users."
|
830 |
+
msgstr ""
|
modules/components/admin-new_wp_login_php.php
CHANGED
@@ -139,14 +139,14 @@
|
|
139 |
if($this->wph->server_htaccess_config === TRUE)
|
140 |
{
|
141 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
142 |
-
$text .= "RewriteRule ^" . $path ." ". $this->wph->default_variables['
|
143 |
}
|
144 |
|
145 |
if($this->wph->server_web_config === TRUE)
|
146 |
$text = '
|
147 |
<rule name="wph-block_default_wp_login_php" stopProcessing="true">
|
148 |
<match url="^'. $path .'" />
|
149 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
150 |
</rule>
|
151 |
';
|
152 |
|
139 |
if($this->wph->server_htaccess_config === TRUE)
|
140 |
{
|
141 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
142 |
+
$text .= "RewriteRule ^" . $path ." ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
143 |
}
|
144 |
|
145 |
if($this->wph->server_web_config === TRUE)
|
146 |
$text = '
|
147 |
<rule name="wph-block_default_wp_login_php" stopProcessing="true">
|
148 |
<match url="^'. $path .'" />
|
149 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
150 |
</rule>
|
151 |
';
|
152 |
|
modules/components/general-html.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
$this->module_settings[] = array(
|
15 |
'id' => 'remove_html_comments',
|
16 |
'label' => 'Remove HTML Comments',
|
17 |
-
'description' => __('Remove all HTML Comments which usualy specify Plugins Name and
|
18 |
|
19 |
'input_type' => 'radio',
|
20 |
'options' => array(
|
14 |
$this->module_settings[] = array(
|
15 |
'id' => 'remove_html_comments',
|
16 |
'label' => 'Remove HTML Comments',
|
17 |
+
'description' => __('Remove all HTML Comments which usualy specify Plugins Name and Version. Any Internet Explorer conditional tags are preserved.', 'wp-hide-security-enhancer'),
|
18 |
|
19 |
'input_type' => 'radio',
|
20 |
'options' => array(
|
modules/components/general-tobots-txt.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
+
|
5 |
+
class WPH_module_general_robots_txt extends WPH_module_component
|
6 |
+
{
|
7 |
+
function get_component_title()
|
8 |
+
{
|
9 |
+
return "Robots.txt";
|
10 |
+
}
|
11 |
+
|
12 |
+
function get_module_settings()
|
13 |
+
{
|
14 |
+
$this->module_settings[] = array(
|
15 |
+
'id' => 'disable_robots_txt',
|
16 |
+
'label' => 'Disable admin url within Robots.txt',
|
17 |
+
'description' => __('Disable any admin url which is being automatically generated by WordPress when called robots.txt.', 'wp-hide-security-enhancer'),
|
18 |
+
|
19 |
+
'input_type' => 'radio',
|
20 |
+
'options' => array(
|
21 |
+
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
22 |
+
'no' => __('No', 'wp-hide-security-enhancer'),
|
23 |
+
),
|
24 |
+
'default_value' => 'no',
|
25 |
+
|
26 |
+
'sanitize_type' => array('sanitize_title', 'strtolower')
|
27 |
+
|
28 |
+
);
|
29 |
+
|
30 |
+
|
31 |
+
return $this->module_settings;
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
function _init_disable_robots_txt($saved_field_data)
|
37 |
+
{
|
38 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
39 |
+
return FALSE;
|
40 |
+
|
41 |
+
add_action( 'robots_txt', array($this, 'disable_robots_txt' ), 999, 2);
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
function disable_robots_txt( $output, $public )
|
46 |
+
{
|
47 |
+
|
48 |
+
$search_for = '/wp-admin/';
|
49 |
+
|
50 |
+
$lines = preg_split("/\\r\\n|\\r|\\n/", $output);
|
51 |
+
|
52 |
+
foreach($lines as $key => $line)
|
53 |
+
{
|
54 |
+
|
55 |
+
if(stripos($line, $search_for) !== FALSE)
|
56 |
+
unset($lines[$key]);
|
57 |
+
|
58 |
+
}
|
59 |
+
|
60 |
+
$output = implode(PHP_EOL, $lines);
|
61 |
+
|
62 |
+
return $output;
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
}
|
68 |
+
?>
|
modules/components/general-wpemoji.php
CHANGED
@@ -29,8 +29,8 @@
|
|
29 |
|
30 |
$this->module_settings[] = array(
|
31 |
'id' => 'disable_tinymce_wpemojia',
|
32 |
-
'label' => 'Disable
|
33 |
-
'description' => __('Disable the
|
34 |
|
35 |
'input_type' => 'radio',
|
36 |
'options' => array(
|
29 |
|
30 |
$this->module_settings[] = array(
|
31 |
'id' => 'disable_tinymce_wpemojia',
|
32 |
+
'label' => 'Disable TinyMCE Emoji',
|
33 |
+
'description' => __('Disable the TinyMCE Emoji icons library from being loaded into TinyMC.', 'wp-hide-security-enhancer'),
|
34 |
|
35 |
'input_type' => 'radio',
|
36 |
'options' => array(
|
modules/components/rewrite-comments.php
CHANGED
@@ -104,14 +104,14 @@
|
|
104 |
if($this->wph->server_htaccess_config === TRUE)
|
105 |
{
|
106 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
107 |
-
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['
|
108 |
}
|
109 |
|
110 |
if($this->wph->server_web_config === TRUE)
|
111 |
$text = '
|
112 |
<rule name="wph-block_wp_comments_post_url" stopProcessing="true">
|
113 |
<match url="^' . $rewrite_file_base . '" />
|
114 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
115 |
</rule>
|
116 |
';
|
117 |
|
104 |
if($this->wph->server_htaccess_config === TRUE)
|
105 |
{
|
106 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
107 |
+
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
108 |
}
|
109 |
|
110 |
if($this->wph->server_web_config === TRUE)
|
111 |
$text = '
|
112 |
<rule name="wph-block_wp_comments_post_url" stopProcessing="true">
|
113 |
<match url="^' . $rewrite_file_base . '" />
|
114 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
115 |
</rule>
|
116 |
';
|
117 |
|
modules/components/rewrite-json-rest.php
CHANGED
@@ -166,14 +166,14 @@
|
|
166 |
|
167 |
if($this->wph->server_htaccess_config === TRUE)
|
168 |
{
|
169 |
-
$text = "\nRewriteRule ^wp-json(.+) ". $this->wph->default_variables['
|
170 |
}
|
171 |
|
172 |
if($this->wph->server_web_config === TRUE)
|
173 |
$text = '
|
174 |
<rule name="wph-block_json_rest" stopProcessing="true">
|
175 |
<match url="^wp-json" />
|
176 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
177 |
</rule>
|
178 |
';
|
179 |
|
166 |
|
167 |
if($this->wph->server_htaccess_config === TRUE)
|
168 |
{
|
169 |
+
$text = "\nRewriteRule ^wp-json(.+) ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php?wph-throw-404 [L]";
|
170 |
}
|
171 |
|
172 |
if($this->wph->server_web_config === TRUE)
|
173 |
$text = '
|
174 |
<rule name="wph-block_json_rest" stopProcessing="true">
|
175 |
<match url="^wp-json" />
|
176 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
177 |
</rule>
|
178 |
';
|
179 |
|
modules/components/rewrite-new_include_path.php
CHANGED
@@ -163,7 +163,7 @@
|
|
163 |
{
|
164 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
165 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
166 |
-
$text .= "RewriteRule ^wp-includes(.+) ". $this->wph->default_variables['
|
167 |
}
|
168 |
|
169 |
if($this->wph->server_web_config === TRUE)
|
@@ -174,7 +174,7 @@
|
|
174 |
<conditions>
|
175 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
176 |
</conditions>
|
177 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
178 |
</rule>
|
179 |
';
|
180 |
|
163 |
{
|
164 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
165 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
166 |
+
$text .= "RewriteRule ^wp-includes(.+) ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
167 |
}
|
168 |
|
169 |
if($this->wph->server_web_config === TRUE)
|
174 |
<conditions>
|
175 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
176 |
</conditions>
|
177 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
178 |
</rule>
|
179 |
';
|
180 |
|
modules/components/rewrite-new_plugin_path.php
CHANGED
@@ -68,7 +68,7 @@
|
|
68 |
$this->module_settings[] = array(
|
69 |
'id' => 'new_plugin_path_' . $plugin_slug,
|
70 |
'label' => __('New Path for', 'wp-hide-security-enhancer') . " <i>" . $pluding_data['Name'] ."</i> ". __('plugin', 'wp-hide-security-enhancer'),
|
71 |
-
'description' => __('This setting
|
72 |
'value_description' => 'e.g. my_plugins/module',
|
73 |
'input_type' => 'text',
|
74 |
|
@@ -222,14 +222,14 @@
|
|
222 |
if($this->wph->server_htaccess_config === TRUE)
|
223 |
{
|
224 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
225 |
-
$text .= "RewriteRule ^". $default_plugin_url ."(.+) ". $this->wph->default_variables['
|
226 |
}
|
227 |
|
228 |
if($this->wph->server_web_config === TRUE)
|
229 |
$text = '
|
230 |
<rule name="wph-block_plugins_url" stopProcessing="true">
|
231 |
<match url="^'. $default_plugin_url .'(.+)" />
|
232 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
233 |
</rule>
|
234 |
';
|
235 |
|
68 |
$this->module_settings[] = array(
|
69 |
'id' => 'new_plugin_path_' . $plugin_slug,
|
70 |
'label' => __('New Path for', 'wp-hide-security-enhancer') . " <i>" . $pluding_data['Name'] ."</i> ". __('plugin', 'wp-hide-security-enhancer'),
|
71 |
+
'description' => __('This setting overwrites the', 'wp-hide-security-enhancer') . ' ' . __('New Plugin Path', 'wp-hide-security-enhancer') . ' ' . __('setting for this plugin, if set.', 'wp-hide-security-enhancer'),
|
72 |
'value_description' => 'e.g. my_plugins/module',
|
73 |
'input_type' => 'text',
|
74 |
|
222 |
if($this->wph->server_htaccess_config === TRUE)
|
223 |
{
|
224 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
225 |
+
$text .= "RewriteRule ^". $default_plugin_url ."(.+) ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
226 |
}
|
227 |
|
228 |
if($this->wph->server_web_config === TRUE)
|
229 |
$text = '
|
230 |
<rule name="wph-block_plugins_url" stopProcessing="true">
|
231 |
<match url="^'. $default_plugin_url .'(.+)" />
|
232 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
233 |
</rule>
|
234 |
';
|
235 |
|
modules/components/rewrite-new_theme_path.php
CHANGED
@@ -5,6 +5,10 @@
|
|
5 |
class WPH_module_rewrite_new_theme_path extends WPH_module_component
|
6 |
{
|
7 |
|
|
|
|
|
|
|
|
|
8 |
function get_component_title()
|
9 |
{
|
10 |
return "Theme";
|
@@ -42,7 +46,28 @@
|
|
42 |
'processing_order' => 5
|
43 |
);
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
|
48 |
if($this->wph->templates_data['use_child_theme'])
|
@@ -78,6 +103,28 @@
|
|
78 |
|
79 |
'processing_order' => 5
|
80 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
}
|
83 |
|
@@ -96,38 +143,7 @@
|
|
96 |
{
|
97 |
if(empty($saved_field_data))
|
98 |
return FALSE;
|
99 |
-
|
100 |
-
|
101 |
-
/*
|
102 |
-
//check for child
|
103 |
-
if($this->wph->templates_data['use_child_theme'] === TRUE)
|
104 |
-
{
|
105 |
-
$child_theme_saved_field_data = $this->wph->functions->get_module_item_setting('new_theme_child_path');
|
106 |
-
if(empty($child_theme_saved_field_data) && empty($saved_field_data))
|
107 |
-
return FALSE;
|
108 |
-
}
|
109 |
-
else
|
110 |
-
{
|
111 |
-
if(empty($saved_field_data))
|
112 |
-
return FALSE;
|
113 |
-
}
|
114 |
-
*/
|
115 |
-
|
116 |
-
//applay when not admin and not customize.php
|
117 |
-
/*
|
118 |
-
if(is_admin() || $this->functions->is_theme_customize())
|
119 |
-
return;
|
120 |
-
*/
|
121 |
-
|
122 |
-
|
123 |
-
//???? to remove?
|
124 |
-
//add_filter('stylesheet_directory_uri', array(&$this, 'stylesheet_directory_uri'), 999, 1);
|
125 |
-
//add_filter('template_directory_uri', array(&$this, 'template_directory_uri'), 999, 3);
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
//add_filter('theme_root_uri', array(&$this, 'theme_root_uri'), 999, 3);
|
130 |
-
|
131 |
//add replacement url
|
132 |
$this->wph->functions->add_replacement( trailingslashit( $this->wph->default_variables['template_url']), trailingslashit( trailingslashit( home_url() ) . $saved_field_data ) );
|
133 |
|
@@ -165,109 +181,14 @@
|
|
165 |
|
166 |
return $processing_response;
|
167 |
}
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
function stylesheet_directory_uri($url)
|
172 |
-
{
|
173 |
-
if ( $this->wph->disable_filters )
|
174 |
-
return $url;
|
175 |
-
|
176 |
-
$template_slug = str_replace($this->wph->templates_data['themes_url'], "", $url);
|
177 |
-
return $url;
|
178 |
-
|
179 |
-
if($this->wph->templates_data['_template_' . $template_slug] == 'main')
|
180 |
-
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_path');
|
181 |
-
else
|
182 |
-
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_child_path');
|
183 |
-
|
184 |
-
if(empty($new_theme_path))
|
185 |
-
return $url;
|
186 |
-
|
187 |
-
$template_dir_uri = trailingslashit( home_url() ) . ltrim(rtrim($new_theme_path, "/"), "/");
|
188 |
-
|
189 |
-
//add replacement
|
190 |
-
$this->wph->functions->add_replacement( $url, $template_dir_uri );
|
191 |
-
|
192 |
-
return $template_dir_uri;
|
193 |
-
}
|
194 |
-
|
195 |
-
|
196 |
-
function template_directory_uri($template_dir_uri, $template, $theme_root_uri)
|
197 |
-
{
|
198 |
-
if ( $this->wph->disable_filters )
|
199 |
-
return $template_dir_uri;
|
200 |
-
|
201 |
-
if($this->wph->templates_data['_template_' . $template] == 'main')
|
202 |
-
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_path');
|
203 |
-
else
|
204 |
-
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_child_path');
|
205 |
-
|
206 |
-
if(empty($new_theme_path))
|
207 |
-
return $template_dir_uri;
|
208 |
-
|
209 |
-
$new_template_dir_uri = trailingslashit( home_url() ) . trim($new_theme_path, "/") ;
|
210 |
-
|
211 |
-
//add replacement
|
212 |
-
$this->wph->functions->add_replacement( $template_dir_uri, $new_template_dir_uri );
|
213 |
-
|
214 |
-
return $new_template_dir_uri;
|
215 |
-
}
|
216 |
-
|
217 |
-
|
218 |
-
/*
|
219 |
-
function theme_root_uri($theme_root_uri, $siteurl, $stylesheet_or_template)
|
220 |
-
{
|
221 |
-
if ( $this->wph->disable_filters )
|
222 |
-
return $theme_root_uri;
|
223 |
-
|
224 |
-
//only for current theme
|
225 |
-
$current_theme = get_stylesheet();
|
226 |
-
if($current_theme != $stylesheet_or_template)
|
227 |
-
return $theme_root_uri;
|
228 |
-
|
229 |
-
$theme_root_uri = untrailingslashit( site_url() ) ;
|
230 |
-
|
231 |
-
return $theme_root_uri;
|
232 |
-
}
|
233 |
-
*/
|
234 |
-
|
235 |
|
236 |
function _init_new_theme_child_path($saved_field_data)
|
237 |
{
|
238 |
if(empty($saved_field_data))
|
239 |
return FALSE;
|
240 |
-
|
241 |
-
|
242 |
-
/*
|
243 |
-
//check for child
|
244 |
-
if($this->wph->templates_data['use_child_theme'] === TRUE)
|
245 |
-
{
|
246 |
-
$child_theme_saved_field_data = $this->wph->functions->get_module_item_setting('new_theme_child_path');
|
247 |
-
if(empty($child_theme_saved_field_data) && empty($saved_field_data))
|
248 |
-
return FALSE;
|
249 |
-
}
|
250 |
-
else
|
251 |
-
{
|
252 |
-
if(empty($saved_field_data))
|
253 |
-
return FALSE;
|
254 |
-
}
|
255 |
-
*/
|
256 |
-
|
257 |
-
//applay when not admin and not customize.php
|
258 |
-
/*
|
259 |
-
if(is_admin() || $this->functions->is_theme_customize())
|
260 |
-
return;
|
261 |
-
*/
|
262 |
-
|
263 |
-
|
264 |
-
//???? to remove?
|
265 |
-
//add_filter('stylesheet_directory_uri', array(&$this, 'stylesheet_directory_uri'), 999, 1);
|
266 |
-
//add_filter('template_directory_uri', array(&$this, 'template_directory_uri'), 999, 3);
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
//add_filter('theme_root_uri', array(&$this, 'theme_root_uri'), 999, 3);
|
271 |
|
272 |
//add replacement url
|
273 |
$this->wph->functions->add_replacement( trailingslashit( $this->wph->default_variables['stylesheet_uri'] ) , trailingslashit( trailingslashit( home_url() ) . untrailingslashit( $saved_field_data ) ) );
|
@@ -393,6 +314,129 @@
|
|
393 |
|
394 |
|
395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
|
397 |
|
398 |
|
@@ -481,6 +525,224 @@
|
|
481 |
}
|
482 |
|
483 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
|
485 |
}
|
486 |
?>
|
5 |
class WPH_module_rewrite_new_theme_path extends WPH_module_component
|
6 |
{
|
7 |
|
8 |
+
var $rewrite_global_output = FALSE;
|
9 |
+
|
10 |
+
var $cache_compare_for_clear = array();
|
11 |
+
|
12 |
function get_component_title()
|
13 |
{
|
14 |
return "Theme";
|
46 |
'processing_order' => 5
|
47 |
);
|
48 |
|
49 |
+
$this->module_settings[] = array(
|
50 |
+
'id' => 'style_file_clean',
|
51 |
+
'label' => __('Remove description header from Style file', 'wp-hide-security-enhancer'),
|
52 |
+
'description' =>
|
53 |
+
array(
|
54 |
+
__('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'),
|
55 |
+
__('This feature may not work if style file url not available on html (being concatenated).', 'wp-hide-security-enhancer'),
|
56 |
+
'',
|
57 |
+
'<div class="notice-error"><div class="dashicons dashicons-warning important" alt="f534">warning</div> <span class="important">' . __('This use caching. If active, cache clear is recommended on styles updated.', 'wp-hide-security-enhancer') .'</span> <a href="admin.php?page=wp-hide&wph_cache_clear=true" class="button action">Cache Clear</a></div>'
|
58 |
+
),
|
59 |
+
|
60 |
+
'input_type' => 'radio',
|
61 |
+
'options' => array(
|
62 |
+
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
63 |
+
'no' => __('No', 'wp-hide-security-enhancer'),
|
64 |
+
),
|
65 |
+
'default_value' => 'no',
|
66 |
+
|
67 |
+
'sanitize_type' => array('sanitize_title', 'strtolower'),
|
68 |
+
'processing_order' => 3
|
69 |
+
|
70 |
+
);
|
71 |
|
72 |
|
73 |
if($this->wph->templates_data['use_child_theme'])
|
103 |
|
104 |
'processing_order' => 5
|
105 |
);
|
106 |
+
|
107 |
+
$this->module_settings[] = array(
|
108 |
+
'id' => 'child_style_file_clean',
|
109 |
+
'label' => __('Child - Remove description header from Style file', 'wp-hide-security-enhancer'),
|
110 |
+
'description' =>
|
111 |
+
array(
|
112 |
+
__('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'),
|
113 |
+
__('This feature may not work if style file url not available on html (being concatenated).', 'wp-hide-security-enhancer'),
|
114 |
+
'',
|
115 |
+
'<div class="notice-error"><div class="dashicons dashicons-warning important" alt="f534">warning</div> <span class="important">' . __('This use caching. If active, cache clear is recommended on styles updated.', 'wp-hide-security-enhancer') .'</span> <a href="admin.php?page=wp-hide&wph_cache_clear=true" class="button action">Cache Clear</a></div>'
|
116 |
+
),
|
117 |
+
'input_type' => 'radio',
|
118 |
+
'options' => array(
|
119 |
+
'yes' => __('Yes', 'wp-hide-security-enhancer'),
|
120 |
+
'no' => __('No', 'wp-hide-security-enhancer'),
|
121 |
+
),
|
122 |
+
'default_value' => 'no',
|
123 |
+
|
124 |
+
'sanitize_type' => array('sanitize_title', 'strtolower'),
|
125 |
+
'processing_order' => 3
|
126 |
+
|
127 |
+
);
|
128 |
|
129 |
}
|
130 |
|
143 |
{
|
144 |
if(empty($saved_field_data))
|
145 |
return FALSE;
|
146 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
//add replacement url
|
148 |
$this->wph->functions->add_replacement( trailingslashit( $this->wph->default_variables['template_url']), trailingslashit( trailingslashit( home_url() ) . $saved_field_data ) );
|
149 |
|
181 |
|
182 |
return $processing_response;
|
183 |
}
|
184 |
+
|
185 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
|
187 |
function _init_new_theme_child_path($saved_field_data)
|
188 |
{
|
189 |
if(empty($saved_field_data))
|
190 |
return FALSE;
|
191 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
//add replacement url
|
194 |
$this->wph->functions->add_replacement( trailingslashit( $this->wph->default_variables['stylesheet_uri'] ) , trailingslashit( trailingslashit( home_url() ) . untrailingslashit( $saved_field_data ) ) );
|
314 |
|
315 |
|
316 |
|
317 |
+
function _init_style_file_clean($saved_field_data)
|
318 |
+
{
|
319 |
+
|
320 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
321 |
+
return FALSE;
|
322 |
+
|
323 |
+
//actual style file path
|
324 |
+
$file_path = trailingslashit(get_template_directory()) . 'style.css';
|
325 |
+
$file_path = str_replace( '\\', '/', $file_path);
|
326 |
+
$file_path = trim($file_path, '\\/ ');
|
327 |
+
|
328 |
+
//not for windows
|
329 |
+
if ( DIRECTORY_SEPARATOR != '\\')
|
330 |
+
$file_path = DIRECTORY_SEPARATOR . $file_path;
|
331 |
+
|
332 |
+
$this->cache_compare_for_clear[] = $file_path;
|
333 |
+
|
334 |
+
if ( ! has_filter( 'shutdown', array($this, 'cache_compare_for_clear'), 999 ) )
|
335 |
+
add_action('shutdown', array($this, 'cache_compare_for_clear'), 999);
|
336 |
+
|
337 |
+
}
|
338 |
+
|
339 |
+
|
340 |
+
function _callback_saved_style_file_clean($saved_field_data)
|
341 |
+
{
|
342 |
+
|
343 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
344 |
+
return FALSE;
|
345 |
+
|
346 |
+
$wp_content_path = $this->wph->functions->get_url_path( WP_PLUGIN_URL );
|
347 |
+
|
348 |
+
$processing_response = array();
|
349 |
+
|
350 |
+
//actual style file path
|
351 |
+
$current_stylesheet_uri = $this->wph->default_variables['template_url'];
|
352 |
+
$current_stylesheet_uri = $this->wph->functions->get_url_path( $current_stylesheet_uri );
|
353 |
+
$current_stylesheet_uri = trailingslashit( $current_stylesheet_uri ) . 'style.css';
|
354 |
+
|
355 |
+
//current style file path
|
356 |
+
$path = '';
|
357 |
+
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_path');
|
358 |
+
$new_style_file_path = $this->wph->functions->get_module_item_setting('new_style_file_path');
|
359 |
+
if(!empty($new_style_file_path))
|
360 |
+
{
|
361 |
+
/*
|
362 |
+
if(!empty($this->wph->default_variables['wordpress_directory']))
|
363 |
+
$path = trailingslashit($this->wph->default_variables['wordpress_directory']);
|
364 |
+
*/
|
365 |
+
|
366 |
+
|
367 |
+
if(!empty($new_theme_path))
|
368 |
+
{
|
369 |
+
$path .= trailingslashit($new_theme_path) . $new_style_file_path;
|
370 |
+
}
|
371 |
+
else
|
372 |
+
{
|
373 |
+
$template_relative_url = $this->wph->functions->get_url_path_relative_to_domain_root($this->wph->default_variables['template_url']);
|
374 |
+
$path .= trailingslashit($template_relative_url) . $new_style_file_path;
|
375 |
+
}
|
376 |
+
|
377 |
+
}
|
378 |
+
else if(!empty($new_theme_path))
|
379 |
+
{
|
380 |
+
$path = trailingslashit( $new_theme_path ) . 'style.css';
|
381 |
+
}
|
382 |
+
else
|
383 |
+
{
|
384 |
+
//use the default
|
385 |
+
// cont/themes/twentyfifteen/style.css
|
386 |
+
|
387 |
+
$default_path = get_template_directory_uri();
|
388 |
+
|
389 |
+
//check for modified wp-content folder
|
390 |
+
$new_content_path = $this->wph->functions->get_module_item_setting('new_content_path');
|
391 |
+
if(!empty($new_content_path))
|
392 |
+
{
|
393 |
+
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
394 |
+
$path = $new_content_path . $path;
|
395 |
+
}
|
396 |
+
else
|
397 |
+
{
|
398 |
+
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
399 |
+
|
400 |
+
$wp_content_folder = str_replace( site_url() , '' , WP_CONTENT_URL);
|
401 |
+
$wp_content_folder = trim($wp_content_folder, '/');
|
402 |
+
|
403 |
+
$path = $wp_content_folder . $path;
|
404 |
+
}
|
405 |
+
|
406 |
+
//$path = $this->wph->functions->get_url_path( get_template_directory_uri() );
|
407 |
+
$path = trailingslashit( $path ) . 'style.css';
|
408 |
+
}
|
409 |
+
|
410 |
+
//plugin File Processor router path
|
411 |
+
$file_processor = $this->wph->functions->get_url_path( WP_PLUGIN_URL );
|
412 |
+
$file_processor = trailingslashit( $file_processor ) . 'wp-hide-security-enhancer/router/file-process.php';
|
413 |
+
|
414 |
+
$current_stylesheet_uri = str_replace(' ', '%20', $current_stylesheet_uri);
|
415 |
+
$path = str_replace(' ', '%20', $path);
|
416 |
+
|
417 |
+
$processing_response['rewrite'] = '';
|
418 |
+
if($this->rewrite_global_output === FALSE)
|
419 |
+
{
|
420 |
+
$processing_response['rewrite'] = $this->get_rewrite_global_file_process();
|
421 |
+
$this->rewrite_global_output = TRUE;
|
422 |
+
}
|
423 |
+
|
424 |
+
|
425 |
+
if($this->wph->server_htaccess_config === TRUE)
|
426 |
+
$processing_response['rewrite'] .= "\nRewriteRule ^" . $path . ' '. $file_processor . '?action=style-clean&file_path=' . $current_stylesheet_uri .'&replacement_path=/'. $path .' [L,QSA]';
|
427 |
+
|
428 |
+
if($this->wph->server_web_config === TRUE)
|
429 |
+
$processing_response['rewrite'] .= '
|
430 |
+
<rule name="wph-style_file_clean" stopProcessing="true">
|
431 |
+
<match url="^'. $path .'" />
|
432 |
+
<action type="Rewrite" url="'. $file_processor .'?action=style-clean&file_path=' . $current_stylesheet_uri .'&replacement_path=/'. $path .'" appendQueryString="true" />
|
433 |
+
</rule>
|
434 |
+
';
|
435 |
+
|
436 |
+
return $processing_response;
|
437 |
+
|
438 |
+
}
|
439 |
+
|
440 |
|
441 |
|
442 |
|
525 |
}
|
526 |
|
527 |
|
528 |
+
function _init_child_style_file_clean($saved_field_data)
|
529 |
+
{
|
530 |
+
|
531 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
532 |
+
return FALSE;
|
533 |
+
|
534 |
+
//actual style file path
|
535 |
+
$file_path = trailingslashit(get_stylesheet_directory()) . 'style.css';
|
536 |
+
$file_path = str_replace( '\\', '/', $file_path);
|
537 |
+
$file_path = trim($file_path, '\\/ ');
|
538 |
+
|
539 |
+
//not for windows
|
540 |
+
if ( DIRECTORY_SEPARATOR != '\\')
|
541 |
+
$file_path = DIRECTORY_SEPARATOR . $file_path;
|
542 |
+
|
543 |
+
$this->cache_compare_for_clear[] = $file_path;
|
544 |
+
|
545 |
+
if ( ! has_filter( 'shutdown', array($this, 'cache_compare_for_clear'), 999 ) )
|
546 |
+
add_action('shutdown', array($this, 'cache_compare_for_clear'), 999);
|
547 |
+
|
548 |
+
}
|
549 |
+
|
550 |
+
function _callback_saved_child_style_file_clean($saved_field_data)
|
551 |
+
{
|
552 |
+
|
553 |
+
if(empty($saved_field_data) || $saved_field_data == 'no')
|
554 |
+
return FALSE;
|
555 |
+
|
556 |
+
$processing_response = array();
|
557 |
+
|
558 |
+
//actual style file path
|
559 |
+
$current_stylesheet_uri = trailingslashit ( $this->wph->templates_data['themes_url'] ) . $this->wph->templates_data['child']['folder_name'];
|
560 |
+
$current_stylesheet_uri = $this->wph->functions->get_url_path( $current_stylesheet_uri );
|
561 |
+
$current_stylesheet_uri = trailingslashit( $current_stylesheet_uri ) . 'style.css';
|
562 |
+
|
563 |
+
//current style file path
|
564 |
+
$path = '';
|
565 |
+
$new_theme_path = $this->wph->functions->get_module_item_setting('new_theme_child_path');
|
566 |
+
$new_style_file_path = $this->wph->functions->get_module_item_setting('child_style_file_path');
|
567 |
+
if(!empty($new_style_file_path))
|
568 |
+
{
|
569 |
+
/*
|
570 |
+
if(!empty($this->wph->default_variables['wordpress_directory']))
|
571 |
+
$path = trailingslashit($this->wph->default_variables['wordpress_directory']);
|
572 |
+
*/
|
573 |
+
|
574 |
+
if(!empty($new_theme_path))
|
575 |
+
{
|
576 |
+
$path .= trailingslashit($new_theme_path) . $new_style_file_path;
|
577 |
+
}
|
578 |
+
else
|
579 |
+
{
|
580 |
+
$template_relative_url = $this->wph->functions->get_url_path_relative_to_domain_root($this->wph->default_variables['stylesheet_uri']);
|
581 |
+
$path .= trailingslashit($template_relative_url) . $new_style_file_path;
|
582 |
+
}
|
583 |
+
}
|
584 |
+
else if(!empty($new_theme_path))
|
585 |
+
{
|
586 |
+
$path = trailingslashit( $new_theme_path ) . 'style.css';
|
587 |
+
}
|
588 |
+
else
|
589 |
+
{
|
590 |
+
//use the default
|
591 |
+
// cont/themes/twentyfifteen/style.css
|
592 |
+
|
593 |
+
$default_path = trailingslashit ( $this->wph->templates_data['themes_url'] ) . $this->wph->templates_data['child']['folder_name'];
|
594 |
+
|
595 |
+
//check for modified wp-content folder
|
596 |
+
$new_content_path = $this->wph->functions->get_module_item_setting('new_content_path');
|
597 |
+
if(!empty($new_content_path))
|
598 |
+
{
|
599 |
+
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
600 |
+
$path = $new_content_path . $path;
|
601 |
+
}
|
602 |
+
else
|
603 |
+
{
|
604 |
+
$path = str_replace( trailingslashit( WP_CONTENT_URL ) , "/", $default_path);
|
605 |
+
|
606 |
+
$wp_content_folder = str_replace( site_url() , '' , WP_CONTENT_URL);
|
607 |
+
$wp_content_folder = trim($wp_content_folder, '/');
|
608 |
+
|
609 |
+
$path = $wp_content_folder . $path;
|
610 |
+
}
|
611 |
+
|
612 |
+
//$path = $this->wph->functions->get_url_path( get_template_directory_uri() );
|
613 |
+
$path = trailingslashit( $path ) . 'style.css';
|
614 |
+
}
|
615 |
+
|
616 |
+
//plugin File Processor router path
|
617 |
+
$file_processor = $this->wph->functions->get_url_path( WP_PLUGIN_URL );
|
618 |
+
$file_processor = trailingslashit( $file_processor ) . 'wp-hide-security-enhancer/router/file-process.php';
|
619 |
+
|
620 |
+
$current_stylesheet_uri = str_replace(' ', '%20', $current_stylesheet_uri);
|
621 |
+
$path = str_replace(' ', '%20', $path);
|
622 |
+
|
623 |
+
|
624 |
+
$processing_response['rewrite'] = '';
|
625 |
+
if($this->rewrite_global_output === FALSE)
|
626 |
+
{
|
627 |
+
$processing_response['rewrite'] = $this->get_rewrite_global_file_process();
|
628 |
+
$this->rewrite_global_output = TRUE;
|
629 |
+
}
|
630 |
+
|
631 |
+
|
632 |
+
if($this->wph->server_htaccess_config === TRUE)
|
633 |
+
$processing_response['rewrite'] .= "\nRewriteRule ^" . $path . ' '. $file_processor . '?action=style-clean&file_path=' . $current_stylesheet_uri .'&replacement_path=/'. $path .' [L,QSA]';
|
634 |
+
|
635 |
+
if($this->wph->server_web_config === TRUE)
|
636 |
+
$processing_response['rewrite'] .= '
|
637 |
+
<rule name="wph-child-style_file_clean" stopProcessing="true">
|
638 |
+
<match url="^'. $path .'" />
|
639 |
+
<action type="Rewrite" url="'. $file_processor .'?action=style-clean&file_path=' . $current_stylesheet_uri .'&replacement_path=/'. $path .'" appendQueryString="true" />
|
640 |
+
</rule>
|
641 |
+
';
|
642 |
+
|
643 |
+
return $processing_response;
|
644 |
+
|
645 |
+
}
|
646 |
+
|
647 |
+
|
648 |
+
function get_rewrite_global_file_process()
|
649 |
+
{
|
650 |
+
|
651 |
+
$rewrite = '';
|
652 |
+
|
653 |
+
if($this->wph->server_htaccess_config === TRUE)
|
654 |
+
{
|
655 |
+
$cache_path = '%{DOCUMENT_ROOT}';
|
656 |
+
$cache_path .= !empty($this->wph->default_variables['site_relative_path']) ? $this->wph->default_variables['site_relative_path'] : '';
|
657 |
+
$cache_path .= !empty($this->wph->default_variables['content_directory']) ? $this->wph->default_variables['content_directory'] : '';
|
658 |
+
|
659 |
+
$actual_cache_path = '';
|
660 |
+
$actual_cache_path .= !empty($this->wph->default_variables['site_relative_path']) ? $this->wph->default_variables['site_relative_path'] : '';
|
661 |
+
$actual_cache_path .= !empty($this->wph->default_variables['content_directory']) ? $this->wph->default_variables['content_directory'] : '';
|
662 |
+
|
663 |
+
$rewrite = "\n" . 'RewriteCond "' . $cache_path . '/cache/wph/%{HTTP_HOST}%{REQUEST_URI}" -f' ."\n" .
|
664 |
+
'RewriteRule .* "' . $actual_cache_path . '/cache/wph/%{HTTP_HOST}%{REQUEST_URI}" [L]' ."\n";
|
665 |
+
}
|
666 |
+
|
667 |
+
if($this->wph->server_web_config === TRUE)
|
668 |
+
{
|
669 |
+
$cache_path = '{DOCUMENT_ROOT}';
|
670 |
+
$cache_path .= !empty($this->wph->default_variables['site_relative_path']) ? $this->wph->default_variables['site_relative_path'] : '';
|
671 |
+
$cache_path .= !empty($this->wph->default_variables['content_directory']) ? $this->wph->default_variables['content_directory'] : '';
|
672 |
+
|
673 |
+
$actual_cache_path = '';
|
674 |
+
$actual_cache_path .= !empty($this->wph->default_variables['site_relative_path']) ? $this->wph->default_variables['site_relative_path'] : '';
|
675 |
+
$actual_cache_path .= !empty($this->wph->default_variables['content_directory']) ? $this->wph->default_variables['content_directory'] : '';
|
676 |
+
|
677 |
+
$rewrite = "\n" . '
|
678 |
+
<rule name="wph_rewrite_global_file_process" stopProcessing="true">
|
679 |
+
<match url=".*" />
|
680 |
+
<conditions>
|
681 |
+
<add input="' . $cache_path . '/cache/wph/{HTTP_HOST}{REQUEST_URI}" matchType="IsFile" />
|
682 |
+
</conditions>
|
683 |
+
<action type="Rewrite" url="' . $actual_cache_path . '/cache/wph/{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
|
684 |
+
</rule>' ."\n";
|
685 |
+
|
686 |
+
}
|
687 |
+
|
688 |
+
return $rewrite;
|
689 |
+
|
690 |
+
}
|
691 |
+
|
692 |
+
|
693 |
+
/**
|
694 |
+
* Compare if there's any changes on the cached files
|
695 |
+
* Trigger cache clear if something has changed
|
696 |
+
*
|
697 |
+
*/
|
698 |
+
function cache_compare_for_clear()
|
699 |
+
{
|
700 |
+
|
701 |
+
global $wp_filesystem;
|
702 |
+
|
703 |
+
if (empty($wp_filesystem))
|
704 |
+
{
|
705 |
+
require_once (ABSPATH . '/wp-admin/includes/file.php');
|
706 |
+
WP_Filesystem();
|
707 |
+
}
|
708 |
+
|
709 |
+
|
710 |
+
$access_type = get_filesystem_method();
|
711 |
+
if($access_type !== 'direct')
|
712 |
+
return;
|
713 |
+
|
714 |
+
$cache_files_data = get_option('wph_cache_files_data');
|
715 |
+
$found_changes = FALSE;
|
716 |
+
|
717 |
+
foreach($this->cache_compare_for_clear as $file)
|
718 |
+
{
|
719 |
+
|
720 |
+
$file_size = $wp_filesystem->size( $file );
|
721 |
+
$file_time = $wp_filesystem->mtime( $file );
|
722 |
+
|
723 |
+
if(isset($cache_files_data[md5($file)]))
|
724 |
+
{
|
725 |
+
$file_data = $cache_files_data[md5($file)];
|
726 |
+
|
727 |
+
if($file_data['size'] != $file_size || $file_data['time'] != $file_time)
|
728 |
+
$found_changes = TRUE;
|
729 |
+
|
730 |
+
}
|
731 |
+
|
732 |
+
$file_data['size'] = $file_size;
|
733 |
+
$file_data['time'] = $file_time;
|
734 |
+
|
735 |
+
$cache_files_data[md5($file)] = $file_data;
|
736 |
+
|
737 |
+
}
|
738 |
+
|
739 |
+
update_option('wph_cache_files_data', $cache_files_data);
|
740 |
+
|
741 |
+
if($found_changes === TRUE)
|
742 |
+
$this->wph->functions->cache_clear();
|
743 |
+
|
744 |
+
}
|
745 |
+
|
746 |
|
747 |
}
|
748 |
?>
|
modules/components/rewrite-new_upload_path.php
CHANGED
@@ -168,14 +168,14 @@
|
|
168 |
if($this->wph->server_htaccess_config === TRUE)
|
169 |
{
|
170 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
171 |
-
$text .= "RewriteRule ^". $path ."(.+) ". $this->wph->default_variables['
|
172 |
}
|
173 |
|
174 |
if($this->wph->server_web_config === TRUE)
|
175 |
$text = '
|
176 |
<rule name="wph-block_upload_url" stopProcessing="true">
|
177 |
<match url="^'. $path .'(.+)" />
|
178 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
179 |
</rule>
|
180 |
';
|
181 |
|
168 |
if($this->wph->server_htaccess_config === TRUE)
|
169 |
{
|
170 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
171 |
+
$text .= "RewriteRule ^". $path ."(.+) ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
172 |
}
|
173 |
|
174 |
if($this->wph->server_web_config === TRUE)
|
175 |
$text = '
|
176 |
<rule name="wph-block_upload_url" stopProcessing="true">
|
177 |
<match url="^'. $path .'(.+)" />
|
178 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
179 |
</rule>
|
180 |
';
|
181 |
|
modules/components/rewrite-new_xml-rpc-path.php
CHANGED
@@ -100,13 +100,13 @@
|
|
100 |
return $processing_response;
|
101 |
|
102 |
if($this->wph->server_htaccess_config === TRUE)
|
103 |
-
$processing_response['rewrite'] = "\nRewriteRule ^" . $saved_field_data . ' '. $this->wph->default_variables['
|
104 |
|
105 |
if($this->wph->server_web_config === TRUE)
|
106 |
$processing_response['rewrite'] = '
|
107 |
<rule name="wph-new_xml_rpc_path" stopProcessing="true">
|
108 |
<match url="^'. $saved_field_data .'" />
|
109 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
110 |
</rule>
|
111 |
';
|
112 |
|
@@ -124,14 +124,14 @@
|
|
124 |
if($this->wph->server_htaccess_config === TRUE)
|
125 |
{
|
126 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
127 |
-
$text .= "RewriteRule ^xmlrpc.php ". $this->wph->default_variables['
|
128 |
}
|
129 |
|
130 |
if($this->wph->server_web_config === TRUE)
|
131 |
$text = '
|
132 |
<rule name="wph-block_xml_rpc" stopProcessing="true">
|
133 |
<match url="^xmlrpc.php" />
|
134 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
135 |
</rule>
|
136 |
';
|
137 |
|
100 |
return $processing_response;
|
101 |
|
102 |
if($this->wph->server_htaccess_config === TRUE)
|
103 |
+
$processing_response['rewrite'] = "\nRewriteRule ^" . $saved_field_data . ' '. $this->wph->default_variables['site_wordpress_relative_path'] .'xmlrpc.php [L,QSA]';
|
104 |
|
105 |
if($this->wph->server_web_config === TRUE)
|
106 |
$processing_response['rewrite'] = '
|
107 |
<rule name="wph-new_xml_rpc_path" stopProcessing="true">
|
108 |
<match url="^'. $saved_field_data .'" />
|
109 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'xmlrpc.php" appendQueryString="true" />
|
110 |
</rule>
|
111 |
';
|
112 |
|
124 |
if($this->wph->server_htaccess_config === TRUE)
|
125 |
{
|
126 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
127 |
+
$text .= "RewriteRule ^xmlrpc.php ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
128 |
}
|
129 |
|
130 |
if($this->wph->server_web_config === TRUE)
|
131 |
$text = '
|
132 |
<rule name="wph-block_xml_rpc" stopProcessing="true">
|
133 |
<match url="^xmlrpc.php" />
|
134 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
135 |
</rule>
|
136 |
';
|
137 |
|
modules/components/rewrite-root-files.php
CHANGED
@@ -146,14 +146,14 @@
|
|
146 |
if($this->wph->server_htaccess_config === TRUE)
|
147 |
{
|
148 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
149 |
-
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['
|
150 |
}
|
151 |
|
152 |
if($this->wph->server_web_config === TRUE)
|
153 |
$text = '
|
154 |
<rule name="wph-block_license_txt" stopProcessing="true">
|
155 |
<match url="^' . $rewrite_file_base . '" />
|
156 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
157 |
</rule>
|
158 |
';
|
159 |
|
@@ -176,14 +176,14 @@
|
|
176 |
if($this->wph->server_htaccess_config === TRUE)
|
177 |
{
|
178 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
179 |
-
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['
|
180 |
}
|
181 |
|
182 |
if($this->wph->server_web_config === TRUE)
|
183 |
$text = '
|
184 |
<rule name="wph-block_readme_html" stopProcessing="true">
|
185 |
<match url="^' . $rewrite_file_base . '" />
|
186 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
187 |
</rule>
|
188 |
';
|
189 |
|
@@ -206,14 +206,14 @@
|
|
206 |
if($this->wph->server_htaccess_config === TRUE)
|
207 |
{
|
208 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
209 |
-
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['
|
210 |
}
|
211 |
|
212 |
if($this->wph->server_web_config === TRUE)
|
213 |
$text = '
|
214 |
<rule name="wph-block_wp_activate_php" stopProcessing="true">
|
215 |
<match url="^' . $rewrite_file_base . '" />
|
216 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
217 |
</rule>
|
218 |
';
|
219 |
|
@@ -237,14 +237,14 @@
|
|
237 |
if($this->wph->server_htaccess_config === TRUE)
|
238 |
{
|
239 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
240 |
-
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['
|
241 |
}
|
242 |
|
243 |
if($this->wph->server_web_config === TRUE)
|
244 |
$text = '
|
245 |
<rule name="wph-block_wp_cron_php" stopProcessing="true">
|
246 |
<match url="^' . $rewrite_file_base . '" />
|
247 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
248 |
</rule>
|
249 |
';
|
250 |
|
@@ -267,14 +267,14 @@
|
|
267 |
if($this->wph->server_htaccess_config === TRUE)
|
268 |
{
|
269 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
270 |
-
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['
|
271 |
}
|
272 |
|
273 |
if($this->wph->server_web_config === TRUE)
|
274 |
$text = '
|
275 |
<rule name="wph-block_default_wp_signup_php" stopProcessing="true">
|
276 |
<match url="^' . $rewrite_file_base . '" />
|
277 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
278 |
</rule>
|
279 |
';
|
280 |
|
@@ -303,7 +303,7 @@
|
|
303 |
$text = '
|
304 |
<rule name="wph-block_default_wp_register_php" stopProcessing="true">
|
305 |
<match url="^wp-register.php" />
|
306 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
307 |
</rule>
|
308 |
';
|
309 |
|
@@ -332,7 +332,7 @@
|
|
332 |
$text .= "RewriteCond %{REQUEST_FILENAME} !wp-comments-post.php [NC]\n";
|
333 |
$text .= "RewriteCond %{REQUEST_FILENAME} !wp-login.php [NC]\n";
|
334 |
|
335 |
-
$text .= "RewriteRule ^" . $rewrite_base . "wp-([a-z-])+.php ". $this->wph->default_variables['
|
336 |
}
|
337 |
|
338 |
if($this->wph->server_web_config === TRUE)
|
@@ -347,7 +347,7 @@
|
|
347 |
<add input="{REQUEST_FILENAME}" pattern="wp-comments-post.php" ignoreCase="true" negate="true" />
|
348 |
<add input="{REQUEST_FILENAME}" pattern="wp-login.php" ignoreCase="true" negate="true" />
|
349 |
</conditions>
|
350 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
351 |
</rule>
|
352 |
';
|
353 |
|
146 |
if($this->wph->server_htaccess_config === TRUE)
|
147 |
{
|
148 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
149 |
+
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
150 |
}
|
151 |
|
152 |
if($this->wph->server_web_config === TRUE)
|
153 |
$text = '
|
154 |
<rule name="wph-block_license_txt" stopProcessing="true">
|
155 |
<match url="^' . $rewrite_file_base . '" />
|
156 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
157 |
</rule>
|
158 |
';
|
159 |
|
176 |
if($this->wph->server_htaccess_config === TRUE)
|
177 |
{
|
178 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
179 |
+
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
180 |
}
|
181 |
|
182 |
if($this->wph->server_web_config === TRUE)
|
183 |
$text = '
|
184 |
<rule name="wph-block_readme_html" stopProcessing="true">
|
185 |
<match url="^' . $rewrite_file_base . '" />
|
186 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
187 |
</rule>
|
188 |
';
|
189 |
|
206 |
if($this->wph->server_htaccess_config === TRUE)
|
207 |
{
|
208 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
209 |
+
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
210 |
}
|
211 |
|
212 |
if($this->wph->server_web_config === TRUE)
|
213 |
$text = '
|
214 |
<rule name="wph-block_wp_activate_php" stopProcessing="true">
|
215 |
<match url="^' . $rewrite_file_base . '" />
|
216 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
217 |
</rule>
|
218 |
';
|
219 |
|
237 |
if($this->wph->server_htaccess_config === TRUE)
|
238 |
{
|
239 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
240 |
+
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
241 |
}
|
242 |
|
243 |
if($this->wph->server_web_config === TRUE)
|
244 |
$text = '
|
245 |
<rule name="wph-block_wp_cron_php" stopProcessing="true">
|
246 |
<match url="^' . $rewrite_file_base . '" />
|
247 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
248 |
</rule>
|
249 |
';
|
250 |
|
267 |
if($this->wph->server_htaccess_config === TRUE)
|
268 |
{
|
269 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
270 |
+
$text .= "RewriteRule ^" . $rewrite_file_base ." ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
271 |
}
|
272 |
|
273 |
if($this->wph->server_web_config === TRUE)
|
274 |
$text = '
|
275 |
<rule name="wph-block_default_wp_signup_php" stopProcessing="true">
|
276 |
<match url="^' . $rewrite_file_base . '" />
|
277 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
278 |
</rule>
|
279 |
';
|
280 |
|
303 |
$text = '
|
304 |
<rule name="wph-block_default_wp_register_php" stopProcessing="true">
|
305 |
<match url="^wp-register.php" />
|
306 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php?wph-throw-404" />
|
307 |
</rule>
|
308 |
';
|
309 |
|
332 |
$text .= "RewriteCond %{REQUEST_FILENAME} !wp-comments-post.php [NC]\n";
|
333 |
$text .= "RewriteCond %{REQUEST_FILENAME} !wp-login.php [NC]\n";
|
334 |
|
335 |
+
$text .= "RewriteRule ^" . $rewrite_base . "wp-([a-z-])+.php ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
336 |
}
|
337 |
|
338 |
if($this->wph->server_web_config === TRUE)
|
347 |
<add input="{REQUEST_FILENAME}" pattern="wp-comments-post.php" ignoreCase="true" negate="true" />
|
348 |
<add input="{REQUEST_FILENAME}" pattern="wp-login.php" ignoreCase="true" negate="true" />
|
349 |
</conditions>
|
350 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
351 |
</rule>
|
352 |
';
|
353 |
|
modules/components/rewrite-wp_content_path.php
CHANGED
@@ -114,7 +114,7 @@
|
|
114 |
{
|
115 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
116 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
117 |
-
$text .= "RewriteRule ^". $content_directory ."(.+) ". $this->wph->default_variables['
|
118 |
|
119 |
$processing_response['rewrite'] = $text;
|
120 |
}
|
@@ -126,7 +126,7 @@
|
|
126 |
<conditions>
|
127 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
128 |
</conditions>
|
129 |
-
<action type="Rewrite" url="'. $this->wph->default_variables['
|
130 |
</rule>
|
131 |
';
|
132 |
|
114 |
{
|
115 |
$text = "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
|
116 |
$text .= "RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]\n";
|
117 |
+
$text .= "RewriteRule ^". $content_directory ."(.+) ". $this->wph->default_variables['site_wordpress_relative_path'] ."index.php [L]";
|
118 |
|
119 |
$processing_response['rewrite'] = $text;
|
120 |
}
|
126 |
<conditions>
|
127 |
<add input="{HTTP_COOKIE}" matchType="Pattern" pattern="wordpress_logged_in_[^.]+" negate="true" />
|
128 |
</conditions>
|
129 |
+
<action type="Rewrite" url="'. $this->wph->default_variables['site_wordpress_relative_path'] .'index.php" />
|
130 |
</rule>
|
131 |
';
|
132 |
|
modules/module-general.php
CHANGED
@@ -12,6 +12,9 @@
|
|
12 |
include(WPH_PATH . "/modules/components/general-meta.php");
|
13 |
$this->components[] = new WPH_module_general_meta();
|
14 |
|
|
|
|
|
|
|
15 |
include(WPH_PATH . "/modules/components/general-wpemoji.php");
|
16 |
$this->components[] = new WPH_module_general_wpemoji();
|
17 |
|
12 |
include(WPH_PATH . "/modules/components/general-meta.php");
|
13 |
$this->components[] = new WPH_module_general_meta();
|
14 |
|
15 |
+
include(WPH_PATH . "/modules/components/general-tobots-txt.php");
|
16 |
+
$this->components[] = new WPH_module_general_robots_txt();
|
17 |
+
|
18 |
include(WPH_PATH . "/modules/components/general-wpemoji.php");
|
19 |
$this->components[] = new WPH_module_general_wpemoji();
|
20 |
|
mu-loader/wp-hide-loader.php
CHANGED
@@ -19,8 +19,9 @@
|
|
19 |
return FALSE;
|
20 |
|
21 |
define('WPH_PATH', trailingslashit( dirname( WP_PLUGIN_DIR . '/wp-hide-security-enhancer/wp-hide.php' ) ) );
|
|
|
22 |
define('WPH_MULOADER', TRUE);
|
23 |
-
define('WPH_MULOADER_VERSION', '1.3');
|
24 |
|
25 |
include_once(WPH_PATH . '/include/wph.class.php');
|
26 |
include_once(WPH_PATH . '/include/functions.class.php');
|
19 |
return FALSE;
|
20 |
|
21 |
define('WPH_PATH', trailingslashit( dirname( WP_PLUGIN_DIR . '/wp-hide-security-enhancer/wp-hide.php' ) ) );
|
22 |
+
define('WPH_CACHE_PATH', WP_CONTENT_DIR . '/cache/wph/' );
|
23 |
define('WPH_MULOADER', TRUE);
|
24 |
+
define('WPH_MULOADER_VERSION', '1.3.1');
|
25 |
|
26 |
include_once(WPH_PATH . '/include/wph.class.php');
|
27 |
include_once(WPH_PATH . '/include/functions.class.php');
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: nsp-code, tdgu
|
|
3 |
Donate link: http://www.nsp-code.com/donate.php
|
4 |
Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, ap-admin, admin hide
|
5 |
Requires at least: 2.8
|
6 |
-
Tested up to: 4.7.
|
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.
|
@@ -154,6 +154,10 @@ Since version 1.2 Change individual plugin urls which make them unrecognizable,
|
|
154 |
* Remove profile link
|
155 |
* Remove canonical link
|
156 |
|
|
|
|
|
|
|
|
|
157 |
**General / Html > Emoji**
|
158 |
|
159 |
* Disable Emoji
|
@@ -239,6 +243,18 @@ 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.3 =
|
243 |
* Tags update
|
244 |
|
3 |
Donate link: http://www.nsp-code.com/donate.php
|
4 |
Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, ap-admin, admin hide
|
5 |
Requires at least: 2.8
|
6 |
+
Tested up to: 4.7.3
|
7 |
+
Stable tag: 1.4.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.
|
154 |
* Remove profile link
|
155 |
* Remove canonical link
|
156 |
|
157 |
+
**General / Robots.txt**
|
158 |
+
|
159 |
+
* Disable admin url within Robots.txt
|
160 |
+
|
161 |
**General / Html > Emoji**
|
162 |
|
163 |
* Disable Emoji
|
243 |
|
244 |
== Changelog ==
|
245 |
|
246 |
+
= 1.4.4 =
|
247 |
+
* New component : Robots.txt to control the outputed data
|
248 |
+
* Check if any environment variable has changed before Update static environment file
|
249 |
+
* Improved Default constants map
|
250 |
+
* File-processing check WordPress wp-load.php down the path, for custom install directory.
|
251 |
+
* Templates style clean
|
252 |
+
* Use cache for cleaned styles files
|
253 |
+
* Set HTTP_MOD_REWRITE environment variable through mod_rewrite
|
254 |
+
* Separate rewrite rules from Wordpress and use distinct block with specific marker
|
255 |
+
* Add relative .htaccess file manipulation to avoid accessing permissions when WordPress installed within a subfolder.
|
256 |
+
* Updated .po language file
|
257 |
+
|
258 |
= 1.4.3 =
|
259 |
* Tags update
|
260 |
|
router/class.file-processor.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
+
|
5 |
+
class WPH_File_Processor
|
6 |
+
{
|
7 |
+
var $action;
|
8 |
+
var $file_path;
|
9 |
+
var $replacement_path;
|
10 |
+
|
11 |
+
var $full_file_path;
|
12 |
+
|
13 |
+
var $allowed_file_type = array('css');
|
14 |
+
|
15 |
+
var $allowed_paths = array();
|
16 |
+
|
17 |
+
var $environment = array();
|
18 |
+
|
19 |
+
function __construct( $action, $file_path, $replacement_path )
|
20 |
+
{
|
21 |
+
|
22 |
+
$this->action = $action;
|
23 |
+
$this->file_path = $file_path;
|
24 |
+
$this->replacement_path = $replacement_path;
|
25 |
+
|
26 |
+
//append doc root to path
|
27 |
+
$this->full_file_path = $_SERVER["DOCUMENT_ROOT"] . $this->file_path;
|
28 |
+
$this->full_file_path = str_replace( '\\', '/', $this->full_file_path);
|
29 |
+
|
30 |
+
//check if file exists
|
31 |
+
if (!file_exists($this->full_file_path))
|
32 |
+
die();
|
33 |
+
|
34 |
+
//allow only style files
|
35 |
+
$pathinfo = pathinfo($this->full_file_path);
|
36 |
+
if(!isset($pathinfo['extension']) || !in_array(strtolower($pathinfo['extension']), $this->allowed_file_type))
|
37 |
+
die();
|
38 |
+
|
39 |
+
|
40 |
+
$this->load_environment();
|
41 |
+
$this->define_wp_constants();
|
42 |
+
|
43 |
+
//check if the file is in allowed path
|
44 |
+
$found = FALSE;
|
45 |
+
foreach($this->environment->allowed_paths as $allowed_path)
|
46 |
+
{
|
47 |
+
$result = stripos($this->full_file_path, $allowed_path);
|
48 |
+
if($result !== FALSE && $result === 0)
|
49 |
+
{
|
50 |
+
$found = TRUE;
|
51 |
+
break;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
if(! $found )
|
56 |
+
die();
|
57 |
+
|
58 |
+
|
59 |
+
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false)
|
60 |
+
{
|
61 |
+
ob_start('ob_gzhandler'); ob_start();
|
62 |
+
}
|
63 |
+
else
|
64 |
+
{
|
65 |
+
ob_start();
|
66 |
+
}
|
67 |
+
|
68 |
+
|
69 |
+
}
|
70 |
+
|
71 |
+
function __destruct()
|
72 |
+
{
|
73 |
+
|
74 |
+
if(ob_get_level() < 1)
|
75 |
+
return;
|
76 |
+
|
77 |
+
$out = ob_get_contents();
|
78 |
+
ob_end_clean();
|
79 |
+
|
80 |
+
echo $out;
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Load environment
|
87 |
+
*
|
88 |
+
*/
|
89 |
+
function load_environment()
|
90 |
+
{
|
91 |
+
require_once('environment.php');
|
92 |
+
|
93 |
+
$this->environment = json_decode($environment_variable);
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Define some of WordPress constants which will be used
|
100 |
+
*
|
101 |
+
*/
|
102 |
+
function define_wp_constants()
|
103 |
+
{
|
104 |
+
|
105 |
+
if ( !defined('WP_CONTENT_DIR') )
|
106 |
+
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
|
107 |
+
|
108 |
+
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Process the action
|
114 |
+
*
|
115 |
+
*/
|
116 |
+
function run()
|
117 |
+
{
|
118 |
+
|
119 |
+
switch($this->action)
|
120 |
+
{
|
121 |
+
case 'style-clean' :
|
122 |
+
$this->style_clean();
|
123 |
+
break;
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Clean the file
|
132 |
+
*
|
133 |
+
*/
|
134 |
+
function style_clean()
|
135 |
+
{
|
136 |
+
//output headers
|
137 |
+
$expires_offset = 31536000;
|
138 |
+
|
139 |
+
header('Content-Type: text/css; charset=UTF-8');
|
140 |
+
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
|
141 |
+
header("Cache-Control: public, max-age=$expires_offset");
|
142 |
+
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($this->full_file_path)).' GMT', true);
|
143 |
+
|
144 |
+
$handle = fopen($this->full_file_path, "r");
|
145 |
+
$file_data = fread($handle, filesize($this->full_file_path));
|
146 |
+
fclose($handle);
|
147 |
+
|
148 |
+
$file_data = preg_replace('!/\*.*?\*/!s', '', $file_data);
|
149 |
+
$file_data = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $file_data);
|
150 |
+
|
151 |
+
|
152 |
+
if(isset($this->environment->theme))
|
153 |
+
{
|
154 |
+
$var_theme = $this->environment->theme;
|
155 |
+
$file_data = str_replace('../' . $var_theme->folder_name .'/', '../' . $var_theme->mapped_name .'/', $file_data);
|
156 |
+
}
|
157 |
+
if(isset($this->environment->child_theme))
|
158 |
+
{
|
159 |
+
$var_theme = $this->environment->child_theme;
|
160 |
+
$file_data = str_replace('../' . $var_theme->folder_name .'/', '../' . $var_theme->mapped_name .'/', $file_data);
|
161 |
+
}
|
162 |
+
|
163 |
+
$this->push_file_to_cache( $file_data );
|
164 |
+
|
165 |
+
echo $file_data;
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Save the file to cache
|
173 |
+
*
|
174 |
+
* @param mixed $file_data
|
175 |
+
*/
|
176 |
+
function push_file_to_cache( $file_data )
|
177 |
+
{
|
178 |
+
|
179 |
+
$file_url = $_SERVER['SERVER_NAME'];
|
180 |
+
$file_url .= !empty($this->environment->site_relative_path) ? $this->environment->site_relative_path : '';
|
181 |
+
$file_url .= $this->replacement_path;
|
182 |
+
|
183 |
+
$pathinfo = pathinfo( $this->environment->cache_path . $file_url );
|
184 |
+
|
185 |
+
if ( ! is_dir( $pathinfo['dirname'] ) )
|
186 |
+
{
|
187 |
+
wp_mkdir_p( $pathinfo['dirname'] );
|
188 |
+
}
|
189 |
+
|
190 |
+
global $wp_filesystem;
|
191 |
+
|
192 |
+
if (empty($wp_filesystem))
|
193 |
+
{
|
194 |
+
|
195 |
+
require_once (ABSPATH . '/wp-includes/l10n.php');
|
196 |
+
require_once (ABSPATH . '/wp-includes/formatting.php');
|
197 |
+
require_once (ABSPATH . '/wp-admin/includes/file.php');
|
198 |
+
WP_Filesystem();
|
199 |
+
}
|
200 |
+
|
201 |
+
$access_type = get_filesystem_method();
|
202 |
+
if($access_type !== 'direct')
|
203 |
+
return;
|
204 |
+
|
205 |
+
if( ! $wp_filesystem->put_contents( trailingslashit($pathinfo['dirname']) . $pathinfo['basename'], $file_data , 0644) )
|
206 |
+
{
|
207 |
+
//error saving the cache data to cache file
|
208 |
+
}
|
209 |
+
|
210 |
+
}
|
211 |
+
|
212 |
+
}
|
213 |
+
|
214 |
+
?>
|
router/environment.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
2 |
+
$environment_variable = '{"theme":{"folder_name":"twentyfifteen","mapped_name":"my_template"},"child_theme":{"folder_name":"child-theme","mapped_name":"my_child_template"},"allowed_paths":["F:\/htdocs\/wp-hide-demo\/wp-content\/themes"],"cache_path":"F:\/htdocs\/wp-hide-demo\/wp-content\/cache\/wph\/","site_wordpress_relative_path":"\/","wordpress_directory":"","site_relative_path":""}' ?>
|
router/file-process.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Load WordPress
|
5 |
+
* Use ShortInit
|
6 |
+
*/
|
7 |
+
define( 'SHORTINIT', true );
|
8 |
+
|
9 |
+
//since we don't knwo the structure directory, we just have to guess
|
10 |
+
$SCRIPT_NAME = $_SERVER['DOCUMENT_ROOT'] . '/' . $_SERVER['SCRIPT_NAME'];
|
11 |
+
$SCRIPT_NAME = str_replace( '\\', '/', $SCRIPT_NAME);
|
12 |
+
$SCRIPT_NAME_items = explode("/", $SCRIPT_NAME);
|
13 |
+
|
14 |
+
//exclude last 4 as there's never a location for wp-load.php
|
15 |
+
$SCRIPT_NAME_items = array_slice($SCRIPT_NAME_items, 0, count($SCRIPT_NAME_items) - 4);
|
16 |
+
|
17 |
+
while(count($SCRIPT_NAME_items) > 0)
|
18 |
+
{
|
19 |
+
$location = implode('/', $SCRIPT_NAME_items);
|
20 |
+
|
21 |
+
if(file_exists($location . '/wp-load.php'))
|
22 |
+
{
|
23 |
+
require_once( $location . '/wp-load.php' );
|
24 |
+
break;
|
25 |
+
}
|
26 |
+
|
27 |
+
$SCRIPT_NAME_items = array_slice($SCRIPT_NAME_items, 0, count($SCRIPT_NAME_items) - 1);
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
if(!defined('ABSPATH'))
|
32 |
+
die();
|
33 |
+
|
34 |
+
$action = isset($_GET['action']) ? filter_var ( $_GET['action'], FILTER_SANITIZE_STRING) : '';
|
35 |
+
$file_path = isset($_GET['file_path']) ? filter_var ( $_GET['file_path'], FILTER_SANITIZE_STRING) : '';
|
36 |
+
$replacement_path = isset($_GET['replacement_path']) ? filter_var ( $_GET['replacement_path'], FILTER_SANITIZE_STRING) : '';
|
37 |
+
|
38 |
+
if(empty($action) || empty($file_path) || empty($replacement_path))
|
39 |
+
die();
|
40 |
+
|
41 |
+
include_once('class.file-processor.php');
|
42 |
+
|
43 |
+
$WPH_FileProcess = new WPH_File_Processor($action, $file_path, $replacement_path);
|
44 |
+
$WPH_FileProcess->run();
|
45 |
+
|
46 |
+
?>
|
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 |
*/
|
@@ -16,7 +16,9 @@ Domain Path: /languages/
|
|
16 |
if(!defined('WPH_PATH'))
|
17 |
{
|
18 |
|
19 |
-
define('WPH_PATH',
|
|
|
|
|
20 |
include_once(WPH_PATH . '/include/wph.class.php');
|
21 |
include_once(WPH_PATH . '/include/functions.class.php');
|
22 |
|
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.4
|
9 |
Text Domain: wp-hide-security-enhancer
|
10 |
Domain Path: /languages/
|
11 |
*/
|
16 |
if(!defined('WPH_PATH'))
|
17 |
{
|
18 |
|
19 |
+
define('WPH_PATH', plugin_dir_path(__FILE__));
|
20 |
+
define('WPH_CACHE_PATH', WP_CONTENT_DIR . '/cache/wph/' );
|
21 |
+
|
22 |
include_once(WPH_PATH . '/include/wph.class.php');
|
23 |
include_once(WPH_PATH . '/include/functions.class.php');
|
24 |
|