#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
Bug Reports
WP MultiSite - User...
 
Share:
Notifications
Clear all

[Solved] WP MultiSite - User registration issue?

    Last Post
RSS

Hansie
Posts: 18
 Hansie
Topic starter
January 22, 2021 1:14 pm
(@hansie)
Active Member
Joined: 4 years ago

Dear WPForo team,

Trying to resolve an issue with MultiSite user registration activation (see this post in the forum), I noticed something that may be a bug or not. Please correct me if I'm wrong.

For MultiSite users, and email activation enabled, the function wpmu_signup_user should be used.
This creates an entry in wp_signups and send an activation email to the user.
Once the user clicks the activation link in this email, the user will be added to the users tabel wp_users.

However, with the current WPForo version (1.9.3) the function register_new_user is being used which right away adds the user to wp_users and does not send an activation email an there will be no entry in wp_signups - the new user can never activate his or her account.

Modifying the original code of a plugin is not something I can recommend to anyone, but while testing this on my test server the following changes worked by modifying wpforo/wpf-includes/class-members.php around line 263 where you'll find:

$user_id = register_new_user( $user_fields['user_login'], $user_fields['user_email'] );
if ( !is_wp_error( $user_id ) && $user_id ) {
do_action( 'wpforo_create_user_after', $data );
WPF()->notice->clear();
WPF()->notice->add('Success! Please check your mail for confirmation.', 'success');
return $user_id;
}

I've modified the code to this for testing:

if( is_multisite() ) {
wpmu_signup_user($user_fields['user_login'], $user_fields['user_email']);
WPF()->notice->clear();
WPF()->notice->add('Success! Please check your mail for confirmation.', 'success');
return TRUE;
} else {
$user_id = register_new_user( $user_fields['user_login'], $user_fields['user_email'] );
if ( !is_wp_error( $user_id ) && $user_id ) {
do_action( 'wpforo_create_user_after', $data );
WPF()->notice->clear();
WPF()->notice->add('Success! Please check your mail for confirmation.', 'success');
return $user_id;
}
}

And now User signup with email activation works correct on my WP Multisite setup.

Please correct me if I'm wrong - I'm not a coding expert and most certainly will not claim to know much about the inner workings of WPForo. 

This topic was modified 1 month ago by Hansie
Topic Tags
multisite user activation email new user
6 Replies
Sofy
Posts: 4065
Sofy - Facebook Sofy - Twitter
 Sofy
Admin
January 22, 2021 2:15 pm
(@sofy)
Support Team
Joined: 3 years ago

@hansie,

The latest versions are not well tested with WordPress multisites. 

The solution found by you is approved by our developers. They found it as a good solution. 

We've added in our to-do list this issue. We'll test and solve all issues with multisites in the next version of the wpForo. 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
Hansie liked
Hansie
Posts: 18
 Hansie
Topic starter
January 22, 2021 2:23 pm
(@hansie)
Active Member
Joined: 4 years ago

Thanks Sofy! 👍 🙂 

Reply
Hansie
Posts: 18
 Hansie
Topic starter
February 8, 2021 5:24 pm
(@hansie)
Active Member
Joined: 4 years ago

I just installed WPForo 1.9.4, where this fix was included.
However, the implemented fix doesn't work.
The email is still not send to the user to activate.

However, I did find the culprit.

In the file class-members.php, line 263, the devs wrote:

if( is_multisite() && apply_filters('wpforo_mu_signup', false) ){

This somehow prevents the activation email from being send and we're back to the same behavior as before (not sure what the apply_filters does).

After changing that line to:

 if( is_multisite() ) {   

things work correctly again. ( I removed " && apply_filters('wpforo_mu_signup', false)" )

I realize you guys may not have access to Multisite setups, so I hope this is helpful for you.

Reply
1 Reply
Robert
 Robert
Admin
(@robert)
Joined: 5 years ago

Support Team
Posts: 7624
February 9, 2021 5:06 pm
Reply toHansieHansie
Posted by: @hansie

things work correctly again. ( I removed " && apply_filters('wpforo_mu_signup', false)" )

Don't do this please. This is a hook to enable it using a hook. Don't do any change in the core. Revert it back asap and use this code in your active WordPress theme functions.php file:

add_filter('wpforo_mu_signup', '__return_true' );

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
Hansie liked
Hansie
Posts: 18
 Hansie
Topic starter
February 9, 2021 5:40 pm
(@hansie)
Active Member
Joined: 4 years ago

Thanks Robert,

Some times I temporary have to change something in the core files to make sure my website works. I'd rather not of course - that's why I'm reporting findings here, as it may help make WPForo better. 😊 

I've revert back to the original code and added the add_filter to my functions.php, and your suggestion works. 👍 

On that note: I doubt folks would like to do this for their multisite setups.
After all, if they use a theme, and update would potentially overwrite their functions.php.

Or ... did I overlook a setting that has become available in the latest WPForo version (1.9.4)?

Reply
1 Reply
Robert
 Robert
Admin
(@robert)
Joined: 5 years ago

Support Team
Posts: 7624
February 9, 2021 7:37 pm
Reply toHansieHansie

Ok, thank you @hansie,

There is no setting for this. The only way is using this hook.

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
  All forum topics
  Previous Topic
Next Topic  
Topic Tags:  multisite (5), user activation (1), email (12), new user (5),

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages  wpforo-advanced-attachments-128x128  wpforo-embeds-128x128 wpForo User Custom Fields addon  wpForo – Blog Cross Posting addon  wpForo Ads Manager
View all Addons »

Recent Topics

  • Entire site crashes after 1.9.5

    By Island Nature Trust, 2 days ago

  • Widget wpForo Recent Posts does not work well

    By st7878, 2 days ago

  • Non-Canonical URL error

    By cluel355, 2 days ago

  • Forum page loading issue

    By Muhammad Umar Farooq, 2 days ago

  • Not able to use any of the tools (such as like, solved, approve, delete, etc.) in a post

    By JNew, 2 days ago

  • Public Forum & Forums Not Displaying

    By Stacy, 2 days ago

Topic Tags

  • new features43
  • seo40
  • translation37
  • plugin conflict36
  • forum36
  • buddypress33
  • login33
  • registration30
  • threaded layout30
  • ultimate member29
  • moderation28
  • editor25
  • avatar24
  • menu24
  • shortcode24
  • css24
  • tags22
  • profile22
  • migration20
  • url20
View all tags (1515)

Recent Posts

  • RE: How to stop profile spam?

    How about users to be allowed to have a signature IF th...

    By dimalifragis, 10 hours ago

  • RE: How to edit profile location select box

    @sofyThank you

    By SpidiMan, 16 hours ago

  • RE: Foro "moves" in Mobile devices as Admin

    Its already sorted and already visibly sorted on mobile...

    By Jesus, 18 hours ago

  • RE: Entire site crashes after 1.9.5

    This issue doesn't have any relation to wpForo plugin. ...

    By Sofy, 18 hours ago

  • RE: Widget wpForo Recent Posts does not work well

    @sofy I deleted everything. It does not help( PS:...

    By st7878, 21 hours ago

  • RE: 1st load layout issue

    @jms, It seems you're using some cache plugin on your...

    By Sofy, 23 hours ago

  • RE: Forum page loading issue

    @pkheart, Discussion Boards and all Forum Softwares a...

    By Robert, 1 day ago

Share:
  Forum Statistics
20 Forums
8,032 Topics
40.2 K Posts
1 Online
15.5 K Members

Latest Post: How to stop profile spam? Our newest member: jensmacintyre1 Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2021 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Documentation