includes/class-freemius.php
private function sync_license_if_not_exist( $license_id, $license_key ) {
            $license = $this->_get_license_by_id( $license_id );

            if ( is_object( $license ) ) {
                // License already exists.
                return $license;
            }

            $license = $this->fetch_license_by_key( $license_id, $license_key );

            if ( $license instanceof FS_Plugin_License ) {
                $this->_licenses[] = $license;
                $this->_license    = $license;
                $this->_store_licenses();

                return $license;
            }

            return $license;
        }
private function sync_license_if_not_exist( $license_id, $license_key ) {
            $license = $this->_get_license_by_id( $license_id );

            if ( is_object( $license ) ) {
                // License already exists.
                return $license;
            }

            $license = $this->fetch_license_by_key( $license_id, $license_key );

            if ( $license instanceof FS_Plugin_License ) {
                $this->_licenses[] = $license;
                $this->_license    = $license;
                $this->_store_licenses();

                return $license;
            }

            return $license;
        }
private function sync_license_if_not_exist ( $ license_id , $ license_key ) { $ license = $ this -> _get_license_by_id ( $ license_id ) ; if ( is_object ( $ license ) ) { // License already exists.
 return $ license ; } $ license = $ this -> fetch_license_by_key ( $ license_id , $ license_key ) ; if ( $ license instanceof FS_Plugin_License ) { $ this -> _licenses [ ] = $ license ; $ this -> _license = $ license ; $ this -> _store_licenses ( ) ; return $ license ; } return $ license ; }
Check if specified license exists locally. If not, fetch it and store it.

@author Vova Feldman (@svovaf)
@since  2.0.0

@param number $license_id
@param string $license_key

@return \FS_Plugin_Plan|object The plan entity or the API error object on failure.
Check if specified license exists locally . If not fetch it and store it .