<?php

/*
Plugin Name: Weichie.com's Gravity Forms x ClickUp
Plugin URI: http://www.weichie.com
Description: Push Gravity Form entries to ClickUp
Version: 1.0.0
Author: Weichie.com
Author URI: http://www.weichie.com
*/
define( 'WEICHIE_GRAVITYFORMS_CLICKUP_VERSION', '0.5' );

if ( !function_exists( 'wgc_fs' ) ) {
    // Create a helper function for easy SDK access.
    function wgc_fs()
    {
        global  $wgc_fs ;
        
        if ( !isset( $wgc_fs ) ) {
            // Include Freemius SDK.
            require_once dirname( __FILE__ ) . '/freemius/start.php';
            $wgc_fs = fs_dynamic_init( array(
                'id'             => '14614',
                'slug'           => 'weichiecom-gravityforms-clickup',
                'premium_slug'   => 'multiple-feeds-premium',
                'type'           => 'plugin',
                'public_key'     => 'pk_8adc2ca46c242164bc034f1df497c',
                'is_premium'     => false,
                'premium_suffix' => 'Multiple Feeds',
                'has_addons'     => false,
                'has_paid_plans' => true,
                'menu'           => array(
                'first-path' => 'plugins.php',
                'contact'    => false,
                'support'    => false,
            ),
                'is_live'        => true,
            ) );
        }
        
        return $wgc_fs;
    }
    
    // Init Freemius.
    wgc_fs();
    // Signal that SDK was initiated.
    do_action( 'wgc_fs_loaded' );
}

add_action( 'gform_loaded', array( 'Weichie_GravityForms_ClickUp_Bootstrap', 'load' ), 5 );
class Weichie_GravityForms_ClickUp_Bootstrap
{
    public static function load()
    {
        if ( !method_exists( 'GFForms', 'include_addon_framework' ) ) {
            return;
        }
        require_once 'class-weichie-gravityform-clickup.php';
        GFAddOn::register( 'WeichieGravityFormClickUpAddon' );
    }

}
function gf_simple_addon()
{
    return WeichieGravityFormClickUpAddon::get_instance();
}
