You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: admin/section/class-convertkit-admin-section-general.php
+28-2Lines changed: 28 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -193,9 +193,35 @@ private function maybe_disconnect() {
193
193
return;
194
194
}
195
195
196
-
// Delete Access Token.
196
+
// Get Settings class.
197
197
$settings = newConvertKit_Settings();
198
-
$settings->delete_credentials();
198
+
199
+
// Setup API.
200
+
$api = newConvertKit_API_V4(
201
+
CONVERTKIT_OAUTH_CLIENT_ID,
202
+
CONVERTKIT_OAUTH_CLIENT_REDIRECT_URI,
203
+
$settings->get_access_token(),
204
+
$settings->get_refresh_token(),
205
+
$settings->debug_enabled(),
206
+
'settings'
207
+
);
208
+
209
+
// Check that we're using the Kit WordPress Libraries 2.1.4 or higher.
210
+
// If another Kit Plugin is active and out of date, its libraries might
211
+
// be loaded that don't have this method.
212
+
if ( ! method_exists( $api, 'revoke_tokens' ) ) { // @phpstan-ignore-line Older WordPress Libraries won't have this function.
213
+
$this->output_error( __( 'The Kit WordPress Libraries is missing the `revoke_tokens` method. Please update all Kit WordPress Plugins to their latest versions, and click Disconnect again.', 'convertkit' ) );
214
+
return;
215
+
}
216
+
217
+
// Revoke Access and Refresh Tokens.
218
+
// See convertkit_delete_credentials() method in functions.php, which is called
219
+
// by the `convertkit_api_revoke_tokens` action and deletes credentials from the Plugin's settings.
0 commit comments