user-session-control icon indicating copy to clipboard operation
user-session-control copied to clipboard

Add bulk actions to session results

Open frankiejarrett opened this issue 10 years ago • 8 comments

frankiejarrett avatar Jan 02 '15 05:01 frankiejarrett

yup - i like the plugin and can find it useful but on this current site there's over 5700 sessions. I'd like to bulk destroy any sessions over 4 weeks. or at some point have a select box for:

Remove all sessions older than [1hour, 1day, 1week, 1 month]

etc. this and the pagination issue in #1

cool plugin tho. like!

chuckreynolds avatar Jan 21 '15 21:01 chuckreynolds

Hey thanks, @chuckreynolds! Yeah there are definitely some major performance drawbacks on large sites using the plugin as-is today. That will be the primary focus of the next release.

frankiejarrett avatar Jan 21 '15 22:01 frankiejarrett

@chuckreynolds Since you are managing such a large site I'm curious if you have seen my Prevent Concurrent Logins plugin yet?

frankiejarrett avatar Jan 21 '15 22:01 frankiejarrett

So I just put that one on to test - doesn't do much if anything - i still see dupe users in this list... my issue with this one is complete sessions are still at 5514, unique at 5009. At this point I'd want to have a bulk destroy sessions older than 1 month. I'm not too sure if there's another plugin that does that - other than maybe one of the hugely bloated security plugins but. Sample of page=user-session-control&paged=13&sessions_per_page=100

screen shot 2015-01-27 at 16 51 41

and everything beyond this is just 45yrs ago created

chuckreynolds avatar Jan 28 '15 00:01 chuckreynolds

@chuckreynolds The concurrent login check only fires when users login, it does not apply immediately upon activating the plugin because it only runs code for the current user.

However, maybe it should. I've added it as an issue: https://github.com/fjarrett/prevent-concurrent-logins/issues/2

I think an Expire User Sessions plugin is a nice idea. I will make one :smile:

frankiejarrett avatar Jan 28 '15 03:01 frankiejarrett

AH... well that makes sense now. and yes I agree w/ fjarrett/prevent-concurrent-logins#2 then :+1:

chuckreynolds avatar Jan 28 '15 03:01 chuckreynolds

@chuckreynolds For future logins, you might be able to accomplish your 30 day expiration idea just by implementing an auth_cookie_expiration filter. Something like this:

add_filter( 'auth_cookie_expiration', function( $expiration ) {
    return DAY_IN_SECONDS * 30;
});

frankiejarrett avatar Jan 28 '15 05:01 frankiejarrett

yeah I have something like that in there now. they wanted a membership type site to save posts but the guys who built it just opened up user reg and used a themeable login plugin... so basically I think a ton of spam user accounts got signed up. was just looking for other ways to clean that mess up. I figured killing all sessions for anything older than a certain date would at least help a little more. Anyways.. thx. if you get the bulk destroy that'd help too. Cheers

chuckreynolds avatar Jan 28 '15 19:01 chuckreynolds