$chat4u_state['scope'], 'delivery_id' => wp_generate_uuid4(), 'topic' => 'uninstalled'], $chat4u_state); } global $wpdb; Chat4U_Commerce_Privacy::uninstall(); $wpdb->query($wpdb->prepare('DROP TABLE IF EXISTS %i',$wpdb->prefix.'chat4u_commerce')); foreach (['chat4u_commerce','chat4u_commerce_policy','chat4u_commerce_schema','chat4u_order_mail_health','chat4u_commerce_key_cart','chat4u_commerce_key_order','chat4u_commerce_key_measurement','chat4u_commerce_key_measurement_control'] as $key) { delete_option($key); } $wpdb->query($wpdb->prepare('DELETE FROM %i WHERE option_name LIKE %s',$wpdb->options,$wpdb->esc_like('chat4u_woo_nonce_').'%')); $chat4u_table = $wpdb->prefix . 'chat4u_changes'; $wpdb->query($wpdb->prepare('DROP TABLE IF EXISTS %i', $chat4u_table)); foreach (['chat4u_connection', 'chat4u_delivered_cursor', 'chat4u_acknowledged_cursor', 'chat4u_delivery_attempts', 'chat4u_pending_control', 'chat4u_control_delivery', 'chat4u_pending_delivery', 'chat4u_render_revision'] as $chat4u_name) { delete_option($chat4u_name); } $chat4u_pattern = $wpdb->esc_like('chat4u_req_') . '%'; $wpdb->query($wpdb->prepare('DELETE FROM %i WHERE option_name LIKE %s', $wpdb->options, $chat4u_pattern)); wp_clear_scheduled_hook('chat4u_deliver'); wp_clear_scheduled_hook('chat4u_cleanup');