Version Description
- Add filter to redirect in cases where the user is already logged in.
- Fix : add rawurldecode for all $_SERVER'REQUEST_URI'
Download this release
Release Info
Developer | NicolasKulka |
Plugin | WPS Hide Login |
Version | 1.5.5 |
Comparing to | |
See all releases |
Code changes from version 1.5.4.2 to 1.5.5
- classes/plugin.php +22 -9
- readme.txt +6 -2
- wps-hide-login.php +2 -2
classes/plugin.php
CHANGED
@@ -140,13 +140,15 @@ class Plugin {
|
|
140 |
|
141 |
public function new_login_url( $scheme = null ) {
|
142 |
|
|
|
|
|
143 |
if ( get_option( 'permalink_structure' ) ) {
|
144 |
|
145 |
-
return $this->user_trailingslashit(
|
146 |
|
147 |
} else {
|
148 |
|
149 |
-
return
|
150 |
|
151 |
}
|
152 |
|
@@ -426,14 +428,14 @@ class Plugin {
|
|
426 |
global $pagenow;
|
427 |
|
428 |
if ( ! is_multisite()
|
429 |
-
&& ( strpos( $_SERVER['REQUEST_URI'], 'wp-signup' ) !== false
|
430 |
-
|| strpos( $_SERVER['REQUEST_URI'], 'wp-activate' ) !== false ) && apply_filters( 'wps_hide_login_signup_enable', false ) === false ) {
|
431 |
|
432 |
wp_die( __( 'This feature is not enabled.', 'wpserveur-hide-login' ) );
|
433 |
|
434 |
}
|
435 |
|
436 |
-
$request = parse_url( $_SERVER['REQUEST_URI'] );
|
437 |
|
438 |
if ( ( strpos( rawurldecode( $_SERVER['REQUEST_URI'] ), 'wp-login.php' ) !== false
|
439 |
|| ( isset( $request['path'] ) && untrailingslashit( $request['path'] ) === site_url( 'wp-login', 'relative' ) ) )
|
@@ -477,7 +479,7 @@ class Plugin {
|
|
477 |
|
478 |
global $pagenow;
|
479 |
|
480 |
-
$request = parse_url( $_SERVER['REQUEST_URI'] );
|
481 |
|
482 |
if ( ! isset( $_POST['post_password'] ) ) {
|
483 |
|
@@ -526,9 +528,20 @@ class Plugin {
|
|
526 |
} elseif ( $pagenow === 'wp-login.php' ) {
|
527 |
global $error, $interim_login, $action, $user_login;
|
528 |
|
529 |
-
|
530 |
-
|
531 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
532 |
}
|
533 |
|
534 |
@require_once ABSPATH . 'wp-login.php';
|
140 |
|
141 |
public function new_login_url( $scheme = null ) {
|
142 |
|
143 |
+
$url = apply_filters( 'wps_hide_login_home_url', home_url( '/', $scheme ) );
|
144 |
+
|
145 |
if ( get_option( 'permalink_structure' ) ) {
|
146 |
|
147 |
+
return $this->user_trailingslashit( $url . $this->new_login_slug() );
|
148 |
|
149 |
} else {
|
150 |
|
151 |
+
return $url . '?' . $this->new_login_slug();
|
152 |
|
153 |
}
|
154 |
|
428 |
global $pagenow;
|
429 |
|
430 |
if ( ! is_multisite()
|
431 |
+
&& ( strpos( rawurldecode( $_SERVER['REQUEST_URI'] ) , 'wp-signup' ) !== false
|
432 |
+
|| strpos( rawurldecode( $_SERVER['REQUEST_URI'] ), 'wp-activate' ) !== false ) && apply_filters( 'wps_hide_login_signup_enable', false ) === false ) {
|
433 |
|
434 |
wp_die( __( 'This feature is not enabled.', 'wpserveur-hide-login' ) );
|
435 |
|
436 |
}
|
437 |
|
438 |
+
$request = parse_url( rawurldecode( $_SERVER['REQUEST_URI'] ) );
|
439 |
|
440 |
if ( ( strpos( rawurldecode( $_SERVER['REQUEST_URI'] ), 'wp-login.php' ) !== false
|
441 |
|| ( isset( $request['path'] ) && untrailingslashit( $request['path'] ) === site_url( 'wp-login', 'relative' ) ) )
|
479 |
|
480 |
global $pagenow;
|
481 |
|
482 |
+
$request = parse_url( rawurldecode( $_SERVER['REQUEST_URI'] ) );
|
483 |
|
484 |
if ( ! isset( $_POST['post_password'] ) ) {
|
485 |
|
528 |
} elseif ( $pagenow === 'wp-login.php' ) {
|
529 |
global $error, $interim_login, $action, $user_login;
|
530 |
|
531 |
+
$redirect_to = admin_url();
|
532 |
+
|
533 |
+
$requested_redirect_to = '';
|
534 |
+
if ( isset( $_REQUEST['redirect_to'] ) ) {
|
535 |
+
$requested_redirect_to = $_REQUEST['redirect_to'];
|
536 |
+
}
|
537 |
+
|
538 |
+
if ( is_user_logged_in() ) {
|
539 |
+
$user = wp_get_current_user();
|
540 |
+
if ( ! isset( $_REQUEST['action'] ) ) {
|
541 |
+
$logged_in_redirect = apply_filters( 'whl_logged_in_redirect', $redirect_to, $requested_redirect_to, $user );
|
542 |
+
wp_safe_redirect( $logged_in_redirect );
|
543 |
+
die();
|
544 |
+
}
|
545 |
}
|
546 |
|
547 |
@require_once ABSPATH . 'wp-login.php';
|
readme.txt
CHANGED
@@ -4,9 +4,9 @@ Contributors: tabrisrp, WPServeur, nicolaskulka
|
|
4 |
Donate link : https://www.paypal.me/donateWPServeur
|
5 |
Tags: rename, login, wp-login, wp-login.php, custom login url, jetpack, wpserveur
|
6 |
Requires at least: 4.1
|
7 |
-
Tested up to: 5.
|
8 |
Requires PHP: 7.0
|
9 |
-
Stable tag: 1.5.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -146,6 +146,10 @@ La première étape consiste à vérifier votre fichier .htaccess et à le compa
|
|
146 |
|
147 |
== Changelog ==
|
148 |
|
|
|
|
|
|
|
|
|
149 |
= 1.5.4.2 =
|
150 |
* Revert to code in tag 1.5.3
|
151 |
|
4 |
Donate link : https://www.paypal.me/donateWPServeur
|
5 |
Tags: rename, login, wp-login, wp-login.php, custom login url, jetpack, wpserveur
|
6 |
Requires at least: 4.1
|
7 |
+
Tested up to: 5.3
|
8 |
Requires PHP: 7.0
|
9 |
+
Stable tag: 1.5.5
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
146 |
|
147 |
== Changelog ==
|
148 |
|
149 |
+
= 1.5.5 =
|
150 |
+
* Add filter to redirect in cases where the user is already logged in.
|
151 |
+
* Fix : add rawurldecode for all $_SERVER['REQUEST_URI'] (Thanks NinTechNet)
|
152 |
+
|
153 |
= 1.5.4.2 =
|
154 |
* Revert to code in tag 1.5.3
|
155 |
|
wps-hide-login.php
CHANGED
@@ -5,7 +5,7 @@ Description: Protect your website by changing the login URL and preventing acces
|
|
5 |
Donate link: https://www.paypal.me/donateWPServeur
|
6 |
Author: WPServeur, NicolasKulka, tabrisrp
|
7 |
Author URI: https://wpserveur.net
|
8 |
-
Version: 1.5.
|
9 |
Requires at least: 4.1
|
10 |
Tested up to: 5.2
|
11 |
Requires PHP: 7.0
|
@@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
21 |
}
|
22 |
|
23 |
// Plugin constants
|
24 |
-
define( 'WPS_HIDE_LOGIN_VERSION', '1.5.
|
25 |
define( 'WPS_HIDE_LOGIN_FOLDER', 'wps-hide-login' );
|
26 |
|
27 |
define( 'WPS_HIDE_LOGIN_URL', plugin_dir_url( __FILE__ ) );
|
5 |
Donate link: https://www.paypal.me/donateWPServeur
|
6 |
Author: WPServeur, NicolasKulka, tabrisrp
|
7 |
Author URI: https://wpserveur.net
|
8 |
+
Version: 1.5.5
|
9 |
Requires at least: 4.1
|
10 |
Tested up to: 5.2
|
11 |
Requires PHP: 7.0
|
21 |
}
|
22 |
|
23 |
// Plugin constants
|
24 |
+
define( 'WPS_HIDE_LOGIN_VERSION', '1.5.5' );
|
25 |
define( 'WPS_HIDE_LOGIN_FOLDER', 'wps-hide-login' );
|
26 |
|
27 |
define( 'WPS_HIDE_LOGIN_URL', plugin_dir_url( __FILE__ ) );
|