Support Forum

Member stats not corresponding to user group info

SZ Stefan Zabel
Stefan Zabel
Member

I suspect I don’t fully understand what the member stats at the bottom of the forum represent.

I set someone up as a WP admin user but have since deleted them from the WP users screen. This person isn’t showing in the moderator user group either. But they are still showing in the forum stats as a moderator.

My default user group for WP admin is moderator so I can see how they became a moderator, but not why they still are.

I’ve got someone else who I’ve moved from a moderator to forum admin using the ‘manage admins’ screen. They still show up in the stats as a moderator, not as admin. They don’t show up in the moderator user group.

What is it that the stats show, historical members as well as current? This still wouldn’t explain why I cannot see the new administrator listed though.

Thanks

9 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Well the stats display data is cached and is coded to update itself once an hour (by default – you can change this on the options > global display settings admin panel).

It uses the WP core cron system to carry out the update. So the first question is – have these changes taken place longer ago than the current update settings? And – if so then perhaps your WP cron system is not functioning – and it is not unheard of!

Go to the forum admin > toolbox > cron inspector and find the entry for ‘sph_stats_cron‘ in the active list. This will show when it is next due to run. Keep looking until it ticks over to see if anything changes. If it doesn’t then that suggests the cron engine is not picking it up.

Probably the easiest way to get it picked up again is to simple deactivate Simple:Press (NOT uninstall of course) and immediately reactivate it. Unless there is a serious problem with the WP cron system then that will usually correct the issue.

SZ Stefan Zabel
Stefan Zabel
Member

Ah, the moderator to admin move did happen so I guess I just had to wait. So hopefully cron is working.

However, I can still see the WP user I’ve deleted appearing as a moderator in the stats. They don’t appear in the moderator user group.

Perhaps this and another issue I’ve just spotted might relate to how I’ve set up Wishlist/Simple Press integration?

I’ve noticed I can still see users with expired Wishlist membership on the forum. I guess I’ve integrated things ok in terms of adding users to the forum when they register as members in Wishlist, but what happens when they stop being Wishlist members? Does the integration allow members to be removed from the forum too? Have I missed a setting somewhere?

Thanks

edit, I checked under forum > users > member info and no sign of that moderator anywhere. However, I can see them as a moderator under admins > manage admins. Cannot see a delete option within manage admins though. How can I remove this person? Thanks

MP Mr Papa
Mr Papa
Member

wishlist does not delete or remove users when their membership expires…  as long as the users remain in wp, they will have access to the forum… there are not separate users for the forum…

can you see this moderator user in the db?  in the wp users table or the sfmembers table?  you can get their user id from the manage admins pane…  or are they still showing in the wp usermeta table?  the capabilities are stored by wp…

 

SZ Stefan Zabel
Stefan Zabel
Member

Hi, the moderator doesn’t appear in wp users or wp usermeta but is in sfmembers.

I tried deleting another test wp user/Wishlist member/forum member via wp dashboard > users – it looks like they’ve disappeared from everything except sfmembers.

Should they be removed from sfmembers automatically?

Thanks

YS Yellow Swordfish
Yellow Swordfish
Member

Let us put it this way… WordPress functions via a system of ‘hooks’. Think of them as messages being passed from core to plugins and back that announce than an event has taken place.

When a user is deleted in WP – such a ‘message’ is sent out to any plugin listening for it so that it can act of required. This happens and Simple:Press picks it up and removes the sfmembers record.

If this is not removed then it suggests very strongly that the message was not sent – or – to be technical -the hook was not fired and Simple:Press never got the message…

SZ Stefan Zabel
Stefan Zabel
Member

Thanks.

Can you point me in the right direction in terms of what to do next? From what you say, it sounds like sfmembers is automatically kept up to date, so something’s going wrong.

Do I have a WP problem of some kind rather than an issue with SP or is it the integration between the two?

MP Mr Papa
Mr Papa
Member

sorry, think Andy forgot about a bug in 5.4 (introduced in 5.4 when another fix was added) where the a mysql error is generated and the row in sfmembers is not deleted…

we are currently discussing when to release 5.4.1 with this fix and other changes…  no date yet… but you can make the fix yourself if you like…

in simple-press/sp-api/sp-api-users.php around line 261, change

$wpdb->query(“DELETE “.$wpdb->prefix.”sfmembers WHERE user_id=$userid”);

to

$wpdb->query(“DELETE FROM “.$wpdb->prefix.”sfmembers WHERE user_id=$userid”);

 

SZ Stefan Zabel
Stefan Zabel
Member

I tested with a new member and it worked, they got deleted completely when I deleted their wishlist membership. I deleted the moderator from sfmembers to clean things up too.

Thanks very much!

YS Yellow Swordfish
Yellow Swordfish
Member

…and my sincerest apologies for forgetting that bug in the delete query. Considering it was me that found it then that was an odd oversight on my part.