<?php

defined('ABSPATH') or die('No script kiddies please!');
/*
  Plugin Name: Subscribe To Download
  Plugin URI:  https://wpshuffle.com/subscribe-to-download
  Description: A plugin to collect email using an email subscribing form by providing the free downloadable items
  Version:     2.1.0
  Author:      WP Shuffle
  Author URI:  http://wpshuffle.com
  Domain Path: /languages
  Text Domain: subscribe-to-download
 */



/**
 * Plugin's main class
 */
if (!class_exists('STD_Class')) {

    class STD_Class {

        function __construct() {
            $this->define_constants();
            $this->includes();
        }

        /**
         * Necessary constants
         */
        function define_constants() {

            global $wpdb;
            defined('STD_VERSION') or define('STD_VERSION', '2.1.0'); // Plugin's active version
            defined('STD_PATH') or define('STD_PATH', plugin_dir_path(__FILE__)); // plugin's absolute path
            defined('STD_URL') or define('STD_URL', plugin_dir_url(__FILE__)); // plugin's absolute path
            defined('STD_IMG_DIR') or define('STD_IMG_DIR', plugin_dir_url(__FILE__) . 'images'); // plugin's image directory URL
            defined('STD_CSS_DIR') or define('STD_CSS_DIR', plugin_dir_url(__FILE__) . 'css'); // plugin's image directory URL
            defined('STD_JS_DIR') or define('STD_JS_DIR', plugin_dir_url(__FILE__) . 'js'); // plugin's image directory URL
            defined('STD_TD') or define('STD_TD', 'subscribe-to-download'); //plugin's translation text domain
            defined('STD_FORM_TABLE') or define('STD_FORM_TABLE', $wpdb->prefix . 'std_forms'); //plugin's translation text domain
            defined('STD_SUBSCRIBERS_TABLE') or define('STD_SUBSCRIBERS_TABLE', $wpdb->prefix . 'std_subscribers'); //plugin's subscriber table
            /**
             * Third party subscription API URLs
             */
            defined('STD_MC_API_URL') or define('STD_MC_API_URL', 'https://api.mailchimp.com/3.0/'); //Mailchimp default api url
            defined('STD_CC_API_URL') or define('STD_CC_API_URL', 'https://api.constantcontact.com/v2/'); //Constant Contact default api url
            defined('STD_ML_API_URL') or define('STD_ML_API_URL', 'https://api.mailerlite.com/api/v2/'); //Mailerlite default api url
            defined('STD_SIB_API_URL') or define('STD_SIB_API_URL', 'https://api.sendinblue.com/v3/'); //Sendinblue default api url
            defined('STD_CK_API_URL') or define('STD_CK_API_URL', 'https://api.convertkit.com/v3/'); //Sendinblue default api url

            defined('STD_TOTAL_TEMPLATES') or define('STD_TOTAL_TEMPLATES', 22); //Total number of templates available
            defined('STD_LANGUAUGE_PATH') or define('STD_LANGUAUGE_PATH', basename(dirname(__FILE__)) . '/languages/');
        }

        /**
         * Includes necessary classes & files
         */
        function includes() {
            include(STD_PATH . 'inc/classes/class-std-library.php');
            include(STD_PATH . 'inc/classes/class-std-init.php');
            include(STD_PATH . 'inc/classes/class-std-activation.php');
            include(STD_PATH . 'inc/classes/class-std-admin.php');
            include(STD_PATH . 'inc/classes/class-std-enqueue.php');
            include(STD_PATH . 'inc/classes/class-std-ajax-admin.php');
            include(STD_PATH . 'inc/classes/class-std-ajax.php');
            include(STD_PATH . 'inc/classes/class-std-shortcode.php');
            include(STD_PATH . 'inc/classes/class-std-downloader.php');
            include(STD_PATH . 'inc/classes/class-std-hooks.php');
            include(STD_PATH . 'inc/classes/class-std-metabox.php');
            include(STD_PATH . 'inc/classes/class-std-mobile-detect.php');
        }
    }

    $std_obj = new STD_Class(); //initialization of plugin
}
