Simple Membership integration (WP-MUMS Multisite)

pennymachines
w3 User
w3 User
Posts: 107
Joined: Mon Feb 06, 2017 9:51 pm

Re: Simple Membership integration (WP-MUMS Multisite)

Post by pennymachines »

axew3 wrote: Fri Jul 24, 2026 9:16 pm Except if the SM plugin is not active or some other code prevent the SM execution somehow...
Reading that, I realized of course the SM plugin is not active on most of the subsites, only on the main subsite.

So testing code changes again:

if user logs in from phpBB and goes to WP subsites where SM plugin is not enabled, the critical error (as above) occurs and the user is logged out of phpBB and WP.

if user logs in from phpBB and goes to WP subsite where SM plugin is enabled, no critical error occurs, but user is logged out of phpBB and WP.

if user logs in from WP subsite where SM plugin is enabled, there are no problems. User stays logged into their WP Simple Membership account, WP and phpBB.
User avatar
axew3
w3all User
w3all User
Posts: 3080
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Simple Membership integration (WP-MUMS Multisite)

Post by axew3 »

Forgive the delay.
You should wrap the code instructions that calls SwpmAuth (SM plugin class) into

Code: Select all

if (class_exists('SwpmAuth')) {
  ....
}

Code: Select all

if (class_exists('SwpmAuth')) {
 $auth = SwpmAuth::get_instance();
 $auth->login_to_swpm_using_wp_user( get_user_by('id', $wpuID) );
}
So that into Subsites where the Simple Memberships is not active the code will not run and will not cause any error.
pennymachines
w3 User
w3 User
Posts: 107
Joined: Mon Feb 06, 2017 9:51 pm

Re: Simple Membership integration (WP-MUMS Multisite)

Post by pennymachines »

axew3 wrote: Sun Aug 02, 2026 5:02 pm Forgive the delay.
No apology necessary. Thank you again for providing this free plugin and free support.

Working great now with that conditional.

I assume this will not be incorporated into w3all, so I'll need to re-edit wp-w3all.php and class.wp.w3all-phpbb.php in the next version update?
User avatar
axew3
w3all User
w3all User
Posts: 3080
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Simple Membership integration (WP-MUMS Multisite)

Post by axew3 »

Think that it can be all considered maybe to be resolved along with a big simplification of the code when the integration, i hope before (but it is an hope) will be rewrite from scratch jumping to 4.0.0 version on Christmas time.
Maybe the going on code will be provided for tests on github that seem the right way to go and where maybe someone else will help on build a brand new integration code!
Many functions requires a rebuild and cleanup, the admin interface is the scaring one. I do not know if it will be rebuilt instead! We will see if the AI can help on it :?: :D ..... maybe yes
pennymachines
w3 User
w3 User
Posts: 107
Joined: Mon Feb 06, 2017 9:51 pm

Re: Simple Membership integration (WP-MUMS Multisite)

Post by pennymachines »

There remains one unresolved issue with the Simple Membership W3all integration and I suspect this also applies to single site Wordpress installations. With the above 2 modifications to class.wp.w3all-phpbb.php, user logged in via phpBB is also logged into Simple Membership - on Firefox or Opera browsers. Unfortunately, this does not work on Chrome, which apparently has stricter cookie handling. When user logs in via phpBB on Chrome, they are (of course) logged into Wordpress thanks to W3all. That means they cannot log into Simple Membership without first logging out to get the Wordpress login form. Then they have to log back in using that form.
pennymachines
w3 User
w3 User
Posts: 107
Joined: Mon Feb 06, 2017 9:51 pm

Re: Simple Membership integration (WP-MUMS Multisite)

Post by pennymachines »

My apologies. Simple Membership appears to be fully integrated, including on the Chrome browser.

I had failed to make the additional edits to wp_w3all.php as instructed: Simple Memberships - Login Logout Autologin fixes

Topic is indeed resolved.
Now I just need to keep copies of the modified class.wp.w3all-phpbb.php and wp_w3all.php for when they get overwritten by the next update.
Post Reply