Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions admin/section/class-convertkit-admin-section-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,20 @@ private function maybe_disconnect() {

// Delete cached resources.
$creator_network = new ConvertKit_Resource_Creator_Network_Recommendations();
$custom_fields = new ConvertKit_Resource_Custom_Fields();
$forms = new ConvertKit_Resource_Forms();
$landing_pages = new ConvertKit_Resource_Landing_Pages();
$posts = new ConvertKit_Resource_Posts();
$products = new ConvertKit_Resource_Products();
$sequences = new ConvertKit_Resource_Sequences();
$tags = new ConvertKit_Resource_Tags();
$creator_network->delete();
$custom_fields->delete();
$forms->delete();
$landing_pages->delete();
$posts->delete();
$products->delete();
$sequences->delete();
$tags->delete();

// Redirect to General screen, which will now show the ConvertKit_Settings_OAuth screen, because
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ public function testValidCredentials(EndToEndTester $I)
// Disconnect the Plugin connection to Kit.
$I->click('Disconnect');

// Check cached resources are removed from the database on disconnection.
$I->dontSeeOptionInDatabase('convertkit_creator_network_recommendations');
$I->dontSeeOptionInDatabase('convertkit_custom_fields');
$I->dontSeeOptionInDatabase('convertkit_forms');
$I->dontSeeOptionInDatabase('convertkit_landing_pages');
$I->dontSeeOptionInDatabase('convertkit_posts');
$I->dontSeeOptionInDatabase('convertkit_products');
$I->dontSeeOptionInDatabase('convertkit_sequences');
$I->dontSeeOptionInDatabase('convertkit_tags');

// Confirm the Connect button displays.
$I->see('Connect');
$I->dontSee('Disconnect');
Expand Down