I’m going to guess that you, like me, have the Proper Network Activation plugin installed.
The issue is a conflict between the Proper Network Activation (PNA) plugin and the W3 Total Cache (W3TC) plugin. The PNA plugin doesn’t call the W3TC plugin’s activate()
function as it would expect and hence the W3TC plugin doesn’t think it’s activated network-wide.
Here is the relevant code in wp-content/plugins/w3-total-cache/lib/W3/RootAdminActivation.php
which expects and gets a parameter of $network_wide
equal to 1
when the PNA plugin is not installed. However, the PNA plugin calls the function without an argument (meaning $network_wide = 0
) which causes the process to skip the appropriate first block and instead fall to the final else
which throws the message and dies.
class W3_RootAdminActivation {
function activate($network_wide) {
w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
// decline non-network activation at WPMU
if (w3_is_network()) {
if ($network_wide) {
// we are in network activation
} else if ($_GET['action'] == 'error_scrape' &&
strpos($_SERVER['REQUEST_URI'], '/network/') !== false) {
// workaround for error_scrape page called after error
// really we are in network activation and going to throw some error
} else {
echo 'Please <a href="' . network_admin_url('plugins.php') . '">network activate</a> W3 Total Cache when using WordPress Multisite. ';
die;
}
I fixed the above by adding a PROPER network activation check within that final ‘else’ block:
class W3_RootAdminActivation {
function activate($network_wide) {
w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
// decline non-network activation at WPMU
if (w3_is_network()) {
if ($network_wide) {
// we are in network activation
} else if ($_GET['action'] == 'error_scrape' &&
strpos($_SERVER['REQUEST_URI'], '/network/') !== false) {
// workaround for error_scrape page called after error
// really we are in network activation and going to throw some error
} else {
if ( ! function_exists( 'is_plugin_active_for_network' ) )
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
if ( ! is_plugin_active_for_network( 'w3-total-cache/w3-total-cache.php' ) ) {
echo 'Please <a href="' . network_admin_url('plugins.php') . '">network activate</a> W3 Total Cache when using WordPress Multisite. ';
die;
}
}
This code properly functions by throwing the error ONLY if the w3tc plugin is not network activated.