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: |
|
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)
Change History (6)
rinatkhaziev
— 3 months ago
comment:1
nacin
— 3 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
rinatkhaziev
— 3 months ago
Thanks for wp-cli patch Andrew. I think this additional parameter still would be good for other edge cases.
comment:4
nacin
— 3 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
SergeyBiryukov
— 3 months ago
- Version changed from trunk to 3.5
Proposed patch for the ticket