WordPress.org

Ready to get started?Download WordPress

Forums

Check Last Login
Check last login plugin does not work (14 posts)

  1. CarpetGuy
    Member
    Posted 3 years ago #

    I have installed this plugin hoping it was the answer, but, although it does add the new columns for "Registered" and "Last Log In", there is n data in them. Should I wait? I mean does this only apply to registrations and log ins, "after" the plugin is installed?

  2. JohnnyPea
    Member
    Plugin Author

    Posted 3 years ago #

    You should see the "Registered" date all the time. I made tiny fix to display "No login" if user has no log in from the time of plugin activation (the column was empty before).

    Do you use any other plugin modifying user screen columns?

  3. kirkward
    Member
    Posted 3 years ago #

    I have the same problem and no, I do not use any other plugins that modify user screen columns.

    I am only testing with my "Administrator" login. Nothing is being recorded for my login.

  4. JohnnyPea
    Member
    Plugin Author

    Posted 3 years ago #

    Hi, are you using the latest version of the plugin 0.3? What is your WP version?

  5. krbvroc1
    Member
    Posted 3 years ago #

    It is impossible for this plugin to work. The function cll_last_user_login() which saves the last login to the usermeta is never called from anywhere in the plugin.

    My guess is that the line
    add_action('wp_login','last_user_login');
    needs to be changed to
    add_action('wp_login','cll_last_user_login');

    This could be why some people have said it is not working for them.

    Also, since users can avoid the login screen for up to 2 weeks using the 'Remember me' option, that will not be reflected as the user logging in.

  6. JohnnyPea
    Member
    Plugin Author

    Posted 3 years ago #

    Thank you for noticing this. There is right function name in the 'wp_login' action hook now.

    But you are wrong with the second thing you mentioned because there is also 'wp_login' action hook in wp_signon() function http://codex.wordpress.org/Function_Reference/wp_signon which is responsible for "auto log in".

  7. krbvroc1
    Member
    Posted 3 years ago #

    JohnnyPea,

    When a user sets the 'Remember Me' box, a cookie is stored on the users computer with expiration of 2 weeks. When they come back another day and the cookie is present, the wp_login hook is not triggered. Therefore the last user login is never updated.

    wp_signon() is only used when the user types in the name/password. That path is not taken when using a login cookie.

  8. JohnnyPea
    Member
    Plugin Author

    Posted 3 years ago #

    I am sorry. You are right!

    I haven't found appropriate hook to add update for the user meta where login time is stored for the users using logging cookies. Any idea?

  9. krbvroc1
    Member
    Posted 3 years ago #

    I notice that some people simply hook the 'init'. If you do that, the timestamp will be written to the database on every single page load. Depending on your site that may or may not be an issue. This is more like a 'last visit' timestamp rather than 'last login', but does not have the limitation of an admin thinking someone has not login in for a week or more, when that is not true.

    Since WordPress does not appear to use PHP 'sessions' there really is no other way than hooking the init. If WordPress used a PHP 'session' it would be possible to update the database only once per session.

  10. JohnnyPea
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, I was also thinking about adding it to the auth_redirect hook in auth_redirect() function but as you said it would update the timestamp on every refresh.

  11. CarpetGuy
    Member
    Posted 3 years ago #

    Hey folks, I just updated the plugin and I still see no data, not even the registration date, what's next?

  12. JohnnyPea
    Member
    Plugin Author

    Posted 3 years ago #

    Hey! I just installed version 0.5 on one of my client's site and it displays everything. Don't know where could be a problem. Have you tried on an another WP installation?

  13. ensonic
    Member
    Posted 2 years ago #

    Btw. There is also a "DRP WordPress User Management" plugin that covers simmilar functionality. Maybe they found a better solution for the "last login issue".

  14. ensonic
    Member
    Posted 2 years ago #

    Johnny, could you ev. update the plugin and offer a setting which hook to use (login vs. visit)?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic