prefix . 'thinroof_' . $table; $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $name ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange } $options = array( 'thinroof_general', 'thinroof_pricing', 'thinroof_email', 'thinroof_db_version', 'thinroof_pricing_reviewed', 'thinroof_mail_log', 'thinroof_form_secret', 'thinroof_sample_calculator_id' ); foreach ( $options as $option ) { delete_option( $option ); } delete_transient( 'thinroof_pricing_rules' ); delete_transient( 'thinroof_activation_notice' ); // Short-lived rate-limit and token transients. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\\_transient\\_thinroof\\_%' OR option_name LIKE '\\_transient\\_timeout\\_thinroof\\_%'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching foreach ( wp_roles()->role_objects as $role ) { $role->remove_cap( 'thinroof_manage_leads' ); $role->remove_cap( 'thinroof_manage_settings' ); } delete_metadata( 'user', 0, 'thinroof_leads_per_page', '', true ); wp_clear_scheduled_hook( 'thinroof_daily_maintenance' ); } if ( is_multisite() ) { $thinroof_sites = get_sites( array( 'fields' => 'ids', 'number' => 0, ) ); foreach ( $thinroof_sites as $thinroof_site ) { switch_to_blog( (int) $thinroof_site ); thinroof_uninstall_site(); restore_current_blog(); } } else { thinroof_uninstall_site(); }