froger-me / wp-remote-users-sync

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

User meta not syncing between single and multisite instances #34

Open qstudio opened 3 years ago

qstudio commented 3 years ago

We are running two WP instances - one as the central API and a network install with multiple sub sites.

We can connect network sites to the API and sync standard user meta fields, such as email - however user meta fields are not syncing.

The plugin reports the following error on the network:

WordPress database error Table 'epharmacy.wp_2_usermeta' doesn't exist this is from Wprus_Settings->get_user_meta_keys

I can overcome the error by using {$wpdb->base_prefix} instead of {$wpdb->prefix} in class-wprus-settings:823 - and the plugin does not report other issues, but this does not resolve the user meta syncing issue.

Also, roles are not syncing at all.

qstudio commented 3 years ago

Follow-up, in fact, the suggested fix did work - but needed to be applied to both versions of the plugins - on the API and network..

Network sites duplicate most WP tables for sub sites, but certain tables, such as wp_user and wp_usermeta are not duplicated, so the $wpdb->prefix should use the base_prefix for these tables.

qstudio commented 3 years ago

This patch tries to address multisite issues - https://github.com/TotalAccessHealth/wp-remote-users-sync

CarlitoDevDreamer commented 1 year ago

Hi @qstudio! I've read some of your comments regarding this plugin's issues, and you mentioned that Network sites duplicate most WP tables for sub-sites. However, specific tables like wp_user and wp_usermeta are not duplicated. Consequently, the $wpdb->prefix should utilize the base_prefix for these particular tables. Could you provide more details on how to implement this? I've also opened an issue related to this topic, which you can find here: https://github.com/froger-me/wp-remote-users-sync/issues/73

Thanks!

qstudio commented 1 year ago

@ArduinoProjectPortugal you can see the PR here: https://github.com/froger-me/wp-remote-users-sync/pull/38