Hi Alessio,axew3 wrote: Thu Jul 16, 2026 8:46 pm Hello!
How to fix the login of the user, when coming to WordPress side with a valid phpBB cookie.
First of all i note that if the user is not added as member into the Simple Membership members list, this will not work.
The user will be logged in WordPress and will stay logged but the user will not result as logged into the SM front end.
But so assuming that the user exists into the Simple Memberships list of active members, to fix the login you could do this (as ever there are more ways to achieve the same changing something else, and also possibles improvement to this basic example so to fit any requirement):
Open class.wp.w3all-phpbb.php
Search for this line:Change into:Code: Select all
if( $current_user->user_email != $phpbb_user_session[0]->user_email )Then search for this line of code:Code: Select all
if( $current_user->ID > 1 && $current_user->user_email != $phpbb_user_session[0]->user_email )So assuming SM is installed and active, Just after add this:Code: Select all
$wpuID = !empty($wpuID) ? $wpuID : 0;This will login the user everywhere.Code: Select all
$auth = SwpmAuth::get_instance(); $auth->login_to_swpm_using_wp_user( get_user_by('id', $wpuID) );
This topic will be now closed but another can be opened!
I've opened a new Simple Membership topic having applied the code changes above.
Just to note, all member accounts on my site are created through the Simple Membership plugin. Registration is disabled in phpBB, so wp.w3all creates the phpBB membership. WP members have two levels of membership through Simple Membership: free and subscribed (for some WP paywall content).
Unfortunately, with the changes I'm getting a critical error:
Fatal error: Uncaught Error: Class "SwpmAuth" not found in /home/www/mysite.com/wp/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php:771 Stack trace: #0 /home/www/mysite.com/wp/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php(31): WP_w3all_phpbb::verify_phpbb_credentials() #1 /home/www/mysite.com/wp/wp-includes/class-wp-hook.php(341): WP_w3all_phpbb::wp_w3all_phpbb_init() #2 /home/www/mysite.com/wp/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() #3 /home/www/mysite.com/wp/wp-includes/plugin.php(522): WP_Hook->do_action() #4 /home/www/mysite.com/wp/wp-settings.php(771): do_action() #5 /home/www/mysite.com/wp/wp-config.php(114): require_once('/home/www/mysite.com...') #6 /home/www/mysite.com/wp/wp-load.php(50): require_once('/home/www/mysite.com...') #7 /home/www/mysite.com/wp/wp-blog-header.php(13): require_once('/home/www/mysite.com...') #8 /home/www/mysite.com/index.php(17): require('/home/www/mysite.com...') #9 {main} thrown in /home/www/mysite.com/wp/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php on line 771

