cre8d design - clean, clear, creative websites
  • Latest
  • Highlights
  • Discussions
  • Blogging
  • Design
  • Ebooks / Books
  • Social Media
  • Personal
  • About
  • Portfolio
  • Services
  • Blog
  • Contact
  • Twitter
  • Facebook
  • RSS

WordPress plugin: Login Logger

July 4, 2007

Stephen coded up a little plugin a while ago so I thought I’d share it with everyone.

Login Logger keeps track of recent logins to WordPress for all users, as well as all failed logins. It records username, time, IP address and how long since each login attempt as well as time since last active for each user. These tables can be accessed from the Users menu, and the list of failed logins can be cleared at any time.

It was mainly written quickly for personal use – so we can’t make any claims regarding its safety or extendibility (it does not use any localization methods, etc) but please let us know if you find it useful!

Download it here:
WordPress 2.5 – 2.8.4
WordPress 2.2 – 2.5

To install, unzip and upload the entire folder to your plugins folder, then activate from the plugin menu.

Updates:

August 28, 2009: Updated styling
April 10, 2008: Updated for WordPress 2.5.
January 24, 2008: Fixed another minor wp prefix bug.
October 2, 2007: Fixed the wp prefix bug and submenu path bug.

Life Blood (Part 2)
The World's Leading
  • Pingback: Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 7/5

  • Pingback: WP Plugins DB » Plugin Details » Login Logger

  • Pingback: Skylog » Blog Archive » links for 2007-07-06

  • http://gozenn.com Jake Johnson

    Thank you,

    this plugin will be used on our many wordpress sites to keep track of our authors.

    -Jake

  • Choder

    Love it, I have been looking for this for a long time. Thanks

  • http://www.copsworld.com larry

    looks good to me! Thanks!

  • http://www.designog.com design for myspace

    Thanks for the plugin it should be very helpful.

  • http://www.aboutclock.com ciken

    good info…thanks…

  • http://www.aoddesign.com/blog/ Aaron

    Nice one! got it working already!

  • Pingback: Login Logger | わーどぷれすっ!

  • http://www.nothingbutsong.org Gill

    Where can I find the admin panel for it? I’ve installed it successfully, but I can’t find it Manage or Options.

  • Stephen

    Hi Gill – its in the ‘Users’ menu.

  • http://www.tasty.sk vlp

    Doesn’t anybody test this plugin with WordPress 2.0.10? I tried to activate the plugin but I didn’t find any option anywhere.

  • Pingback: Free as in Time » Blog Archive » Wordpress Wednesday 18/07/2007

  • Pingback: TechnologyTales.com » Blog Archive » Login Logger plugin

  • http://blog.mobius.name moby

    Does not display a manage function in Users using WP 2.0.x

  • Sjebo

    Hi! Thanks for the plugin, I was looking for something like this! Only one feature request. Can you log ‘last visit to site’ as well? That would be nice!

  • http://www.cyberlearninghub.com wordpress quickstart guy

    hey, this is a cool plugin. Thanks for sharing especially if my site is access by more than one person.

    yup i would also like to request for last visitor.

  • Pingback: bilgiservisim » En iyi 100 wordpress eklentisi

  • http://thebollywoodzone.com/ Bollywood Blog

    I upgraded to WP 2.2.3 and suddenly the menu link was not working. So i go through the code and changed the following function.

    function loginlog_users()
    {
    add_submenu_page(‘index.php’,'Login Logs’,'Last Logins’,8,’loginlog/manage.php’);
    }

    Removed the full path from the last parameter and everything goes back to normal operation.

  • http://www.efuxx.com/ Robert

    damn :)

    i found out the same thing in approx one hour….
    maybe i should have take a look on this site…. :)
    but it works!
    it’ll work also with

    add_submenu_page(’index.php’,’Login Logs’,’Last Logins’,8,’../wp-content/plugins/loginlog/manage.php’);

    so whatever ….
    good plugin anyway!

  • Pingback: En iyi 100 wordpress eklentisi | Turkmecmua

  • http://blog.mobius.name moby

    Same problem here w/V2.2.3. Tweaked as listed above and works again now!

  • http://worldarchivetr.com/wp canarkadaş

    Thanks..
    […] Açıklamalı 232 WordPress eklentisi (Agu. 15, 2007 !!) (WordPress plugin list),[…]

  • dan

    hi! I just noticed that it will only work on tables with the default prefix (“wp_”).

    Around line 21 on the manage.php, “wp_users” is referenced explicitly. I added a variable name on top of that line to reference it to $wpdb->prefix . ‘users’ instead.

    But still a very useful plugin. Thanks!

  • Stephen

    The hardcoded wp_ is now fixed. The menu should now show up in 2.0.x as well as 2.2.3 onwards.

  • Pingback: How To Secure Your WordPress Blog | FabNet Revenue

  • Danny

    I love this plugin. I have a couple things to ask, though.

    1. Could you make an option so that I can choose to not delete the database tables when I deactivate the plugin. I was surprised ot see all my data gone when I came back after bug checking another issue, where i deactivated all my plugins.

    2. I would love it if you would expand this plugin to show all content (posts, comments, pages) that have been updated since the lats visit by a visitor who logs in. But it seems a little out of the scope, eh? I might do this myself, but I’d need the plugin to not erase the db records when deactivated, as mentioned above.

    3. Just installed v. 1.1 (thanks for fixing the 404 error I was getting when trying to call up the management page). Now though, with no records (see above) I am getting the following error on the management page, under Last logins:

    WordPress database error: [Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '=']
    SELECT distinct wp_users.user_login,wp_loginlog.username FROM wp_users LEFT OUTER JOIN wp_loginlog ON wp_users.user_login = wp_loginlog.username WHERE wp_loginlog.username IS NULL

    I don’t know what that means. Have I done something wrong? I am using WP 2.3.

    Thank you for listening, and for the plugin.

  • Pingback: 何如保护你的wordpress博客安全 » Rapid Search

  • aditya

    when i install and activate its saying Database error
    user.wp-logs table not found

  • http://www.maxclubin.com forum

    Thanks for the plugin

  • http://www.zjdfdr.com/main.asp jill0001

    是吗?这样也可以反应釜?

  • http://www.copsworld.com larry

    Great plugin! I started using it with version 2.1 and upgraded to 2.3. It stopped working after that, I am now downloading the newest version and hopefully that one will work.
    Thanks!

    larry

  • http://overdosse.com Demian

    WordPress database error: [Table 'overdosse_wordpress.as_wp_loginlog' doesn't exist]
    UPDATE as_wp_loginlog SET active = ’2007-11-11 15:13:37′ WHERE username = ‘admin’

    WHYY????

  • Junipingla

    Wow!!! Been looking for this one!! I know many who needs this plugin!
    However I get a bunch of N/A’s. Is it because I just installed the plugin?? I use WP 2.3.1

    Could you maybe, in the future implent to display how many comments the members have done?

  • huh

    I keep getting this error, what to do??

    The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay

  • http://www.HomeRunOffices.com/ Lance Homer

    I’m not sure if this is a bug or just how it works, but in the failed logins section it show every user name as Array. I’d like to know which user name was tried rather than just a generic “Array”. It looks like a bug in the script:

    Username Time IP How Long Ago
    Array 2007-11-30 21:06:11 71.36.73.221 48 min 37 sec
    Array 2007-11-30 20:41:51 168.103.141.240 1 hour 12 min
    Array 2007-11-30 18:39:20 128.187.0.178 3 hours 15 min
    Array 2007-11-30 17:27:45 157.201.184.242 4 hours 27 min

  • Pingback: Plugin wordpress | Valeriu Tihai

  • Pingback: 230 Wordpress eklentisi — Wordpress Türkiye

  • Pingback: leocheng™ 博客 » Blog Archive » 何如保护你的Wordpress博客安全

  • http://www.peleodiase.com pele

    I tried the plugin on my blog with wordpress 2.3, it didn’t work.

  • Tom

    Can’t locate the tab menu when installed on WordPress Version 2.3.2

    What should I do?

    THank you.

  • Jason

    I too am having a problem with this and 2.3.2. Clicking on Users -> Login Logs results in a blank page (I’ve been able to check for output errors yet).

    Further, a look in the database shows that there are no entries, so it appears as though something changed in 2.3.2 which causes problems with this plugin.

  • rachelcunliffe

    We’ve just tested this in 2.3.2 and it works fine for us.

    When you say you got a blank page, does that mean an actual blank page, or just no logins yet in the table?

  • Jason

    The page is physically blank, as in a there is no output if I look at the source.

    The manage file does in fact exist where the plugin is looking for it (/wp-admin/loginlog/manage.php), but nothing is displayed.

  • Pingback: 300 Adet Wordpress Eklentisi : Yılmaz Eres

  • Stephen

    Hi Jason,

    It looks like you’ve unzipped both the loginlog.php and manage.php files directly into the plugins folder rather than keeping them in the loginlog folder. They’ll both need to be in a loginlog folder (provided in the zip) to work correctly.

  • http://escritatorta.em.blog.br Norberto Kawakami

    Hi,
    i’ve made some alterations in your plugin to keep track of the same user login.
    I’ve made lines 71, 72, 73 and 74 to comments.
    This change can show me if there is some intruder in my blog that have not altered my password….

  • http://escritatorta.em.blog.br Norberto Kawakami

    oops…
    lines 71, 72, 73 and 74 from file loginlog.php

  • Pingback: Segurança: Monitorando os Logins no Blog | Escrita Torta em Linha Reta

  • Pingback: Top Plugins WordPress 2008 | Escrita Torta em Linha Reta

  • ll

    Could you add an extra function that allows you to delete inactive users?

  • rachelcunliffe

    I would probably prefer people still going to the Users tab and manually deleting them from there. If you see there’s no recent logins, then you might want to contact the person first?

  • ll

    Too much work. there are literally thousands of inactive users with no logins for months. It takes the plugin forever to display the log. I tried searching for a bulk deleter, but no luck. So figure this is the best option for me.

  • Pingback: Plantillas para Blogger, recursos y herramientas » 22 plugins para mejorar la seguridad de tu blog con WordPress.

  • Danny

    Hello,

    I like the plugin, but it looks the plugin doesn’t log the returning users who have checked the “remember me” checkbox at the login form.
    Is it possible to log these users as well, without them having to log in each time?

    Greets,

    Danny

  • Chris

    I’m using 2.5 and there seems to be some issue going on. When logged out and you login again, I get logged in the failed area. Other users have logged and they too are just showing up under the failed area. Sometimes if I clear the failed logins the users that were under failed disappear form the last login area. Weird.

  • http://www.turkbaron.com baron

    hi there.com plugin but :

    Does anybody know if tis script is compatible with WordPress 2.5?

    Thanks in advance for any help on this!

    turkbaron

  • Chris

    Thanks Rachel,

    I really enjoy the plugin and am glad it’s not being abandoned like many others lately.

  • Stephen

    Hi Chris,

    I installed the plugin on a newly installed 2.5 blog and didn’t seem to have any problems. It did use some deprecated functions however, so I’ve updated it to work in another way – can you see if it works for you now?

  • Pingback: Melhores Plugins para o Wordpress - Pc Saudável.com

  • Pingback: 13 plugins de segurança de seu blog do WordPress

  • Pingback: Order of the Bath » Blog Archive » User profiles in WordPress

  • Darkraisin

    Hi

    seems to be the one I was looking for. Thanks for putting it up. I will DL and install it soon.

    BTW, can it be altered in such a way that records from which country users has logged in and if the same user has logged in from different country in (in certain interval of time but this is not so important) an email would be sent to the administrator with the detail, or just being recorded in another table or column?

    Haa, that would be cool. But let me first try to install this one first.

    Regards

    Darkraisin

  • Pingback: Aumentando a Segurança do seu Blog em WordPress | Escrita Torta em Linha Reta

  • http://www.sapkaci.biz şapkacı

    It looks like you’ve unzipped both the loginlog.php and manage.php files directly into the plugins folder rather than keeping them in the loginlog folder. They’ll both need to be in a loginlog folder (provided in the zip) to work correctly.

  • http://www.sapkaci.biz promosyon

    I tried the plugin on my blog with wordpress 2.3, it didn’t work.

  • http://www.factoryfast.com.au/Toys/c175/index.html toys

    hmmm… I’m not sure if I quite understand how this plugin adds value, from a truly practical perspective. Is it to help to see if someone is trying to hack into your website? Or, if someone else is logging in? I guess it would be useful if you suspected anything, but otherwise it doesn’t carry much use to me in my mind. However, I will keep it in mind if I ever suspect something’s going awry with who’s logging into my site.

  • Pingback: Jonathan Hensley | The Blog » Build a Secure Family Blog with Wordpress

  • Pingback: word press eklentileri on Grafik Hocam

  • http://www.isteelbisem.com iş elbiseleri

    I tried the plugin on my blog with wordpress 2.3, it didn’t work.

  • http://www.sapkadunyasi.net Promosyon şapka

    Login Logger – Anotando todos os logins efetuados no painel de administração do blog.

  • Jenny

    I tried to activate this plugin, but it doesn’t show up in the plugin-activation list in WordPress, and I kept both files in the loginlog folder. Any ideas? I really could use this information in my database.

    Thanks!

  • http://www.richardtape.com Richard Tape

    Hey!

    Nice idea fora plugin. Just a quick note that it doesn’t seem to work in 2.6. Doesn’t appear to create the mysql table correctly which is a real shame… any chance of an update at all? I’m sure there’s plenty of people who would love this plugin…I’ll help if I can…

  • Pingback: Wordpress En iyi eklentiler ve açıklama 400 adet | İnternet Çöplüğü

  • Stephen

    Hi Richard,

    It looks like the last time I uploaded the plugin I forgot to zip the actual loginlog folder – which I’ve updated. If you put both files in a loginlog folder in the plugins directory it should work – have tested this on a fresh 2.6 install.

  • http://360.itcow.com etegration

    This works fine with 2.7-beta1 too. Thanks for this plugin.

  • Pingback: ZDaYLaN

  • Pingback: Açıklamalı 400 Wordpress Eklentisi

  • Pingback: How to make your Wordpress blog secure [Prevent hacking attacks] | TheChetan.com

  • http://www.rubiksroom.com Ruark

    Great plugin and works perfectly thanks :D

  • http://www.jamesturner.co.nz James

    G’day,

    Great start to a handy wee plugin. Do you plan on continuing to update this plugin by any chance?

    Thanks,
    James
    =-)

  • http://code.lifeform.co.nz/ Rob

    Hi There – a note to say thanks for this plugin. It’s on my list of essential plugins for new installs. Also seems to be working fine in Wp 2.8 Nice one :-)

  • Sam

    It would be nice to see an updated design of the log overview because its hard to read now.
    Example:
    Sam 2009-08-16 19:39:31 68.*.***.** 45 sec 0 sec
    and
    Username Time IP How Long Ago Time Since Last Active

    some columns are very close without any separation and make it confusing

    it would be nice to see some separation between columns and rows and a
    (WP 2.8.4)

  • Pingback: iWeb Blog » Securing Wordpress against hackers and bots

  • Pingback: iWeb Blog » Sécuriser Wordpress contre les pirates et les scripts

  • Pingback: iWeb Blog » Proteger Wordpress de los piratas y de los scripts

  • Sam

    Thanks allot for the design update!!

  • http://www.phaudio.com peter moore

    would be good if this plugin logged the number of times a user has logged in

  • http://Dreammagic.de Feechen

    Hallo,
    finde das Plugin auch genial, kann man das irgentwie hinbekommen, das die geköschten User nicht mehr in der Liste angezeigt werden.

    Wäre toll

    Grüße Feechen

  • Pingback: Dakiri Blog » Blog Archive » Wordpress – Les plugins et la sécurisation

  • http://www.design-is.co.uk/ Doug Barned

    Perfect :) Thanks!

    /Doug

  • Simo Savonen

    Love the plugin, but noticed a design flaw:
    if your members never log out, and choose to use the cookie login instead, the plugin never shows their initial log ins.

    I modified the code a bit, made the function loging_active() check if the database has any mention of the user (otherwise the update statement doesn’t do anything):

    function loginlog_active() {
    global $user_login, $wpdb;
    $table_name = $wpdb->prefix.”loginlog”;
    $check = $wpdb->prepare( “SELECT * FROM “.$table_name.” WHERE username= %s AND success=’1′”,$user_login);
    $empty = $wpdb->query($check);
    if($empty == 0) { loginlog_loginsuccess($user_login); }
    else {
    $update = $wpdb->prepare(“UPDATE “.$table_name.” SET active = %s WHERE username=%s”,current_time(‘mysql’),$user_login);
    $wpdb->query($update);
    }
    }

  • Simo Savonen

    oops, small bug, should be:

    if($empty == 0 && is_user_logged_in() )

  • Jonesy

    Simo -
    Thanks for that update! Plugin works great with WP 2.9.2…

  • http://www.webswonder.co.uk Jeremy Clulow

    Thanks. Very useful plugin for my community site at http://www.newcastle-emlyn.com

  • aljuk

    It would be useful, for starters, if you could view logins ordered by date, and automatically delete unused accounts over a certain age.

    Are you planning to develop the plugin with some functionality?

  • Pingback: iWeb Blog » Proteger Wordpress de los piratas de la informática

  • Pingback: Sécuriser WordPress contre les pirates informatiques | stephanejose communications

  • Phil

    This message appears above the logs:

    WordPress database error: [Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '=']
    SELECT distinct wp_users.user_login,wp_loginlog.username FROM wp_users LEFT OUTER JOIN wp_loginlog ON wp_users.user_login = wp_loginlog.username WHERE wp_loginlog.username IS NULL

    Is there a fix for this? also would be nice if I could clear the Last Logins field. I’ve got a long list.

  • Rachel

    Hi Phil,

    What version of WordPress and MySQL are you using?

    Thanks!
    Rachel

  • Pingback: Blog Govworks - Protegendo Wordpress contra hackers

  • Pingback: Sécuriser WordPress contre les pirates informatiques | LC Production.com – LCBlog

  • Mel

    Looks great!

  • ozgurhaber.org

    great plugin, thanks

Hi, I'm Rachel Cunliffe!

Looking for a blog designer, Wordpress expert, website designer, or want to find out how I can help you? I'd love to hear from you.

Email:
rachel@cre8d-design.com
Phone:
(US) 646 233 3046
(NZ) 027 3833 746
Skype:
rachelcunliffe

Keep updated

Get blog posts via email

Follow @cre8d