Plugin Directory

Changeset 3365744


Ignore:
Timestamp:
09/22/2025 11:29:13 AM (6 weeks ago)
Author:
webtoffee
Message:

1.2.5 2025-09-22

*[Tweak] - Performance optimization and bug fixes.

Location:
wt-gift-cards-woocommerce
Files:
155 added
22 edited

Legend:

Unmodified
Added
Removed
  • wt-gift-cards-woocommerce/trunk/README.txt

    r3348454 r3365744  
    1 === WebToffee WooCommerce Gift Cards - Create & Manage Gift Cards for WooCommerce ===
     1=== WebToffee Gift Cards for WooCommerce ===
    22Contributors: WebToffee
    3 Version: 1.2.4
     3Version: 1.2.5
    44Donate link:https://www.webtoffee.com/product/woocommerce-gift-cards/
    55Tags: gift cards, woocommerce gift cards,  gift certificates, gift voucher, advanced gift cards
     
    77Tested up to: 6.8
    88Requires PHP: 5.6
    9 Stable tag: 1.2.4
     9Stable tag: 1.2.5
    1010License: GPLv3
    1111License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2121The WebToffee WooCommerce Gift Cards plugin (also known as WooCommerce gift voucher plugin) is a digital gift card solution that helps create gift certificates in WooCommerce. You can easily generate eye-catching customized WooCommerce gift cards with a beginner-friendly interface.
    2222
    23 This free gift card plugin is the ultimate gift card solution for WooCommerce stores. It lets you create Amazon-like gift vouchers and allows your customers to conveniently purchase and redeem from your store.
    24 
    25 == Key Features of this Free Gift Cards Plugin ==
     23This free gift card WordPress plugin is the ultimate gift card solution for WooCommerce stores. It lets you create Amazon-like gift vouchers and allows your customers to conveniently purchase and redeem from your store.
     24
     25== Key Features of this Free WordPress Gift Cards Plugin ==
    2626🔸 **Create digital gift card** - Create and sell digital gift card in WooCommerce.
    2727🔸 **Free gift card template** - The WooCommerce gift voucher plugin offers four gift cards free templates.
     
    3838
    3939== Free Templates for WooCommerce Gift Vouchers ==
    40 This free gift card plugin for WooCommerce offers four cool templates for gift card images. You can allow your customers to choose an image for the gift card from the given four templates. These templates feature a range of designs, from classic and elegant to festive and fun, ensuring a perfect match for every occasion and recipient.
     40This free gift card plugin for WooCommerce offers four cool templates for gift card images. You can create customized WooCommerce gift cards from the free templates. These templates feature a range of designs, from classic and elegant to festive and fun, ensuring a perfect match for every occasion and recipient. With the premium version of this ecommerce gift card plugin you can upload custom images for the gift card and allow your customers to personalize the gift cards with custom images and messages.
    4141
    4242== Send Free Gift Cards to Customers ==
     
    8080
    8181== WebToffee WooCommerce Gift Cards (Premium) ==
    82 The [WooCommerce Gift Cards](https://www.webtoffee.com/product/woocommerce-gift-cards/) plugin by WebToffee allows you to create and sell gift card codes on your WooCommerce store. You can set up both digital and physical gift cards and allow customers to send custom gift cards from your store. Unlock advanced gift cards features with the premium version.
     82The [WooCommerce Gift Cards](https://www.webtoffee.com/product/woocommerce-gift-cards/?utm_source=free_plugin_readme&utm_medium=gift_cards&utm_campaign=WooCommerce_Gift_Cards) plugin by WebToffee allows you to create and sell gift card codes on your WooCommerce store. You can set up both digital and physical gift cards and allow customers to send custom gift cards from your store. Unlock advanced gift cards features with the premium version.
    8383
    8484[youtube https://www.youtube.com/watch?v=bKmGBG9U1uY&ab_channel=WebToffee]
     
    100100&#9989; Use store credits on shipping, tax, and other charges </li>
    101101
     102== Extend Gift Cards with WooCommerce Smart Coupons ==
     103
     104Want to supercharge your WooCommerce gift cards? Pair them with **Smart Coupons for WooCommerce** – the all-in-one solution for coupons, store credits, and advanced discounts. 
     105
     106With **Smart Coupons**, you can: 
     107- Generate and assign **store credits** that customers can redeem partially or fully. 
     108- Create **advanced coupon types** like BOGO (Buy One Get One), bulk discounts, and more. 
     109- Set **usage restrictions** based on products, categories, user roles, and cart conditions. 
     110- Schedule coupons for **special promotions** and campaigns. 
     111- Issue **store credit-style gift vouchers** that customers can use across multiple orders until fully redeemed. 
     112
     113Both free and premium options are available: 
     114- **[Get Smart Coupons Free](https://wordpress.org/plugins/wt-smart-coupons-for-woocommerce/)** – Start with essential coupon and store credit features to run basic campaigns. 
     115- **[Get Smart Coupons Premium](https://www.webtoffee.com/product/smart-coupons-for-woocommerce/?utm_source=free_plugin_readme&utm_medium=gift_cards&utm_campaign=smart_coupons)** – Unlock the full power of Smart Coupons with BOGO deals, auto-apply coupons, bulk generation, URL coupons, advanced restrictions, and more. 
     116
     117By combining WooCommerce Gift Cards with Smart Coupons, you can create a complete gifting and discounting strategy that keeps customers coming back and helps boost your store’s revenue. 
     118
     119== You May Also Need ==
     120GDPR Cookie Consent is our flagship cookie consent plugin, which is a Google-certified CMP built specifically for WordPress websites. With this plugin, you can display a fully customizable cookie banner on your site to help ensure compliance with major privacy laws like the GDPR and CCPA.
     121
     122Key features include an advanced cookie scanner, automatic script blocking, and detailed consent log reporting. It also lets you deploy an IAB-compliant cookie banner and supports Google Consent Mode v2.
     123
     124Get [GDPR Cookie Consent Plugin](https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_readme&utm_medium=gift_cards&utm_campaign=GDPR) Now.
     125
    102126== Installation ==
    103127
     
    178202== Upgrade Notice ==
    179203
    180 = 1.2.4 =
    181 *[Compatibility] - Tested OK with WooCommerce 10.1
     204= 1.2.5 =
     205*[Tweak] - Performance optimization and bug fixes.
  • wt-gift-cards-woocommerce/trunk/admin/class-wbte-woocommerce-gift-cards-free-admin.php

    r3067373 r3365744  
    5454        'gift_card',
    5555        'freevspro',
     56        'gc_pro_banner', /** @since 1.2.5 */
    5657    );
    5758
     
    186187            wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wt-woocommerce-gift-cards-free-admin.css', array( 'wc-admin-layout' ), $this->version, 'all' );
    187188            wp_enqueue_style( 'wp-color-picker' );
    188             wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css' );
     189            wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), $this->version );
    189190        }
    190191    }
     
    417418        foreach ( $the_options as $key => $value ) {
    418419            if ( isset( $_POST[ $key ] ) ) {
    419                 $the_options[ $key ] = Wbte_Gc_Free_Security_Helper::sanitize_data( wc_clean( wp_unslash( $_POST[ $key ] ) ), $key, $validation_rule );
     420                $the_options[ $key ] = Wbte_Gc_Free_Security_Helper::sanitize_data( wc_clean( wp_unslash( $_POST[ $key ] ) ), $key, $validation_rule ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    420421            } elseif ( array_key_exists( $key, $default_val_needed_fields ) ) {
    421422                    /* Set a hidden field for every multi-select, checkbox etc fields in the form. This will be used to add a default value when it does not have any POST value. */
  • wt-gift-cards-woocommerce/trunk/admin/modules/freevspro/views/comparison-table.php

    r3030434 r3365744  
    4040    ),
    4141    array(
     42        __( 'Allow users to schedule gift cards', 'wt-gift-cards-woocommerce' ),
     43        false,
     44        true,
     45    ),
     46    array(
     47        __( 'Category-wise template listing', 'wt-gift-cards-woocommerce' ),
     48        false,
     49        true,
     50    ),
     51    array(
    4252        __( "'Gift this product' option (Create gift cards worth of a specific product)", 'wt-gift-cards-woocommerce' ),
    4353        false,
     
    5565    ),
    5666    array(
    57         __( 'Category-wise template listing', 'wt-gift-cards-woocommerce' ),
    58         false,
    59         true,
    60     ),
    61     array(
    62         __( 'Allow users to schedule gift cards', 'wt-gift-cards-woocommerce' ),
     67        __( 'Manage store credit balances of users', 'wt-gift-cards-woocommerce' ),
    6368        false,
    6469        true,
     
    8590    ),
    8691    array(
    87         __( 'Give discounts on gift cards', 'wt-gift-cards-woocommerce' ),
     92        __( 'Give discounts on gift card purchases', 'wt-gift-cards-woocommerce' ),
    8893        false,
    8994        true,
     
    133138?>
    134139
    135 <table style="width:100%; background: linear-gradient(to right, #fff, #F1FFF4); padding:37px 46px; border: 1px solid #6ABE45; border-radius: 10px 10px 0px 0px;">
    136     <tr>
    137         <td>
    138             <img src="<?php echo esc_url( WBTE_GC_FREE_URL . 'admin/modules/freevspro/assets/images/plugin_icon.png' ); ?>" style="float:left; width:51px;">
     140<table style="width:100%;  background: #fff url('<?php echo esc_url( WBTE_GC_FREE_URL . 'admin/images/background-freevspro.png' ); ?>') no-repeat bottom right; border-radius:8px; padding:2px; margin:2px 0; box-shadow:0 1px 3px rgba(0,0,0,0.05); margin-bottom: 14px; background-size: 100% auto;">
     141    <tr style="vertical-align:middle;">
     142       
     143        <td style="padding:20px;">
     144            <div style="display:flex; align-items:center; gap:15px; width:56%;">
     145                <img src="<?php echo esc_url( WBTE_GC_FREE_URL . 'admin/modules/freevspro/assets/images/plugin_icon.png' ); ?>" alt="Plugin Icon" style="width:50px; height:50px;">
     146                <p style="margin:0; font-size:18px; font-weight:600; color:#111;">
     147                    <?php esc_html_e( 'Upgrade to Premium and Enjoy the Full Potential of WooCommerce Gift Cards', 'wt-gift-cards-woocommerce' ); ?>
     148                </p>
     149            </div>
     150           
     151            <div style="margin-top:17px; display:flex; gap:25px; font-size:14px; color:#444; font-weight: 600;">
     152                <span><span style="color:#6abe45; margin-right:6px;" class="dashicons dashicons-yes"></span><?php esc_html_e( '99% Customer Satisfaction', 'wt-gift-cards-woocommerce' ); ?></span>
     153                <span><span style="color:#6abe45; margin-right:6px;" class="dashicons dashicons-yes"></span><?php esc_html_e( '30 Day money back guarantee', 'wt-gift-cards-woocommerce' ); ?></span>
     154            </div>
    139155        </td>
    140         <td style="padding-left: 20px;">
    141             <p style="font-size:23px; font-weight:700;">⚡ <?php esc_html_e( 'Unlock the full potential of gift cards with a', 'wt-gift-cards-woocommerce' ); ?> ✨ <?php esc_html_e( 'premium upgrade', 'wt-gift-cards-woocommerce' ); ?></p>
    142             <p><?php esc_html_e( 'See what you are missing on your free version!', 'wt-gift-cards-woocommerce' ); ?></p>
    143             <span style="color:#6ABE45;" class="dashicons dashicons-saved"></span><span style="color:#616161; font-size:14px;"><?php esc_html_e( '99% Customer Satisfaction', 'wt-gift-cards-woocommerce' ); ?></span>&ensp;&ensp;<span style="color:#6ABE45;" class="dashicons dashicons-saved"></span><span style="color:#616161; font-size:14px;"><?php esc_html_e( '30 Day money back guarantee', 'wt-gift-cards-woocommerce' ); ?></span>
    144         </td>
    145         <td>
    146             <a style="background:#4750CB; font-size:16px; font-weight:500; border-radius:11px; line-height:48px; color:#fff; border:none; text-align: center;" class="button button-secondary" href="<?php echo esc_url( 'https://www.webtoffee.com/product/woocommerce-gift-cards/?utm_source=free_plugin_free_vs_pro&utm_medium=Gift_card_basic&utm_campaign=WooCommerce_Gift_Cards&utm_content=' . WBTE_GC_FREE_VERSION ); ?>" target="_blank"><?php esc_html_e( 'Unlock pro features', 'wt-gift-cards-woocommerce' ); ?> <span class="dashicons dashicons-arrow-right-alt" style="line-height:48px;font-size:14px;"></span></a>
     156       
     157        <td style="text-align:right; padding:20px; width:40%;">
     158            <a href="<?php echo esc_url( 'https://www.webtoffee.com/product/woocommerce-gift-cards/?utm_source=free_plugin_free_vs_pro&utm_medium=Gift_card_basic&utm_campaign=WooCommerce_Gift_Cards&utm_content=' . WBTE_GC_FREE_VERSION ); ?>" target="_blank"
     159                style="display:inline-block; background:#4750cb; font-size:15px; font-weight:500; border-radius:8px; padding:12px 20px; color:#fff; text-decoration:none;">
     160                <?php esc_html_e( 'Unlock Pro Features', 'wt-gift-cards-woocommerce' ); ?> →
     161            </a>
    147162        </td>
    148163    </tr>
     
    151166    <tr class="wt_gc_freevspro_table_hd_tr">
    152167        <td><?php esc_html_e( 'FEATURES', 'wt-gift-cards-woocommerce' ); ?></td>
    153         <td><?php esc_html_e( 'FREE', 'wt-gift-cards-woocommerce' ); ?></td>
    154         <td><?php esc_html_e( 'PREMIUM', 'wt-gift-cards-woocommerce' ); ?>&nbsp;<span><img src="<?php echo esc_url( WBTE_GC_FREE_URL . 'admin/images/pro_crown.svg' ); ?>" style="width:16px;"></span></td>
     168        <td class="wt_gc_upsell_text_align_center"><?php esc_html_e( 'FREE', 'wt-gift-cards-woocommerce' ); ?></td>
     169        <td class="wt_gc_upsell_text_align_center"><?php esc_html_e( 'PREMIUM', 'wt-gift-cards-woocommerce' ); ?>&nbsp;<span><img src="<?php echo esc_url( WBTE_GC_FREE_URL . 'admin/images/pro_crown.svg' ); ?>" style="width:16px;"></span></td>
    155170    </tr>
    156171    <?php
     
    159174        <tr class="wt_gc_freevspro_table_body_tr">
    160175            <td><?php echo wp_kses_post( $val_arr[0] ); ?></td>
    161             <td>
     176            <td class="wt_gc_upsell_text_align_center">
    162177                <?php
    163178                wbte_gc_free_vs_pro_column_vl( $val_arr[1], $yes_icon, $no_icon );
    164179                ?>
    165180            </td>
    166             <td>
     181            <td class="wt_gc_upsell_text_align_center">
    167182                <?php
    168183                wbte_gc_free_vs_pro_column_vl( $val_arr[2], $yes_icon, $no_icon );
     
    174189    ?>
    175190</table>
     191
  • wt-gift-cards-woocommerce/trunk/admin/modules/freevspro/views/goto-pro.php

    r3030434 r3365744  
    66<style>
    77/* hide default sidebar */
     8.wt-gc-tab-container{ background:none; }
    89.wt-gc-tab-container, .wt-gc-tab-head{ width:100%; }
    910.wt-gc-tab-right-container{ display:none; }
     
    1617.wt_gc_freevspro_table_subhd_tr td{ background:#f0f0f0; font-weight:600; font-size:14px; }
    1718.wt_gc_freevspro_table_subhd_desc{ font-weight:400; font-size:13px; display:inline-block; margin-left:30px; }
     19.wt_gc_freevs_pro .wt_gc_upsell_text_align_center, .wt_gc_freevspro_table_body_tr .wt_gc_upsell_text_align_center{ text-align:center ; }
    1820
    1921</style>
  • wt-gift-cards-woocommerce/trunk/admin/modules/gift_card/gift_card.php

    r3213631 r3365744  
    9090        add_action( 'submitpost_box', array( $this, 'add_hidden_gc_product_edit_input' ) ); // add a hidden input
    9191
     92        // Banner  metabox on product edit page
     93        add_action( 'add_meta_boxes', array( $this, 'add_banner_metabox' ) );
     94
    9295        // add custom product data meta box
    9396        add_action( 'add_meta_boxes', array( $this, 'add_custom_product_data_meta_box' ) );
     
    186189
    187190                $product_id = $gift_card_products[0];
    188                 $templates  = isset( $_POST['wt_gc_visible_gift_template'] ) ? wc_clean( wp_unslash( $_POST['wt_gc_visible_gift_template'] ) ) : array(); // phpcs:disable WordPress.Security.NonceVerification.Missing
    189 
     191                $templates  = isset( $_POST['wt_gc_visible_gift_template'] ) ? (array) wc_clean( wp_unslash( $_POST['wt_gc_visible_gift_template'] ) ) : array(); // phpcs:disable WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     192                $templates = array_map( 'sanitize_text_field', $templates );
     193               
    190194                update_post_meta( $product_id, '_wt_gc_templates', $templates );
    191195                update_post_meta( $product_id, '_wt_gc_enable_template', ( empty( $templates ) ? 'no' : 'yes' ) ); // Disable template if list is empty
     
    265269        }
    266270
    267         $visible_gift_templates = ( isset( $_POST['wt_gc_visible_gift_template'] ) ? wc_clean( wp_unslash( $_POST['wt_gc_visible_gift_template'] ) ) : '' ); // phpcs:disable WordPress.Security.NonceVerification.Missing
    268         $visible_gift_templates = ( ! is_array( $visible_gift_templates ) ? array() : $visible_gift_templates );
     271
     272        $visible_gift_templates = isset( $_POST['wt_gc_visible_gift_template'] ) ? (array) wp_unslash( $_POST['wt_gc_visible_gift_template'] ) : array(); // phpcs:disable WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     273        $visible_gift_templates = array_map( 'sanitize_text_field', $visible_gift_templates );
     274
    269275
    270276        $hidden_templates = array();
     
    567573                #delete-action .submitdelete.deletion{ display:none; }
    568574                .wrap a.page-title-action, a.page-title-action{ display:none; }
     575
     576                /* Hide arrow and close/move controls for upsell banner metabox */
     577                #wt-gc-upsell-banner-metabox { background-color: #f0f0f1; border: none; box-shadow: none; }
     578                #wt-gc-upsell-banner-metabox .handlediv,
     579                #wt-gc-upsell-banner-metabox .handle-actions{ display:none !important; }
     580                #wt-gc-upsell-banner-metabox .postbox-header,
     581                #wt-gc-upsell-banner-metabox .hndle{ display:none !important; }
     582                #wt-gc-upsell-banner-metabox .inside{ margin-top:0; padding-top:0; }
     583               
    569584            </style>
    570585            <?php
     
    630645            add_filter( 'wt_gc_include_admin_js_file', '__return_true', 1 ); // include admin JS file
    631646
    632             $not_hide_meta_boxes  = apply_filters( 'wt_gc_product_page_non_hidden_metaboxes', array( '#submitdiv', '#postimagediv', '#product_catdiv', '#tagsdiv-product_tag', '#wt-gc-custom-product-data-meta-box' ) );
     647            $not_hide_meta_boxes  = apply_filters( 'wt_gc_product_page_non_hidden_metaboxes', array( '#submitdiv', '#postimagediv', '#product_catdiv', '#tagsdiv-product_tag', '#wt-gc-custom-product-data-meta-box', '#wt-gc-upsell-banner-metabox' ) );
    633648            $gift_product_tab_url = admin_url( 'admin.php?page=' . WBTE_GC_FREE_PLUGIN_NAME . '&wt_gc_tab=' . $this->gift_card_product_tab_id );
    634649            ?>
     
    771786        return ( 0 === $post_id && isset( $_REQUEST['wt_gc_product_edit'] ) ? absint( wp_unslash( $_REQUEST['wt_gc_product_edit'] ) ) : $post_id );
    772787    }
     788
     789    /**
     790     * Register the upsell banner metabox on product edit screen (gift card products only)
     791     *
     792     * @since 1.2.5
     793     *
     794     */
     795    public function add_banner_metabox() {
     796        if ( ! $this->is_product_edit_page() ) {
     797            return;
     798        }
     799
     800        add_meta_box('wt-gc-upsell-banner-metabox',__( 'Gift Card Upsell Banner', 'wt-gift-cards-woocommerce' ),array( $this, 'render_gc_upsell_banner_metabox' ),'product','normal','default');
     801    }
     802
     803
     804    /**
     805     * Render the upsell banner metabox content
     806     *
     807     * @since 1.2.5
     808     *
     809     */
     810    public function render_gc_upsell_banner_metabox( ) {
     811        /**
     812         * @var mixed
     813         *
     814         * Display upsell banner
     815         */
     816        $gc_pro_banner = Wbte_Gc_Upsell_Banner::get_instance();
     817        ?>
     818            <div class="woocommerce">
     819                <div class="panel-wrap product_data">
     820                    <?php $gc_pro_banner->pro_banner_content(); ?>
     821                </div>
     822            </div>
     823        <?php
     824    }
     825
    773826
    774827    /**
     
    929982            foreach ( self::get_product_metas( $post_id ) as $meta_key => $meta_data ) {
    930983                if ( isset( $_POST[ $meta_key ] ) ) {
    931                     $meta_value = Wbte_Gc_Free_Security_Helper::sanitize_item( wc_clean( wp_unslash( $_POST[ $meta_key ] ) ), $meta_data['type'] );
     984                    $meta_value = Wbte_Gc_Free_Security_Helper::sanitize_item( wc_clean(  wp_unslash( $_POST[ $meta_key ] ) ), $meta_data['type'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    932985                    update_post_meta( $post_id, $meta_key, $meta_value );
    933986                }
     
    11311184    public function process_shop_coupon_meta( $post_id, $post ) {
    11321185        if ( ! current_user_can( 'manage_woocommerce' ) ) {
    1133             wp_die( __( 'You do not have sufficient permission to perform this operation', 'wt-gift-cards-woocommerce' ) );
     1186            wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'wt-gift-cards-woocommerce' ) );
    11341187        }
    11351188
  • wt-gift-cards-woocommerce/trunk/admin/modules/gift_card/views/--email-configuration-settings-tab.php

    r3213323 r3365744  
    1414    if(!$is_mpdf_active && !$is_mpdf_exists)
    1515    {
    16         $enable_mpdf_msg = __('Requires mPDF library to add PDF support. %s Click here %s to install the %s mPDF add-on by WebToffee %s (free).', 'wt-gift-cards-woocommerce');
     16        /* translators: 1: Opening link tag, 2: Closing link tag, 3: Opening link tag, 4: Closing link tag */
     17        $enable_mpdf_msg = __('Requires mPDF library to add PDF support. %1$s Click here %2$s to install the %3$s mPDF add-on by WebToffee %4$s (free).', 'wt-gift-cards-woocommerce');
    1718        $placeholder_arr[0] = '<a href="' . esc_url(wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $mpdf_slug), 'install-plugin_' . $mpdf_slug)) . '">';
    1819
    1920    }elseif($is_mpdf_active && !$is_required_mpdf_version_installed)
    2021    {
    21         $enable_mpdf_msg = __('Requires mPDF version %s or greater to add PDF support. %s Click here %s to update the %s mPDF add-on by WebToffee %s (free).', 'wt-gift-cards-woocommerce');
     22        /* translators: 1: mPDF version, 2: Opening link tag, 3: Closing link tag, 4: Opening link tag, 5: Closing link tag */
     23        $enable_mpdf_msg = __('Requires mPDF version %1$s or greater to add PDF support. %2$s Click here %3$s to update the %4$s mPDF add-on by WebToffee %5$s (free).', 'wt-gift-cards-woocommerce');
    2224        $placeholder_arr[0] = '<a href="' . esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . $mpdf_slug), 'upgrade-plugin_' . $mpdf_slug)) . '">';
    2325        array_unshift($placeholder_arr , $mpdf_required_version);
     
    2527    }elseif(!$is_mpdf_active && $is_mpdf_exists)
    2628    {
    27         $enable_mpdf_msg = __('Requires mPDF library to add PDF support. %s Click here %s to activate the %s mPDF add-on by WebToffee %s(free).', 'wt-gift-cards-woocommerce');
     29        /* translators: 1: Opening link tag, 2: Closing link tag, 3: Opening link tag, 4: Closing link tag */
     30        $enable_mpdf_msg = __('Requires mPDF library to add PDF support. %1$s Click here %2$s to activate the %3$s mPDF add-on by WebToffee %4$s(free).', 'wt-gift-cards-woocommerce');
    2831        $placeholder_arr[0] = '<a href="' . esc_url(wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=' . urlencode($mpdf_path) . '&plugin_status=all&paged=1&s'), 'activate-plugin_' . $mpdf_path)) . '">';
    2932    }else
     
    3437}else
    3538{
    36     $enable_mpdf_msg = __('Requires mPDF library to add PDF support. Please install the %s mPDF add-on by WebToffee %s(free).', 'wt-gift-cards-woocommerce');
     39    /* translators: 1: Opening link tag, 2: Closing link tag */
     40    $enable_mpdf_msg = __('Requires mPDF library to add PDF support. Please install the %1$s mPDF add-on by WebToffee %2$s(free).', 'wt-gift-cards-woocommerce');
    3741    $placeholder_arr = array('<a href="'.esc_url($mpdf_wp_url).'" target="_blank">', '</a>');
    3842}
  • wt-gift-cards-woocommerce/trunk/admin/modules/gift_card/views/--template-settings-tab.php

    r3030434 r3365744  
    2020    </div>
    2121</div>
     22<div class="wt-upsell-banner" style="margin-top: 142px;">
     23    <?php
     24        /**
     25         * @var mixed
     26         *
     27         * Display upsell banner
     28         */
     29        $gc_pro_banner = Wbte_Gc_Upsell_Banner::get_instance();
     30        $gc_pro_banner->pro_banner_content();
     31    ?>
     32</div>
  • wt-gift-cards-woocommerce/trunk/admin/modules/gift_card/views/gift-card-product.php

    r3154517 r3365744  
    125125                                $actions = array(
    126126                                    /* translators: %d: Product ID. */
    127                                     'id' => array( 'title' => sprintf( __( 'ID: %d', 'woocommerce' ), $product_id ) ),
     127                                    'id' => array( 'title' => sprintf( __( 'ID: %d', 'wt-gift-cards-woocommerce' ), $product_id ) ),
    128128                                );
    129129
     
    245245    </table>
    246246
     247    <div class="wt_gc_upsell_banner_product_table">
     248    <?php
     249        /**
     250         * @var mixed
     251         *
     252         * Display upsell banner
     253         */
     254        $gc_pro_banner = Wbte_Gc_Upsell_Banner::get_instance();
     255        $gc_pro_banner->pro_banner_content();
     256    ?>
     257    </div>
    247258</div>
  • wt-gift-cards-woocommerce/trunk/admin/views/-form-field-generator.php

    r3030434 r3365744  
    119119
    120120                    foreach ( $checkbox_fields as $checkbox_vl => $checkbox_label ) {
     121                        $vl = is_array( $vl ) ? $vl : ( ! empty( $vl ) ? array( $vl ) : array() );
    121122                        ?>
    122                         <span class="wt_gc_checkbox_list_item"><input type="checkbox" id="<?php echo esc_attr( $field_id . '_' . $checkbox_vl ); ?>" name="<?php echo esc_attr( $field_name ); ?>[]" class="<?php echo esc_attr( $css_class ); ?>" value="<?php echo esc_attr( $checkbox_vl ); ?>" <?php echo wp_kses_post( in_array( $checkbox_vl, $vl ) ? ' checked="checked"' : '' ); ?> <?php echo wp_kses_post( $fld_attr ); ?> /> <label for="<?php echo esc_attr( $field_id . '_' . $checkbox_vl ); ?>"><?php echo esc_html( $checkbox_label ); ?></label> </span>
     123                        <span class="wt_gc_checkbox_list_item"><input type="checkbox" id="<?php echo esc_attr( $field_id . '_' . $checkbox_vl ); ?>" name="<?php echo esc_attr( $field_name ); ?>[]" class="<?php echo esc_attr( $css_class ); ?>" value="<?php echo esc_attr( $checkbox_vl ); ?>" <?php echo wp_kses_post( in_array( $checkbox_vl, $vl, true ) ? ' checked="checked"' : '' ); ?> <?php echo wp_kses_post( $fld_attr ); ?> /> <label for="<?php echo esc_attr( $field_id . '_' . $checkbox_vl ); ?>"><?php echo esc_html( $checkbox_label ); ?></label> </span>
    123124                        &nbsp;&nbsp;
    124125                        <?php
  • wt-gift-cards-woocommerce/trunk/admin/views/settings-page.php

    r3192268 r3365744  
    116116                    <div class="wt_gc_extras_content" style="border-bottom: none; border-radius: 5px 5px 0px 0px;">
    117117                        <img src="<?php echo esc_url(WBTE_GC_FREE_URL . 'admin/images/30day-money-back.svg')?>">
    118                         <h3  style="color: #606060;"><?php _e('100% No Risk Money Back Guarantee', 'wt-woocommerce-related-products'); ?></h3>
     118                        <h3  style="color: #606060;"><?php esc_html_e('100% No Risk Money Back Guarantee', 'wt-gift-cards-woocommerce'); ?></h3>
    119119                    </div>
    120120                    <div class="wt_gc_extras_content" style="border-radius: 0px 0px 5px 5px;">
    121121                        <img src="<?php echo esc_url(WBTE_GC_FREE_URL . 'admin/images/satisfaction-rating.svg')?>">
    122                         <h3  style="color: #606060;"><?php _e('Excellent Support with 99% Satisfaction Rating', 'wt-woocommerce-related-products'); ?></h3>
     122                        <h3  style="color: #606060;"><?php esc_html_e('Excellent Support with 99% Satisfaction Rating', 'wt-gift-cards-woocommerce'); ?></h3>
    123123                    </div>
    124124                </div>
  • wt-gift-cards-woocommerce/trunk/changelog.txt

    r3348454 r3365744  
    11== Changelog ==
     2
     3= 1.2.5 2025-09-22 =
     4*[Tweak] - Performance optimization and bug fixes.
    25
    36= 1.2.4 2025-08-22 =
  • wt-gift-cards-woocommerce/trunk/common/class-wbte-woocommerce-gift-cards-free-common.php

    r3348454 r3365744  
    10801080
    10811081                    <form class="wbte_gc_check_balance_form">
    1082                         <?php wp_nonce_field('wbte_gc_check_balance', 'wbte_gc_check_balance_nonce'); ?>
     1082                        <?php wp_nonce_field(WBTE_GC_FREE_PLUGIN_NAME); ?>
    10831083                        <label for="wbte_gc_coupon_code"><?php echo esc_html($coupon_code_label); ?></label>
    10841084                        <input type="text" name="wbte_gc_coupon_code" class="wbte_gc_coupon_code" required>
     
    11171117        $nonce = ( isset( $_REQUEST['_wpnonce'] ) ? sanitize_key( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '' );
    11181118        $nonce = ( is_array( $nonce ) ? reset( $nonce ) : $nonce );
    1119         if ( ! $nonce ) {
    1120             echo wp_send_json_error( $out );
     1119        if ( ! $nonce || ! wp_verify_nonce( $nonce, WBTE_GC_FREE_PLUGIN_NAME ) ) {
     1120            $out = array(
     1121                'balance' => '',
     1122                'message'    => esc_html__( 'Security check failed.', 'wt-gift-cards-woocommerce' ),
     1123            );
     1124            wp_send_json_error( $out );
    11211125            exit();
    11221126        }
     
    11591163        $balance = $coupon->get_amount();
    11601164        $currency = get_woocommerce_currency();
    1161         $formatted_balance = strip_tags(wc_price($balance, array('currency' => $currency)));
     1165        $formatted_balance = wp_strip_all_tags( wc_price( $balance, array( 'currency' => $currency ) ));
    11621166       
    11631167        $success_message = sprintf(
     1168            /* translators: 1: Gift card balance */
    11641169            esc_html__('Your gift card balance is&nbsp;%s', 'wt-gift-cards-woocommerce'),
    11651170            '<span class="wt_gc_balance_amount">' . $formatted_balance . '</span>'
  • wt-gift-cards-woocommerce/trunk/common/classes/class-wbte-gc-store-credit-apply-free.php

    r3284848 r3365744  
    164164                    if ( isset( $item->object['wt_credit_amount'] ) || isset( $item->object['wt_credit_coupon_generated'] ) ) {
    165165                        $valid = false;
    166                         throw new Exception( __( 'Sorry, you cannot purchase store credit with this coupon.', 'wt-gift-cards-woocommerce' ) );
     166                        throw new Exception( esc_html__( 'Sorry, you cannot purchase store credit with this coupon.', 'wt-gift-cards-woocommerce' ) );
    167167                        break;
    168168                    }
  • wt-gift-cards-woocommerce/trunk/common/modules/gift_card/data/data.template.php

    r3213323 r3365744  
    9292                        </div>
    9393                        <div class="wt_gc_pdf_coupon_expiry">
    94                             <?php echo ("" !== $expiry_date ? sprintf(__('Expiry date: %s', 'wt-gift-cards-woocommerce'), $expiry_date) : ''); ?>
     94                            <?php
     95                            /* translators: 1: Expiry date */
     96                            echo ( "" !== $expiry_date ? sprintf( esc_html__( 'Expiry date: %s', 'wt-gift-cards-woocommerce' ),esc_html( $expiry_date )) : '');
     97                            ?>
    9598                        </div>
    9699                    </td>
     
    105108                { ?>
    106109                    <tr>
    107                         <td align="left" valign="bottom"><?php _e('From:', 'wt-gift-cards-woocommerce'); ?></td>
     110                        <td align="left" valign="bottom"><?php esc_html_e('From:', 'wt-gift-cards-woocommerce'); ?></td>
    108111                        <td><?php echo esc_html($from);?></td>
    109112                    </tr>
     
    115118                ?>
    116119                <tr>
    117                     <td align="left" valign="bottom"><?php _e('To:', 'wt-gift-cards-woocommerce'); ?></td>
     120                    <td align="left" valign="bottom"><?php esc_html_e('To:', 'wt-gift-cards-woocommerce'); ?></td>
    118121                    <td><?php echo esc_html($reciever_name);?></td>
    119122                </tr>
     
    125128                ?>
    126129                <tr>
    127                     <td align="left" valign="bottom"><?php _e('Message:', 'wt-gift-cards-woocommerce'); ?></td>
     130                    <td align="left" valign="bottom"><?php esc_html_e('Message:', 'wt-gift-cards-woocommerce'); ?></td>
    128131                    <td><?php echo esc_html($coupon_message);?></td>
    129132                </tr>
     
    137140            <div class="wt_gift_coupon_custom_additional_content">
    138141                <?php
    139                     $custom_addition_content = __('To redeem this gift card, you can enter the gift card code in the dedicated field during checkout.', 'wt-gift-cards-woocommerce');
    140                     echo apply_filters('wt_gc_alter_gift_card_pdf_custom_addition_content', $custom_addition_content, $coupon_obj);
     142                $custom_addition_content = __(
     143                    'To redeem this gift card, you can enter the gift card code in the dedicated field during checkout.',
     144                    'wt-gift-cards-woocommerce'
     145                );
     146
     147                echo esc_html(apply_filters( 'wt_gc_alter_gift_card_pdf_custom_addition_content', $custom_addition_content, $coupon_obj ));
     148
    141149                ?> 
    142150            </div>
  • wt-gift-cards-woocommerce/trunk/common/modules/gift_card/gift_card.php

    r3213631 r3365744  
    10061006        }
    10071007
    1008         while ( $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'shop_coupon' AND post_status ='publish' AND post_title = %s ", $random_coupon ) ) ) {
     1008        while ( wc_get_coupon_id_by_code( $random_coupon ) ) {
    10091009            return self::generate_random_coupon_code();
    10101010        }
     
    12321232        $upload_url = $upload_url.'/wt-gift-cards-woocommerce';
    12331233
     1234        global $wp_filesystem;
     1235        if ( ! $wp_filesystem ) {
     1236            require_once ABSPATH . '/wp-admin/includes/file.php';
     1237        }
     1238        WP_Filesystem();
     1239
    12341240        if(!is_dir($upload_dir))
    12351241        {
    1236             @mkdir($upload_dir, 0700); //create it if not exists
     1242            if ( ! $wp_filesystem->mkdir( $upload_dir, FS_CHMOD_DIR ) && ! is_dir( $upload_dir ) ) {
     1243                return false; // Failed to create directory.
     1244            }
    12371245        }
    12381246
     
    12431251            foreach($files_to_create as $file => $file_content)
    12441252            {
    1245                 if(!file_exists($upload_dir.'/'.$file))
    1246                 {
    1247                     $fh = @fopen($upload_dir.'/'.$file, "w");
    1248                    
    1249                     if(is_resource($fh))
    1250                     {
    1251                         fwrite($fh, $file_content);
    1252                         fclose($fh);
    1253                     }
    1254                 }
     1253                $file_path = trailingslashit( $upload_dir ) . $file;
     1254
     1255                if ( ! $wp_filesystem->exists( $file_path ) ) {
     1256
     1257                    $wp_filesystem->put_contents( $file_path, $file_content, FS_CHMOD_FILE );
     1258                }
    12551259            }
    12561260        }else
  • wt-gift-cards-woocommerce/trunk/includes/class-wbte-black-friday-cyber-monday-twenty-twenty-four.php

    r3192268 r3365744  
    6565                        <div class="wbte-bfcm-banner-body">
    6666                            <div class="wbte-bfcm-banner-body-img-section">
    67                                 <img src="<?php echo plugins_url( 'admin/images/black-friday-2024.svg', dirname(__FILE__) ); ?>" alt="Black Friday Cyber Monday 2024">
     67                                <img src="<?php echo esc_url( plugins_url( 'admin/images/black-friday-2024.svg', dirname( __FILE__ ) ) ); ?>"
     68                                     alt="<?php esc_attr_e( 'Black Friday Cyber Monday 2024', 'wt-gift-cards-woocommerce' ); ?>">
    6869                            </div>
    6970                            <div class="wbte-bfcm-banner-body-info">
    7071                                <div class="never-miss-this-deal">
    71                                     <p><?php echo esc_html__( 'Never Miss This Deal', '' ); ?></p>
     72                                    <p><?php echo esc_html__( 'Never Miss This Deal', 'wt-gift-cards-woocommerce' ); ?></p>
    7273                                </div>
    7374                                <div class="info">
    7475                                    <p><?php
    75                                         echo sprintf(
    76                                                 __( 'Your Last Chance to Avail %1$s on WebToffee Plugins. Grab the deal before it`s gone!', '' ),
    77                                                 '<span>30% '.__("OFF","").'</span>'
    78                                             );
     76                                       echo sprintf(
     77                                            /* translators: %1$s: Discount text with span wrapper, e.g. <span>30% OFF</span>. */
     78                                            esc_html__( 'Your Last Chance to Avail %1$s on WebToffee Plugins. Grab the deal before it`s gone!', 'wt-gift-cards-woocommerce' ),
     79                                            '<span>' . esc_html__( '30% OFF', 'wt-gift-cards-woocommerce' ) . '</span>'
     80                                        )
    7981                                    ?></p>
    8082                                </div>
    8183                                <div class="wbte-bfcm-banner-body-button">
    82                                     <a href="<?php echo self::$promotion_link; ?>" class="bfcm_cta_button" target="_blank"><?php echo esc_html__( 'View plugins', '' ); ?> <span class="dashicons dashicons-arrow-right-alt"></span></a>
     84                                    <a href=" <?php echo esc_url( self::$promotion_link ); ?> " class="bfcm_cta_button" target="_blank"><?php echo esc_html__( 'View plugins', 'wt-gift-cards-woocommerce' ); ?> <span class="dashicons dashicons-arrow-right-alt"></span></a>
    8385                                </div>
    8486                            </div>
     
    146148            if ( isset( $_POST['wbte_bfcm_twenty_twenty_four_banner_action_type'] ) ) {
    147149               
    148                 $action_type = absint( sanitize_text_field( $_POST['wbte_bfcm_twenty_twenty_four_banner_action_type'] ) );
    149                 // Current action is allowed?
     150                $action_type = absint( sanitize_text_field( wp_unslash( $_POST['wbte_bfcm_twenty_twenty_four_banner_action_type'] ) ));
     151                // Current action is allowed?
    150152                if ( in_array( $action_type, array( 2, 3 ) ) ) {
    151153                    update_option( self::$banner_state_option_name, $action_type );
  • wt-gift-cards-woocommerce/trunk/includes/class-wbte-uninstall-feedback.php

    r3067373 r3365744  
    9090                            <?php foreach ($reasons as $reason) { ?>
    9191                                <li data-type="<?php echo esc_attr($reason['type']); ?>" data-placeholder="<?php echo esc_attr($reason['placeholder']); ?>">
    92                                     <label><input type="radio" name="selected-reason" value="<?php esc_html_e( $reason['id'] ); ?>"> <?php esc_html_e( $reason['text'] ); ?></label>
     92                                    <label><input type="radio" name="selected-reason" value="<?php echo esc_attr( $reason['id'] ); ?>"> <?php echo esc_html( $reason['text'] ); ?></label>
    9393                                </li>
    9494                            <?php } ?>
     
    101101                    <div class="wbtegiftcards-modal-footer">
    102102                        <a href="#" class="dont-bother-me"><?php esc_html_e('I rather wouldn\'t say', 'wt-gift-cards-woocommerce'); ?></a>                     
    103                         <a href="https://wordpress.org/support/plugin/wt-gift-cards-woocommerce/#new-topic-0" target="_blank" class="button-primary wbtegiftcards-model-submit"><span class="dashicons dashicons-external" style="margin-top:3px;"></span> <?php _e('Contact Support', 'wt-gift-cards-woocommerce'); ?></a>
     103                        <a href="https://wordpress.org/support/plugin/wt-gift-cards-woocommerce/#new-topic-0" target="_blank" class="button-primary wbtegiftcards-model-submit"><span class="dashicons dashicons-external" style="margin-top:3px;"></span> <?php esc_html_e('Contact Support', 'wt-gift-cards-woocommerce'); ?></a>
    104104                        <button class="button-primary wbtegiftcards-model-submit"><?php esc_html_e('Submit & Deactivate', 'wt-gift-cards-woocommerce'); ?></button>
    105105                        <button class="button-secondary wbtegiftcards-model-cancel"><?php esc_html_e('Cancel', 'wt-gift-cards-woocommerce'); ?></button>
     
    174174            <script type="text/javascript">
    175175                (function ($) {
     176                    var wbtegiftcardsNonce = '<?php echo esc_js( wp_create_nonce( 'wbtegiftcards_uninstall_nonce' ) ); ?>';
    176177                    $(function () {
    177178                        var modal = $('#wbtegiftcards-wbtegiftcards-modal');
     
    202203
    203204                            if ('reviewhtml' === inputType) {
    204                                 var reasonInputHtml = '<div class="reviewlink reason-block"><a href="#" target="_blank" class="review-and-deactivate"><?php _e('Deactivate and leave a review', 'wt-gift-cards-woocommerce'); ?> <span class="wt-wbtegiftcards-rating-link"> &#9733;&#9733;&#9733;&#9733;&#9733; </span></a></div>';
     205                                var reasonInputHtml = '<div class="reviewlink reason-block"><a href="#" target="_blank" class="review-and-deactivate"><?php esc_html_e('Deactivate and leave a review', 'wt-gift-cards-woocommerce'); ?> <span class="wt-wbtegiftcards-rating-link"> &#9733;&#9733;&#9733;&#9733;&#9733; </span></a></div>';
    205206                            } else if ('supportlink' === inputType) {
    206                                 var reasonInputHtml = '<div class="support_link reason-block"> <a href="https://www.webtoffee.com/contact" target="_blank" class="reach-via-support"><?php _e('Let our support team help you', 'wt-gift-cards-woocommerce'); ?> </a>' + '</div>';
     207                                var reasonInputHtml = '<div class="support_link reason-block"> <a href="https://www.webtoffee.com/contact" target="_blank" class="reach-via-support"><?php esc_html_e('Let our support team help you', 'wt-gift-cards-woocommerce'); ?> </a>' + '</div>';
    207208                            } else {
    208209                                var reasonInputHtml = '<div class="reason-input reason-block">' + (('text' === inputType) ? '<input type="text" class="input-text" size="40" />' : '<textarea rows="5" cols="45"></textarea>') + '</div>';
     
    233234                                    action: 'wbtegiftcards_submit_uninstall_reason',
    234235                                    reason_id: $reason_id,
    235                                     reason_info: $reason_info
     236                                    reason_info: $reason_info,
     237                                    nonce: wbtegiftcardsNonce
    236238                                },
    237239                                beforeSend: function () {
     
    258260            }
    259261
     262            // Verify nonce
     263            if ( ! isset( $_POST['nonce'] ) ) {
     264                wp_send_json_error( array( 'message' => 'Bad request' ), 400 );
     265            }
     266            $nonce = sanitize_text_field( wp_unslash( $_POST['nonce'] ) );
     267            if ( ! wp_verify_nonce( $nonce, 'wbtegiftcards_uninstall_nonce' ) ) {
     268                wp_send_json_error( array( 'message' => 'Invalid nonce' ), 403 );
     269            }
     270
    260271            $data = array(
    261                 'reason_id' => sanitize_text_field($_POST['reason_id']),
     272                'reason_id' => sanitize_text_field(wp_unslash($_POST['reason_id'])),
    262273                'plugin' => "wbtegiftcards",
    263274                'auth' => 'wbtegiftcards_uninstall_1234#',
     
    265276                'url' => '',
    266277                'user_email' => '',
    267                 'reason_info' => isset($_REQUEST['reason_info']) ? trim(stripslashes($_REQUEST['reason_info'])) : '',
    268                 'software' => $_SERVER['SERVER_SOFTWARE'],
     278                'reason_info' => isset($_REQUEST['reason_info']) ? sanitize_textarea_field( wp_unslash( $_REQUEST['reason_info'] ) ) : '',
     279                'software' => isset($_SERVER['SERVER_SOFTWARE']) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
    269280                'php_version' => phpversion(),
    270281                'mysql_version' => $wpdb->db_version(),
  • wt-gift-cards-woocommerce/trunk/includes/class-wbte-woocommerce-gift-cards-free.php

    r3348454 r3365744  
    7979            $this->version = WBTE_GC_FREE_VERSION;
    8080        } else {
    81             $this->version = '1.2.4';
     81            $this->version = '1.2.5';
    8282        }
    8383        $this->plugin_name = WBTE_GC_FREE_PLUGIN_NAME;
  • wt-gift-cards-woocommerce/trunk/public/modules/gift_card/classes/class-wbte-gc-gift-card-free-purchase-process-cart.php

    r3251245 r3365744  
    335335        $credit_value = floatval( $legacy_values['wt_credit_amount'] );
    336336        $settings     = self::get_product_metas( $product_id ); // gift card product settings
    337 
    338         $email_id = isset( $legacy_values['wt_store_credit_template']['wt_credit_coupon_send_to'] ) ? sanitize_email( $legacy_values['wt_store_credit_template']['wt_credit_coupon_send_to'] ) : sanitize_email( wp_unslash( $_REQUEST['billing_email'] ) );
     337        $billing_email = isset($_REQUEST['billing_email']) ? sanitize_email( wp_unslash( $_REQUEST['billing_email'] ) ) : '';
     338
     339        $email_id = isset( $legacy_values['wt_store_credit_template']['wt_credit_coupon_send_to'] ) ? sanitize_email( $legacy_values['wt_store_credit_template']['wt_credit_coupon_send_to'] ) : $billing_email;
    339340        $message  = isset( $legacy_values['wt_store_credit_template']['wt_credit_coupon_send_to_message'] ) ? sanitize_textarea_field( $legacy_values['wt_store_credit_template']['wt_credit_coupon_send_to_message'] ) : '';
    340341
     
    418419                        $last_status = end($status_list);
    419420                        $order_status_for_gift_card_email = $formatted_status ? $formatted_status . ' or ' . $last_status : $last_status;
    420                         $order->add_order_note(sprintf(__('Gift card <strong>%s</strong> generated. Awaiting %s order status for activation.','wt-gift-cards-woocommerce'), $coupon_code,$order_status_for_gift_card_email));
     421                        /* translators: 1: Gift card code, 2: Order status */
     422                        $order->add_order_note(sprintf(__('Gift card <strong>%1$s</strong> generated. Awaiting %2$s order status for activation.','wt-gift-cards-woocommerce'), $coupon_code,$order_status_for_gift_card_email));
    421423                    }else{
    422                         $order->add_order_note(__('Gift card generated. Not activated.'), 'wt-gift-cards-woocommerce');
     424                        $order->add_order_note(__('Gift card generated. Not activated.', 'wt-gift-cards-woocommerce'));
    423425                    }   
    424426                }
  • wt-gift-cards-woocommerce/trunk/public/modules/gift_card/classes/class-wbte-gc-gift-card-free-purchase-setup-product-page.php

    r3348454 r3365744  
    732732                    // Show a warning message for admins
    733733                    if ( current_user_can( 'manage_options' ) ) {               
    734                         _e( 'Please update your template', 'wt-gift-cards-woocommerce' );         
     734                        esc_html_e( 'Please update your template', 'wt-gift-cards-woocommerce' );         
    735735                    }         
    736736                }, 9999 );
  • wt-gift-cards-woocommerce/trunk/public/modules/gift_card/gift_card.php

    r3154517 r3365744  
    3434        include_once $this->module_path . 'classes/class-wbte-gc-gift-card-free-purchase.php';
    3535        Wbte_Gc_Gift_Card_Free_Purchase::get_instance();
    36 
    37         /**
    38          *  Store credit coupon section in my account
    39          */
    40         add_action( 'wt_gc_myaccount_store_credit_page_content', array( $this, 'myaccount_store_credit_page_content' ), 10 );
    4136    }
    4237
     
    6358        $this->module_path      = plugin_dir_path( __FILE__ );
    6459        $this->module_url       = plugin_dir_url( __FILE__ );
    65     }
    66 
    67     /**
    68      *  Show store credit coupons in my account page
    69      *  This method works only when Webtoffee Smart coupon plugin is activated
    70      *  By default this method will only show the coupons created via Smart coupon plugin.
    71      *  Use filter `wt_gc_exclude_coupons_created_via_gift_cards_plugin` to show all coupons.
    72      *
    73      *  @since 1.0.0
    74      */
    75     public function myaccount_store_credit_page_content() {
    76         include_once ABSPATH . 'wp-admin/includes/plugin.php';
    77 
    78         if ( Wbte_Woocommerce_Gift_Cards_Free::is_smart_coupon_active() ) {
    79             if ( ! class_exists( 'Wt_Smart_Coupon_Public' )
    80                 || ! method_exists( 'Wt_Smart_Coupon_Public', 'get_coupon_meta_data' )
    81                 || ! method_exists( 'Wt_Smart_Coupon_Public', 'get_coupon_html' )
    82             ) {
    83                 return;
    84             }
    85 
    86             $user  = wp_get_current_user();
    87             $email = $user->user_email;
    88 
    89             $args = array(
    90                 'post_type' => 'shop_coupon',
    91             );
    92 
    93             $meta_query = array(
    94                 array(
    95                     'key'     => 'customer_email',
    96                     'value'   => $email,
    97                     'compare' => 'LIKE',
    98                 ),
    99                 array(
    100                     'key'     => 'discount_type',
    101                     'value'   => Wbte_Woocommerce_Gift_Cards_Free_Common::$store_credit_coupon_type_name,
    102                     'compare' => 'LIKE',
    103                 ),
    104                 array(
    105                     'key'     => '_wt_smart_coupon_credit_activated',
    106                     'value'   => true,
    107                     'compare' => 'EXISTS',
    108                 ),
    109                 array(
    110                     'key'     => 'coupon_amount',
    111                     'value'   => 0,
    112                     'compare' => '>',
    113                 ),
    114             );
    115 
    116             /* exclude store credits coupons created via Gift card plugin */
    117             if ( apply_filters( 'wt_gc_exclude_coupons_created_via_gift_cards_plugin', true ) ) {
    118                 $meta_query[] = array(
    119                     'key'     => '_wt_gc_auto_generated_store_credit_coupon',
    120                     'value'   => 'completely', // a dummy value to fix WP bug #23268 [https://core.trac.wordpress.org/ticket/23268]
    121                     'compare' => 'NOT EXISTS',
    122                 );
    123 
    124                 $meta_query[] = array(
    125                     'key'     => '_wt_gc_store_credit_coupon',
    126                     'value'   => 'completely', // a dummy value to fix WP bug #23268 [https://core.trac.wordpress.org/ticket/23268]
    127                     'compare' => 'NOT EXISTS',
    128                 );
    129             }
    130 
    131             $args['meta_query'] = $meta_query;
    132 
    133             $the_query = new WP_Query( $args );
    134 
    135             if ( $the_query->have_posts() ) {
    136                 include 'views/-myaccount-store-credit-coupons.php';
    137             }
    138         }
    13960    }
    14061
  • wt-gift-cards-woocommerce/trunk/wt-gift-cards-woocommerce.php

    r3348454 r3365744  
    99 * Plugin URI:        https://wordpress.org/plugins/wt-gift-cards-woocommerce/
    1010 * Description:       Create and manage beautiful gift cards for your WooCommerce store.
    11  * Version:           1.2.4
     11 * Version:           1.2.5
    1212 * Author:            WebToffee
    1313 * Author URI:        https://www.webtoffee.com/
     
    3535 * Start at version 1.0.0 and use SemVer - https://semver.org
    3636 */
    37 define( 'WBTE_GC_FREE_VERSION', '1.2.4' );
     37define( 'WBTE_GC_FREE_VERSION', '1.2.5' );
    3838
    3939define( 'WBTE_GC_FREE_FILE_NAME', __FILE__ );
     
    7676    require_once ABSPATH . 'wp-admin/includes/plugin.php';
    7777    deactivate_plugins( WBTE_GC_FREE_BASE_NAME );
    78     wp_die( __( 'Oops! Woocommerce not activated, It should required for `Gift cards for woocommerce`.', 'wt-gift-cards-woocommerce' ), '', array( 'back_link' => 1 ) );
     78    wp_die( esc_html__( 'Oops! Woocommerce not activated, It should required for `Gift cards for woocommerce`.', 'wt-gift-cards-woocommerce' ), '', array( 'back_link' => 1 ) );
    7979}
    8080
Note: See TracChangeset for help on using the changeset viewer.