• Resolved nadworks

    (@nadworks)


    It appears that if a site uses a custom login URL instead of the default /wp-admin, the plugin is not working. That’s too bad.

    We have the plugin installed and even though the “Send me the login link” button appears below the WordPress login form, when clicked, it takes us to 404 error unless we deactivate our custom login URL.

    Bit inflexible, maybe?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @nadworks,

    Which plugin do you use to customize login URLs? For example if your need login url is custom-login.php, you can customize something like this:

    add_filter('site_url', function ($url, $path, $scheme) {
        // Check if the path starts with wp-login.php
        if (strpos($path, 'wp-login.php') === 0) {
            // Replace wp-login.php with custom-login.php in the URL
            $url = str_replace('wp-login.php', 'custom-login.php', $url);
        }
        return $url;
    }, 10, 3);

    Could you give it a try to this snippet and let me know if it works for you?

    Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @nadworks,

    I’m marking this thread as resolved. If the issue persists, don’t hesitate to let me know.

    Thread Starter nadworks

    (@nadworks)

    Hi Mustafa, thanks. But that doesn’t seem to work.
    We are using Admin and Site Enhancements (ASE) and – let’s say – our login URL is mydomain.com/xyz.

    If we set /xyz to replace /wp-admin, the Magic Login doesn’t work. Happy to try an alternative snippet, if you can help.

    Plugin Author Mustafa Uysal

    (@m_uysl)

    @nadworks update the latest version of the plugin (added a new filter in this version)

    and you can use something like this: (update the xyz with the actual slug that you are using for login url)

    add_filter( 'magic_login_get_wp_login_url', function ( $login_url ) {
        $login_url = site_url( '/wp-login.php?xyz&redirect=false&action=magic_login' );
        return $login_url;
    } );

    I hope this helps!

    Thread Starter nadworks

    (@nadworks)

    Thanks, I’ll give this a shot.
    Taking that custom login links are pretty common as far as we can see from working on numerous 3rd party client websites, it might be an idea to somehow incorporate this scenario into your plugin by default, maybe? Would be a great addition and increase flexibility.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.