Last Login column query issue
-
Hello, I noticed that every time I sort by using the Last Login column provided by Wordfence in Users list, the users count decreases.
Also, sometimes I was looking for a certain user, accessing the wp-admin dashboard > then Users > then using the search… and the user was not found (but still present in the database).
Found the reason: the way you modify the pre_users query adding the meta_key condition to sort by Last Login. This causes the loss of the users without that meta set (pretty common for new users created by admins).
Also note that the Sort columns setting in Users list is saved in cookies and not immediately clear that there’s a sorting active, until you get on the column title with your mouse pointer.
For that reason, after applying the Last Login sorting, if you close the admin and get back on it a few moments later from /wp-admin > then Users list:
– you are viewing the All users tab
– BUT not all the users is actually listed
– completely unclear it’s happening bc the Last Login sorting is still turned on.Of course you are not responsible for a UI lack from the core.
Still, you are responsible for the pre_users query changes you apply.That can be changed to perform better and include the users who never logged in as well.
- The topic ‘Last Login column query issue’ is closed to new replies.