ld be set. * * @param string $mask_url The Mask URL slug. * * @return bool * @since 3.12.0 */ public function is_set_locale( string $mask_url ): bool { return $this->is_land_on_masked_url( $mask_url ) && ! empty( defender_get_data_from_request( 'wp_lang', 'g' ) ); } /** * Set locale on Mask Login page. * * @return void * @since 3.12.0 */ public function set_locale(): void { $wp_lang = defender_get_data_from_request( 'wp_lang', 'g' ); if ( ! empty( $wp_lang ) ) { switch_to_locale( $wp_lang ); } } /** * Check if this is a login page. * * @return bool * @since 4.1.0 */ public function is_login_url(): bool { $is_login_path = wp_parse_url( wp_login_url(), PHP_URL_PATH ); $requested_path = $this->get_request_path(); return trim( $requested_path, '/' ) === trim( $is_login_path, '/' ); } /** * Provides the login URL, which might be masked if the feature is active. * * @return string The login URL, potentially masked. */ public static function maybe_masked_login_url(): string { $settings = wd_di()->get( \WP_Defender\Model\Setting\Mask_Login::class ); if ( $settings->is_active() ) { return $settings->get_new_login_url(); } else { return wp_login_url(); } } /** * Is user hit the recovery link? * * @return bool */ public function is_recovery_mode(): bool { return WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTER === defender_get_data_from_request( 'action', 'r' ); } }