<?php
/*
  * Plugin Name: Divi Contact Form Helper
  * Description: Upgrade the Divi Contact Form with over 115 premium features like file uploads, date & time picker, spam protection, digital signature, confirmation emails, Zapier integration, save entries to database, SMTP settings, custom subject line, reply-to address, conditional email routing, custom merge tags, export to CSV, auto entry backups, 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.7.7
  * 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 © 2022, Divi Contact Form Helper
*/

namespace PWH_DCFH;

use PWH_DCFH\App\Controllers\PWH_DCFH_Autoload;

// Ensure script execution only within WordPress environment
if (!defined('ABSPATH')) {
    exit;
}
// Define Plugin File Name Constant
if (!defined('PWH_DCFH_PLUGIN_FILE')):
    define('PWH_DCFH_PLUGIN_FILE', __FILE__);
endif;
// Define Plugin Version Constant
if (!defined('PWH_DCFH_PLUGIN_VERSION')):
    define('PWH_DCFH_PLUGIN_VERSION', '1.7.7');
endif;
// Define Plugin Basename Constant
if (!defined('PWH_DCFH_PLUGIN_BASENAME')):
    define('PWH_DCFH_PLUGIN_BASENAME', plugin_basename(__FILE__));
endif;
// Define Plugin Development Mode Constant
if (!defined('PWH_DCFH_PLUGIN_DEV_MOD')):
    define('PWH_DCFH_PLUGIN_DEV_MOD', false);
endif;
// Plugin Required Bootstrap
require_once __DIR__.'/bootstrap.php';
/**
 * Activate the PWH DCFH plugin.
 * This function is hooked into the activation process of the plugin and is responsible for
 * executing activation procedures.
 *
 * @param bool $network_wide Whether the plugin is being network activated.
 *
 * @return void
 */
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;
/**
 * Deactivates the PWH DCFH plugin.
 * This function is triggered upon deactivation of the plugin.
 *
 * @param bool $network_wide Whether the plugin is being deactivated network-wide.
 *
 * @return void
 */
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;
/**
 * Initializes the text domain for the plugin, allowing for translation.
 * @return void
 */
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;
/**
 * Register services on Divi Extensions initialization.
 * Hooked to the 'divi_extensions_init' action.
 * @since 1.0.0
 */
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.7.7');
if(!defined('WOO_SLT_DCFH_DB_VERSION_DCFH'))
define('WOO_SLT_DCFH_DB_VERSION_DCFH', '1.7.7'); 

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();

?>