post_content, '[fixlight_statement' ) ) { wp_trash_post( $page->ID ); } } global $wpdb; // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Uninstall cleanup. $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i, %i, %i, %i', $wpdb->prefix . 'fixlight_issues', $wpdb->prefix . 'fixlight_pages', $wpdb->prefix . 'fixlight_events', $wpdb->prefix . 'fixlight_reports' ) ); $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $wpdb->esc_like( '_transient_fixlight_' ) . '%', $wpdb->esc_like( '_transient_timeout_fixlight_' ) . '%' ) ); // phpcs:enable delete_post_meta_by_key( '_fixlight_decorative' ); delete_post_meta_by_key( '_fixlight_ai_suggestion' ); foreach ( array( 'fixlight_settings', 'fixlight_db_version', 'fixlight_scan_state', 'fixlight_ledger', 'fixlight_statement', 'fixlight_hosted', 'fixlight_scan_lock', 'fixlight_events_seeded', 'fixlight_installed_at', 'fixlight_stats_id', 'fixlight_stats_sent', 'fixlight_overlays' ) as $option ) { delete_option( $option ); } delete_transient( 'fixlight_scan_token' ); // Also clears them from a persistent object cache. delete_transient( 'fixlight_summary' ); wp_clear_scheduled_hook( 'fixlight_daily' ); wp_clear_scheduled_hook( 'fixlight_scan_chunk' ); wp_unschedule_hook( 'fixlight_scan_post' ); wp_clear_scheduled_hook( 'fixlight_purge_soon' ); }; if ( is_multisite() ) { $fixlight_sites = get_sites( array( 'fields' => 'ids', 'number' => 0, ) ); foreach ( $fixlight_sites as $fixlight_site ) { switch_to_blog( $fixlight_site ); $fixlight_uninstall(); restore_current_blog(); } } else { $fixlight_uninstall(); } // Users are shared by every site of a network: their answers to the review request go once. delete_metadata( 'user', 0, 'fixlight_review_ask', '', true ); delete_metadata( 'user', 0, 'fixlight_overlays_hidden', '', true );