froger-me / wp-remote-users-sync

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

store_nonce fails on multisite when "Network Activated" #35

Closed ptrsmk closed 1 year ago

ptrsmk commented 3 years ago

I am operating a multisite network that presently has two distinct domains. I installed and network activated the plugin. I completed setup, and enabled only login and logout functionality. I have previously custom coded a solution to have every user in my db assigned to all sites on the network.

If I logged in to the subsite, then I was properly logged into the main site as well. But logging into the main site did not log me into the subsite.

In the process of debugging, I discovered that the breakdown ultimately occurred in the store_nonce function. On installation of the plugin, because it was Network Activated, the wp_wprus_nonce table was created, but there was no wp_2_wprus_nonce table created. This was causing the insert to fail and return false inside the store_nonce function.

So, I don't know if it's right to classify this as a bug, since the plugin works on multisite as long as it's activated individually on each site. However, I think it would be profitable to modify it such that the plugin would work as expected when Network Activated. So, maybe this is just an enhancement request.

qstudio commented 3 years ago

you need to fork the plugin and force base_prefix on certain tables, notable user, usermeta and the wprus tables - so that WP Multisite reads from the right tables.

qstudio commented 3 years ago

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

froger-me commented 1 year ago

fixed in 2.0