froger-me / wp-remote-users-sync

Synchronise users across WordPress websites
GNU General Public License v3.0
72 stars 33 forks source link

Need help syncing profile images! #7

Closed gearrup closed 4 years ago

gearrup commented 4 years ago

Hi, first of all, the plugin is awesome, there are very few similar plugins to this, great work. I'm using buddypress on both sites, it syncs profiles but the profile images are not being synced. I can see _ap_temp_media in meta data on one site only but not the other but not even sure what this is as it just spells media. I can't find anything in meta that relates to media or profile images other than this. Is syncing profile images possible at all? Thanks in advance!

froger-me commented 4 years ago

Hello @gearrup !

BuddyPress rebuilds the path to the profile pictures each time it displays it instead of relying on metadata, using a combination of bp_core_fetch_avatar and user ID.

Achieving the sync of user avatars would require significant additions to the code base, altering both how buddypress fetches and saves the information. I think the best approach would be to keep a new user meta getting synced across sites with the latest URL that gets updated when the avatar is updated, and use the value of that meta if it exists instead of rebuilding the URL when fetching the avatar. This way, site A may use site B's URL for avatars, and vice-versa, depending on which URL is synced up in the newly created user meta. That should do the trick, and also take care of compatibility with themes as well.

froger-me commented 4 years ago

With no more information provided in the past 7 days, I am closing the issue.