WordPress.org

Ready to get started?Download WordPress

Forums

Rename wp-login.php
[resolved] plugin not working with front-end login (7 posts)

  1. katootje
    Member
    Posted 5 months ago #

    Hi,
    We were using the plugin with a front-end login. Everything was set NOT to get de default login page after filling in wrong credentials. But now after the update, people are redirected to the custom login page after giving no credentials or false credentials.Plugin is installed on a multisite with the members plugin active. Was working fine on the old version.
    We like to keep the people on the front-end.
    What can we do to get it as it were, without installing an older version of the plugin. How do we keep people on the front-end
    We have tried with making a loginform with custom coding and with the login widget which comes with the members plugin. I tried several codes to keep people front end but nothing is working.

    This is one of the snippets I used in my functions.php.
    It worked before, but isn't anymore:
    add_action( 'wp_login_failed', 'vvg_login_fail' ); // hook failed login
    function vvg_login_fail( $username ) {
    $referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from?
    // if there's a valid referrer, and it's not the default log-in screen
    if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
    wp_redirect(home_url() . '/?login=failed' ); // let's append some information (login=failed) to the URL for the theme to use
    exit;
    }
    }

    Hope you can help out.

    cheers

    Karin

    https://wordpress.org/plugins/rename-wp-login/

  2. Janneke Van Dorpe
    Member
    Plugin Author

    Posted 5 months ago #

    Which plugin is it? This one? http://wordpress.org/plugins/members/
    Let me know and I'll take a look at the code.

  3. katootje
    Member
    Posted 5 months ago #

    Yes, its the members plugin. We want to keep the visitors front-end - which was working fine before the update. I checked on a test-site.

    The first problem we had was with a custom login field in the page. The redirect wasn't working and we had to login twice... after entering the credentials frontend, we were redirect to the default loginpage and had to fill in our credentials again and ended in the backend.. On a test-site that was not happening anymore after deactivating the rename plugin.
    But that problem was solved by using the login widget.
    Now the only problem that's still there is the redirect to the default loginpage after entering false or no credentials. Which should be solved with the code mentioned above.
    Hope you can help out.

    Thanks

    Karin

  4. Janneke Van Dorpe
    Member
    Plugin Author

    Posted 5 months ago #

    Of course, we'll fix it. Let me check that plugin today and I'll get back to you.

  5. Janneke Van Dorpe
    Member
    Plugin Author

    Posted 5 months ago #

    I just installed the Members plugin, added the login widget and added the code you provided in your first post. If I log in on the front page, I'm redirected to the front page with /?login=failed added to the URL. So it seems to work as expected...

    Do you have any other plugins installed that might cause the problem?

  6. katootje
    Member
    Posted 5 months ago #

    It is a multisite installation.. will that be the problem? Or a htaccess setting?
    Plugins that could be intervering....
    Path Access (but not activated on this site
    Remove dashboard Access

    Can it be the redirect rules.. I have to say it's a windows server with iirf.ini instead of htaccess.. but that should work the same.

    I just entered the code above again in the functions.php and partly it's working now. If I enter wrong credentials I stay on the page (YEAH!) - but without any message... but that is more the problem of the code than it is your plugin ;)

    When I don't put any credentials.. I go to the default loginpage. Is that a lack in the above code? My coding is not so good. Just found it on internet and it was working. Didn't write it myself.

  7. Janneke Van Dorpe
    Member
    Plugin Author

    Posted 4 months ago #

    Did you figure out something in the end? Let me know if you're still having problems, and sorry for the late reply.

Reply

You must log in to post.

About this Plugin

About this Topic