PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← All changes | php/Core/Uninstaller.php +17 -0 4.0.0-beta.1 → trunk View file →
@@ -8,8 +8,13 @@
8 8 */
9 9
10 10 namespace Code_Snippets\Core;
11 11
12 +use Code_Snippets\Admin\Feedback_Panel;
13 +use Code_Snippets\Client\Feedback_Client;
14 +use Code_Snippets\Model\Feedback_Connection;
15 +use function Code_Snippets\flush_versioned_cache_groups;
16 +
12 17 /**
13 18 * Uninstaller class.
14 19 *
15 20 * This class handles the uninstallation of the Code Snippets plugin, including
@@ -66,15 +71,27 @@
66 71
67 72 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}snippets" );
68 73
69 74 delete_option( 'code_snippets_version' );
75 +
76 + // Shed cached snippet objects before dropping the recorded cache version,
77 + // otherwise a same-version reinstall can read data this uninstall removed.
78 + flush_versioned_cache_groups( (string) get_option( 'code_snippets_cache_version', '' ) );
79 + delete_option( 'code_snippets_cache_version' );
70 80 delete_option( 'recently_active_snippets' );
71 81 delete_option( 'recently_activated_snippets' );
72 82 delete_option( 'code_snippets_settings' );
83 + delete_option( 'code_snippets_insights_preferences' );
84 + delete_option( 'code_snippets_demos_seen' );
73 85
74 86 delete_option( 'code_snippets_cloud_settings' );
87 + delete_transient( 'code_snippets_cloud_links' );
75 88 delete_transient( 'cs_codevault_snippets' );
76 89 delete_transient( 'cs_local_to_cloud_map' );
90 +
91 + delete_option( Feedback_Connection::CREDENTIALS_OPTION );
92 + delete_transient( Feedback_Panel::SUMMARY_TRANSIENT );
93 + delete_transient( Feedback_Client::REGISTRATION_FAILURE_TRANSIENT );
77 94 }
78 95
79 96 /**
80 97 * Clean up data created by this plugin on multisite.