diff --git a/plugin.php b/plugin.php index 2a9b41a..4ae63b8 100644 --- a/plugin.php +++ b/plugin.php @@ -32,8 +32,7 @@ */ define( 'MR_FEATURE_FLAGS_PLUGIN_PATH', __FILE__ ); - -if ( ! file_exists( FeatureFlags::class ) ) { +if ( ! file_exists( Utils::class ) ) { include_once __DIR__ . '/vendor/autoload.php'; } @@ -52,7 +51,7 @@ function(): void { ); - $feature_flag_meta = get_option( FeatureFlags::$option_name ); + $feature_flag_meta = get_option( Utils::$option_name ); $flags_list = []; if ( is_array( $feature_flag_meta ) ) { $flags_list = $feature_flag_meta; @@ -149,7 +148,7 @@ function( string $page ): void { add_filter( 'plugin_action_links_mr-feature-flags/plugin.php', - function ( $links ) { + function ( $links ) { $url = esc_url( add_query_arg( 'page', @@ -167,3 +166,14 @@ function ( $links ) { return $links; } ); + +register_deactivation_hook( __FILE__, __NAMESPACE__ . '\mr_feature_flags_uninstall' ); + +/** + * Uninstall method for the plugin. + */ +function mr_feature_flags_uninstall() { + delete_option( Utils::$option_name ); +} + + diff --git a/src/components/SubmitControls.tsx b/src/components/SubmitControls.tsx index 2ffb594..b8e403d 100644 --- a/src/components/SubmitControls.tsx +++ b/src/components/SubmitControls.tsx @@ -49,8 +49,10 @@ const SubmitControls = ({ setIsSaving(false); - dispatch('core/notices').createSuccessNotice('✅ Saved successfully!', { + dispatch('core/notices').createSuccessNotice('Saved successfully!', { type: 'snackbar', + id: 'mr-feature-flags-snackbar', + icon: <>✅, }); }; return (