includes/class-freemius.php
private function get_cron_target_blog_id( $except_blog_id = 0 ) {
            if ( ! is_multisite() ) {
                return 0;
            }

            if ( $this->_is_network_active &&
                 is_numeric( $this->_storage->network_install_blog_id ) &&
                 $except_blog_id != $this->_storage->network_install_blog_id &&
                 self::is_site_active( $this->_storage->network_install_blog_id )
            ) {
                // Try to run cron from the main network blog.
                $install = $this->get_install_by_blog_id( $this->_storage->network_install_blog_id );

                if ( is_object( $install ) &&
                     ( $this->is_premium() || $install->is_tracking_allowed() )
                ) {
                    return $this->_storage->network_install_blog_id;
                }
            }

            // Get first opted-in blog ID with active tracking.
            $installs = $this->get_blog_install_map();
            foreach ( $installs as $blog_id => $install ) {
                if ( $except_blog_id != $blog_id &&
                     self::is_site_active( $blog_id ) &&
                     ( $this->is_premium() || $install->is_tracking_allowed() )
                ) {
                    return $blog_id;
                }
            }

            return 0;
        }
private function get_cron_target_blog_id( $except_blog_id = 0 ) {
            if ( ! is_multisite() ) {
                return 0;
            }

            if ( $this->_is_network_active &&
                 is_numeric( $this->_storage->network_install_blog_id ) &&
                 $except_blog_id != $this->_storage->network_install_blog_id &&
                 self::is_site_active( $this->_storage->network_install_blog_id )
            ) {
                // Try to run cron from the main network blog.
                $install = $this->get_install_by_blog_id( $this->_storage->network_install_blog_id );

                if ( is_object( $install ) &&
                     ( $this->is_premium() || $install->is_tracking_allowed() )
                ) {
                    return $this->_storage->network_install_blog_id;
                }
            }

            // Get first opted-in blog ID with active tracking.
            $installs = $this->get_blog_install_map();
            foreach ( $installs as $blog_id => $install ) {
                if ( $except_blog_id != $blog_id &&
                     self::is_site_active( $blog_id ) &&
                     ( $this->is_premium() || $install->is_tracking_allowed() )
                ) {
                    return $blog_id;
                }
            }

            return 0;
        }
private function get_cron_target_blog_id ( $ except_blog_id = 0 ) { if ( ! is_multisite ( ) ) { return 0 ; } if ( $ this -> _is_network_active && is_numeric ( $ this -> _storage -> network_install_blog_id ) && $ except_blog_id != $ this -> _storage -> network_install_blog_id && self :: is_site_active ( $ this -> _storage -> network_install_blog_id ) ) { // Try to run cron from the main network blog.
 $ install = $ this -> get_install_by_blog_id ( $ this -> _storage -> network_install_blog_id ) ; if ( is_object ( $ install ) && ( $ this -> is_premium ( ) || $ install -> is_tracking_allowed ( ) ) ) { return $ this -> _storage -> network_install_blog_id ; } } // Get first opted-in blog ID with active tracking.
 $ installs = $ this -> get_blog_install_map ( ) ; foreach ( $ installs as $ blog_id => $ install ) { if ( $ except_blog_id != $ blog_id && self :: is_site_active ( $ blog_id ) && ( $ this -> is_premium ( ) || $ install -> is_tracking_allowed ( ) ) ) { return $ blog_id ; } } return 0 ; }
WP Cron is executed on a site level. When running in a multisite network environment
with the network integration activated, for optimization reasons, we are consolidating
the installs data sync cron to be executed only from a single site.

@author Vova Feldman (@svovaf)
@since  2.0.0

@param int $except_blog_id Target any except the excluded blog ID.

@return int
WP Cron is executed on a site level . When running in a multisite network environment with the network integration activated for optimization reasons we are consolidating the installs data sync cron to be executed only from a single site .