@girish said in Multiple WP sites sharing wp_users db table:
@ChicagoGregg said in Multiple WP sites sharing wp_users db table:
I would like to share the WP users between the two.
Is this something supported by WP ? How can it share users but not anything else? It writes to db1 for users and db2 for other things like posts/comments ?
Sure, this is done currently on WP sites even when cloudron isn't in the mix. For simplicity of this thread, I was just referring it to wp_users, but it also requires usermeta.
I wonder how the bigger sites using WP also have their topology laid out with MySQL DB's clustered, and even with something like Kubernetes.
I would love to find a tech paper somewhere on this. And then, when it comes to having a larger website that is load balanced across disparate physical locations, how Cloudron could (if possible) be laid out to handle the workload. I'm thinking that it would be difficult and, in these situations, it might be best to simply have a dedicated host running, for example, Docker, Portainer, Kubernetes, MySQL (clustered), etc.
==========
Ok, it might be that I'm the guinea pig for this to test to and validate this works as expected.
I've found the below two articles to be very valuable.
-
How to Share Logins and Users Between Multiple WordPress Sites - https://kinsta.com/blog/share-logins-wordpress/
-
The Ultimate Guide to WordPress User Roles and Capabilities - https://kinsta.com/blog/wordpress-user-roles/
After reading the above two, I think the WP sites would have to use the same MySQL database, but have a different DB table prefix for each site (for the non-wp_users and wp_usermeta tables). The WP hook that the first article references is essentially to clone the user capabilities from one site to another within the same MySQL database upon modification.
Basically, here is what I'm working on.
Site #1 - Primary website (domain.org) that hosts the home page / landing page. Introduces the visitor to the society, its features, how the public/private memberships work, how to join, etc. This also will likely handle some administrative-related functions (including plugins), e.g. CRM, Support/Ticketing system, newsletter blasts, etc. This might also be the primary interface for where user roles, metadata, etc. are administered (TBD).
Site #2 - Social website part of the society (domain.social). This runs the social platform, event calendar, etc. It will also have such WP plugins like AutomatorWP and WP Fusion (amongst others).
Site #3 (TBD) - Media platform (domain.tv). This will handle a "media" related matters... Very similar to such sites like YouTube, Rumble, Bitchute, Odyssey, etc. and/or providing a "Netflix-like" type site. Users, based on their membership level, would be able to access this site. The users would likely also be "synchronized" to this site.
For now, I will be working on checking into the feasibility and implications for Site #1 and Site #2 "synchronization".
I will find out also what drawbacks, if any, exist for such things like having AutomatorWP (Site #2) trigger certain events and if it would (could) be picked up by the CRM (Site #1).
I would love to keep the administrative-related functions separate from Site #2 and Site #3. No need to have additional bloat where not needed.
So, within the next month, I plan on getting all this in place. I will do some testing and validation in the next few weeks.
If anyone has information, tips, etc. please do chime in!
Looking forward to checking this out.
-gregg