axew3.com

phpBB user session update

—

by

Since plugin version 2.9.6 >

Note that this normally NOT required! But you know that it is possible…

A while ago, someone asked how to stop the verify_phpbb_credentials() function—which updates user data and the phpBB session—from running every time a WordPress page loads.

By default, this option is not included on the plugin’s admin configuration page. Functions like verify_phpbb_credentials() and the Last Topic Heartbeat shortcode (when used) are the main two features that can impact server performance. All other plugin functions and hooks only run when a user performs a specific action, such as registering in WordPress or updating their profile. Even those two functions normally execute in milliseconds, so you won’t notice any difference on an uncached site whether the integration plugin is active or not. That said, very large sites—or anyone else—might still find this option useful.

To do so just open up with a text editor the wp_config.php file (or add the line of code anywhere inside the custom_functions.php file, if you are using it) and maybe just after the line

/* That's all, stop editing! Happy publishing. */

add the following line of code:

define('WPW3ALL_ULOGGED_NOPHPBBCREDENTIALS', 1);

Note that:
By avoiding the execution of verify_phpbb_credentials() every time a WordPress page loads, the function will only run when a user is logged out of WordPress but visits with a valid phpBB session cookie. In this case, the user will be logged into WordPress (and created if they do not exist yet). At the same time, profile fields like their URL or email will also be updated if they do not match

PM shortcodes (pm notifications shortcodes) will not work.

NOTE: the user require to be as MANDATORY allowed to update the profile email, password and url ONLY into WordPress if the phpBB WordPress extension has not been installed into phpBB.

If the phpBB user session expires because it is no longer updated on the WordPress side by verify_phpbb_credentials(), the user may simply need to log into the forum again. However, this shouldn’t be a big issue. When a user logs into WordPress, a long-term ‘Remember Me’ cookie is created. As long as you configure your phpBB session settings as explained in the installation steps (setting the cookie to last for months or 365 days), users will rarely need to log in again.

Note: Your phpBB cookie session settings must match this long-term behavior; otherwise, phpBB will follow its own rules and log the user out early, even if a long-term cookie exists. To prevent this, go to phpBB ACP > Security settings, set Allow “Remember Me” logins to Yes, and adjust the “Remember Me” login key expiration length (in days) value to match.

That’s all.