=== Last Logins === Contributors: coffee2code Donate link: http://coffee2code.com Tags: users, login Requires at least: 2.0.2 Tested up to: 2.5 Stable tag: trunk Version: 1.0 Logs the dates and IP addresses of successful user logins and failed login attempts. == Description == Logs the dates and IP addresses of successful user logins and failed login attempts. Features: * Records the IP address and date and time of the last successful login for each user account. * Records the IP address and date and time of the most recent failed login for each user account, as well as a count of total number of failed logins since the last successful login. * Adds the submenu 'Last Logins' under the 'Users' admin menu which displays a table of the last login and bad logins data recorded for all user accounts. * Adds the template tags last_login() and bad_logins() that can be inserted in theme templates to display information regarding the logged-in users last login or bad login attempts since last login, respectively. * Each template tag allows for default information display, or can be passed a custom format string that will be parsed for percent-tag substitution. * Last login information, and bad logins since last login (if any had occurred), is summarized in the upper-right corner of the WP Admin pages. (This feature is not compatible with the Hello Dolly plugin, or any of its knockoffs). == Installation == 1. Unzip `last-logins.zip` inside the `/wp-content/plugins/` directory, or create the directory `/wp-content/plugins/last-logins/` and upload `last-logins.php` into it 1. Activate the plugin through the 'Plugins' admin menu in WordPress 1. (Optional) If you wish, you can insert function call(s) to your templates to display information about the last login and/or bad login attempts since the last successful login Note: users of versions of WordPress older than WP 2.2 may need to perform these additional steps: 1. Go to the admin 'Users' page and click the new 'Last Logins' submenu link 1. Press the 'Install' button to create the database table needed for the plugin to work == Template Tags == The plugin provides two optional template tags for use in your theme templates. = Functions = * `` This displays information regarding the last login for the currently logged in user. * `` This displays information regarding failed login attempts for the currently logged in user. = Arguments = * `$custom_message` Optional argument. This is a string to be output instead of the default string. Use '%date%', '%ip%', (and only for `bad_logins()`: '%count%') to indicate where those respective pieces of information should be substituted by the functions. * `$if_none` Optional argument. This is a string to be output when the requested information is not available (the user hasn't had a login recorded yet, or there haven't been any failed login attempts for the user account). = Examples = * `` "Your last successful login was at 2008-01-08 14:32:21 from 127.0.0.1." * `` "There have been 2 bad login attempts for your account since your last successful login. Last failed login at 2008-01-08 12:12:03 from 127.0.0.1." * `` "Last logged in at 2008-01-14:32:21 from 127.0.0.1" * `` "2 failed logins -- latest from 127.0.0.1 at 2008-01-08 12:12:03" == Frequently Asked Questions == = Does this plugin retain EVERY successful login and failed login attempt? = No. In the future it likely will, but at the moment it only retains information about the two most recent logins for each user, and the two most recent failed login attempts. It does retain a count of how many failed logins were attempted for each user account since the last successful login by that user. However, the count is reset once the user successfully logs in. = Does this plugin do anything with login and/or failed login attempt information other than logging and report? = Not at this time. In the future, it may harness the information it collects to do things like throttle IP addresses and/or user accounts after a certain number of failed logins, among other possible things. = I (or my visitor(s)) have been to the site more recently than the last login indicates; what gives?! = Bear in mind that the plugin only logs *logins*. If a user never logs out and/or never ends their browser session, they can effectively remain logged in indefinitely. The plugin only tracks logins, not site access. = Why does the bad login count get reset back to 0? = The count of bad logins (as well as the information regarding the most recent failed login attempt) is only retained through the next successful login. In a later version, this plugin will retain all login and failed login attempt logs indefinitely. == Screenshots == 1. A screenshot of the admin header showing the last successful login as well as failed login attempts. 2. A screenshot of the admin header showing the last successful login when there hasn't been failed login attempts. 3. A screenshot of the 'Last Logins' submenu admin page under 'Users'. This page presents the log of successful and failed logins.