diff --git a/aaa-option-optimizer.php b/aaa-option-optimizer.php index d41f2e9..75b11ec 100644 --- a/aaa-option-optimizer.php +++ b/aaa-option-optimizer.php @@ -24,6 +24,7 @@ require_once __DIR__ . '/src/autoload.php'; register_activation_hook( __FILE__, 'aaa_option_optimizer_activation' ); +register_deactivation_hook( __FILE__, 'aaa_option_optimizer_deactivation' ); /** * Activation hooked function to store start stats. @@ -53,6 +54,16 @@ function aaa_option_optimizer_activation() { ); } +/** + * Deactivation hooked function to remove autoload from the plugin option. + * + * @return void + */ +function aaa_option_optimizer_deactivation() { + $aaa_option_value = get_option( 'option_optimizer' ); + update_option( 'option_optimizer', $aaa_option_value, false ); +} + /** * Initializes the plugin. * diff --git a/uninstall.php b/uninstall.php new file mode 100644 index 0000000..4fa17e2 --- /dev/null +++ b/uninstall.php @@ -0,0 +1,16 @@ +