includes/class-freemius.php
private function sync_plan_if_not_exist( $plan_id ) {
            $plan = self::_get_plan_by_id( $plan_id );

            if ( is_object( $plan ) ) {
                // Plan already exists.
                return $plan;
            }

            $plan = $this->fetch_plan_by_id( $plan_id );

            if ( $plan instanceof FS_Plugin_Plan ) {
                $this->_plans[] = $plan;
                $this->_store_plans();

                return $plan;
            }

            return $plan;
        }
private function sync_plan_if_not_exist( $plan_id ) {
            $plan = self::_get_plan_by_id( $plan_id );

            if ( is_object( $plan ) ) {
                // Plan already exists.
                return $plan;
            }

            $plan = $this->fetch_plan_by_id( $plan_id );

            if ( $plan instanceof FS_Plugin_Plan ) {
                $this->_plans[] = $plan;
                $this->_store_plans();

                return $plan;
            }

            return $plan;
        }
private function sync_plan_if_not_exist ( $ plan_id ) { $ plan = self :: _get_plan_by_id ( $ plan_id ) ; if ( is_object ( $ plan ) ) { // Plan already exists.
 return $ plan ; } $ plan = $ this -> fetch_plan_by_id ( $ plan_id ) ; if ( $ plan instanceof FS_Plugin_Plan ) { $ this -> _plans [ ] = $ plan ; $ this -> _store_plans ( ) ; return $ plan ; } return $ plan ; }
Check if specified plan exists locally. If not, fetch it and store it.

@author Vova Feldman (@svovaf)
@since  2.0.0

@param number $plan_id

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