includes/class-freemius.php
private function install_with_new_user(
            $user_id,
            $user_public_key,
            $user_secret_key,
            $is_marketing_allowed,
            $install_id,
            $install_public_key,
            $install_secret_key,
            $redirect = true,
            $auto_install = false
        ) {
            /**
             * This method is also executed after opting in with a license key since the
             * license can be potentially associated with a different owner.
             *
             * @since 2.0.0
             */
            $user = self::_get_user_by_id( $user_id );

            if ( ! is_object( $user ) ) {
                $user             = new FS_User();
                $user->id         = $user_id;
                $user->public_key = $user_public_key;
                $user->secret_key = $user_secret_key;

                $this->_user = $user;
                $user_result = $this->get_api_user_scope()->get();
                $user        = new FS_User( $user_result );
            }

            $this->_user = $user;

            $site             = new FS_Site();
            $site->id         = $install_id;
            $site->public_key = $install_public_key;
            $site->secret_key = $install_secret_key;

            $this->_site = $site;
            $site_result = $this->get_api_site_scope()->get();
            $site        = new FS_Site( $site_result );
            $this->_site = $site;

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

            return $this->setup_account(
                $this->_user,
                $this->_site,
                $redirect,
                $auto_install
            );
        }
private function install_with_new_user(
            $user_id,
            $user_public_key,
            $user_secret_key,
            $is_marketing_allowed,
            $install_id,
            $install_public_key,
            $install_secret_key,
            $redirect = true,
            $auto_install = false
        ) {
            /**
             * This method is also executed after opting in with a license key since the
             * license can be potentially associated with a different owner.
             *
             * @since 2.0.0
             */
            $user = self::_get_user_by_id( $user_id );

            if ( ! is_object( $user ) ) {
                $user             = new FS_User();
                $user->id         = $user_id;
                $user->public_key = $user_public_key;
                $user->secret_key = $user_secret_key;

                $this->_user = $user;
                $user_result = $this->get_api_user_scope()->get();
                $user        = new FS_User( $user_result );
            }

            $this->_user = $user;

            $site             = new FS_Site();
            $site->id         = $install_id;
            $site->public_key = $install_public_key;
            $site->secret_key = $install_secret_key;

            $this->_site = $site;
            $site_result = $this->get_api_site_scope()->get();
            $site        = new FS_Site( $site_result );
            $this->_site = $site;

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

            return $this->setup_account(
                $this->_user,
                $this->_site,
                $redirect,
                $auto_install
            );
        }
private function install_with_new_user ( $ user_id , $ user_public_key , $ user_secret_key , $ is_marketing_allowed , $ install_id , $ install_public_key , $ install_secret_key , $ redirect = true , $ auto_install = false ) { /**
             * This method is also executed after opting in with a license key since the
             * license can be potentially associated with a different owner.
             *
             * @since 2.0.0
             */ $ user = self :: _get_user_by_id ( $ user_id ) ; if ( ! is_object ( $ user ) ) { $ user = new FS_User ( ) ; $ user -> id = $ user_id ; $ user -> public_key = $ user_public_key ; $ user -> secret_key = $ user_secret_key ; $ this -> _user = $ user ; $ user_result = $ this -> get_api_user_scope ( ) -> get ( ) ; $ user = new FS_User ( $ user_result ) ; } $ this -> _user = $ user ; $ site = new FS_Site ( ) ; $ site -> id = $ install_id ; $ site -> public_key = $ install_public_key ; $ site -> secret_key = $ install_secret_key ; $ this -> _site = $ site ; $ site_result = $ this -> get_api_site_scope ( ) -> get ( ) ; $ site = new FS_Site ( $ site_result ) ; $ this -> _site = $ site ; if ( ! is_null ( $ is_marketing_allowed ) ) { $ this -> disable_opt_in_notice_and_lock_user ( ) ; } return $ this -> setup_account ( $ this -> _user , $ this -> _site , $ redirect , $ auto_install ) ; }
Install plugin with new user.

@author Vova Feldman (@svovaf)
@since  1.1.7.4

@param number    $user_id
@param string    $user_public_key
@param string    $user_secret_key
@param bool|null $is_marketing_allowed
@param number    $install_id
@param string    $install_public_key
@param string    $install_secret_key
@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.
Install plugin with new user .