Closed clatwell closed 9 months ago
Ok, so here's what I discovered:
Upon visiting the separate multisite site, the admin bar was present and I was still logged in as bdichiarademotest. (Same for the Root/Main site)
Even though my session exists, it appears I'm limited in some kind of way only to the "Demo" site.
So really, I haven't discovered anything you didn't already know, but can confirm that the user session is valid/shared across sites.
- Are Users automatically logged-in to all Nonprofit Sites once they log-in to one site?
Yes. Your assessment is correct.
- Will Nonprofit Site Admins be able to see all front-end Users in the network from their Site?
I would suggest an alternative approach. Rather than syncing everyone across all sites all the time, why not just sync them as-needed? If I'm logged in to any site (i.e. have a WordPress user session), then visit any other site, we can:
add_user_to_blog()
in an early hook (or perform a redirect if necessary) and add them only to that site.That way we don't run the risk of adding ALL users to ALL sites, which could be hundreds, just in case they decide to visit that site.
- Will all front-end Users show as Customers in WooCommerce reports for all Sites?
I guess it depends on which reports we're talking about. If it's the reports built into WooCommerce, I assume the reports would include any user, regardless of role, as long as they've interacted with the site (placed a bid, won an auction, etc). In order to restrict these reports to users of a specific role, we'd need to modify the WooCommerce reporting feature.
If we're talking about our custom reports (in Admin dashboards), we can set up filters by role if it's a requirement.
- What happens when a new Nonprofit site launches?
With the approach I outlined above, nothing. Users will have to visit the site in order to be added to it.
I think WP Global Cart is overkill for what we need, and I don't really trust that Multisite User Sync. I think this is something we can handle in ~2 hrs of dev + ~1hr of testing.
The expected functionality for GB is that Donors who create an account on the front-end and login will be logged-in to all Nonprofit sites on the network and can bid on any Auction without needing to create a new account or login for each Nonprofit site. I've done a bunch of research on this but I'm spinning my wheels and need some back-up. :)
For this ticket, we'd like to identify the best way to support global users. We don't necessarily have to implement it now, but we need to feel confident enough about the approach that we can make decisions dependent on it.
Current Understanding
In WordPress multisite, the Users are shared. Specifically, the WordPress User table is shared. But, this doesn't mean a User can access all sites with a single login. This can be made possible only if the User is granted access to other sites. So, if a Front-end User creates an account from Nonprofit A's site, a User will be created in the shared User table, but the User will only have a Customer role with Nonprofit A. If they visit Nonprofit B's site, they won't have login access, because they don't have a Customer role with Nonprofit B.
Automated Customer Sync Approach
Since the Users table is shared, when a front-end User registers with a Nonprofit site, we could create a Customer role for them on all the existing Nonprofit sites. We could pull in a plugin like WordPress Multisite User Sync to accomplish this, which supports WooCommerce customers and automatic syncing for front-end user registrations. Or we could write this code ourselves based on the user registered hook (_userregister). Here are my open questions with this approach:
1. Are Users automatically logged-in to all Nonprofit Sites once they log-in to one site? I think so. If they log-in to Nonprofit Site A, then go to Nonprofit Site B, we'll do an auth check, see that they're logged-in, see that they have a Customer role, and voila.
2. Will Nonprofit Site Admins be able to see all front-end Users in the network from their Site? If Users are automatically given a Customer role for all Sites, and Site Admins see all Users registered for their Site in their Site's Users section, then the answer is yes. At a minimum, we would need to ensure that Site Admins aren't able to modify / delete those User accounts. Ideally, we would be able to "hide" Users with a Customer role from the Users section for each Site, but I'm not sure what the ramifications of that would be.
3. Will all front-end Users show as Customers in WooCommerce reports for all Sites? Ideally, we'd like for Nonprofit Site Admins to only see Customers in their WooCommerce reports who have actually participated in their Auctions. Nonprofits will be itching to export donor information in their CRMs, but we don't want those exports to include the names and email addresses of every User in the system; just the ones that have actually donated to the Nonprofit.
4. What happens when a new Nonprofit site launches? This approach assumes that new Users are synced when they register, but what happens when a new Nonprofit site launches? Does the Multisite User Sync plugin support auto-syncing when a new site is created?
Automated Subscriber Sync + Site-specific Customer Registration -- Current Favorite
When a front-end User registers with a Nonprofit site, we could create a Subscriber role for them on all Nonprofit sites. They would show as logged-in on all the sites and be able to Bid. When they click "Bid Now" for a specific site, we check to see if they have a Customer role at the Nonprofit hosting the Auction. If they don't, we create one for them before redirecting them to the Checkout flow.
This approach gives us global user login and eliminates a lot of the concerns around Nonprofits having Customers who have never interacted with their site, but adds a bit of complexity to the Bidding flow, and we'd still need to figure out answers to 2 and 4 above.
WP Global Cart Plugin
The WP Global Cart plugin supports global users, and has a few other features that might help us out, like a global "My Account" page that we could use as our "Bidder Dashboard" to show Users their bid history across the Network.
This plugin is cited frequently in WooCommerce + Multisite blog posts, but it isn't listed in the WordPress plugin repository. Based on my understanding of plugin stuff with WPVIP, that might mean we aren't able to use it. But even if we could, we might be wading into unchartered waters and would prefer to use something more official.
Other approaches I've ruled out