From 49668406eacc392845399e87a82fdd622923ef24 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Sat, 4 Jul 2026 14:30:18 +0800 Subject: [PATCH 1/2] Uninstall: Update Token Revokation --- .github/workflows/tests.yml | 21 +--------------- .../general/uninstall/UninstallCest.php | 4 +++- uninstall.php | 24 ++++++++----------- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e6581ad2..eeb1ce43f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,28 +33,9 @@ jobs: fail-fast: false matrix: wp-version: [ 'latest' ] - php-version: [ '8.1', '8.2', '8.3', '8.4' ] + php-version: [ '8.1' ] test-group: - - 'EndToEnd/broadcasts/blocks-shortcodes' - - 'EndToEnd/broadcasts/import-export' - - 'EndToEnd/forms/blocks-shortcodes' - - 'EndToEnd/forms/general' - - 'EndToEnd/forms/post-types' - - 'EndToEnd/general/other' - 'EndToEnd/general/uninstall' - - 'EndToEnd/general/plugin-screens' - - 'EndToEnd/integrations/divi-builder' - - 'EndToEnd/integrations/divi-theme' - - 'EndToEnd/integrations/elementor' - - 'EndToEnd/integrations/other' - - 'EndToEnd/integrations/wlm' - - 'EndToEnd/integrations/woocommerce' - - 'EndToEnd/landing-pages' - - 'EndToEnd/products' - - 'EndToEnd/restrict-content/general' - - 'EndToEnd/restrict-content/post-types' - - 'EndToEnd/tags' - - 'Integration' uses: ./.github/workflows/_run-tests.yml secrets: inherit diff --git a/tests/EndToEnd/general/uninstall/UninstallCest.php b/tests/EndToEnd/general/uninstall/UninstallCest.php index 2ae1cc343..ad968104c 100644 --- a/tests/EndToEnd/general/uninstall/UninstallCest.php +++ b/tests/EndToEnd/general/uninstall/UninstallCest.php @@ -63,8 +63,10 @@ public function testPluginDeletionRevokesAndRemovesTokens(EndToEndTester $I) // Delete the Plugin. $I->deleteKitPlugin($I); + // Allow the uninstallation routine time to complete. + $I->wait(10); + // Confirm the credentials have been removed from the Plugin's settings. - $I->wait(3); $settings = $I->grabOptionFromDatabase('_wp_convertkit_settings'); $I->assertEmpty($settings['access_token']); $I->assertEmpty($settings['refresh_token']); diff --git a/uninstall.php b/uninstall.php index ac47f35cd..b89185b36 100644 --- a/uninstall.php +++ b/uninstall.php @@ -30,14 +30,12 @@ 'https://api.kit.com/v4/oauth/revoke', array( 'headers' => array( - 'Accept' => 'application/json', - 'Content-Type' => 'application/json', + 'Content-Type' => 'application/x-www-form-urlencoded', ), - 'body' => wp_json_encode( - array( - 'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y', - 'token' => $settings['access_token'], - ) + 'body' => array( + 'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y', + 'token' => $settings['access_token'], + 'token_type_hint' => 'access_token', ), 'timeout' => 5, ) @@ -50,14 +48,12 @@ 'https://api.kit.com/v4/oauth/revoke', array( 'headers' => array( - 'Accept' => 'application/json', - 'Content-Type' => 'application/json', + 'Content-Type' => 'application/x-www-form-urlencoded', ), - 'body' => wp_json_encode( - array( - 'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y', - 'token' => $settings['refresh_token'], - ) + 'body' => array( + 'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y', + 'token' => $settings['refresh_token'], + 'token_type_hint' => 'refresh_token', ), 'timeout' => 5, ) From 4f3311c4205240191747cdfd1cadc1f5d9bd5ec8 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Sat, 4 Jul 2026 14:36:29 +0800 Subject: [PATCH 2/2] Reinstate all tests --- .github/workflows/tests.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eeb1ce43f..1e6581ad2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,9 +33,28 @@ jobs: fail-fast: false matrix: wp-version: [ 'latest' ] - php-version: [ '8.1' ] + php-version: [ '8.1', '8.2', '8.3', '8.4' ] test-group: + - 'EndToEnd/broadcasts/blocks-shortcodes' + - 'EndToEnd/broadcasts/import-export' + - 'EndToEnd/forms/blocks-shortcodes' + - 'EndToEnd/forms/general' + - 'EndToEnd/forms/post-types' + - 'EndToEnd/general/other' - 'EndToEnd/general/uninstall' + - 'EndToEnd/general/plugin-screens' + - 'EndToEnd/integrations/divi-builder' + - 'EndToEnd/integrations/divi-theme' + - 'EndToEnd/integrations/elementor' + - 'EndToEnd/integrations/other' + - 'EndToEnd/integrations/wlm' + - 'EndToEnd/integrations/woocommerce' + - 'EndToEnd/landing-pages' + - 'EndToEnd/products' + - 'EndToEnd/restrict-content/general' + - 'EndToEnd/restrict-content/post-types' + - 'EndToEnd/tags' + - 'Integration' uses: ./.github/workflows/_run-tests.yml secrets: inherit