<?php

/*
Plugin Name: Flexible FAQs
Plugin URI: https://flexiblefaqs.com
Description: The easiest way to manage FAQs on your site. Beautiful drag/drop interface. Designed to handle small or large number of FAQs with ease.
Version: 0.5.11
Requires PHP: 7.0
Author: David Gwyer
Author URI: http://www.wpgoplugins.com
Text Domain: flexible-faqs
@package Flexible_FAQs
*/
/*
Copyright 2020 David Gwyer (email : hello@flexiblefaqs.com)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
namespace WPGO_Plugins\Flexible_Faqs;

if ( !defined( 'ABSPATH' ) ) {
    exit;
}
// For now hard code this until a better method can be found.

if ( !defined( 'FFAQ_FREEMIUS_NAVIGATION' ) ) {
    define( 'FFAQ_FREEMIUS_NAVIGATION', 'menu' );
    // Options: menu|tabs.
}


if ( function_exists( __NAMESPACE__ . '\\flexible_faqs_fs' ) ) {
    flexible_faqs_fs()->set_basename( false, __FILE__ );
} else {
    
    if ( !function_exists( __NAMESPACE__ . '\\flexible_faqs_fs' ) ) {
        /**
         * Create a helper function for easy SDK access.
         *
         * @return Object An instance the main plugin Freemius class.
         */
        function flexible_faqs_fs()
        {
            global  $flexible_faqs_fs ;
            
            if ( !isset( $flexible_faqs_fs ) ) {
                // Include Freemius SDK.
                require_once dirname( __FILE__ ) . '/freemius/start.php';
                $flexible_faqs_fs = fs_dynamic_init( array(
                    'id'             => '5704',
                    'slug'           => 'flexible-faqs',
                    'premium_slug'   => 'flexible-faqs-pro',
                    'type'           => 'plugin',
                    'public_key'     => 'pk_718b1ab80c043f6bb8507fae3f2f5',
                    'is_premium'     => false,
                    'navigation'     => FFAQ_FREEMIUS_NAVIGATION,
                    'premium_suffix' => 'Pro',
                    'has_addons'     => false,
                    'has_paid_plans' => true,
                    'menu'           => array(
                    'slug'       => 'edit.php?post_type=wpgo_faq',
                    'first-path' => 'edit.php?post_type=wpgo_faq&page=flexible-faqs-wpgoplugins-welcome',
                ),
                    'is_live'        => true,
                ) );
            }
            
            return $flexible_faqs_fs;
        }
        
        // Init Freemius.
        flexible_faqs_fs();
        // Signal that SDK was initiated.
        do_action( 'flexible_faqs_fs_loaded' );
    }
    
    /**
     * Main plugin class.
     */
    class Main
    {
        /**
         * Common root paths/directories.
         *
         * @var $module_roots
         */
        public static  $module_roots ;
        /**
         * The main initialization function.
         */
        public static function init()
        {
            self::$module_roots = array(
                'dir'  => plugin_dir_path( __FILE__ ),
                'pdir' => plugin_dir_url( __FILE__ ),
                'uri'  => plugins_url( '', __FILE__ ),
                'file' => __FILE__,
            );
            $root = self::$module_roots['dir'];
            require_once $root . 'classes/class-bootstrap.php';
            new BootStrap();
        }
    
    }
    Main::init();
}
