query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_ainp_feed_%' OR option_name LIKE '_transient_timeout_ainp_feed_%'" ); // --- 4. Clear User Meta (Preferences) --- // Remove the 'Dismiss Welcome Panel' preference for all users. // This ensures if they reinstall, they see the welcome panel again. $ainp_users = get_users( array( 'fields' => 'ID' ) ); foreach ( $ainp_users as $ainp_user_id ) { delete_user_meta( $ainp_user_id, 'ainp_hide_welcome_panel' ); } // --- Optional: Remove Post Meta Data --- // This section is commented out by default as deleting post meta is destructive // and usually not desired upon simple uninstallation (posts might be kept). // Uncomment *only* if you want to strictly remove ALL data attached to posts. /* // Define the meta keys added by the plugin to posts. $ainp_meta_keys_to_delete = array( '_ainp_guid', // Original item GUID '_ainp_original_link', // Link to the original article '_ainp_source_url', // URL of the feed/scraper source '_ainp_source_name', // Name of the feed/scraper source '_ainp_image_source', // Source of the featured image ('feed', 'ia_generated', etc.) '_ainp_feed_item_xml', // Original XML string of the item (temporary) '_ainp_final_post_status', // Intended final status (temporary) ); // Format keys for SQL IN clause. $placeholders = implode( ',', array_fill( 0, count( $ainp_meta_keys_to_delete ), '%s' ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->postmeta} WHERE meta_key IN ($placeholders)", $ainp_meta_keys_to_delete ) ); */