From ad9eaebecd0bf4518747160497f702c674b1583b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Ran=C4=91elovi=C4=87?= Date: Tue, 21 Jan 2025 02:23:38 -0800 Subject: [PATCH] Remove plugin settings matching old DB key on uninstall (#67) Summary: This changeset makes sure that both database entries containing the plugin settings are removed when uninstalling the plugin. Previously, only the current setting DB entry was being removed when uninstalling the plugin. Because the plugin copies values from the old DB entry (`facebook_config`) to the new one (`facebook_business_extension_config`) when being run, the plugin never returns to an "empty" state when reinstalled on a machine that had an older version of the plugin which used the `facebook_config` options DB key. Pull Request resolved: https://github.com/facebookincubator/Facebook-Pixel-for-Wordpress/pull/67 Reviewed By: tzahgr Differential Revision: D68435405 Pulled By: vahidkay-meta fbshipit-source-id: 001dcb230b49a3d3cbd77dae423a78fb4fac87e0 --- uninstall.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uninstall.php b/uninstall.php index 068bbeb3..f1c75deb 100644 --- a/uninstall.php +++ b/uninstall.php @@ -29,4 +29,6 @@ } delete_option( FacebookPluginConfig::SETTINGS_KEY ); +delete_option( FacebookPluginConfig::OLD_SETTINGS_KEY ); + delete_user_meta( get_current_user_id(), FacebookPluginConfig::ADMIN_IGNORE_PIXEL_ID_NOTICE );