prefix, never user input. // phpcs:disable WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter $as_actions = $wpdb->prefix . 'actionscheduler_actions'; $as_logs = $wpdb->prefix . 'actionscheduler_logs'; if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $as_actions ) ) ) === $as_actions ) { $in = "'" . implode( "','", array_map( 'esc_sql', $hooks ) ) . "'"; if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $as_logs ) ) ) === $as_logs ) { $wpdb->query( "DELETE FROM {$as_logs} WHERE action_id IN ( SELECT action_id FROM {$as_actions} WHERE hook IN ( {$in} ) )" ); } $wpdb->query( "DELETE FROM {$as_actions} WHERE hook IN ( {$in} )" ); } foreach ( array( 'orderping_nonces', 'orderping_outbox', 'orderping_confirmation', 'orderping_confirm_action', 'orderping_cancel_action' ) as $table ) { $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . $table . '`' ); } $options = array( 'orderping_connection', 'orderping_instance_id', 'orderping_pairing', 'orderping_db_version', 'orderping_pending_revoke', 'orderping_update_required', 'orderping_plugin_version', 'orderping_account_email', 'orderping_pilot_phone', // "Limit to one phone number". ); foreach ( $options as $option ) { delete_option( $option ); delete_site_option( $option ); } // Transients: the one-time activation redirect and the per-user "settings error" notes. delete_transient( 'orderping_activation_redirect' ); $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $wpdb->esc_like( '_transient_orderping_' ) . '%', $wpdb->esc_like( '_transient_timeout_orderping_' ) . '%' ) ); // phpcs:enable } orderping_uninstall_notify(); orderping_uninstall_cleanup();