Technology Tales

Adventures & experiences in contemporary technology

Login Logger plugin

20th July 2007

The Login Logger WordPress plugin sounds a great idea and it works fine with standard situations. However, go beyond these and things start to go awry. An example is where you have to use unique database table prefixes because you use shared hosting. This is certainly something that I do and it breaks Login Logger. Thankfully, the fix for this is easy enough: just amend the database query on line 22 in the manage.php file as follows:

Before:

$query = “SELECT distinct wp_users.user_login,”.$table_name.”.username FROM wp_users LEFT OUTER JOIN “.$table_name.” ON wp_users.user_login = “.$table_name.”.username WHERE “.$table_name.”.username IS NULL”;

After:

$query = “SELECT distinct ” . $table_prefix . “users.user_login,”.$table_name.”.username FROM ” . $table_prefix . “users LEFT OUTER JOIN “.$table_name.” ON ” . $table_prefix . “users.user_login = “.$table_name.”.username WHERE “.$table_name.”.username IS NULL”;

The issue was caused by hard-coding of the table prefix for the user table and using the prefix that you yourself have set is the way out of this. What is less easy to resolve is a conflict between Login Logger and the Themed Login plugin. That will take further investigation before I come up with a fix.

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.