Login-logout

Speedup WordPressLogin-logoutDonateGitHub

WordPress plugin: widget with login or logout link. It is the replacement of the default Meta widget.

"Login Logout" plugin add widget with login or logout link.

If user is not logged in there are two links:

  • login (after login action user will return to previous page);
  • register (if user can register) (if checkbox is active);

If user is logged in there are two links:

  • logout (after logout action user will return to previous page);
  • site admin (if checkbox is active);

Translation

  • Spanish translation made by Maria Ramos from WebHostingHub
  • Serbian translation made by Borisa Djuraskovic from WebHostingHub

If you need "login-logout" link you can use this code without the plugin:

<?php wp_loginout( get_permalink() ); ?>

If you need "register-admin" link you can use this code without the plugin:

<?php wp_register('', ''); ?>

121 thoughts on “Login-logout

  1. zippo

    Hi,
    I like ur plugin and already install it to my WP. Good if can do Login and register side by site. eg:

    Login | Register

    Can u do like above?

    Reply
    1. webster

      Yes, you can change display like this: "Login | Register"
      Just enable "[x]Inline (list or line of links);" option in the Login-logout widget options.

      Reply
  2. Greg

    Great plugin! However, I have a need that I don't see discussed. I have a members based site with public pages and private pages. If I send a link in an email to a member and if they then click on the link they are directed to a page to login. However, after logging into my site they are then directed to the page I set up in the widget.

    Is there a way to redirect them to the location they were originally trying to navigate to assuming a successful login?

    Thanks!

    Reply
    1. webster

      I think, this question is not connected to the Login-Logout plugin, because this plugin does not creates private pages and does not redirects users automatically.
      You should find a plugin on your site which redirects users from private pages to login page and add "redirect_to" param to redirect url like this:
      http://site.com/wp-login.php?redirect_to=http%3A%2F%site.com%2Fsample-page%2F
      After successful login user will return to the page, where "redirect_to" param is pointing to.
      The same mechanism works in Login-Logout plugin, you may check the code.

      Reply
  3. Blair MacIntyre

    Hi,

    I just found your plugin, thanks! I wanted exactly this: login/logout without all the meta stuff.

    I'm also using a plugin called SimpleModal Login, which pops up a login box, instead of sending you to the login page. To make it work with yours, all I need to do was insert:

    class="simplemodal-login"

    into the [a] link you create for Login, and

    class="simplemodal-register"

    for the register link. But, I don't want to have a modified version just for that. I wonder if you could add an option to the admin panel that either has a checkbox for "Using SimpleModal Login? "
    (and inserts these classes if so), or just lets us specify the class to use for the register and login (and I guess, logout) links?

    Thanks!

    Reply
    1. webster

      Wow, you did awesome trick. Thanks for great feedback.
      I am thinking about showing login-box in future releases but not immediately and only after user clicks "login link".
      As I can see "SimpleModal Login" plugin already solve it.
      I will check out their code and think how to do somethink like this in future "Login-Logout" versions.

      Reply
  4. Grumpy

    We were doing great-- A little problem with seniors seeing where they're supposed to register but outside of that great.. A big button that says register here dummy might be helpful.. Just kidding-

    I said were doing Great-- The plug I'm using to stop spammers was letting 6--700 comment spammers a month get through, You plugin cut that to 0, .Zero's a good number but the bots are getting smarter-- today several of them managed to register,, Idea's

    Reply
    1. web-developer

      I could recommend you to install some Captcha plugin (could be simple for the start).
      I did not see any other clever solutions.

      Reply
  5. FanaticWeb

    So bottom line you plugin is still redirecting users to the WP front end to actually login? Wouldn't it make more sense to present the Userrname and password fields within the widget and have it update to reflect the login status?

    Reply
    1. web-developer

      differences between default meta widget and Login-logout plugin:
      1) in Meta widget such items:

      • Site Admin
      • Log out
      • Entries RSS
      • Comments RSS
      • WordPress.org

      in Login-Logout plugin:

      • Site Admin
      • Log out
      • Custom item

      2) after login and logout Login-Logout plugin redirects to the same page, where you clicked the link; Meta widget has not;

      3) in Login-Logout plugin there are many options for configuration; Meta widget has not;

      Login-logout plugin did not show login-form I will explain why.
      Only 10% of the visitors will need to login so there is no need to show login-form for everyone.
      If user wants to login, than user can click the "login" link and he will be redirected to login-page and after login user will be redirected to the page where he clicked "login"-link.
      Not showing login-form - is feature and not a bug :)

      Reply
      1. FanaticWeb

        I saw the difference, I'm just saying, it would be worth it to include the login fields within the widget and limit the interaction within the widget instead of jumping to the default WP login page. Anyway we can tweak the plugin to do that?

        Reply
  6. Sergio

    I always see in my login-logout widget text "hello, username | logout" even if I am logged out. What could create this problem?

    Reply
    1. web-developer

      I think the problem is in cache. I suppose you are using some caching plugin and all users see the same page with the same string: "hello, username | logout".
      Try to disable your caching plugin.
      If you still need to cache your site, than try WP Super Cache plugin and enable "Don’t cache pages for known users" option in it. So, not logged in users will see cached page with text "login" and logged in users will see not cached page with text "hello, leonard | logout" for example.

      Reply
    1. Hoang

      Let me try to make my question clearer:

      Is there a way to edit the editor use the

      "Show admin link (if user is logged in);"

      option to redirect you to a different page of your choosing

      Reply
      1. web-developer

        You can disable "admin link" and add what you need to the "Extra item when user is logged in:" option. Like this: "my <a href="http://www.google.com">events</a>"

        Reply
  7. tommyboy

    How can I insert this plugin/widget into my header?

    And how can I position it?

    I am trying to redesign my header but struggling

    Can you help?

    Thomas

    Reply
    1. web-developer

      you can add login-logout only into widget zone.
      If you want to add it somewhere else, than you shold add it manually into the code.

      Reply
    1. web-developer

      Try to set redirect url: http://tbfaa.org/?page_id=1 (without www)

      When you will click login-link, then you will go to login page.
      After you logged in successfully you wil return to page, specified in your widget in parameter "Redirect to this page after login: "
      In your case it is: http://www.tbfaa.org/?page_id=1
      The same with the logout page, but you are redirecting iimediately.
      This is how it works.

      Reply
      1. Chuck Thompson

        The login/logout plugin is well thought out and feature-rich. Plugin developer provided excellent and rapid support when I ran into a configuration issue. Highly recommended!

        Reply
  8. Vládia

    Hello, is how to insert the registry the terms of the site, with a box must be ticked to register? I've been looking for a plugin with this feature and have not found.

    Reply
    1. Web-developer

      To eanble register option for your site try to visit this link:
      your_site.com/wp-admin/options-general.php
      And enable option "Membership = Anyone can register".

      Reply
  9. Vládia

    how to customize the login page. would like the login page had the same layout of my site and did not have the name "wordpress".

    Reply
  10. buttsby

    Hi, Fantastic plugin! Is it possible to show "Welcome, admin" on the same line with "Site Admin | Log out" rather on two separate lines?

    Reply
    1. Web-developer

      Here are my suggestions:
      I could add the checkbox option called "inline list" for showing in one line: "Log out | Site Admin".
      And I could add the checkbox option called "wellcome text" for showing: "Welcome, admin".
      And if "inline" and "wellcome" is turned on then we will see this: "Welcome, admin | Log out | Site Admin"
      And if "inline" is off and "wellcome" is turned on then we will see the list:

      • Welcome, admin
      • Log out
      • Site Admin

      Or maybe you have better idea?

      Reply
  11. Cris

    Hello

    Great plugin
    Maybe you could add a check box that will display a login form with username and password if anyone wants this option.

    Reply
    1. Web-developer

      I think that login form will not be needed for 80% of the visitors and the other 20% of users could visit login page when then want to login so there is no need to include this feature into plugin options. Sorry, but this feature will not be added into Login-Logout plugin for keep it as simple as posible. (At least now I think so, maybe something could be changed in future)

      Reply
  12. a4jp.com

    Can you add an option to the settings to change the word log-in and log-off to another word in a different language? Maybe having a reset word after it has been changed would be great for basic users as well.

    Your plug-in is so simple and works really well :) Thank you so much.

    Glen
    http://a4jp.com
    (Japanese Website)

    Reply
  13. Grant Mitchell

    Hi , i have Version: 1.6.0 of Login Logout & when im NOT LOGGED IN - i do not see the "Register" button & users often ask how do they register....

    so is this a problem? because there is no dedicated settings page for this plugin for me to enable a checkbox etc to show it.

    Reply
        1. Web-developer

          1) show register option in widget is enabled;
          2) WordPress membership option is enabled;
          3) User is logged out;
          all three items are true and you don't see the Register link?
          Try to save again the widget options and write me back.

          Reply
          1. Grant Mitchell

            Nope , resetting everything & changing it back really doesn't work.

            I've also tried disabling the plugin & re-enabling it - however that proves unsuccessful aswell.

            Reply
  14. jeroen

    Like this simple plugin. Only thing is that the logout redirect is not managable. I'm getting this 'not found' page in my theme. Could this be arranged in some way?

    Reply
    1. jeroen

      has to do with the password protected area the logged in user is at that moment. At the point of logout he has no longer access to that page. A simple logout redirect would solve this.

      Reply
  15. Adriaan

    I like your plugin a lot!
    Is it possible to change the layout? I guess it is, but I don't know how.. I would like to remove the 'login-logout' title, change remove the and stuff, but I can't find a .css file to change all this.. Hopefully you can tell me how! :)

    Reply
    1. Web-developer

      You should update Login-Logout plugin to version 1.3.0.
      Title is removed now if it is empty.
      The layout is based on list-items and it is the the best way to show it.
      The design you may change in your style.css file.

      Reply
    1. Web-developer

      This happens sometime and only with this plugin. Plugin does not contain complex code and it has small weight. I don't even know what is the problem. :(
      You should delete the plugin thru ftp to start your site working.
      You may try to install Login-Logout plugin in such ways:

      • download zip-archive of the plugin from the plugin page and upload it in your "dashboard=>plugins=>add new=>upload=>activate";
      • if the prev method did not help then upload the unzipped plugin via ftp and then activate it in the dashboard;
      Reply
    1. admin

      Please, update the plugin.
      In the latest version I added the checkbox to the widget options for enabling or disabling "register" and "admin" links.

      Reply
      1. Seth

        I want to keep the login/register links when not logged in. but NOT have the "site admin" link appear when logged in. not sure why it has to be both or none.

        Reply
        1. Web-developer

          It is fixed now - register and admin links are splitted and have different options. You should update your plugin to version 1.2.0 and also check if the Login-Logout widget exist in widget area.

          Reply

Leave a Reply to Vládia Cancel reply

Your email address will not be published. Required fields are marked *