<?php
/*
  * Plugin Name: Divi Contact Form Helper
  * Description: Upgrade the Divi Contact Form with tons of new settings and premium features like file uploads, date & time picker, custom subject line, confirmation emails, Zapier integration, save submissions to database, SMTP, icons, new merge tags, dashboard stats, and so much more!.
  * Author: <a href="https://pakwebhouse.com/">Pak Web House</a> & <a href="https://www.peeayecreative.com/">Pee-Aye Creative</a>
  * Update URI: https://www.peeayecreative.com/
  * Text Domain: pwh-dcfh
  * Domain Path: /languages/
  * Version: 1.5.5
  * Requires at least: 5.x
  * Requires PHP: 7.0
  * License:  GPL2
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  *
  * You should have received a copy of the GNU General Public License
  * along with Divi Contact Form Helper. If not, see <https://www.gnu.org/licenses/>.
  *
  * @since     1.0.0
  * @author    Pak Web House & Pee-Aye Creative
  * @license   GPL-2.0+
  * @copyright Copyright (c) 2022, Divi Contact Form Helper
*/

namespace PWH_DCFH;

use PWH_DCFH\App\Controllers\PWH_DCFH_Autoload;

if (!defined('ABSPATH')) exit;
// Plugin File Name
if (!defined('PWH_DCFH_PLUGIN_FILE')):
    define('PWH_DCFH_PLUGIN_FILE', __FILE__);
endif;
// Plugin Version
if (!defined('PWH_DCFH_PLUGIN_VERSION')):
    define('PWH_DCFH_PLUGIN_VERSION', '1.5.5');
endif;
// Plugin Basename
if (!defined('PWH_DCFH_PLUGIN_BASENAME')):
    define('PWH_DCFH_PLUGIN_BASENAME', plugin_basename(__FILE__));
endif;
// Plugin Dev Mod
if (!defined('PWH_DCFH_PLUGIN_DEV_MOD')):
    define('PWH_DCFH_PLUGIN_DEV_MOD', false);
endif;
// Plugin Required Bootstrap
require_once __DIR__.'/bootstrap.php';
// Plugin Activation
if (!function_exists('pwh_dcfh_plugin_activation')):
    function pwh_dcfh_plugin_activation($network_wide)
    {
        App\Base\PWH_DCFH_Activate::activate($network_wide);
    }

    register_activation_hook(__FILE__, __NAMESPACE__.'\pwh_dcfh_plugin_activation');
endif;
// Plugin Deactivation
if (!function_exists('pwh_dcfh_plugin_deactivation')):
    function pwh_dcfh_plugin_deactivation($network_wide)
    {
        App\Base\PWH_DCFH_Deactivate::deactivate($network_wide);
    }

    register_deactivation_hook(__FILE__, __NAMESPACE__.'\pwh_dcfh_plugin_deactivation');
endif;
// Plugin Translation Ready
if (!function_exists('pwh_dcfh_text_domain')):
    function pwh_dcfh_text_domain()
    {
        load_plugin_textdomain('pwh-dcfh', false, wp_basename(__DIR__).'/languages/');
    }

    add_action('init', __NAMESPACE__.'\pwh_dcfh_text_domain');
endif;
// Plugin Services
add_action('divi_extensions_init', [new PWH_DCFH_Autoload(), 'register_services']);


// LICENSE MANAGER CODE BEGINS HERE
if(!defined('WOO_SLT_DCFH_PATH_DCFH'))
define('WOO_SLT_DCFH_PATH_DCFH',   plugin_dir_path(__FILE__));
if(!defined('WOO_SLT_DCFH_URL_DCFH'))
define('WOO_SLT_DCFH_URL_DCFH',    plugins_url('', __FILE__));
if(!defined('WOO_SLT_DCFH_APP_API_URL_DCFH'))
define('WOO_SLT_DCFH_APP_API_URL_DCFH',      'https://www.peeayecreative.com/product/divi-contact-form-helper/');

if(!defined('WOO_SLT_DCFH_VERSION_DCFH'))
define('WOO_SLT_DCFH_VERSION_DCFH', '1.5.5');
if(!defined('WOO_SLT_DCFH_DB_VERSION_DCFH'))
define('WOO_SLT_DCFH_DB_VERSION_DCFH', '1.5.5'); 

if(!defined('WOO_SLT_DCFH_PRODUCT_ID_DCFH'))
define('WOO_SLT_DCFH_PRODUCT_ID_DCFH',           'PA-DCFH');
if(!defined('WOO_SLT_DCFH_INSTANCE_DCFH'))
define('WOO_SLT_DCFH_INSTANCE_DCFH',             str_replace(array ("https://" , "http://"), "", network_site_url()));


if(!class_exists('WOO_SLT_DCFH'))
include_once(WOO_SLT_DCFH_PATH_DCFH . '/license/class.wooslt.php');
if(!class_exists('WOO_SLT_DCFH_licence'))
include_once(WOO_SLT_DCFH_PATH_DCFH . '/license/class.licence.php');
if(!class_exists('WOO_SLT_DCFH_options_interface'))
include_once(WOO_SLT_DCFH_PATH_DCFH . '/license/class.options.php');
if(!class_exists('WOO_SLT_DCFH_CodeAutoUpdate'))
include_once(WOO_SLT_DCFH_PATH_DCFH . '/license/class.updater.php');

function WOO_SLT_DCFH_DCFH_activated() 
	{

	}

function WOO_SLT_DCFH_DCFH_deactivated() 
	{

	}

global $WOO_SLT_DCFH;
$WOO_SLT_DCFH = new \WOO_SLT_DCFH();

?>