multisite-fixes
multisite-fixes copied to clipboard
Sunrise.php and some mu-plugins to fix common issues on Multisite / Multinetwork
Multisite Fixes
DISCLAIMER: This project is no longer maintained.
This repository contains a sunrise.php and some must-use plugins to address common issues when working with Multisite and Multinetwork.
Bundled functionalities
All parts of this repository can be used individually as needed. You don't have to use all of them.
sunrise.php: Detects www vs non-www and redirects if necessary- WPMS SSL Redirects Plugin: Allows to define which sites are HTTPS (through
wp-config.php) and redirects if necessary - WPMN Global Admins Plugin: Uses constants in
wp-config.phpto specify users who are global admins (across all networks) vs regular network admins - WPMS Site URL Fixer Plugin: Fixes URLs in WordPress setups where WordPress Core is located in a subdirectory
Setup
- Copy all must-use plugin files you would like to use into your
wp-content/mu-pluginsdirectory. - If you wanna use
sunrise.php, copy it directly into yourwp-contentdirectory and then adddefine( 'SUNRISE', 'on' );to yourwp-config.phpfile.
Individual Plugins
- For WPMS SSL Redirects, define a constant called
SSL_SITESin yourwp-config.phpand fill it with a comma-separated list of domains that should use HTTPS; you may also add a constantSSL_NETWORKSin a similar manner to make entire networks use HTTPS orSSL_GLOBALwith boolean true to have all sites in all networks use HTTPS. - For WPMN Global Admins, define a constant called
WP_GLOBAL_ADMINSin yourwp-config.phpand fill it with a comma-separated list of usernames that should be global administrators; you should then add further constants named likeWPMN_NETWORK_{{NETWORK_ID}}_ADMINSin a similar manner to define the network admins for each network. - For WPMS Site URL Fixer, define a constant called
WP_CORE_DIRECTORYan simply add the subdirectory name where WordPress Core resides (no trailing slashes!).
Be aware
Everything here should only be used for subdomain (or domain) setups. Do not use with subdirectory setups!
The code in this repository requires at least WordPress 4.6.