Make WordPress Core

Opened 7 years ago

Last modified 5 years ago

#38750 new feature request

Split wp_signups into wp_user_signups and wp_blog_signups

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.0
Component: Login and Registration Keywords: 2nd-opinion needs-screenshots needs-unit-tests needs-patch
Focuses: multisite Cc:

Description

Right now, wp_signups (and the entire related API) does double-duty. It's 1 database table that's used for both users & blogs, but there are a few issues with this approach:

  • Open sign-ups may or may not include ability to create sites
  • There is no UI for managing sign-ups in WordPress core
  • Sign-ups are different between singlesite & multi-site
  • Plugins like BuddyPress do their best to include and/or work-around WordPress's core functionality, but end up writing a ton of additional code to manage this
  • Other membership plugins are forced to roll their own approach every single time
  • It's possible for multisite sign-up race conditions to exist, with users & sites created or activated from underneath each other (documented in wpmu_activate_signup())

I'm adding the multisite focus to this issue, because all of the current code is only relevant to multisite, but I'd like to see single-site inherit whatever future approach we can come up with.

The core sign-ups code, stinks. Yet open registration is part of what makes WordPress & community/membership sites great. I think it would be great to take what we've learned from BuddyPress, WordPress.org, WordPress.com, and the bevy of Membership plugins, and make a great sign-up component/API for WordPress core.

Change History (5)

#1 @johnjamesjacoby
7 years ago

  • Keywords 2nd-opinion needs-screenshots needs-unit-tests needs-patch added

#2 @johnjamesjacoby
7 years ago

An alternative would be to ditch wp_signups all together, and add status and creator columns to wp_blogs.

Then, when a user is activated, the process would be:

  • Check wp_users::user_activation_key
  • Switch their user_status from pending to active
  • Check for wp_blogs::status in pending with a matching creator_id to the wp_users::user_id
  • Switch wp_blogs::status from pending to active

This has the net positives of:

  • Eliminating an unloved API
  • Removing a weird database table
  • Unifying sign-ups across single & multi site installation types
  • Giving plugins a reliable API & schema to use going forward

...at the cost of...

  • Needing to refactor the existing WPMU specific code
  • Deprecating a truckload of code
  • Updating various interfaces to include "Pending" users, and the associated links to handle manual activation, etc...
  • Developer awareness that wp_signups is going away
  • Probably a several step, several release cycle development plan

See also #34316.

#3 @Mista-Flo
7 years ago

+1 on this needed refactoring, it will be far easier to deal with signups with this approach.

This ticket was mentioned in Slack in #core-multisite by florian-tiar. View the logs.


7 years ago

#5 @eArtboard
5 years ago

+1 on this sign-ups on multisite should match the UI of single site.

Note: See TracTickets for help on using tickets.