Plugin Directory

Changeset 2924703


Ignore:
Timestamp:
06/12/2023 09:59:15 AM (3 years ago)
Author:
thanhtd
Message:

Update

Location:
woo-notification/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • woo-notification/trunk/CHANGELOG.txt

    r2783680 r2924703  
     1/**1.2.11 - 2023.06.12**/
     2-Updated: Change image size slug
     3
    14/**1.2.10 - 2022.09.13**/
    25-Updated: Translate for Vietnamese
  • woo-notification/trunk/admin/settings.php

    r2729040 r2924703  
    218218        foreach ( $data as $key => $value ) {
    219219            if ( in_array( $key, $args ) ) {
    220                 $data[ $key ] = wp_kses_post($this->stripslashes_deep( $value ));
     220                $data[ $key ] = wp_kses_post( $this->stripslashes_deep( $value ) );
    221221            } else {
    222222                $data[ $key ] = wc_clean( $value );
     
    887887
    888888                            <td>
    889                                 <?php global $_wp_additional_image_sizes; ?>
     889                                <?php
     890                                $additional_image_sizes = wp_get_additional_image_sizes();
     891                                $default_image_sizes    = array( 'thumbnail', 'medium', 'medium_large', 'large' );
     892                                $image_sizes            = array();
     893
     894                                foreach ( $default_image_sizes as $size ) {
     895                                    $image_sizes[ $size ] = array(
     896                                        'width'  => (int) get_option( $size . '_size_w' ),
     897                                        'height' => (int) get_option( $size . '_size_h' ),
     898                                        'crop'   => (bool) get_option( $size . '_crop' ),
     899                                    );
     900                                }
     901
     902                                if ( $additional_image_sizes ) {
     903                                    $image_sizes = array_merge( $image_sizes, $additional_image_sizes );
     904                                }
     905
     906                                $image_sizes['full'] = array();
     907                                ?>
    890908                                <select name="<?php echo esc_attr( self::set_field( 'product_sizes' ) ) ?>"
    891909                                        class="vi-ui fluid dropdown">
    892                                     <option <?php selected( self::get_field( 'product_sizes' ), 'shop_thumbnail' ) ?>
    893                                             value="shop_thumbnail"><?php esc_attr_e( 'shop_thumbnail', 'woo-notification' ) ?>
    894                                         - <?php echo isset( $_wp_additional_image_sizes['shop_thumbnail'] ) ? $_wp_additional_image_sizes['shop_thumbnail']['width'] . 'x' . $_wp_additional_image_sizes['shop_thumbnail']['height'] : ''; ?></option>
    895                                     <option <?php selected( self::get_field( 'product_sizes' ), 'shop_catalog' ) ?>
    896                                             value="shop_catalog"><?php esc_attr_e( 'shop_catalog', 'woo-notification' ) ?>
    897                                         - <?php echo isset( $_wp_additional_image_sizes['shop_catalog'] ) ? $_wp_additional_image_sizes['shop_catalog']['width'] . 'x' . $_wp_additional_image_sizes['shop_catalog']['height'] : ''; ?></option>
    898                                     <option <?php selected( self::get_field( 'product_sizes' ), 'shop_single' ) ?>
    899                                             value="shop_single"><?php esc_attr_e( 'shop_single', 'woo-notification' ) ?>
    900                                         - <?php echo isset( $_wp_additional_image_sizes['shop_single'] ) ? $_wp_additional_image_sizes['shop_single']['width'] . 'x' . $_wp_additional_image_sizes['shop_single']['height'] : ''; ?></option>
     910                                    <?php
     911                                    $selected_product_sizes = self::get_field( 'product_sizes' );
     912                                    $mapping                = [
     913                                        'shop_thumbnail' => 'woocommerce_thumbnail',
     914                                        'shop_catalog'   => 'woocommerce_gallery_thumbnail',
     915                                        'shop_single'    => 'woocommerce_single',
     916                                    ];
     917                                    if ( isset( $mapping[ $selected_product_sizes ] ) ) {
     918                                        $selected_product_sizes = $mapping[ $selected_product_sizes ];
     919                                    }
     920
     921                                    foreach ( $image_sizes as $slug => $info ) {
     922                                        $display_size = ! empty( $info['width'] ) ? " - {$info['width']}" : '';
     923                                        $display_size .= ! empty( $info['height'] ) ? "x{$info['height']}" : '';
     924
     925                                        printf( "<option value='%s' %s>%s</option>", esc_attr( $slug ), selected( $selected_product_sizes, $slug, false ), esc_html( $slug . $display_size ) );
     926                                    }
     927                                    ?>
    901928                                </select>
    902929
     
    14461473                            <td>
    14471474                                <textarea class=""
    1448                                           name="<?php echo esc_attr( self::set_field( 'custom_css' ) ) ?>"><?php echo wp_kses_post(self::get_field( 'custom_css' )) ?></textarea>
     1475                                          name="<?php echo esc_attr( self::set_field( 'custom_css' ) ) ?>"><?php echo wp_kses_post( self::get_field( 'custom_css' ) ) ?></textarea>
    14491476                            </td>
    14501477                        </tr>
     
    16271654
    16281655                                                    <textarea
    1629                                                             name="<?php echo esc_attr( self::set_field( 'message_purchased', 1 ) ) ?>"><?php echo strip_tags( wp_kses_post($message) ) ?></textarea>
     1656                                                            name="<?php echo esc_attr( self::set_field( 'message_purchased', 1 ) ) ?>"><?php echo strip_tags( wp_kses_post( $message ) ) ?></textarea>
    16301657
    16311658                                                    <?php
  • woo-notification/trunk/includes/data.php

    r2579043 r2924703  
    6262            'product_sizes'               => 'shop_thumbnail',
    6363            'non_ajax'                    => 0,
    64             'enable_single_product'          => 0,
     64            'enable_single_product'       => 0,
    6565            'enable_out_of_stock_product' => 0,
    6666            'product_link'                => 0,
    67             'rounded_corner'                 => 0,
    68             'loop_session'                   => 0,
    69             'loop_session_duration'          => 1,
    70             'loop_session_duration_unit'     => 'h',
    71             'loop_session_total'             => '60',
    72             'image_padding'                  => '0',
    73             'close_icon_color'                  => '#000000',
     67            'rounded_corner'              => 0,
     68            'loop_session'                => 0,
     69            'loop_session_duration'       => 1,
     70            'loop_session_duration_unit'  => 'h',
     71            'loop_session_total'          => '60',
     72            'image_padding'               => '0',
     73            'close_icon_color'            => '#000000',
    7474        );
    7575        $this->params = apply_filters( 'woonotification_settings_args', wp_parse_args( $this->params, $args ) );
    76         //      print_r($this->params);die;
    77     }
     76    }
     77
    7878    /**
    7979     * @return mixed|void
     
    8282        return apply_filters( 'woonotification_get_close_icon_color', $this->params['close_icon_color'] );
    8383    }
     84
    8485    /**
    8586     * @return mixed|void
     
    123124        return apply_filters( 'woonotification_get_rounded_corner', $this->params['rounded_corner'] );
    124125    }
     126
    125127    /**
    126128     * Get time close cookie
     
    473475     */
    474476    public function get_product_sizes() {
    475         return apply_filters( 'woonotification_get_product_sizes', $this->params['product_sizes'] );
     477        $selected_product_sizes = $this->params['product_sizes'];
     478
     479        $mapping = [
     480            'shop_thumbnail' => 'woocommerce_thumbnail',
     481            'shop_catalog'   => 'woocommerce_gallery_thumbnail',
     482            'shop_single'    => 'woocommerce_single',
     483        ];
     484
     485        return apply_filters( 'woonotification_get_product_sizes', $mapping[ $selected_product_sizes ] ?? $selected_product_sizes );
    476486    }
    477487
     
    483493        return apply_filters( 'woonotification_non_ajax', $this->params['non_ajax'] );
    484494    }
     495
    485496    /**
    486497     * Enable notification in single product page
     
    490501        return apply_filters( 'woonotification_enable_single_product', $this->params['enable_single_product'] );
    491502    }
     503
    492504    /**
    493505     * Get notification type show in single product
     
    503515     */
    504516    public function show_variation() {
    505         return apply_filters( 'woonotification_show_variation', isset($this->params['show_variation'])?$this->params['show_variation']:''  );
    506     }
     517        return apply_filters( 'woonotification_show_variation', isset( $this->params['show_variation'] ) ? $this->params['show_variation'] : '' );
     518    }
     519
    507520    public function enable_out_of_stock_product() {
    508521        return apply_filters( 'woonotification_enable_out_of_stock_product', $this->params['enable_out_of_stock_product'] );
  • woo-notification/trunk/includes/support.php

    r2783680 r2924703  
    88    /**
    99     * Class VillaTheme_Support
    10      * 1.1.7
     10     * 1.1.8
    1111     */
    1212    class VillaTheme_Support {
    1313        protected $plugin_base_name;
    1414        protected $ads_data;
    15         protected $version = '1.1.7';
     15        protected $version = '1.1.8';
     16        protected $data = [];
    1617
    1718        public function __construct( $data ) {
  • woo-notification/trunk/readme.txt

    r2869089 r2924703  
    44Tags: woocommerce, notify, marketing, boost sales ,recent sales popup,live sales,recent sales notification, villatheme, woocommerce notification, up sell
    55Requires at least: 5.0
    6 Tested up to: 6.0.0
    7 WC tested up to: 6.5.0
     6Tested up to: 6.2.0
     7WC tested up to: 7.7.0
    88Stable tag: 1.2.9
    99License: GPLv2 or later
     
    2422425. Front end
    243243== Changelog ==
     244
     245/**1.2.11 - 2023.06.12**/
     246-Updated: Change image size slug
    244247
    245248/**1.2.10 - 2022.09.13**/
  • woo-notification/trunk/woo-notification.php

    r2869089 r2924703  
    44 * Plugin URI: https://villatheme.com/extensions/woocommerce-notification-boost-sales/
    55 * Description: Increase conversion rate by highlighting other customers that have bought products.
    6  * Version: 1.2.10
     6 * Version: 1.2.11
    77 * Author: Andy Ha (villatheme.com)
    88 * Author URI: http://villatheme.com
     
    1010 * Copyright 2016-2023 VillaTheme.com. All rights reserved.
    1111 * Requires at least: 5.0
    12  * Tested up to: 6.1
     12 * Tested up to: 6.2
    1313 * WC requires at least: 5.0
    14  * WC tested up to: 7.3
     14 * WC tested up to: 7.7
    1515 */
    1616if ( ! defined( 'ABSPATH' ) ) {
    1717    exit;
    1818}
    19 define( 'VI_WNOTIFICATION_F_VERSION', '1.2.10' );
     19define( 'VI_WNOTIFICATION_F_VERSION', '1.2.11' );
    2020/**
    2121 * Detect plugin. For use on Front End only.
Note: See TracChangeset for help on using the changeset viewer.