/** * Deactivate plugin action * * @return void */ public static 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 = '<strong>W3 Total Cache Error:</strong> ' . 'Files and directories could not be automatically ' . 'removed to complete the deactivation. ' . '<br />Please execute commands manually:<br />' . '<div style="' . $changes_style . '">' . $r['required_changes'] . '</div>'; // this is not shown since wp redirects from that page // not solved now echo '<div class="error"><p>' . $error . '</p></div>'; } } try { Util_Activation::disable_maintenance_mode(); } catch (\Exception $ex) { } }