includes/class-freemius.php
private function install_many_with_new_user(
            $user_id,
            $user_public_key,
            $user_secret_key,
            $is_marketing_allowed,
            array $installs,
            $redirect = true,
            $auto_install = false
        ) {
            $this->setup_user( $user_id, $user_public_key, $user_secret_key );

            if ( ! is_null( $is_marketing_allowed ) ) {
                $this->disable_opt_in_notice_and_lock_user();
            }

            $install_ids = array();

            foreach ( $installs as $install ) {
                $install_ids[] = $install->id;
            }

            $left   = count( $install_ids );
            $offset = 0;

            $installs = array();
            while ( $left > 0 ) {
                $result = $this->get_api_user_scope()->get( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', array_slice( $install_ids, $offset, 25 ) ) );

                if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
                    // @todo Handle API error.
                }

                $installs = array_merge( $installs, $result->installs );

                $left -= 25;
            }

            foreach ( $installs as &$install ) {
                $install = new FS_Site( $install );
            }

            return $this->setup_network_account(
                $this->_user,
                $installs,
                $redirect,
                $auto_install
            );
        }
private function install_many_with_new_user(
            $user_id,
            $user_public_key,
            $user_secret_key,
            $is_marketing_allowed,
            array $installs,
            $redirect = true,
            $auto_install = false
        ) {
            $this->setup_user( $user_id, $user_public_key, $user_secret_key );

            if ( ! is_null( $is_marketing_allowed ) ) {
                $this->disable_opt_in_notice_and_lock_user();
            }

            $install_ids = array();

            foreach ( $installs as $install ) {
                $install_ids[] = $install->id;
            }

            $left   = count( $install_ids );
            $offset = 0;

            $installs = array();
            while ( $left > 0 ) {
                $result = $this->get_api_user_scope()->get( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', array_slice( $install_ids, $offset, 25 ) ) );

                if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
                    // @todo Handle API error.
                }

                $installs = array_merge( $installs, $result->installs );

                $left -= 25;
            }

            foreach ( $installs as &$install ) {
                $install = new FS_Site( $install );
            }

            return $this->setup_network_account(
                $this->_user,
                $installs,
                $redirect,
                $auto_install
            );
        }
private function install_many_with_new_user ( $ user_id , $ user_public_key , $ user_secret_key , $ is_marketing_allowed , array $ installs , $ redirect = true , $ auto_install = false ) { $ this -> setup_user ( $ user_id , $ user_public_key , $ user_secret_key ) ; if ( ! is_null ( $ is_marketing_allowed ) ) { $ this -> disable_opt_in_notice_and_lock_user ( ) ; } $ install_ids = array ( ) ; foreach ( $ installs as $ install ) { $ install_ids [ ] = $ install -> id ; } $ left = count ( $ install_ids ) ; $ offset = 0 ; $ installs = array ( ) ; while ( $ left > 0 ) { $ result = $ this -> get_api_user_scope ( ) -> get ( "/plugins/{$this->_module_id}/installs.json?ids=" . implode ( ',' , array_slice ( $ install_ids , $ offset , 25 ) ) ) ; if ( ! $ this -> is_api_result_object ( $ result , 'installs' ) ) { // @todo Handle API error.
 } $ installs = array_merge ( $ installs , $ result -> installs ) ; $ left -= 25 ; } foreach ( $ installs as & $ install ) { $ install = new FS_Site ( $ install ) ; } return $ this -> setup_network_account ( $ this -> _user , $ installs , $ redirect , $ auto_install ) ; }
Multi-site install with a new user.

@author Vova Feldman (@svovaf)
@since  2.0.0

@param number    $user_id
@param string    $user_public_key
@param string    $user_secret_key
@param bool|null $is_marketing_allowed
@param object[]  $installs
@param bool      $redirect
@param bool      $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will
redirect (or return a URL) to the account page with a special parameter to
trigger the auto installation processes.

@return string If redirect is `false`, returns the next page the user should be redirected to.
Multi - site install with a new user .