| @@ -234,32 +234,8 @@ | ||
| 234 | 234 | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
| 238 | - * Helper method to get registered plugin sidebars. | |
| 239 | - * | |
| 240 | - * @since 3.3.0 | |
| 241 | - * | |
| 242 | - * @return array Plugin sidebars | |
| 243 | - */ | |
| 244 | -function convertkit_get_plugin_sidebars() { | |
| 245 | - | |
| 246 | - $plugin_sidebars = array(); | |
| 247 | - | |
| 248 | - /** | |
| 249 | - * Registers plugin sidebars for the WordPress block editor. | |
| 250 | - * | |
| 251 | - * @since 3.3.0 | |
| 252 | - * | |
| 253 | - * @param array $plugin_sidebars Plugin sidebars. | |
| 254 | - */ | |
| 255 | - $plugin_sidebars = apply_filters( 'convertkit_plugin_sidebars', $plugin_sidebars ); | |
| 256 | - | |
| 257 | - return $plugin_sidebars; | |
| 258 | - | |
| 259 | -} | |
| 260 | - | |
| 261 | -/** | |
| 262 | 238 | * Helper method to get registered pre-publish actions. |
| 263 | 239 | * |
| 264 | 240 | * @since 2.4.0 |
| 265 | 241 | * |
| @@ -818,31 +794,8 @@ | ||
| 818 | 794 | |
| 819 | 795 | /** |
| 820 | 796 | * Deletes the stored access token, refresh token and its expiry from the Plugin settings, |
| 821 | 797 | * and clears any existing scheduled WordPress Cron event to refresh the token on expiry, |
| 822 | - * when the user revokes the access token. | |
| 823 | - * | |
| 824 | - * @since 3.2.4 | |
| 825 | - * | |
| 826 | - * @param string $client_id OAuth Client ID used for the Access and Refresh Tokens. | |
| 827 | - */ | |
| 828 | -function convertkit_delete_credentials( $client_id ) { | |
| 829 | - | |
| 830 | - // Don't delete these credentials if they're not for this Client ID. | |
| 831 | - // They're for another Kit Plugin that uses OAuth. | |
| 832 | - if ( $client_id !== CONVERTKIT_OAUTH_CLIENT_ID ) { | |
| 833 | - return; | |
| 834 | - } | |
| 835 | - | |
| 836 | - // Delete Access and Refresh Tokens. | |
| 837 | - $settings = new ConvertKit_Settings(); | |
| 838 | - $settings->delete_credentials(); | |
| 839 | - | |
| 840 | -} | |
| 841 | - | |
| 842 | -/** | |
| 843 | - * Deletes the stored access token, refresh token and its expiry from the Plugin settings, | |
| 844 | - * and clears any existing scheduled WordPress Cron event to refresh the token on expiry, | |
| 845 | 798 | * when either: |
| 846 | 799 | * - The access token is invalid |
| 847 | 800 | * - The access token expired, and refreshing failed |
| 848 | 801 | * |
| @@ -875,11 +828,8 @@ | ||
| 875 | 828 | |
| 876 | 829 | // Update Access Token when refreshed by the API class. |
| 877 | 830 | add_action( 'convertkit_api_get_access_token', 'convertkit_maybe_update_credentials', 10, 2 ); |
| 878 | 831 | add_action( 'convertkit_api_refresh_token', 'convertkit_maybe_update_credentials', 10, 2 ); |
| 879 | - | |
| 880 | -// Delete credentials when the user revokes the access and refresh tokens. | |
| 881 | -add_action( 'convertkit_api_revoke_tokens', 'convertkit_delete_credentials', 10, 1 ); | |
| 882 | 832 | |
| 883 | 833 | // Delete credentials if the API class uses a invalid access token. |
| 884 | 834 | // This prevents the Plugin making repetitive API requests that will 401. |
| 885 | 835 | add_action( 'convertkit_api_access_token_invalid', 'convertkit_maybe_delete_credentials', 10, 2 ); |