prefix . 'agentlane_queue' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- uninstall drops the plugin's own table; name from $wpdb->prefix and a constant, passed through esc_sql(). $wpdb->query( "DROP TABLE IF EXISTS {$table}" ); $options = array( 'agentlane_settings', 'agentlane_blocklist', 'agentlane_db_version', 'agentlane_stats', 'agentlane_digest_last', 'agentlane_welcome', 'agentlane_queue_failure', ); foreach ( $options as $option ) { delete_option( $option ); } // Экранная опция "записей на страницу" (Admin::SCREEN_OPTION) хранится в user meta. if ( function_exists( 'delete_metadata' ) ) { delete_metadata( 'user', 0, 'agentlane_queue_per_page', '', true ); } // Транзиенты плагина (кэш ключей подписанных агентов и т.п.). // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- uninstall removes the plugin's own transients by prefix; prepared with esc_like(). $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $wpdb->esc_like( '_transient_agentlane_' ) . '%', $wpdb->esc_like( '_transient_timeout_agentlane_' ) . '%' ) ); wp_clear_scheduled_hook( 'agentlane_purge' ); } if ( is_multisite() ) { $agentlane_site_ids = get_sites( array( 'fields' => 'ids', 'number' => 0, ) ); foreach ( (array) $agentlane_site_ids as $agentlane_site_id ) { switch_to_blog( (int) $agentlane_site_id ); agentlane_uninstall_site(); restore_current_blog(); } unset( $agentlane_site_ids, $agentlane_site_id ); } else { agentlane_uninstall_site(); }