Check for `wp_is_large_network()` before looping through all blogs in the network, to prevent looping through thousands of sites on large networks. If you have this many sites, you should manage this in a queue or job system. See #5749.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8584 cdf35c40-ae34-48e0-9cc9-0c9da1808c22