Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion includes/class-ayecode-connect-turnstile.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private function init_hooks() {
} else if ( $pagenow && in_array( $pagenow, array(
'wp-login.php',
'wp-register.php'
) ) ) { // @todo test on sub domain install
) ) || $this->is_wps_login_page() ) { // @todo test on sub domain install
add_action( 'login_footer', array( $this, 'add_lazy_load_script' ) );
add_action( 'login_footer', array( $this, 'adjust_login_form_size_css' ) );
} else {
Expand Down Expand Up @@ -976,6 +976,48 @@ public function verify_turnstile_keys() {

wp_die();
}

/**
* Check WPS Hide Login page.
*
* @since 1.4.10
*
* @return bool True when WPS login page, else False.
*/
public function is_wps_login_page() {
if ( is_login() ) {
return true;
}

if ( ! defined( 'WPS_HIDE_LOGIN_BASENAME' ) ) {
return false;
}

if ( $slug = get_option( 'whl_page' ) ) {
$login_slug = $slug;
} else if ( ( is_multisite() && is_plugin_active_for_network( WPS_HIDE_LOGIN_BASENAME ) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
$login_slug = $slug;
} else if ( ! empty( $slug ) && $slug = 'login' ) {
$login_slug = $slug;
} else {
return false;
}

$request_uri = ! empty( $_SERVER['REQUEST_URI'] ) ? rawurldecode( $_SERVER['REQUEST_URI'] ) : '';

if ( $request_uri && strpos( $request_uri, $login_slug ) !== false ) {
$current_parse_url = parse_url( $request_uri );
$login_parse_url = parse_url( site_url( $login_slug, 'relative' ) );
$current_path = ! empty( $current_parse_url['path'] ) ? trim( $current_parse_url['path'], "/" ) : '';
$login_path = ! empty( $login_parse_url['path'] ) ? trim( $login_parse_url['path'], "/" ) : '';

if ( $current_path && $current_path == $login_path ) {
return true;
}
}

return false;
}
}

// run
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ If your host runs "mod security" on your hosting and has some specific additiona

== Changelog ==

= 1.4.10 - 2025-08-TBD =
* Turnstile captcha is not working on WPS Hide Login page - FIXED

= 1.4.9 - 2025-08-07 =
* Site auto disconnected when url contains www. - FIXED
* Turnstile captcha support for UWP Mailerlite addon forms - ADDED
Expand Down