gmdate( 'c' ), 'reviews' => is_array( $shouldcheck_reports ) ? count( $shouldcheck_reports ) : 0, 'events' => is_array( $shouldcheck_events ) ? count( $shouldcheck_events ) : 0, ), false ); $shouldcheck_remove = array( 'shouldcheck_v8_runtime_tests', 'shouldcheck_db_version', 'shouldcheck_leaving' ); } else { $shouldcheck_remove = array( 'shouldcheck_v2_snapshots', 'shouldcheck_v2_events', 'shouldcheck_v2_last_check', 'shouldcheck_v3_reports', 'shouldcheck_v8_runtime_tests', 'shouldcheck_settings', 'shouldcheck_kept_data', 'shouldcheck_db_version', 'shouldcheck_leaving' ); } foreach ( $shouldcheck_remove as $shouldcheck_option ) { delete_option( $shouldcheck_option ); } $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_shouldcheck\_%' OR option_name LIKE '\_transient\_timeout\_shouldcheck\_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery delete_metadata( 'user', 0, 'shouldcheck_setup_dismissed', '', true ); wp_clear_scheduled_hook( 'shouldcheck_v2_reconcile' ); wp_clear_scheduled_hook( 'shouldcheck_v2_deferred' ); } if ( is_multisite() ) { // A network-activated plugin keeps its options in every site, so clear each one. $shouldcheck_sites = get_sites( array( 'fields' => 'ids', 'number' => 0, ) ); foreach ( $shouldcheck_sites as $shouldcheck_blog ) { switch_to_blog( (int) $shouldcheck_blog ); shouldcheck_uninstall_site(); restore_current_blog(); } } else { shouldcheck_uninstall_site(); } $shouldcheck_tmp = trailingslashit( get_temp_dir() ); foreach ( array( 'shouldcheck-upload-*.zip', 'shouldcheck-local-*.zip', 'shouldcheck-dep-*.zip', 'shouldcheck-dep-*.tmp' ) as $shouldcheck_pattern ) { foreach ( (array) glob( $shouldcheck_tmp . $shouldcheck_pattern ) as $shouldcheck_file ) { if ( is_file( $shouldcheck_file ) ) { wp_delete_file( $shouldcheck_file ); } } }