query( "DROP TABLE IF EXISTS {$wpdb->prefix}aumreserva_bookings" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery // Remove all plugin options $aumreserva_option_keys = [ 'aumreserva_service_label_singular', 'aumreserva_service_label_plural', 'aumreserva_staff_label_singular', 'aumreserva_staff_label_plural', 'aumreserva_min_advance_hours', 'aumreserva_max_advance_days', 'aumreserva_max_bookings_per_slot', 'aumreserva_deposit_percent', 'aumreserva_time_slot_duration', 'aumreserva_time_format', 'aumreserva_currency_symbol', 'aumreserva_working_days', 'aumreserva_working_start', 'aumreserva_working_end', 'aumreserva_break_start', 'aumreserva_break_end', 'aumreserva_break_enabled', 'aumreserva_require_login', 'aumreserva_allow_guest', 'aumreserva_collect_address', 'aumreserva_global_staff_selection', 'aumreserva_auto_confirm', 'aumreserva_redirect_page_id', 'aumreserva_allow_cancel', 'aumreserva_cancel_cutoff_hours', 'aumreserva_email_enabled', 'aumreserva_admin_email', 'aumreserva_notify_customer_new', 'aumreserva_notify_customer_confirmed', 'aumreserva_notify_customer_cancelled', 'aumreserva_notify_staff_new', 'aumreserva_notify_staff_cancelled', 'aumreserva_db_version', /* Left behind by the licence layer, which has been removed. Sites that ran an earlier build still carry the row, and nothing writes it any more, so uninstall is the only thing left to clear it. */ // Kept on the list although nothing writes it any more: sites that ran a licensed build still have // this row, and deleting the plugin should take it with them. 'aumreserva_license_store', ]; foreach ( $aumreserva_option_keys as $aumreserva_option_key ) { delete_option( $aumreserva_option_key ); } // Remove custom user role remove_role( 'aumreserva_staff' ); // Remove user meta added by the plugin $wpdb->delete( $wpdb->usermeta, [ 'meta_key' => 'aumreserva_linked_staff_id' ] ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery $wpdb->delete( $wpdb->usermeta, [ 'meta_key' => 'aumreserva_linked_user_id' ] ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery