includes/class-freemius.php
private function activate_license_on_many_installs(
            FS_User $user,
            $license_key,
            array $blog_2_install_map
        ) {
            $params = array(
                array( 'license_key' => $this->apply_filters( 'license_key', $license_key ) )
            );

            $install_2_blog_map = array();
            foreach ( $blog_2_install_map as $blog_id => $install ) {
                $params[] = array( 'id' => $install->id );

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

            $result = $this->get_api_user_scope_by_user( $user )->call(
                "plugins/{$this->_plugin->id}/installs.json",
                'PUT',
                $params
            );

            if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
                return $result;
            }

            foreach ( $result->installs as $r_install ) {
                $install                  = new FS_Site( $r_install );
                $install->is_disconnected = false;

                // Update install.
                $this->_store_site(
                    true,
                    $install_2_blog_map[ $r_install->id ],
                    $install
                );
            }

            return true;
        }
private function activate_license_on_many_installs(
            FS_User $user,
            $license_key,
            array $blog_2_install_map
        ) {
            $params = array(
                array( 'license_key' => $this->apply_filters( 'license_key', $license_key ) )
            );

            $install_2_blog_map = array();
            foreach ( $blog_2_install_map as $blog_id => $install ) {
                $params[] = array( 'id' => $install->id );

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

            $result = $this->get_api_user_scope_by_user( $user )->call(
                "plugins/{$this->_plugin->id}/installs.json",
                'PUT',
                $params
            );

            if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
                return $result;
            }

            foreach ( $result->installs as $r_install ) {
                $install                  = new FS_Site( $r_install );
                $install->is_disconnected = false;

                // Update install.
                $this->_store_site(
                    true,
                    $install_2_blog_map[ $r_install->id ],
                    $install
                );
            }

            return true;
        }
private function activate_license_on_many_installs ( FS_User $ user , $ license_key , array $ blog_2_install_map ) { $ params = array ( array ( 'license_key' => $ this -> apply_filters ( 'license_key' , $ license_key ) ) ) ; $ install_2_blog_map = array ( ) ; foreach ( $ blog_2_install_map as $ blog_id => $ install ) { $ params [ ] = array ( 'id' => $ install -> id ) ; $ install_2_blog_map [ $ install -> id ] = $ blog_id ; } $ result = $ this -> get_api_user_scope_by_user ( $ user ) -> call ( "plugins/{$this->_plugin->id}/installs.json" , 'PUT' , $ params ) ; if ( ! $ this -> is_api_result_object ( $ result , 'installs' ) ) { return $ result ; } foreach ( $ result -> installs as $ r_install ) { $ install = new FS_Site ( $ r_install ) ; $ install -> is_disconnected = false ; // Update install.
 $ this -> _store_site ( true , $ install_2_blog_map [ $ r_install -> id ] , $ install ) ; } return true ; }
Activate a given license on a collection of installs.

@author Vova Feldman (@svovaf)
@since  2.0.0

@param \FS_User $user
@param string   $license_key
@param array    $blog_2_install_map {
@key    int Blog ID.
@value  FS_Site Blog's associated install.
}

@return mixed|true
Activate a given license on a collection of installs .