• Resolved Mirco Babini

    (@mirkolofio)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @mirkolofio, thanks for sharing your findings.

    I have put the process above to the QA team and they’ve already taken a look into them. The user count and missing users are now scheduled for an upcoming release. As we occasionally change focus for urgent updates or fixing bugs pre-release, dates can be quite fluid but it looks to be two releases away right now.

    The team can’t reproduce the cookie issue though across multiple test sites. Do you have a WordPress/browser plugin or cache that could be storing the sort settings? If we sort by either of our custom columns, leave the page and come back, it’s sorted by username as default. If we sort by other methods, it’s visible in the URL: /wp-admin/users.php?orderby=wfls-lastlogin&order=asc

    It might be worth trying the same process in a different browser to your default or with your other WordPress plugins disabled temporarily. Let us know if there’s anything else we might need to know to reproduce it.

    Many thanks,
    Peter.

    Thread Starter Mirco Babini

    (@mirkolofio)

    Mh, I’m using Advanced Columns Pro which might be related to the cookie issue.
    Btw, that’s just a side effect; if you fix the missing user issue, I think we are done.

    Thanks!

    Plugin Support wfpeter

    (@wfpeter)

    No worries, it should be coming soon – we appreciate you bringing it to our attention.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Last Login column query issue’ is closed to new replies.