includes/class-freemius.php
private function _store_site( $store = true, $network_level_or_blog_id = null, FS_Site $site = null ) {
            $this->_logger->entrance();

            if ( empty( $this->_site->id ) ) {
                $this->_logger->error( "Empty install ID, can't store site." );

                return;
            }

            $site_clone     = is_object( $site ) ? $site : $this->_site;
            $encrypted_site = clone $site_clone;

            $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );

            $prev_stored_user_id = $this->_storage->get( 'prev_user_id', false, $network_level_or_blog_id );

            if ( empty( $prev_stored_user_id ) &&
                 $this->_user->id != $this->_site->user_id
            ) {
                /**
                 * Store the current user ID as the previous user ID so that the previous user can be used
                 * as the install's owner while the new owner's details are not yet available.
                 *
                 * This will be executed only in the `replica` site. For example, there are 2 sites, namely `original`
                 * and `replica`, then an ownership change was initiated and completed in the `original`, the `replica`
                 * will be using the previous user until it is updated again (e.g.: until the next clone of `original`
                 * into `replica`.
                 *
                 * @author Leo Fajardo (@leorw)
                 */
                $this->_storage->store( 'prev_user_id', $sites[ $this->_slug ]->user_id, $network_level_or_blog_id );
            }

            $sites[ $this->_slug ] = $encrypted_site;

            $this->set_account_option( 'sites', $sites, $store, $network_level_or_blog_id );
        }
private function _store_site( $store = true, $network_level_or_blog_id = null, FS_Site $site = null ) {
            $this->_logger->entrance();

            if ( empty( $this->_site->id ) ) {
                $this->_logger->error( "Empty install ID, can't store site." );

                return;
            }

            $site_clone     = is_object( $site ) ? $site : $this->_site;
            $encrypted_site = clone $site_clone;

            $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );

            $prev_stored_user_id = $this->_storage->get( 'prev_user_id', false, $network_level_or_blog_id );

            if ( empty( $prev_stored_user_id ) &&
                 $this->_user->id != $this->_site->user_id
            ) {
                /**
                 * Store the current user ID as the previous user ID so that the previous user can be used
                 * as the install's owner while the new owner's details are not yet available.
                 *
                 * This will be executed only in the `replica` site. For example, there are 2 sites, namely `original`
                 * and `replica`, then an ownership change was initiated and completed in the `original`, the `replica`
                 * will be using the previous user until it is updated again (e.g.: until the next clone of `original`
                 * into `replica`.
                 *
                 * @author Leo Fajardo (@leorw)
                 */
                $this->_storage->store( 'prev_user_id', $sites[ $this->_slug ]->user_id, $network_level_or_blog_id );
            }

            $sites[ $this->_slug ] = $encrypted_site;

            $this->set_account_option( 'sites', $sites, $store, $network_level_or_blog_id );
        }
private function _store_site ( $ store = true , $ network_level_or_blog_id = null , FS_Site $ site = null ) { $ this -> _logger -> entrance ( ) ; if ( empty ( $ this -> _site -> id ) ) { $ this -> _logger -> error ( "Empty install ID, can't store site." ) ; return ; } $ site_clone = is_object ( $ site ) ? $ site : $ this -> _site ; $ encrypted_site = clone $ site_clone ; $ sites = self :: get_all_sites ( $ this -> _module_type , $ network_level_or_blog_id ) ; $ prev_stored_user_id = $ this -> _storage -> get ( 'prev_user_id' , false , $ network_level_or_blog_id ) ; if ( empty ( $ prev_stored_user_id ) && $ this -> _user -> id != $ this -> _site -> user_id ) { /**
                 * Store the current user ID as the previous user ID so that the previous user can be used
                 * as the install's owner while the new owner's details are not yet available.
                 *
                 * This will be executed only in the `replica` site. For example, there are 2 sites, namely `original`
                 * and `replica`, then an ownership change was initiated and completed in the `original`, the `replica`
                 * will be using the previous user until it is updated again (e.g.: until the next clone of `original`
                 * into `replica`.
                 *
                 * @author Leo Fajardo (@leorw)
                 */ $ this -> _storage -> store ( 'prev_user_id' , $ sites [ $ this -> _slug ] -> user_id , $ network_level_or_blog_id ) ; } $ sites [ $ this -> _slug ] = $ encrypted_site ; $ this -> set_account_option ( 'sites' , $ sites , $ store , $ network_level_or_blog_id ) ; }
Update site information.

@author Vova Feldman (@svovaf)
@since  1.0.1

@param bool     $store                    Flush to Database if true.
@param null|int $network_level_or_blog_id Since 2.0.0
@param \FS_Site $site                     Since 2.0.0
Update site information .