'feedweaver_feed', 'post_status' => 'any', 'posts_per_page' => -1, 'fields' => 'ids', ) ); foreach ( $feedweaver_feeds as $feedweaver_id ) { wp_delete_post( $feedweaver_id, true ); } delete_option( 'feedweaver_cache_generation' ); delete_option( 'feedweaver_rewrite_version' ); // Every transient this plugin writes starts with "feedweaver_": cached feeds // ("feedweaver_cache_"), custom field lists ("feedweaver_meta_keys_") and form stashes // ("feedweaver_form_"). Transients expire by themselves, but a removed plugin should not leave // rows behind (and, with an external object cache, they are not in this table). The earlier short // "fw_" prefix is not matched: no released version used it, and it could belong to another plugin. $feedweaver_like = array( $wpdb->esc_like( '_transient_feedweaver_' ) . '%', $wpdb->esc_like( '_transient_timeout_feedweaver_' ) . '%', ); foreach ( $feedweaver_like as $feedweaver_pattern ) { $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $feedweaver_pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- one-off cleanup of this plugin's own transients. } } }//end if if ( is_multisite() ) { foreach ( get_sites( array( 'fields' => 'ids', 'number' => 0, ) ) as $feedweaver_blog_id ) { switch_to_blog( (int) $feedweaver_blog_id ); feedweaver_uninstall_site(); restore_current_blog(); } } else { feedweaver_uninstall_site(); }