WordPress User Sync

NOTE: This content is for advanced users only, who understand the concept of user tables, database, etc. If you don’t understand any of this, then just ignore this – you don’t really need to know this in order to use DAP. This is only an explanation for those who wish to go under the hood of DAP and its integration with WordPress.

As you probably already know, WordPress has its own user database.

DAP has its own User database, and doesn’t use the WordPress database – for many reasons, not limited to the following…

1) Ability to store more user information than what WordPress allows

2) More powerful user search, profile updates, affiliate information, etc.

So, if you want to use any WordPress based plugins – like WordPress Forums or Subscribe2Blog – these forums are looking at WordPress’ native user database.

Now comes the necessity of “syncing” the DAP user data and your WordPress user data.

In the DAP Dashboard, in “Setup > Config > Advanced“, you will see two settings for syncing DAP & WP user data.

(1) Sync DAP User data and WP User data

If you turn this to “Y” (for “Yes”), then every time someone logs into DAP, their DAP user data (just name and email) is automatically “synced” with WordPress user data. If you set this to “N”, then no data will be transferred from DAP to WordPress.

(2) Sync WP data only for PAID users

This one matters only if you have set (1) above to “Y”.

If you want only your “PAID” members to be synced with WordPress, then set this to “Y“.

If you want both “FREE” and “PAID” members synced with WordPress, then set this to “N“.

Here’s how it actually works:

  1. For the sync to work, you must first setup and save the above 2 config settings
  2. After you save the above two config settings, make sure you log out of DAP and re-log in (if you are/were logged in and testing as a regular user), because only then, the Config settings above will take effect.
  3. Your user must log in through a DAP login form (not the WP login form).
  4. Make sure the user is redirected to any part of your WordPress blog after log in. This can be done via “Logged In URL” setting in DAP Config.
  5. The user can be redirected to any WP page, WP post or even your blog home page – that’s the only time the ‘syncing’ kicks in.
  6. When user lands on any page/post of your WP blog, then the DAP LiveLinks plugin (which you have already installed & enabled) kicks of the “sync”, copies the logged in member’s name and email over to the WordPress user table, and also automatically logs him into your WordPress blog.

That’s all there is to it.

Also see: Forum Integration

14 comments ↓

#1 Jeff Kurzner on 05.05.10 at 10:21 pm

what happens if the user updates their name or email in WordPress from the WP Profile instead of DAP profile?

#2 Ravi Jayagopal on 05.06.10 at 11:09 am

In the current version, the WP changes will get overwritten by DAP the next time they log in or update their profile. DAP is the main “master” database.

#3 Lex on 08.03.10 at 11:52 am

Hi Ravi,

Is there a way to add user profile photos to the DAP profile so that users can have a photo in their profile? It would be ideal to have this synch with the Simple:Press or other WP forum plugins.

#4 Veena Prashanth on 08.10.10 at 12:39 pm

Lex,
No, cannot add user profile photos to DAP profile currently but it’s on our to-do list.

#5 Candace on 12.06.10 at 8:32 pm

Hi, I've installed DAP and so far it's working fine. I am also using Mingle Forums, and have Synched DAP as instructed, and it works…when you login with the DAP login, you are also logged into the forum, but you are not added as a "new user" to the forum automatically. This means that even though you are logged in, you can't access the posts in the forum. Is there a way to overcome this? I would like new users to be added when they log in for the first time, without me having to add them manually. Is this possible?

#6 Veena Prashanth on 12.07.10 at 12:34 pm

Candace,

If you are logged into the forum when you login to DAP, then that indicates that the user sync to wordpress is working fine.

So I am not following your comment about DAP not creating new users. If the user is not created in WP, then DAP cannot log you into the forum. Anyway… we have made some more improvements to the forum / wordpress syncing rules with DAP 4.0. So I suggest that you wait a couple weeks and install dap 4.0 and see if your syncing issues are resolved with that.

#7 Dan Linstedt on 03.09.11 at 4:30 am

Hi Ravi,

I like the integration, BUT – is there an API callback function in DAP that I can execute when a login in WP is made? I have my own custom login form that I want to use, and I’d like to call “DAP” to setup the cookie/verify the user and so on.

Please let me know,
Dan L

#8 Veena Prashanth on 03.09.11 at 11:40 am

Dan,

You can redirect to http://Yoursite.com/dap/authenticate.php

Example below:

header(“Location: /dap/authenticate.php?email=” . $post['email'] . “&password=” . $post['password'] . “&submitted=Y”);

#9 Troubleshooting DAP/WordPress Sync — DAP Documentation on 03.18.11 at 11:50 pm

[...] Check if you’ve enabled DAP/WP sync in the first [...]

#10 Starters Guide — DAP Documentation on 04.05.11 at 1:30 pm

[...] rid of wordpress login. Make DAP login the only entry point.  If you set up DAP->WP sync correctly, then DAP will automatically sync users to WP and upon login to DAP, the users will be [...]

#11 Juan on 09.28.11 at 6:33 am

If the user is created by dap, then the ID will be the same in wordpress no matter what changes are done to the user in DAP and/or in wordpress? (knowing that wordpress user get rewritten everytime it syncs with DAP)

thanks.

#12 Veena Prashanth on 09.28.11 at 4:37 pm

>>If the user is created by dap, then the ID will be the same in wordpress no matter what changes are done to the user in DAP and/or in wordpress? < <

Yes, if dap -> wp sync is enabled, then dap will figure out how to sync dynamically i.e. when to create a new account and when to update existing account.

#13 Al on 02.01.12 at 7:06 am

The problem I have when using the dap –> wordpress feature is that wp users automatically see the wordpress toolbar at the top of the screen when they login. From this wp toolbar, they can access their wp profile and change their wp password there.
However as dap is the master and wp the slave, this password change will not be effective. It’s going to be difficult to explain to my users that they have a profile here but they can’t change the password because they have to do it on another profile (the dap one).

Any idea on how to solve this ?

#14 Ravi Jayagopal on 02.03.12 at 2:52 am

It’s unfortunately an annoying WP feature. There are a few different ways to get rid of it.

Pls see https://www.google.com/search?q=wordpress+remove+admin+toolbar

Leave a Comment