• Welcome to the all-new Kolakube support, the official place to get help for Marketers Delight, XFtoWP, CryptoWP, and other WordPress products! Please login with your account details to access private support forums.

In progress Update email address from Memberium

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
Hey there!

So the last update rectified the issue of passwords changed from the user account to be synced over to Xenforo. Part of the buddypress update that y'all did. But now we've found that email changes are not syncing over. If a user changes their email on our site in their account details (same place they change their passwords) the email doesn't change in the XFtoWP sync tool, nor does it change over in Xenforo.

Any ideas as to why?

All the best,
Donnie
 

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Hey there!

So the last update rectified the issue of passwords changed from the user account to be synced over to Xenforo. Part of the buddypress update that y'all did. But now we've found that email changes are not syncing over. If a user changes their email on our site in their account details (same place they change their passwords) the email doesn't change in the XFtoWP sync tool, nor does it change over in Xenforo.

Any ideas as to why?

All the best,
Donnie
Dumb question, but do you have email changes turned on to sync? Xfwp > user syncing > settings
 
Comment

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
Haha @Alex not dumb! Yes all 3 options for the sync settings are turned on. Specifically "Sync user edit email and password changes" .
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Haha @Alex not dumb! Yes all 3 options for the sync settings are turned on. Specifically "Sync user edit email and password changes" .
Ok, great. I'll take a look tonight, is the account edit page made by buddy press or woo options?
 
Comment

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
It's actually woocommerce account details. But the password change works just fine to crossover, so I assumed it would work for email as well. Since both are the woocommerce account details forms.
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
It's actually woocommerce account details. But the password change works just fine to crossover, so I assumed it would work for email as well. Since both are the woocommerce account details forms.
Ok, I just tested changing an email from the "Account details" section and the user also changed in XenForo.

Screen Shot 2022-03-10 at 10.00.25 PM.png

Does the WP user in your instance have an XF account linked? Are they a super admin?
 
Comment

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
Hey @Alex I think I've found the issue but still don't have a solution. We are using memberium on our site so we've changed out the woocommerce account email changer to the memberium form version. It changes the profile email in the WP admin panel though. So it's essentially doing the same thing - but it's just not moving down into the xenforo sync form. That one holds onto the original email. Any ideas for how to handle that?

Thanks!
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Hey @Alex I think I've found the issue but still don't have a solution. We are using memberium on our site so we've changed out the woocommerce account email changer to the memberium form version. It changes the profile email in the WP admin panel though. So it's essentially doing the same thing - but it's just not moving down into the xenforo sync form. That one holds onto the original email. Any ideas for how to handle that?

Thanks!
Every plugin handles these changes a little differently, so XFtoWP's actions have to be added to any custom hooks involved like in the case of this Memberium action.

If you have a test dev site I could use I'd be willing to take a look as I don't have Memberium.

Otherwise, it should be easy to copy code from existing XFtoWP integrations and add it to the respective Memberium hook. Take a look at the update_customer() method in /wp-content/plugins/XFWP/integrations/woocommerce.php for how XFtoWP sends email changes from Woo account to XenForo.
 
Comment

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
Hey @Alex just wondering if you had any movement on this or should I find someone who can take a look at the code and do some custom work around it?
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Hey @donniewalden, my apologies for stuffing this into PM then falling off!

There is some custom work involved just because of the API integration their plugin requires, which I have from your messages. I will plug that into my test site and see what needs to be done to get the emails to fully sync from the frontend.

Apologies for any inconvenience this may have caused and I will report back here shortly with progress.
 
Comment

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
No worries @Alex I just wasn't sure if I dropped off your radar. If it's too much work let me know, we can look into having someone else handle it for us. But I can't imagine we'll be the only people forever with the Memberium email Xenforo situation using your plugin :) Thanks for everything!
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Ok, I am making progress on the plugin setup. I have Woo installed and using the default account area with the edit email field correctly syncing to XF.

With Memberium installed, can you share the steps you took to modify this account area with a different edit email field?
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Thanks, this code snippet from your site was the missing piece:

PHP:
function email_updater_edit_account() {
    echo '<div>
    <h2>Update Email Address</h2>';
    echo do_shortcode('[memb_change_email buttontext="Change my Email Address" automation_id=17]');
    echo '</div>';
}

add_action( 'woocommerce_after_edit_account_form', 'email_updater_edit_account' );

I can now hook XFtoWP into the email form and this will be the first official Memberium code the plugin supports. I'll update here shortly.
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Update: I wasn't able to perform a test due to API limitations, but the code is now in place in XFtoWP 1.5 Beta 3 that should change the connected WP user's email in XenForo with your custom integration.

After you install beta 3, go to XFtoWP > Site Setup > Integrations and enable Memberium. Save, and then you should be able to see user emails update from the account area.
 
Comment

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
Hey @Alex so it looks like this is kind of working. The email change goes through in WP, but the sync doesn't automatically happen. I'm not sure if it just takes a while, but each time I change a user's email through the memberium shortcode system, it changes across the account, but the XFtoWP sync window just holds onto the email right before. If I manually sync, then the email is sent over to Xenforo and you can then login with the new email. But it seems the email change isn't triggering a sync in the account, so the user is left logging in with the previous email.
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Hey @Alex so it looks like this is kind of working. The email change goes through in WP, but the sync doesn't automatically happen. I'm not sure if it just takes a while, but each time I change a user's email through the memberium shortcode system, it changes across the account, but the XFtoWP sync window just holds onto the email right before. If I manually sync, then the email is sent over to Xenforo and you can then login with the new email. But it seems the email change isn't triggering a sync in the account, so the user is left logging in with the previous email.
Ok, there should be no delay with syncing so it either works on save or it doesn't at all.

It's hard for me to test since I wasn't able to replicate your setup, so are you willing to make a minor modification to your live or staging site?

Basically, I want to print the $_POST response from when the email is saved to your WP's debug.log file (make sure you have that enabled in your wp-config.php file).

To do this, open XFWP/integrations/memberium.php and add to line 32:

PHP:
error_log( $_POST );

Now go ahead and save the email and check your error log to see if it returns a message. That will confirm the data is going through and we can go from there.

I hope that makes sense and is workable. I am sure we are using the right hook but I am not fully sure where the disconnect is happening on your site.
 
Comment

donniewalden

Active member
XFtoWP
Messages
32
Reaction score
5
Hey @Alex here is the error log:

[17-May-2022 18:43:36 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 for query SELECT * FROM wp_ed89467657_xfwp_logs WHERE xf_user_id = made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action('wc_ajax_checkout'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_customer, wc_create_new_customer, wp_insert_user, do_action('user_register'), WP_Hook->do_action, WP_Hook->apply_filters, XFWP_Users_Requests->user_register, XFWP_Users_Requests->create_user, XFWP_Users_Requests->update_user, XFWP_Users_Requests->create_user_log, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection_QueryCaching->query, W3TC\_CallUnderlying->query, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection->query, W3TC\DbCache_WpdbNew->default_query


Hopefully this gives you what you need? :)
 
Comment
Top