WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#23709 new enhancement

Relax wildcard restrictions for populate_network() when installing in subdomain mode

Reported by: rinatkhaziev Owned by:
Priority: normal Milestone: Awaiting Review
Component: Multisite Version: 3.5
Severity: normal Keywords: has-patch
Cc:

Description

I ran into the issue while trying to use wp-cli install-network command with --subdomains support.

Underlying core issue is that populate_network is trying to check if wildcard subdomain is accessible. This makes sense for large networks, but might not work with certain setups, or not needed for small sites.

Proposed solution is to add extra arg for populate_network() $wildcard_check with default to true. See attached patch

Attachments (1)

subdomain_wildcard.patch (1022 bytes) - added by rinatkhaziev 3 months ago.
Proposed patch for the ticket

Download all attachments as: .zip

Change History (6)

rinatkhaziev3 months ago

Proposed patch for the ticket

comment:1 nacin3 months ago

I don't see a problem necessarily with this patch. But, WP-CLI should check the returned WP_Error code and treat no_wildcard_dns as a warning, not a failure. If you look in wp-admin/network.php, we do the same.

I think it is probably time to turn populate_network() into an array of arguments.

comment:3 rinatkhaziev3 months ago

Thanks for wp-cli patch Andrew. I think this additional parameter still would be good for other edge cases.

comment:4 nacin3 months ago

I wonder if this wildcard check should be pulled out of populate_network(), and instead be done directly in wp-admin/network.php. (Wrapped into a function for wp-admin/includes/ms.php.) It is more of an application flow check than something that should be done at the schema/upgrade API level.

comment:5 SergeyBiryukov3 months ago

  • Version changed from trunk to 3.5
Note: See TracTickets for help on using tickets.