network activate W3 Total Cache when using WordPress Multisite.';
die;
}
}
try {
$e = Dispatcher::component( 'Root_Environment' );
$config = Dispatcher::config();
$e->fix_on_event( $config, 'activate' );
Generic_AdminLinks::link_update( $config );
// try to save config file if needed, optional thing so exceptions
// hidden
if ( !file_exists( Config::util_config_filename( 0, false ) ) ) {
try {
// create folders
$e->fix_in_wpadmin( $config );
} catch ( \Exception $ex ) {
}
try {
Util_Admin::config_save( Dispatcher::config(), $config );
} catch ( \Exception $ex ) {
}
}
} catch ( \Exception $e ) {
Util_Activation::error_on_exception( $e );
}
}
/**
* Deactivate plugin action
*
* @return void
*/
static public function deactivate() {
try {
Util_Activation::enable_maintenance_mode();
} catch ( \Exception $ex ) {
}
try {
$e = Dispatcher::component( 'Root_Environment' );
$config = Dispatcher::config();
$e->fix_after_deactivation( $config );
Generic_AdminLinks::link_delete();
} catch ( Util_Environment_Exceptions $exs ) {
$r = Util_Activation::parse_environment_exceptions( $exs );
if ( strlen( $r['required_changes'] ) > 0 ) {
$changes_style = 'border: 1px solid black; ' .
'background: white; ' .
'margin: 10px 30px 10px 30px; ' .
'padding: 10px;';
$error = 'W3 Total Cache Error: ' .
'Files and directories could not be automatically ' .
'removed to complete the deactivation. ' .
'
Please execute commands manually:
' .
'
' . $error . '