• I am getting the following error when I try to active this plugin

    Plugin could not be activated because it triggered a fatal error
    Please network activate W3 Total Cache when using WordPress Multisite.

    We’re not running a multi-site installation anymore. This was a converted site from a MU to a standalone and I’m assuming the activation still sees that. Is there a way around this?

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Having exactly the same error on wordpress v 3.6.1 with W3 version 0.9.3. Please post if you find a fix.

    Cheers

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘W3- Total Cache Error when Activating’ is closed to new replies.