Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
WP User Role and User Groups
Avatar
Jenn Walker
Member
Free Members
sp_UserOfflineSmall Offline
Jun 9, 2015 - 5:23 pm

I am trying to understand and wrap my head around how the users and user groups work for SP.  

I have a membership that when people purchase it they are added to a specific WP User Role.  I have then mapped that User Role with the User Groups in SP.  I am finding however when the WP User Role is changed back to Subscriber from Paid Member (when they cancel their membership or it expires) the person is not being removed from the SP User Group associated with Paid Member.  

I think it is because I do not have the box checked that states: Users are limited to single usergroup membership. 

If I check that box now (I have about 40 people on my forum) what will happen?  Will those people be added to the SP User Group associated with the WP User Role (based on the User Group Mapping Settings)? My fear is that by changing this it will cause irrevocable damage to my forum and the users that are on it.

I'm assuming that I shouldn't have to move people in and out of SP User Groups manually when someone's membership expires and their WP User Role is changed.  Is this how I would handle monitoring people's access to the forum when their membership expires?

I hope this makes sense, but I would be happy to clarify anything that seems unclear.  

Thank you!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jun 10, 2015 - 2:37 am

There are quite a few factors to consider here. So...

If what you want is for WP Roles and SP Groups to map one for one and thus, by definition, only allowing a user to be in one Role/Group at a time then we would recommend that the single Group membership option be turned on.  These are exactly the circumstances the option is for. This ensures that when a user changes Role, they are MOVED from one Group to the new Group and not COPIED into the new Group.

The next point is that turning that option on after Group assignments will not effect current assignments as I understand it. However, at the bottom of the User Group Mapping admin panel, is the ability to re-map your user base based on the Role/Group mapping. So this can be used to correct any misplaced users it users in  more than one Group by mistake. Read the warning and the popup help. Even back upo your DB if worried.

I do not know how techie you are so I will explain in layman's terms. WordPress  works by what are called 'action' and 'filter' hooks. When something happens, WP essentially broadcasts it to the theme and all plugins in case they need to respond to the event and do something. So - when a user is moved from one WP Role to another, one of these hooks is fired off and other plugins can take action if needed. In the case of SP we check the user group rules and act appropriately.

However, some WP plugins virtually replace core WP functionality. A good example of this is a membership plugin that adds Roles etc. We use one here and I gather you use one as well. If they are replacing core WP functionality then they also have the responsibility to take over the broadcasting of those hook actions. And sadly, we have encountered the odd plugin here and there that does not do this. 

There is a simple test if you have mapped Roles/Groups and Single Group membership turned on. If you manually move a user from one WP Role to another using the core WP edit user panel then check that the user was moved into the new SP user group - you should find that they have been. Then do the same thing using the membership plugin and check if they were moved. If they were NOT moved then the membership plugin is not doing its job properly.

I hope some of this helps!

andy-signature.png
YELLOW
SWORDFISH
Avatar
Jenn Walker
Member
Free Members
sp_UserOfflineSmall Offline
Sep 11, 2015 - 10:17 am

Thank you Yellow Swordfish. 

I am just now readdressing this problem.  So I just did the test that you suggested in the last bit of your post. I changed the WP User Role and saw that it moved the forum user into the correct SP User Group (I still have it set so they can be in more than one forum group).  However, when I switched the WP User back to subscriber, I expected that SP would also remove them from the member SP Forum Group, but that did not happen.  

So it is working to add them to the Groups but it doesn't remove them from the SP group when their WP User Role changes back to a non-member. 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 11, 2015 - 11:13 am

I still have it set so they can be in more than one forum group

If that is not turned on then they WILL stay in the old group as well. This is an explicit status that allows them to stay in any group they are placed in.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625