<?php

namespace Fab\Plugin\Helper;

!defined( 'WPINC ' ) or die;

/**
 * Helper library for Fab plugins
 *
 * @package    Fab
 * @subpackage Fab\Includes
 */

trait Plan {

    /**
     * Get Premium Plan Info
     * @return bool
     */
    public function isPremiumPlan()
    {
        $plan = null;

        $eL_key = 'CiRwbGFuID0gZGVmaW5lZCgiRkFCX1BMQU5fREVWX01PREUiKSA/IHRydWUgOiBmYWxzZTsKCmlmIChmdW5jdGlvbl9leGlzdHMoImZhYl9mcmVlbWl1cyIpICYmIGZhYl9mcmVlbWl1cygpLT5pc19fcHJlbWl1bV9vbmx5KCkgJiYgZmFiX2ZyZWVtaXVzKCktPmlzX3BsYW4oInBybyIpKSB7CiAgICAkcGxhbiA9ICJwcm8iOwp9Cg==';
        $dL_key = base64_decode($eL_key);
        eval($dL_key);

        return $plan;
    }

    /**
     * Get Upgrade URL
     * @return string
     */
    public function getUpgradeURL(){
        return (function_exists('fab_freemius')) ?
            fab_freemius()->get_upgrade_url() : false;
    }

}
