Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Site Reviews uses the wp_login_url and wp_registration_url WordPress functions to get the login and registration URL.

    This is what these functions are designed to do, and these URLs are part of the default WordPress installation.

    Changing the WordPress URLs is not something that is provided by WordPress by default, it is something that people use security plugins for. Woocommerce does not change these URLs for security, but rather for convenience.

    If you are using a plugin to change the login and registration URLs, then (if they are made correctly), they will use the login_url and register_url hooks to override the output of the wp_login_url and wp_registration_url functions. This is why WordPress provides those filter hooks.

    If the plugin does not make use of those filter hooks to change the default login and registrations URLs, then it may not be as secure as you think it is.

    Lastly, obfuscating login/registration URLs is not a foolproof way to protect your site, “security through obscurity” is always bad security! I say this also from experience.

    Instead, you probably should want to focus on using a two-factor authentication plugin, and a security plugin which throttles login attempts, and (optionally) limits the login page to a specific IP address.

    Again, if your plugin does not do so, you can use the login_url and register_url filter hooks yourself to override the output of the wp_login_url and wp_registration_url functions.

    Your suggestion to add a setting to choose where to redirect someone to login is still a good one though! I’ll add it to the roadmap.

    • This reply was modified 4 years, 5 months ago by Gemini Labs.
    Thread Starter romonoutic

    (@romonoutic)

    Thanks for your answer, but unfortunately none 2 factor authentication plugin will work, because your plugin will always be the priority over any other plugin.. I already tested 3 plugins and it’s always the same result.. and for this simple reason I cannot use your plugin.. even if I find very useful..

    So, please, I’ll really appreciate if you can notify me if one day you decide to add this new feature (field for adding customs links) to my email: [email protected]

    Thanks for your time,
    Regards,

    Plugin Author Gemini Labs

    (@geminilabs)

    Screenshot taken from the WordPress Handbook for the “login_url” hook (as provided above) https://developer.ww.wp.xz.cn/reference/hooks/login_url/

    Using that example, and assuming that your login page is: https://yourwebsite.com/my-account/

    function custom_wordpress_login_url($login_url, $redirect, $force_reauth) {
        $login_url = home_url('/my-account/');
        if (!empty($redirect)) {
            $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url);
        }
        if ($force_reauth) {
            $login_url = add_query_arg('reauth', '1', $login_url);
        }
        return $login_url;
    }
    
    add_filter('login_url', 'custom_wordpress_login_url', 10, 3);

    And the result:

    Thread Starter romonoutic

    (@romonoutic)

    Hi again, Thanks a lot for your reply and solution!
    Please find below my review to your service:

    https://ww.wp.xz.cn/support/topic/very-satisfied-129/#new-post

    Happy Holidays!
    Regards,

    Plugin Author Gemini Labs

    (@geminilabs)

    Thank you!

    FYI, in the next version:

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘wp-login.php redirection for ordinary users’ is closed to new replies.