From cb3ccb4cdc7351f4acde3b68857c69183c825d37 Mon Sep 17 00:00:00 2001 From: Shea Bunge Date: Sun, 12 Nov 2023 01:19:18 +1100 Subject: [PATCH] Remove constant import from uninstall script. --- CHANGELOG.md | 1 + php/uninstall.php | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5873a7b6..cf22ec84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Fixed: Error when attempting to download export files from Edit menu. * Fixed: Issue loading Freemius string overrides too early. (PRO) * Fixed: Fix redirect URL when connecting with OAuth on subdirectory or HTTPS sites. (PRO) +* Fixed: Import error when attempting to completely uninstall the plugin, ## 3.6.1 (07 Nov 2023) * Fixed: Issue accessing fields on Snippets class. diff --git a/php/uninstall.php b/php/uninstall.php index 3cd0a285..6d8eb3a5 100644 --- a/php/uninstall.php +++ b/php/uninstall.php @@ -9,8 +9,6 @@ namespace Code_Snippets\Uninstall; -use const Code_Snippets\Settings\OPTION_NAME; - /** * Determine whether the option for allowing a complete uninstallation is enabled. * @@ -24,7 +22,7 @@ function complete_uninstall_enabled(): bool { $unified = empty( $menu_perms['snippets_settings'] ); } - $settings = $unified ? get_site_option( OPTION_NAME ) : get_option( OPTION_NAME ); + $settings = $unified ? get_site_option( 'code_snippets_settings' ) : get_option( 'code_snippets_settings' ); return isset( $settings['general']['complete_uninstall'] ) && $settings['general']['complete_uninstall']; } @@ -41,7 +39,7 @@ function uninstall_current_site() { delete_option( 'code_snippets_version' ); delete_option( 'recently_activated_snippets' ); - delete_option( OPTION_NAME ); + delete_option( 'code_snippets_settings' ); } /**