froger-me / wp-remote-users-sync

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

Login logout & update issue #36

Open soham99 opened 3 years ago

soham99 commented 3 years ago

Hello, at first great plugin offering one of those most important features.

I tried this on two fresh wordpress installs for test purpose http://domain1.local and http://domain2.local .

Site A WordPress Address (URL) - http://domain1.local - (WP Settings General) Site Address (URL) - http://domain1.local - (WP Settings General)

Site B WordPress Address (URL) - http://domain2.local - (WP Settings General) Site Address (URL) - http://domain2.local - (WP Settings General)

Both sites comprised of same versions of wordpress, themes & plugins. Wordpress version – 5.7.2 (Not a multisite installation) Themes & plugins – wordpress defaults Theme – Twenty twenty one Permalinks – postname Membership – anyone can register (Also checked & enabled). Also Home url in sites database table wp_option matches exact same.

Tried same setup using different http & php softwares & by varying software versions but still same happens. Nginx v1.16.0 & apache Php v7.3 & Php v8.0 MySQL v8.0.16

WP Remote Users Sync setup is made as shown in below video on both sites WP Remote Users Sync Setup

Issues :-

Whenever I create user on one site it syncs to other site and account gets created on Site B as it should be but if you look into array object in log of domain1.local (SiteA) the roles array is empty . There is no value like subscriber or editor. I am not sure if it is a problem as I just tried with default subscriber role. The problem might occur if multiple or different user roles have to be carried over.

Secondly whenever I try to login the user “user1” in this case from any of the domain it doesn’t sync the session to another site. It logs in the user on only single site from where we logged in. After refreshing the second site multiple times also it doesn’t log the user in on second site. I also checked browser cookies it only generates cookies for the site we login from cookies for second sites URL are not generated, like wordpress_loggedin & wordpress[hash] something similar to that.

Also lastly when I update existing user information from anyone of the site it does get updated on both the sites except for user role. User role only gets updated on the site which we are making changes or updating user information from but doesn’t sync to other site. I tried changing user role of existing user from “subscriber” to “editor”. I tried to update user info from SiteA.

I also tried opening the whole wordpress site as project in PHP IDE it ended up showing me below errors class-wprus-nonce.php -> on line 68 undefined variable $value redirect-processing-script.php ->on line 8 & 11. Undefined variables $async_url & $output class-wprus-api-role.php ->on line 97 undefined variable $data[ ‘base_url’ ] class-wprus-api-login.php ->on line 197 undefined variable $secure_cookie class-wprus-logger ->on line 138 uniform variable syntax is available in php 7 only for self::$settings_class::get_option() function.

Creating user logs snapshots

I have attached many screenshots for your reference as you might find them helpful in resolving the issue. But yeah great plugin.

user create - domain1 - snapshot 2 user create - domain1 -snapshot 1 user create - domain2

Login user logs snapshots

user login - domain1 user login - domain2

Logout user logs snapshot

user logout - domain1 user logout - domain2

Updating users logs snapshots

update user - domain1 snapshot update user - domain2  snapshot1 update user - domain2 snapshot2