<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php

namespace WordfenceLS;

class Utility_Multisite {
	
	/**
	 * Returns an array of all active multisite blogs (if `$blogIds` is `null`) or a list of active multisite blogs 
	 * filtered to only those in `$blogIds` if non-null.
	 * 
	 * @param array|null $blogIds
	 * @return array
	 */
	public static function retrieve_active_sites($blogIds = null) {
		$args = array(
			'number' => '', /* WordPress core passes an empty string which appears to remove the result set limit */
			'update_site_meta_cache' => false, /* Defaults to true which is not desirable for this use case */
			//Ignore archived/spam/deleted sites
			'archived' => 0,
			'spam' => 0,
			'deleted' => 0
		);
		
		if ($blogIds !== null) {
			$args['site__in'] = $blogIds;
		}
		
		if (function_exists('get_sites')) {
			return get_si