• 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.

Fixed Data validation breaks user syncing

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
The "username" and "email" fields should not be empty, so something is wrong with the user sync. I recommend you follow these steps:
  1. Upgrade the plugin to XFtoWP 1.5 RC1 (just released today)
    1. Read how to upgrade the plugin, go to "Manual Updates":
  2. After the upgrade, go to Bulk actions > Disconnect users. Wait to complete the process.
  3. Edit any WP user and scroll down to the "XenForo Profile" tab. It should be empty and the "User notes" section should not appear.
  4. If the user is successfully disconnected, try to manually connect an XF user to this WP user by entering the matching forum username. Once connected, each user's profile should look something like this:
    View attachment 4052
  5. Finally, if your test user syncs you can run Bulk actions > Refresh users and your users should properly sync

I have followed all the steps and it doesn't work. (Up to point 3 all perfect)

When I try to sync manually it stays like this:
1663143783961.png
The form is emptied:
1663143808242.png
-------------------
 

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
I see, there is an underlying issue with your sync setup. Are you willing to provide me with a wp admin login to take a look? Pm me login details if so.
 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
I see, there is an underlying issue with your sync setup. Are you willing to provide me with a wp admin login to take a look? Pm me login details if so.

I can't do that, it's a web in production. We could do it via anydesk or teamviewer, my telegram is: @alfnso

Talk to me and we'll see 👍🏼
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Understood. Be sure to also see this guide about setting up the api user and giving it full access including the "manage users and moderators" admin permission.

 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
Understood. Be sure to also see this guide about setting up the api user and giving it full access including the "manage users and moderators" admin permission.


Yes that is correct,

1663165127955.png
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Does the api user also have the admin permission "manage users and moderators"?
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
any other ideas to check out? any way to debug @Alex ??
Are any errors or warnings being posted to your debug file? At this point that's the only thing that may give me a clue as everything else sounds like it is setup correctly.
 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
Are any errors or warnings being posted to your debug file? At this point that's the only thing that may give me a clue as everything else sounds like it is setup correctly.

No, I do not see any error reflected in wordpress
 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
I will run from a clean install and see if the same issue occurs when I import wp users into xf.

Anything else I can do? I bought it for this, but it does not perform the function.

I have tried to debug via php but I can't see where the error is
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
Anything else I can do? I bought it for this, but it does not perform the function.

I have tried to debug via php but I can't see where the error is
I just ran a test where I created 150 test users on WP and 0 users on XF, and running the "sync WP users to XF" registered and synced the users successfully. Here is what a synced user's profile settings should look like:

Screen Shot 2022-09-15 at 4.27.00 PM.png

I can't say what the issue with your site at this point without seeing the WP admin. A recording of you manually syncing a user and your plugin settings would also be helpful.
 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
I just ran a test where I created 150 test users on WP and 0 users on XF, and running the "sync WP users to XF" registered and synced the users successfully. Here is what a synced user's profile settings should look like:

View attachment 4060

I can't say what the issue with your site at this point without seeing the WP admin. A recording of you manually syncing a user and your plugin settings would also be helpful.

could you talk via telegram or whatsapp to see this?

telegram: @alfnso

Thank you
 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
I have found some errors:

- This format is not correct for Xenforo API when the field is created with date format (This breaks the synchronization of users):
1663576402418.png
1663576444551.png
1663576482795.png

If we deactivate that field, the synchronization is carried out correctly.
 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
My wordpress looks like this after launching the synchronization:
1663576970583.png


This is because the plugin has previously created a "$wp_usermeta['users']" with empty ID in this user's profile.

For that reason, when you show it through the console, 2 are shown. One empty and the other with the correct data.

This causes wordpress to fail to link the account correctly.

Here is a sample of "$wp_usermeta['users']" after launching the sync request:

1663576926381.png
 
Comment

joska1993

Active member
XFtoWP
Messages
32
Reaction score
1
To fix this, I've modified the "disconnect_user" function to add "unset($wp_usermeta['users']);" and so remove the empty field.

This should be added natively in future plugin updates.

1663578837625.png

And now when I sync everything is perfect:

1663578962747.png
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
I have found some errors:

- This format is not correct for Xenforo API when the field is created with date format (This breaks the synchronization of users):
View attachment 4070
View attachment 4071
View attachment 4072

If we deactivate that field, the synchronization is carried out correctly.
Thank you for sending me this information. I have made a change that will no longer sync the hour:minute:second timestamp to the XF user profile field, as that extra information was breaking the date validator, unfortunately.

XFtoWP will still primarily save sync dates in the following format:

2022-09-21 15:04:05

But will only send the date formats that to match XF validation like so:

2022-09-21

My wordpress looks like this after launching the synchronization:
View attachment 4074


This is because the plugin has previously created a "$wp_usermeta['users']" with empty ID in this user's profile.

For that reason, when you show it through the console, 2 are shown. One empty and the other with the correct data.

This causes wordpress to fail to link the account correctly.

Here is a sample of "$wp_usermeta['users']" after launching the sync request:

View attachment 4073

In addition, the type of error that was triggered from the broken API validator will no longer allow empty users to be created if returned again, so it should solve the phantom users issue.

To fix this, I've modified the "disconnect_user" function to add "unset($wp_usermeta['users']);" and so remove the empty field.

This should be added natively in future plugin updates.

View attachment 4075

And now when I sync everything is perfect:

View attachment 4076
Good suggestion, but if a WP user has multiple XF users synced to their account then clearing the whole users key will also remove those users which is not intended here. An exception could be made to only clear the whole key it when only 1 user is allowed per account, and I'd look into it if this issue comes up again.

I believe this was only caused because of the date validation issue, which shouldn't come up again. I have made the necessary changes in XFtoWP 1.5 RC2 which will be ready to download shortly.

Thank you again for your time on this and I hope the plugin is working better for you now. :)
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,702
Reaction score
1,901
To fix this, I've modified the "disconnect_user" function to add "unset($wp_usermeta['users']);" and so remove the empty field.

This should be added natively in future plugin updates.

View attachment 4075

And now when I sync everything is perfect:

View attachment 4076
For the sake of completion, your suggestion here has been patched into the next XFtoWP Release Candidate as described:

Good suggestion, but if a WP user has multiple XF users synced to their account then clearing the whole users key will also remove those users which is not intended here. An exception could be made to only clear the whole key it when only 1 user is allowed per account, and I'd look into it if this issue comes up again.
 
Comment
Top