Version Description
- Confirmation page for Recovery link
- Use home_url() instead site_url() for recovery links to ensure the format is correct for WordPress instances using own directory
- Trigger the login URL change e-mail at shutdown instead init
- Compatibility with TranslatePress - Multilingual
- Fix undefined notice
- Fix meta Uncaught TypeError: count(): Argument
- Slight code improvements
Download this release
Release Info
Developer | nsp-code |
Plugin | WP Hide & Security Enhancer |
Version | 1.6.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.6.3.1 to 1.6.3.2
- assets/css/wph.css +3 -3
- compatibility/translatepress-multilingual.php +63 -0
- include/admin-interface.class.php +2 -4
- include/class.compatibility.php +13 -64
- include/functions.class.php +52 -8
- include/wph.class.php +12 -10
- modules/components/admin-new_wp_login_php.php +15 -16
- readme.txt +17 -2
- wp-hide.php +3 -1
assets/css/wph.css
CHANGED
@@ -9,12 +9,12 @@
|
|
9 |
#wph #reset_settings_form .reset_settings { margin-top: -31px;}
|
10 |
#wph h2 #reset_settings, #wph #reset_settings_form .reset_settings { }
|
11 |
#wph span.wph-pro {background-color: #f04d46; color:#FFF; font-weight: bold;display: inline-block; padding: 2px 4px;}
|
12 |
-
#wph .
|
13 |
-moz-transition: opacity 0.3s ease-in-out;
|
14 |
-ms-transition: opacity 0.3s ease-in-out;
|
15 |
-o-transition: opacity 0.3s ease-in-out;
|
16 |
transition: opacity 0.3s ease-in-out;}
|
17 |
-
#wph .
|
18 |
|
19 |
.wph-postbox {display: flex; border-color: #e5e5e5}
|
20 |
|
@@ -143,7 +143,7 @@ h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold}
|
|
143 |
.container-description img {max-width: 100%}
|
144 |
.container-description.environment-notices span.dashicons {font-size: 22px; padding-right: 4px}
|
145 |
.container-description.environment-notices span.dashicons.error {color: #dc3232;}
|
146 |
-
.container-description .framed {border: 1px dashed #000; padding: 10px; display: inline-block}
|
147 |
.container-description p {}
|
148 |
.container-description.environment-notices img {margin-top: 10px}
|
149 |
|
9 |
#wph #reset_settings_form .reset_settings { margin-top: -31px;}
|
10 |
#wph h2 #reset_settings, #wph #reset_settings_form .reset_settings { }
|
11 |
#wph span.wph-pro {background-color: #f04d46; color:#FFF; font-weight: bold;display: inline-block; padding: 2px 4px;}
|
12 |
+
#wph .something-wrong { opacity: 0.2; -webkit-transition: opacity 0.3s ease-in-out;
|
13 |
-moz-transition: opacity 0.3s ease-in-out;
|
14 |
-ms-transition: opacity 0.3s ease-in-out;
|
15 |
-o-transition: opacity 0.3s ease-in-out;
|
16 |
transition: opacity 0.3s ease-in-out;}
|
17 |
+
#wph .something-wrong:hover {opacity: 1;}
|
18 |
|
19 |
.wph-postbox {display: flex; border-color: #e5e5e5}
|
20 |
|
143 |
.container-description img {max-width: 100%}
|
144 |
.container-description.environment-notices span.dashicons {font-size: 22px; padding-right: 4px}
|
145 |
.container-description.environment-notices span.dashicons.error {color: #dc3232;}
|
146 |
+
.container-description .framed {border: 1px dashed #000; padding: 10px; display: inline-block; font-weight: bold}
|
147 |
.container-description p {}
|
148 |
.container-description.environment-notices img {margin-top: 10px}
|
149 |
|
compatibility/translatepress-multilingual.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Compatibility for Plugin Name: TranslatePress - Multilingual
|
5 |
+
* Since: 1.9.5
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
9 |
+
|
10 |
+
class WPH_conflict_handle_tp_multilingual
|
11 |
+
{
|
12 |
+
|
13 |
+
var $wph;
|
14 |
+
|
15 |
+
function __construct()
|
16 |
+
{
|
17 |
+
if( ! $this->is_plugin_active() )
|
18 |
+
return FALSE;
|
19 |
+
|
20 |
+
global $wph;
|
21 |
+
$this->wph = $wph;
|
22 |
+
|
23 |
+
add_filter( 'trp_is_admin_link', array ( $this, 'trp_is_admin_link' ), 99, 4 );
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
function is_plugin_active()
|
28 |
+
{
|
29 |
+
|
30 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
31 |
+
|
32 |
+
if( is_plugin_active( 'translatepress-multilingual/index.php' ) )
|
33 |
+
return TRUE;
|
34 |
+
else
|
35 |
+
return FALSE;
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
function trp_is_admin_link( $is_admin_link, $url, $admin_url, $wp_login_url )
|
40 |
+
{
|
41 |
+
$new_wp_login_php = $new_login = $wph->functions->get_module_item_setting('new_wp_login_php');
|
42 |
+
$login_url = home_url( $new_wp_login_php, 'login' );
|
43 |
+
|
44 |
+
$default_login_url = site_url( 'wp-login', 'login');
|
45 |
+
|
46 |
+
if ( strpos( $url, $default_login_url ) !== false || strpos( $url, $new_wp_login_php ) !== false
|
47 |
+
|| strpos( $url, $admin_url ) !== false ){
|
48 |
+
$is_admin_link = true;
|
49 |
+
} else {
|
50 |
+
$is_admin_link = false;
|
51 |
+
}
|
52 |
+
|
53 |
+
return $is_admin_link;
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
new WPH_conflict_handle_tp_multilingual();
|
61 |
+
|
62 |
+
|
63 |
+
?>
|
include/admin-interface.class.php
CHANGED
@@ -127,7 +127,7 @@
|
|
127 |
|
128 |
?>
|
129 |
|
130 |
-
<div class="content<?php if( $results['critical_issues'] ) {echo ('
|
131 |
|
132 |
<?php
|
133 |
|
@@ -353,9 +353,7 @@
|
|
353 |
{
|
354 |
|
355 |
?>
|
356 |
-
<h2 class="nav-tab-wrapper
|
357 |
-
if($this->wph->server_htaccess_config === FALSE && $this->wph->server_web_config === FALSE) {echo (' disabled');}
|
358 |
-
?>">
|
359 |
<?php
|
360 |
|
361 |
//output all module components as tabs
|
127 |
|
128 |
?>
|
129 |
|
130 |
+
<div class="content<?php if( $results['critical_issues'] ) {echo (' something-wrong');} ?>">
|
131 |
|
132 |
<?php
|
133 |
|
353 |
{
|
354 |
|
355 |
?>
|
356 |
+
<h2 class="nav-tab-wrapper">
|
|
|
|
|
357 |
<?php
|
358 |
|
359 |
//output all module components as tabs
|
include/class.compatibility.php
CHANGED
@@ -28,113 +28,62 @@
|
|
28 |
* General
|
29 |
*/
|
30 |
include_once(WPH_PATH . 'compatibility/general.php');
|
31 |
-
|
32 |
-
|
33 |
-
//w3-cache compatibility handle
|
34 |
include_once(WPH_PATH . 'compatibility/w3-cache.php');
|
35 |
WPH_conflict_handle_w3_cache::init();
|
36 |
-
|
37 |
-
//super-cache compatibility handle
|
38 |
include_once(WPH_PATH . 'compatibility/super-cache.php');
|
39 |
WPH_conflict_handle_super_cache::init();
|
40 |
-
|
41 |
-
//BuddyPress handle
|
42 |
include_once(WPH_PATH . 'compatibility/buddypress.php');
|
43 |
WPH_conflict_handle_BuddyPress::init();
|
44 |
-
|
45 |
-
|
46 |
-
//WP Fastest Cache handle
|
47 |
include_once(WPH_PATH . 'compatibility/wp-fastest-cache.php');
|
48 |
WPH_conflict_handle_wp_fastest_cache::init();
|
49 |
-
|
50 |
-
|
51 |
-
//WooCommerce
|
52 |
include_once(WPH_PATH . 'compatibility/woocommerce.php');
|
53 |
WPH_conflict_handle_woocommerce::init();
|
54 |
-
|
55 |
-
//WPML
|
56 |
include_once(WPH_PATH . 'compatibility/wpml.php');
|
57 |
WPH_conflict_handle_wpml::init();
|
58 |
-
|
59 |
-
//WooGlobalCart
|
60 |
include_once(WPH_PATH . 'compatibility/woo-global-cart.php');
|
61 |
WPH_conflict_handle_wgc::init();
|
62 |
-
|
63 |
-
//ShortPixel Adaptive Images
|
64 |
include_once(WPH_PATH . 'compatibility/shortpixel-adaptive-images.php');
|
65 |
WPH_conflict_shortpixel_ai::init();
|
66 |
-
|
67 |
-
//WebArx
|
68 |
include_once(WPH_PATH . 'compatibility/webarx.php');
|
69 |
WPH_conflict_webarx::init();
|
70 |
-
|
71 |
-
//WPS Hide Login
|
72 |
include_once(WPH_PATH . 'compatibility/wps-hide-login.php');
|
73 |
WPH_conflict_wps_hide_login::init();
|
74 |
-
|
75 |
-
//Hummingbird
|
76 |
include_once(WPH_PATH . 'compatibility/wp-hummingbird.php');
|
77 |
WPH_conflict_handle_hummingbird::init();
|
78 |
-
|
79 |
-
//WP Rocket
|
80 |
include_once(WPH_PATH . 'compatibility/wp-rocket.php');
|
81 |
-
|
82 |
-
//Autoptimize
|
83 |
include_once(WPH_PATH . 'compatibility/autoptimize.php');
|
84 |
-
|
85 |
-
//Easy Digital Downloads
|
86 |
include_once(WPH_PATH . 'compatibility/easy-digital-downloads.php');
|
87 |
-
|
88 |
-
//Fusion Builder
|
89 |
include_once(WPH_PATH . 'compatibility/fusion-builder.php');
|
90 |
-
|
91 |
-
//Elementor
|
92 |
include_once(WPH_PATH . 'compatibility/fusion-builder.php');
|
93 |
-
|
94 |
-
//Cache Enabler
|
95 |
include_once(WPH_PATH . 'compatibility/cache-enabler.php');
|
96 |
-
|
97 |
-
//WP Smush
|
98 |
include_once(WPH_PATH . 'compatibility/wp-smush.php');
|
99 |
-
|
100 |
-
//ShortCode Image Optimizer
|
101 |
include_once(WPH_PATH . 'compatibility/shortpixel-image-optimiser.php');
|
102 |
-
|
103 |
-
//Fluentform
|
104 |
include_once(WPH_PATH . 'compatibility/fluentform.php');
|
105 |
-
|
106 |
-
//Ultimate Member
|
107 |
include_once(WPH_PATH . 'compatibility/ultimate-member.php');
|
108 |
-
|
109 |
-
//Swift Performance
|
110 |
include_once(WPH_PATH . 'compatibility/swift-performance.php');
|
111 |
-
|
112 |
-
//Fast Velocity Minify
|
113 |
include_once(WPH_PATH . 'compatibility/fast-velocity-minfy.php');
|
114 |
-
|
115 |
-
//LiteSpeed Cache
|
116 |
include_once(WPH_PATH . 'compatibility/litespeed-cache.php');
|
117 |
-
|
118 |
-
//WP Speed of Light
|
119 |
include_once(WPH_PATH . 'compatibility/wp-speed-of-light.php');
|
120 |
-
|
121 |
-
//WP Job Manager
|
122 |
include_once(WPH_PATH . 'compatibility/wp-job-manager.php');
|
123 |
-
|
124 |
-
//WP Job Manager
|
125 |
include_once(WPH_PATH . 'compatibility/jobboardwp.php');
|
126 |
-
|
127 |
-
//WP-Optimize - Clean, Compress, Cache
|
128 |
include_once(WPH_PATH . 'compatibility/wp-optimize.php');
|
129 |
-
|
130 |
-
//Hyper Cache
|
131 |
include_once(WPH_PATH . 'compatibility/hyper-cache.php');
|
132 |
-
|
133 |
include_once(WPH_PATH . 'compatibility/wp-asset-clean-up.php');
|
134 |
-
|
135 |
include_once(WPH_PATH . 'compatibility/wepos.php');
|
136 |
-
|
137 |
include_once(WPH_PATH . 'compatibility/oxygen.php');
|
|
|
138 |
|
139 |
/**
|
140 |
* Themes
|
28 |
* General
|
29 |
*/
|
30 |
include_once(WPH_PATH . 'compatibility/general.php');
|
31 |
+
|
|
|
|
|
32 |
include_once(WPH_PATH . 'compatibility/w3-cache.php');
|
33 |
WPH_conflict_handle_w3_cache::init();
|
34 |
+
|
|
|
35 |
include_once(WPH_PATH . 'compatibility/super-cache.php');
|
36 |
WPH_conflict_handle_super_cache::init();
|
37 |
+
|
|
|
38 |
include_once(WPH_PATH . 'compatibility/buddypress.php');
|
39 |
WPH_conflict_handle_BuddyPress::init();
|
40 |
+
|
|
|
|
|
41 |
include_once(WPH_PATH . 'compatibility/wp-fastest-cache.php');
|
42 |
WPH_conflict_handle_wp_fastest_cache::init();
|
43 |
+
|
|
|
|
|
44 |
include_once(WPH_PATH . 'compatibility/woocommerce.php');
|
45 |
WPH_conflict_handle_woocommerce::init();
|
46 |
+
|
|
|
47 |
include_once(WPH_PATH . 'compatibility/wpml.php');
|
48 |
WPH_conflict_handle_wpml::init();
|
49 |
+
|
|
|
50 |
include_once(WPH_PATH . 'compatibility/woo-global-cart.php');
|
51 |
WPH_conflict_handle_wgc::init();
|
52 |
+
|
|
|
53 |
include_once(WPH_PATH . 'compatibility/shortpixel-adaptive-images.php');
|
54 |
WPH_conflict_shortpixel_ai::init();
|
55 |
+
|
|
|
56 |
include_once(WPH_PATH . 'compatibility/webarx.php');
|
57 |
WPH_conflict_webarx::init();
|
58 |
+
|
|
|
59 |
include_once(WPH_PATH . 'compatibility/wps-hide-login.php');
|
60 |
WPH_conflict_wps_hide_login::init();
|
61 |
+
|
|
|
62 |
include_once(WPH_PATH . 'compatibility/wp-hummingbird.php');
|
63 |
WPH_conflict_handle_hummingbird::init();
|
64 |
+
|
|
|
65 |
include_once(WPH_PATH . 'compatibility/wp-rocket.php');
|
|
|
|
|
66 |
include_once(WPH_PATH . 'compatibility/autoptimize.php');
|
|
|
|
|
67 |
include_once(WPH_PATH . 'compatibility/easy-digital-downloads.php');
|
|
|
|
|
68 |
include_once(WPH_PATH . 'compatibility/fusion-builder.php');
|
|
|
|
|
69 |
include_once(WPH_PATH . 'compatibility/fusion-builder.php');
|
|
|
|
|
70 |
include_once(WPH_PATH . 'compatibility/cache-enabler.php');
|
|
|
|
|
71 |
include_once(WPH_PATH . 'compatibility/wp-smush.php');
|
|
|
|
|
72 |
include_once(WPH_PATH . 'compatibility/shortpixel-image-optimiser.php');
|
|
|
|
|
73 |
include_once(WPH_PATH . 'compatibility/fluentform.php');
|
|
|
|
|
74 |
include_once(WPH_PATH . 'compatibility/ultimate-member.php');
|
|
|
|
|
75 |
include_once(WPH_PATH . 'compatibility/swift-performance.php');
|
|
|
|
|
76 |
include_once(WPH_PATH . 'compatibility/fast-velocity-minfy.php');
|
|
|
|
|
77 |
include_once(WPH_PATH . 'compatibility/litespeed-cache.php');
|
|
|
|
|
78 |
include_once(WPH_PATH . 'compatibility/wp-speed-of-light.php');
|
|
|
|
|
79 |
include_once(WPH_PATH . 'compatibility/wp-job-manager.php');
|
|
|
|
|
80 |
include_once(WPH_PATH . 'compatibility/jobboardwp.php');
|
|
|
|
|
81 |
include_once(WPH_PATH . 'compatibility/wp-optimize.php');
|
|
|
|
|
82 |
include_once(WPH_PATH . 'compatibility/hyper-cache.php');
|
|
|
83 |
include_once(WPH_PATH . 'compatibility/wp-asset-clean-up.php');
|
|
|
84 |
include_once(WPH_PATH . 'compatibility/wepos.php');
|
|
|
85 |
include_once(WPH_PATH . 'compatibility/oxygen.php');
|
86 |
+
include_once(WPH_PATH . 'compatibility/translatepress-multilingual.php');
|
87 |
|
88 |
/**
|
89 |
* Themes
|
include/functions.class.php
CHANGED
@@ -928,7 +928,7 @@
|
|
928 |
function show_recovery()
|
929 |
{
|
930 |
?>
|
931 |
-
<p class="important framed"><span class="dashicons dashicons-warning important" alt="f534"></span> <?php _e('Copy the following link to a safe place. You can use it later to reset all plugin options if something goes wrong or lost the new login URL.', 'wp-hide-security-enhancer') ?> <b><span id="wph-recovery-link" onClick="WPH.selectText( 'wph-recovery-link' )"><?php echo
|
932 |
<?php
|
933 |
|
934 |
}
|
@@ -1024,7 +1024,7 @@
|
|
1024 |
if( ! isset( $this->wph->settings['write_check_string'] ) || empty( $this->wph->settings['write_check_string'] ) )
|
1025 |
return TRUE;
|
1026 |
|
1027 |
-
$test_url = apply_filters( 'wp-hide/test_sample_rewrite/url', trailingslashit (
|
1028 |
$response = wp_remote_get( $test_url );
|
1029 |
|
1030 |
$response_message = '';
|
@@ -1142,7 +1142,7 @@
|
|
1142 |
|
1143 |
$markerdata = explode( "\n", implode( '', file( $file_path ) ) );
|
1144 |
|
1145 |
-
if (
|
1146 |
return FALSE;
|
1147 |
|
1148 |
foreach ( $markerdata as $markerline )
|
@@ -1994,7 +1994,7 @@
|
|
1994 |
$to = get_option('admin_email');
|
1995 |
$subject = get_option('blogname') . ' - WP Hide Recovery Link';
|
1996 |
$message = __('Hello', 'wp-hide-security-enhancer') . ", \n\n"
|
1997 |
-
. __('This is an automated message to inform that you can always use a recovery link if something go wrong', 'wp-hide-security-enhancer') . ": " .
|
1998 |
. __('Please keep this url to a safe place.', 'wp-hide-security-enhancer') . ".";
|
1999 |
$headers = 'From: '. get_option('blogname') .' <'. get_option('admin_email') .'>' . "\r\n";
|
2000 |
|
@@ -2013,7 +2013,7 @@
|
|
2013 |
function do_recovery()
|
2014 |
{
|
2015 |
//prevent hammering
|
2016 |
-
sleep(
|
2017 |
|
2018 |
//feetch a new set of settings
|
2019 |
$settings = $this->get_settings();
|
@@ -2075,12 +2075,56 @@
|
|
2075 |
/** WordPress Administration File API */
|
2076 |
require_once(ABSPATH . 'wp-admin/includes/file.php');
|
2077 |
|
2078 |
-
flush_rewrite_rules();
|
2079 |
|
2080 |
-
|
2081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2082 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2083 |
die();
|
|
|
2084 |
}
|
2085 |
|
2086 |
/**
|
928 |
function show_recovery()
|
929 |
{
|
930 |
?>
|
931 |
+
<p class="important framed"><span class="dashicons dashicons-warning important" alt="f534"></span> <?php _e('Copy the following link to a safe place. You can use it later to reset all plugin options if something goes wrong or lost the new login URL.', 'wp-hide-security-enhancer') ?> <b><span id="wph-recovery-link" onClick="WPH.selectText( 'wph-recovery-link' )"><?php echo trailingslashit ( home_url() ) ?>?wph-recovery=<?php echo $this->get_recovery_code() ?></span></b></p>
|
932 |
<?php
|
933 |
|
934 |
}
|
1024 |
if( ! isset( $this->wph->settings['write_check_string'] ) || empty( $this->wph->settings['write_check_string'] ) )
|
1025 |
return TRUE;
|
1026 |
|
1027 |
+
$test_url = apply_filters( 'wp-hide/test_sample_rewrite/url', trailingslashit ( home_url() ) . 'rewrite_test_' . $this->wph->settings['write_check_string'] . '/' );
|
1028 |
$response = wp_remote_get( $test_url );
|
1029 |
|
1030 |
$response_message = '';
|
1142 |
|
1143 |
$markerdata = explode( "\n", implode( '', file( $file_path ) ) );
|
1144 |
|
1145 |
+
if ( empty ( $markerdata ) )
|
1146 |
return FALSE;
|
1147 |
|
1148 |
foreach ( $markerdata as $markerline )
|
1994 |
$to = get_option('admin_email');
|
1995 |
$subject = get_option('blogname') . ' - WP Hide Recovery Link';
|
1996 |
$message = __('Hello', 'wp-hide-security-enhancer') . ", \n\n"
|
1997 |
+
. __('This is an automated message to inform that you can always use a recovery link if something go wrong', 'wp-hide-security-enhancer') . ": " . home_url() . '?wph-recovery='. $this->get_recovery_code() . "\n\n"
|
1998 |
. __('Please keep this url to a safe place.', 'wp-hide-security-enhancer') . ".";
|
1999 |
$headers = 'From: '. get_option('blogname') .' <'. get_option('admin_email') .'>' . "\r\n";
|
2000 |
|
2013 |
function do_recovery()
|
2014 |
{
|
2015 |
//prevent hammering
|
2016 |
+
sleep(2);
|
2017 |
|
2018 |
//feetch a new set of settings
|
2019 |
$settings = $this->get_settings();
|
2075 |
/** WordPress Administration File API */
|
2076 |
require_once(ABSPATH . 'wp-admin/includes/file.php');
|
2077 |
|
2078 |
+
flush_rewrite_rules();
|
2079 |
|
2080 |
+
delete_option( 'wph-previous-login-url' );
|
2081 |
+
|
2082 |
+
?><!DOCTYPE html>
|
2083 |
+
<html lang="en-US">
|
2084 |
+
<head>
|
2085 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
2086 |
+
<meta name="viewport" content="width=device-width">
|
2087 |
+
<meta name='robots' content='noindex,follow' />
|
2088 |
+
<title>WP-Hide - Recovery</title>
|
2089 |
+
<style type="text/css">
|
2090 |
+
html{background:#f1f1f1}body{background:#fff;color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;margin:2em auto;padding:1em 2em;max-width:700px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13)}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font-size:24px;margin:30px 0 0 0;padding:0;padding-bottom:7px}#error-page{margin-top:50px}#error-page .wp-die-message,#error-page p{font-size:14px;line-height:1.5;margin:25px 0 20px}#error-page code{font-family:Consolas,Monaco,monospace}ul li{margin-bottom:10px;font-size:14px}a{color:#0073aa}a:active,a:hover{color:#006799}a:focus{color:#124964;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:0}.button{background:#f7f7f7;border:1px solid #ccc;color:#555;display:inline-block;text-decoration:none;font-size:13px;line-height:2;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 0 #ccc;box-shadow:0 1px 0 #ccc;vertical-align:top}.button.button-large{height:30px;line-height:2.15384615;padding:0 12px 2px}.button:focus,.button:hover{background:#fafafa;border-color:#999;color:#23282d}.button:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 3px rgba(0,115,170,.8);box-shadow:0 0 3px rgba(0,115,170,.8);outline:0}.button:active{background:#eee;border-color:#999;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}
|
2091 |
+
</style>
|
2092 |
+
</head>
|
2093 |
+
<body>
|
2094 |
+
|
2095 |
+
<h1>WP-Hide - <?php _e('Recovery', 'wp-hide-security-enhancer') ?></h1>
|
2096 |
+
<p><b><?php _e('The plugin options have been reset successfully.', 'wp-hide-security-enhancer') ?></b></p>
|
2097 |
+
<br />
|
2098 |
+
<?php
|
2099 |
+
|
2100 |
+
if ( $this->wph->server_htaccess_config === TRUE )
|
2101 |
+
{
|
2102 |
+
?>
|
2103 |
+
<p><?php _e('Ensure the .htaccess file does not contain any WP-Hide rewrite lines. The plugin already attempts to clear the lines, if the operation fails, they are required to be removed manually. ', 'wp-hide-security-enhancer') ?></p>
|
2104 |
+
<?php
|
2105 |
+
}
|
2106 |
+
|
2107 |
+
if ( $this->wph->server_web_config === TRUE )
|
2108 |
+
{
|
2109 |
+
?>
|
2110 |
+
<p><?php _e('Ensure the web.config file does not contain any WP-Hide rewrite lines. The plugin already attempts to clear the lines, if the operation fails, they are required to be removed manually. ', 'wp-hide-security-enhancer') ?></p>
|
2111 |
+
<?php
|
2112 |
+
}
|
2113 |
+
|
2114 |
+
?>
|
2115 |
+
|
2116 |
+
<p><br /></p>
|
2117 |
+
<p><a class="button" href="<?php echo get_site_url() ?>"><?php _e('Continue to your Site', 'wp-hide-security-enhancer') ?></a></p>
|
2118 |
+
|
2119 |
|
2120 |
+
</body>
|
2121 |
+
</html>
|
2122 |
+
<?php
|
2123 |
+
|
2124 |
+
wp_logout();
|
2125 |
+
|
2126 |
die();
|
2127 |
+
|
2128 |
}
|
2129 |
|
2130 |
/**
|
include/wph.class.php
CHANGED
@@ -1418,7 +1418,7 @@
|
|
1418 |
if($screen->base != "options-permalink")
|
1419 |
return;
|
1420 |
|
1421 |
-
//recheck if the permalinks
|
1422 |
$this->custom_permalinks_applied = $this->functions->rewrite_rules_applied();
|
1423 |
|
1424 |
//ignore if permalinks are available
|
@@ -1431,7 +1431,7 @@
|
|
1431 |
{
|
1432 |
$new_admin_url = $this->functions->get_module_item_setting('admin_url' , 'admin');
|
1433 |
if(!empty($new_admin_url))
|
1434 |
-
$new_location = trailingslashit(
|
1435 |
}
|
1436 |
|
1437 |
$new_location .= '?settings-updated=true';
|
@@ -1507,7 +1507,7 @@
|
|
1507 |
* @param mixed $meta_value
|
1508 |
* @param mixed $prev_value
|
1509 |
*/
|
1510 |
-
function update_post_metadata ( $check, $object_id, $meta_key, $meta_value, $prev_value)
|
1511 |
{
|
1512 |
global $wpdb;
|
1513 |
|
@@ -1544,14 +1544,16 @@
|
|
1544 |
$passed_value = wp_slash($meta_value);
|
1545 |
|
1546 |
// Compare existing value to new value if no prev value given and the key exists only once.
|
1547 |
-
if ( empty( $prev_value ) )
|
1548 |
-
|
1549 |
-
|
1550 |
-
if ( $old_value
|
1551 |
-
|
1552 |
-
|
|
|
|
|
|
|
1553 |
}
|
1554 |
-
}
|
1555 |
|
1556 |
|
1557 |
$meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) );
|
1418 |
if($screen->base != "options-permalink")
|
1419 |
return;
|
1420 |
|
1421 |
+
//recheck if the permalinks were sucesfully saved
|
1422 |
$this->custom_permalinks_applied = $this->functions->rewrite_rules_applied();
|
1423 |
|
1424 |
//ignore if permalinks are available
|
1431 |
{
|
1432 |
$new_admin_url = $this->functions->get_module_item_setting('admin_url' , 'admin');
|
1433 |
if(!empty($new_admin_url))
|
1434 |
+
$new_location = trailingslashit( home_url() ) . $new_admin_url . "/options-permalink.php";
|
1435 |
}
|
1436 |
|
1437 |
$new_location .= '?settings-updated=true';
|
1507 |
* @param mixed $meta_value
|
1508 |
* @param mixed $prev_value
|
1509 |
*/
|
1510 |
+
function update_post_metadata ( $check, $object_id, $meta_key, $meta_value, $prev_value )
|
1511 |
{
|
1512 |
global $wpdb;
|
1513 |
|
1544 |
$passed_value = wp_slash($meta_value);
|
1545 |
|
1546 |
// Compare existing value to new value if no prev value given and the key exists only once.
|
1547 |
+
if ( empty( $prev_value ) )
|
1548 |
+
{
|
1549 |
+
$old_value = get_metadata_raw( $meta_type, $object_id, $meta_key );
|
1550 |
+
if ( is_countable( $old_value ) && count( $old_value ) === 1 )
|
1551 |
+
{
|
1552 |
+
if ( $old_value[0] === $meta_value ) {
|
1553 |
+
return false;
|
1554 |
+
}
|
1555 |
+
}
|
1556 |
}
|
|
|
1557 |
|
1558 |
|
1559 |
$meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) );
|
modules/components/admin-new_wp_login_php.php
CHANGED
@@ -82,9 +82,10 @@
|
|
82 |
{
|
83 |
//check if the value has changed, e-mail the new url to site administrator
|
84 |
$previous_url = get_option('wph-previous-login-url');
|
85 |
-
if($saved_field_data != $previous_url)
|
86 |
{
|
87 |
-
|
|
|
88 |
update_option('wph-previous-login-url', $saved_field_data);
|
89 |
}
|
90 |
|
@@ -99,28 +100,26 @@
|
|
99 |
|
100 |
}
|
101 |
|
102 |
-
|
103 |
-
function
|
104 |
{
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
$to = get_option('admin_email');
|
109 |
-
$subject =
|
110 |
$message = __('Hello', 'wp-hide-security-enhancer') . ", \n\n"
|
111 |
-
. __('This is an automated message to inform that your login url has been changed at
|
112 |
-
. __('The new login url is', 'wp-hide-security-enhancer') . ": " .
|
113 |
-
. __('Additionality you can use the
|
114 |
-
. __('Please keep this url
|
115 |
-
$headers = 'From: '. get_option('blogname') .' <'. get_option('admin_email') .'>' . "\r\n";
|
116 |
|
117 |
if ( ! function_exists( 'wp_mail' ) )
|
118 |
require_once ABSPATH . WPINC . '/pluggable.php';
|
119 |
-
|
120 |
-
wp_mail( $to, $subject, $message, $headers );
|
121 |
}
|
122 |
|
123 |
-
|
124 |
function login_url($login_url, $redirect, $force_reauth)
|
125 |
{
|
126 |
$new_wp_login_php = $this->wph->functions->get_module_item_setting('new_wp_login_php');
|
82 |
{
|
83 |
//check if the value has changed, e-mail the new url to site administrator
|
84 |
$previous_url = get_option('wph-previous-login-url');
|
85 |
+
if( $saved_field_data != $previous_url )
|
86 |
{
|
87 |
+
//$this->new_login_email_notice($saved_field_data);
|
88 |
+
add_action( 'shutdown', array ( __CLASS__, 'new_url_email_notice') );
|
89 |
update_option('wph-previous-login-url', $saved_field_data);
|
90 |
}
|
91 |
|
100 |
|
101 |
}
|
102 |
|
103 |
+
|
104 |
+
static public function new_url_email_notice()
|
105 |
{
|
106 |
+
global $wph;
|
107 |
+
|
|
|
108 |
$to = get_option('admin_email');
|
109 |
+
$subject = 'New Login Url for your WordPress - ' .get_option('blogname');
|
110 |
$message = __('Hello', 'wp-hide-security-enhancer') . ", \n\n"
|
111 |
+
. __('This is an automated message to inform that your login url has been changed at', 'wp-hide-security-enhancer') . " " . trailingslashit( home_url() ) . "\n"
|
112 |
+
. __('The new login url is', 'wp-hide-security-enhancer') . ": " . wp_login_url() . "\n\n"
|
113 |
+
. __('Additionality you can use this to recover the default login / admin links ', 'wp-hide-security-enhancer') . ": " . trailingslashit ( home_url() ) . '?wph-recovery='. $wph->functions->get_recovery_code() . "\n\n"
|
114 |
+
. __('Please keep this url safe for recover, if forgot', 'wp-hide-security-enhancer') . ".";
|
115 |
+
$headers = 'From: '. get_option('blogname') .' <'. get_option('admin_email') .'>' . "\r\n";
|
116 |
|
117 |
if ( ! function_exists( 'wp_mail' ) )
|
118 |
require_once ABSPATH . WPINC . '/pluggable.php';
|
119 |
+
|
120 |
+
wp_mail( $to, $subject, $message, $headers );
|
121 |
}
|
122 |
|
|
|
123 |
function login_url($login_url, $redirect, $force_reauth)
|
124 |
{
|
125 |
$new_wp_login_php = $this->wph->functions->get_module_item_setting('new_wp_login_php');
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.nsp-code.com/
|
|
4 |
Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, wp-admin, admin hide, login change,
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 5.7
|
7 |
-
Stable tag: 1.6.3.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Hide WordPress default paths, wp-content, wp-includes, wp-admin, login URL, plugins, themes etc. Block the defaults for being still accessible. No files and data are changed on your server.
|
@@ -328,7 +328,7 @@ The error appear when the plugin is not able to write to .htaccess file located
|
|
328 |
|
329 |
= Something is wrong, what can I do? How can I recover my site? =
|
330 |
|
331 |
-
*
|
332 |
* Go to admin and change some of the plugin options to see which one causes the problem. Then report it to the forum or get in touch with us to fix it.
|
333 |
* If you can't log in to admin, use the Recovery Link which has been sent to your e-mail. This will reset the login to default.
|
334 |
* If you can't find the recovery link or none of the above worked, delete the plugin from your wp-content/plugins directory. Then remove any lines in your .htaccess file between
|
@@ -338,6 +338,12 @@ The error appear when the plugin is not able to write to .htaccess file located
|
|
338 |
|
339 |
* At this point, the site should run as before. If for some reason still not working, you missed something, please get in touch with us at contact@wp-hide.com and we'll fix it for you in no time!
|
340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
= I can't find a functionality that i'am looking for =
|
342 |
|
343 |
Please get in touch with us and we'll do our best to include it for a next version.
|
@@ -349,6 +355,15 @@ Please get in touch with us and we'll do our best to include it for a next versi
|
|
349 |
|
350 |
== Changelog ==
|
351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
= 1.6.3.1 =
|
353 |
* Improved description for Test Rewrite procedure, when the server fails to provide a valid response, rewrite engine is not active or the custom urls are not allowd.
|
354 |
* Fixed Undefined Property Notice
|
4 |
Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, wp-admin, admin hide, login change,
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 5.7
|
7 |
+
Stable tag: 1.6.3.2
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Hide WordPress default paths, wp-content, wp-includes, wp-admin, login URL, plugins, themes etc. Block the defaults for being still accessible. No files and data are changed on your server.
|
328 |
|
329 |
= Something is wrong, what can I do? How can I recover my site? =
|
330 |
|
331 |
+
* There will be no harm.
|
332 |
* Go to admin and change some of the plugin options to see which one causes the problem. Then report it to the forum or get in touch with us to fix it.
|
333 |
* If you can't log in to admin, use the Recovery Link which has been sent to your e-mail. This will reset the login to default.
|
334 |
* If you can't find the recovery link or none of the above worked, delete the plugin from your wp-content/plugins directory. Then remove any lines in your .htaccess file between
|
338 |
|
339 |
* At this point, the site should run as before. If for some reason still not working, you missed something, please get in touch with us at contact@wp-hide.com and we'll fix it for you in no time!
|
340 |
|
341 |
+
= How to use the Recovery Link =
|
342 |
+
|
343 |
+
The Recovery Link can be used to reset all plugin options and restore the site to the default state.
|
344 |
+
The link should be entered into the browser URL bar. After the operation is completed, a system message will show "The plugin options have been reset successfully".
|
345 |
+
If the message does not show, there is a cache on your site that prevents the code to run. Locate your cache data, usually at /wp-content/cache/ and remove the files. Then re-load the recovery link.
|
346 |
+
|
347 |
= I can't find a functionality that i'am looking for =
|
348 |
|
349 |
Please get in touch with us and we'll do our best to include it for a next version.
|
355 |
|
356 |
== Changelog ==
|
357 |
|
358 |
+
= 1.6.3.2 =
|
359 |
+
* Confirmation page for Recovery link
|
360 |
+
* Use home_url() instead site_url() for recovery links to ensure the format is correct for WordPress instances using own directory
|
361 |
+
* Trigger the login URL change e-mail at shutdown instead init
|
362 |
+
* Compatibility with TranslatePress - Multilingual
|
363 |
+
* Fix undefined notice
|
364 |
+
* Fix meta Uncaught TypeError: count(): Argument
|
365 |
+
* Slight code improvements
|
366 |
+
|
367 |
= 1.6.3.1 =
|
368 |
* Improved description for Test Rewrite procedure, when the server fails to provide a valid response, rewrite engine is not active or the custom urls are not allowd.
|
369 |
* Fixed Undefined Property Notice
|
wp-hide.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.wp-hide.com/
|
|
5 |
Description: Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
|
6 |
Author: Nsp Code
|
7 |
Author URI: http://www.nsp-code.com
|
8 |
-
Version: 1.6.3.
|
9 |
Text Domain: wp-hide-security-enhancer
|
10 |
Domain Path: /languages/
|
11 |
*/
|
@@ -79,6 +79,8 @@ Domain Path: /languages/
|
|
79 |
//replace the mu-loader
|
80 |
WPH_functions::unlink_mu_loader();
|
81 |
|
|
|
|
|
82 |
}
|
83 |
|
84 |
?>
|
5 |
Description: Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
|
6 |
Author: Nsp Code
|
7 |
Author URI: http://www.nsp-code.com
|
8 |
+
Version: 1.6.3.2
|
9 |
Text Domain: wp-hide-security-enhancer
|
10 |
Domain Path: /languages/
|
11 |
*/
|
79 |
//replace the mu-loader
|
80 |
WPH_functions::unlink_mu_loader();
|
81 |
|
82 |
+
delete_option( 'wph-previous-login-url' );
|
83 |
+
|
84 |
}
|
85 |
|
86 |
?>
|