• 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 members-only support forums.

Bulk "Import WP users to XF" is not working

topicseed

Member
XFtoWP
Messages
6
Reaction score
0
Hello,

I've set up a XenForo in a subfolder (example.com/community) with its separate database, with essentially just me as administrator and a couple of test users. And I have my seven-year-old WordPress blog in the root (example.com). I have installed and connected the XFtoWP plugin, and it seems to connect to my forums just fine in the settings.

My WP/WC site has 5,000 registered users that I want to bulk import into XF – so they can immediately use the forums once I launch it publicly via our email list.

1673089796714.png

When I run the action, it essentially says "USERNAME OF WORDPRESS user synced to LOGO_OF_XENFORO" without the username of the associated XF user. When I looked in XF's user list, none were created. When I look in wp_usermeta for these users, there is the "xftowp" meta_key but with 0 (zero) as the associated user ID.

And in my WordPress php_errorlog file:
[07-Jan-2023 11:03:24 UTC] PHP Warning: Undefined property: stdClass::$user in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 588
[07-Jan-2023 11:03:24 UTC] PHP Warning: Attempt to read property "user_id" on null in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 588
[07-Jan-2023 11:03:24 UTC] PHP Warning: Undefined variable $xf_connected_user in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 658
[07-Jan-2023 11:03:24 UTC] PHP Warning: Attempt to read property "user" on null in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 658
[07-Jan-2023 11:03:24 UTC] PHP Warning: Attempt to read property "user_id" on null in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 658
[07-Jan-2023 11:03:24 UTC] PHP Warning: Undefined variable $xf_connected_user in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 679
[07-Jan-2023 11:03:24 UTC] PHP Warning: Attempt to read property "user" on null in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 679
[07-Jan-2023 11:03:24 UTC] PHP Warning: Attempt to read property "username" on null in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 679
[07-Jan-2023 11:03:24 UTC] PHP Warning: Undefined variable $xf_connected_user in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 680
[07-Jan-2023 11:03:24 UTC] PHP Warning: Attempt to read property "user" on null in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 680
[07-Jan-2023 11:03:24 UTC] PHP Warning: Attempt to read property "email" on null in /home/customer/www/mydomain.com/public_html/wp-content/plugins/XFWP/requests/users.php on line 680

Any thoughts on what it could be due to?
 
Last edited:

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,771
Reaction score
1,918
When I run the action, it essentially says "USERNAME OF WORDPRESS user synced to LOGO_OF_XENFORO" without the username of the associated XF user. When I looked in XF's user list, none were created. When I look in wp_usermeta for these users, there is the "xftowp" meta_key but with 0 (zero) as the associated user ID.
It looks like there is a problem creating users with your API key.

Double check this newly revised guide about API user permissions:


Also, test if a single user can be created manually from WP admin > Users > add new. Make sure "Sync user registrations" is on from the XFtoWP settings.
 
Comment

topicseed

Member
XFtoWP
Messages
6
Reaction score
0
I created a WP user manually from the dashboard, and it did not create it in XenForo.

Screenshot 2023-01-08 at 13.53.19.png

I've also checked the API key's permissions, and they're (should be) fine.

Screenshot 2023-01-08 at 13.56.18.png

User creation on XF works, so that's definitely not where the issue seems to be.

Not sure what to try next :/
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,771
Reaction score
1,918
Does your API user have permissions to create users? They will need to be an Admin, or you can assign user creation only permissions in XF admin > Groups & Permissions > Administrators
 
Comment

topicseed

Member
XFtoWP
Messages
6
Reaction score
0
From my understanding, the API Key is a super user, so it is not linked to a regular XF user.

Should I instead create an admin user on XF and then an API key to assume that admin's role?
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,771
Reaction score
1,918
From my understanding, the API Key is a super user, so it is not linked to a regular XF user.
Yes, you still need a user attached to the super user api key. Enter that user ID in the xftowp site setup, and make sure that user has the admin permission to create users.
 
Comment

topicseed

Member
XFtoWP
Messages
6
Reaction score
0
I tried adding the ID of a specific admin user from XF in the plugin's settings, and it did not work. I then tried in Postman myself directly to call the API, and it did not work either. Using the first user's ID (admin) worked.

So it must be on the XF side that permissions were not working.

It seems to work now (when I sync a WP user for example). I will try importing the 5k users this week.

Thanks!
 
Comment
Top