includes/class-freemius.php
function stop_network_tracking() {
            $this->_logger->entrance();

            if ( ! $this->is_registered() ) {
                // User never opted-in.
                return false;
            }

            $install_id_2_blog_id = array();
            $installs_map         = $this->get_blog_install_map();

            $opt_out_all = true;

            $params = array();
            foreach ( $installs_map as $blog_id => $install ) {
                if ( $install->is_tracking_prohibited() ) {
                    // Already opted-out.
                    continue;
                }

                if ( $this->is_site_delegated_connection( $blog_id ) ) {
                    // Opt-out only from non-delegated installs.
                    $opt_out_all = false;
                    continue;
                }

                $params[] = array( 'id' => $install->id );

                $install_id_2_blog_id[ $install->id ] = $blog_id;
            }

            if ( empty( $install_id_2_blog_id ) ) {
                return true;
            }

            $params[] = array( 'is_disconnected' => true );

            // Send update to FS.
            $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params );

            if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
                $this->_logger->api_error( $result );

                return $result;
            }

            foreach ( $result->installs as $r_install ) {
                $blog_id                  = $install_id_2_blog_id[ $r_install->id ];
                $install                  = $installs_map[ $blog_id ];
                $install->is_disconnected = $r_install->is_disconnected;
                $this->_store_site( true, $blog_id, $install );
            }

            $this->clear_sync_cron( $opt_out_all );

            // Successfully disconnected.
            return true;
        }
function stop_network_tracking() {
            $this->_logger->entrance();

            if ( ! $this->is_registered() ) {
                // User never opted-in.
                return false;
            }

            $install_id_2_blog_id = array();
            $installs_map         = $this->get_blog_install_map();

            $opt_out_all = true;

            $params = array();
            foreach ( $installs_map as $blog_id => $install ) {
                if ( $install->is_tracking_prohibited() ) {
                    // Already opted-out.
                    continue;
                }

                if ( $this->is_site_delegated_connection( $blog_id ) ) {
                    // Opt-out only from non-delegated installs.
                    $opt_out_all = false;
                    continue;
                }

                $params[] = array( 'id' => $install->id );

                $install_id_2_blog_id[ $install->id ] = $blog_id;
            }

            if ( empty( $install_id_2_blog_id ) ) {
                return true;
            }

            $params[] = array( 'is_disconnected' => true );

            // Send update to FS.
            $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params );

            if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
                $this->_logger->api_error( $result );

                return $result;
            }

            foreach ( $result->installs as $r_install ) {
                $blog_id                  = $install_id_2_blog_id[ $r_install->id ];
                $install                  = $installs_map[ $blog_id ];
                $install->is_disconnected = $r_install->is_disconnected;
                $this->_store_site( true, $blog_id, $install );
            }

            $this->clear_sync_cron( $opt_out_all );

            // Successfully disconnected.
            return true;
        }
function stop_network_tracking ( ) { $ this -> _logger -> entrance ( ) ; if ( ! $ this -> is_registered ( ) ) { // User never opted-in.
 return false ; } $ install_id_2_blog_id = array ( ) ; $ installs_map = $ this -> get_blog_install_map ( ) ; $ opt_out_all = true ; $ params = array ( ) ; foreach ( $ installs_map as $ blog_id => $ install ) { if ( $ install -> is_tracking_prohibited ( ) ) { // Already opted-out.
 continue ; } if ( $ this -> is_site_delegated_connection ( $ blog_id ) ) { // Opt-out only from non-delegated installs.
 $ opt_out_all = false ; continue ; } $ params [ ] = array ( 'id' => $ install -> id ) ; $ install_id_2_blog_id [ $ install -> id ] = $ blog_id ; } if ( empty ( $ install_id_2_blog_id ) ) { return true ; } $ params [ ] = array ( 'is_disconnected' => true ) ; // Send update to FS.
 $ result = $ this -> get_current_or_network_user_api_scope ( ) -> call ( "/plugins/{$this->_module_id}/installs.json" , 'put' , $ params ) ; if ( ! $ this -> is_api_result_object ( $ result , 'installs' ) ) { $ this -> _logger -> api_error ( $ result ) ; return $ result ; } foreach ( $ result -> installs as $ r_install ) { $ blog_id = $ install_id_2_blog_id [ $ r_install -> id ] ; $ install = $ installs_map [ $ blog_id ] ; $ install -> is_disconnected = $ r_install -> is_disconnected ; $ this -> _store_site ( true , $ blog_id , $ install ) ; } $ this -> clear_sync_cron ( $ opt_out_all ) ; // Successfully disconnected.
 return true ; }
Opt-out network from usage tracking.

Note: This will not delete the account information but will stop all tracking.

Returns:
1. FALSE  - If the user never opted-in.
2. TRUE   - If successfully opted-out.
3. object - API result on failure.

@author Leo Fajardo (@leorw)
@since  1.2.1.5

@return bool|object
Opt - out network from usage tracking .