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, )