<?php
/*
* Plugin Name: Digital Warranty Card Generator
* Plugin URI: https://plugins.hirewebxperts.com/digital-warranty-cards/
* Description: Digital Warranty Card Generator WordPress Plugin as the name suggests this Plugin can be used for generating Digital Warranty Cards for your Products. If you have an ecommerce website then you can provide your customer with such Digital Warranty Cards which not only boost your sales but also help you to earn more trust. You can also configure or change the settings to convert warranty cards to be used as Digital Gift Cards.  
* Version:1.3
* Donate link: 	    https://hirewebxperts.com/donate/
* Requires at least: 6.2 or higher
* Requires PHP: 8.0 or higher
* Author: coder426
* License: GPLv2 or later
* Text Domain: wcgen
* Domain Path:/i18n/languages
* License URI:      https://www.gnu.org/licenses/gpl-2.0.txt

*/

if (!defined('ABSPATH')) {
    exit;
}

/* Plugin details */
$version             =  rand();
$name                =  'wcgen';
$dir_name            =  'digital-wc-generator';
$location            =  'plugins';
$plugin_dir          =  dirname(__FILE__);
$plugin_url          =  plugin_dir_url(__FILE__);

//Define plugin url path
define($plugin_url, plugin_dir_url(__FILE__));
define($plugin_dir, dirname(__FILE__));
define('WCGEN_JS', $plugin_url . 'assets/js/');
define('WCGEN_CSS', $plugin_url . 'assets/css/');
define('WCGEN_IMG', $plugin_url . 'assets/images/');
define('WCGEN_LIBS', $plugin_url . 'assets/libs/');
define('WCGEN_TCPDF_INC', $plugin_dir . '/include/');
define('WCGEN_TCPDF', $plugin_dir . '/tcpdf/');
define('WCGEN_TCPDF_URL', $plugin_url . 'tcpdf/');
define('WCGEN_VER', $version);
define('WCGEN_NAME', $name);


/* 
** Include Admin Setting Page
**/
include(WCGEN_TCPDF_INC.'wc-style-script.php');

//Add languages files
add_action('init', 'wcgen_language_translate');
/* Translate language */
function wcgen_language_translate()
{
    load_plugin_textdomain('wcgen', false, dirname(plugin_basename(__FILE__)) . '/i18n/languages/');
}

//Setting link to pluign
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'wcgen_add_plugin_page_settings_link');
function wcgen_add_plugin_page_settings_link($links)
{
$links[] = '<a href="' . admin_url('options-general.php?page=digital-warranty-card') . '">' . __('Settings', 'wcgen') . '</a>';
return $links;
}

function wcgen_main_menu_html()
{
    /* 
    ** Include Admin Setting Page
    **/
    include(WCGEN_TCPDF_INC.'admin/wc-admin-setting.php');
}

/* 
** Include Admin Setting Page
**/
include(WCGEN_TCPDF_INC.'functions.php');

?>