Plugin Directory

Changeset 3472287


Ignore:
Timestamp:
03/02/2026 12:13:24 AM (4 weeks ago)
Author:
ivole
Message:

5.102.0

Location:
customer-reviews-woocommerce
Files:
872 added
7 edited

Legend:

Unmodified
Added
Removed
  • customer-reviews-woocommerce/trunk/class-ivole.php

    r3464600 r3472287  
    8686
    8787class Ivole {
    88     const CR_VERSION = '5.101.0';
     88    const CR_VERSION = '5.102.0';
    8989
    9090    public function __construct() {
  • customer-reviews-woocommerce/trunk/includes/blocks/class-cr-all-reviews.php

    r3464600 r3472287  
    1111        private $shortcode_atts;
    1212        private $shop_page_id;
    13         private $crsearch = 'crsearch';
    1413        private $search = '';
    1514        private $tags = array();
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-ajax-reviews.php

    r3389261 r3472287  
    750750            $search_val = '';
    751751            $clear_class = 'cr-clear-input';
    752             if( get_query_var( 'crsearch' ) ) {
     752            if ( get_query_var( 'crsearch' ) ) {
    753753                $search_val = strval( get_query_var( 'crsearch' ) );
    754                 if( 0 < mb_strlen( $search_val ) ) {
     754                if ( 0 < strlen( $search_val ) ) {
    755755                    $clear_class = 'cr-clear-input cr-visible';
    756756                }
     
    767767                            <path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zM13 6.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0z"/>
    768768                        </svg>
    769                         <input name="cr_input_text_search" class="cr-input-text" type="text" placeholder="'. esc_attr__( 'Search customer reviews', 'customer-reviews-woocommerce' ) .'" value="' . $search_val . '" aria-label="' . esc_attr__( 'Search customer reviews', 'customer-reviews-woocommerce' ) . '">
     769                        <input name="cr_input_text_search" class="cr-input-text" type="text" placeholder="'. esc_attr__( 'Search customer reviews', 'customer-reviews-woocommerce' ) .'" value="' . esc_attr( $search_val ) . '" aria-label="' . esc_attr__( 'Search customer reviews', 'customer-reviews-woocommerce' ) . '">
    770770                        <span class="' . $clear_class . '">
    771771                            <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-x-circle-fill" fill="#868686" xmlns="http://www.w3.org/2000/svg">
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-reviews.php

    r3464600 r3472287  
    17311731                    $ec->maybe_send_coupon(
    17321732                        $comment_id, // id of the review
    1733                         0, // count of media files uploaded with the review
     1733                        $this->count_media_meta( $comment_id ), // count of media files uploaded with the review
    17341734                        'onsite', // scenario when a review is submitted via an on-site review form
    17351735                        $customer_email, // email of the reviewer
     
    19011901        }
    19021902    }
     1903
     1904    private function count_media_meta( $comment_id ) {
     1905        global $wpdb;
     1906
     1907        $comment_id = absint( $comment_id );
     1908
     1909        if ( ! $comment_id ) {
     1910            return 0;
     1911        }
     1912
     1913        $meta_keys = array(
     1914            self::REVIEWS_META_IMG,
     1915            self::REVIEWS_META_LCL_IMG,
     1916            self::REVIEWS_META_VID,
     1917            self::REVIEWS_META_LCL_VID
     1918        );
     1919
     1920        // Prepare placeholders for IN clause.
     1921        $placeholders = implode( ',', array_fill( 0, count( $meta_keys ), '%s' ) );
     1922
     1923        $query = $wpdb->prepare(
     1924            "
     1925            SELECT COUNT(*)
     1926            FROM {$wpdb->commentmeta}
     1927            WHERE comment_id = %d
     1928            AND meta_key IN ($placeholders)
     1929            ",
     1930            array_merge( array( $comment_id ), $meta_keys )
     1931        );
     1932
     1933        return (int) $wpdb->get_var( $query );
     1934    }
    19031935}
    19041936
  • customer-reviews-woocommerce/trunk/includes/settings/class-cr-settings-discount-tiers.php

    r3396824 r3472287  
    652652                $coupon['channel'] = $coupon_settings[$setting_index]['channel'];
    653653                $s = self::read_coupon_tiers_table();
    654                 if( $s and is_array( $s ) ) {
     654                if ( $s and is_array( $s ) ) {
    655655                    $tier_w_coupon = 0;
    656656                    $compare_count = -1;
    657657                    foreach( self::$tiers as $tier ) {
    658                         if( in_array( $s[self::$tiers_settings['cr_coupon_type']][$tier], array( 'dynamic', 'static' ) ) &&
     658                        if (
     659                            in_array( $s[self::$tiers_settings['cr_coupon_type']][$tier], array( 'dynamic', 'static' ) ) &&
    659660                            $media_count >= $s[self::$tiers_settings['cr_media_count']][$tier] &&
    660                             $compare_count < $s[self::$tiers_settings['cr_media_count']][$tier] ) {
    661                                 $compare_count = $s[self::$tiers_settings['cr_media_count']][$tier];
    662                                 $tier_w_coupon = $tier;
     661                            $compare_count < $s[self::$tiers_settings['cr_media_count']][$tier]
     662                        ) {
     663                            $compare_count = $s[self::$tiers_settings['cr_media_count']][$tier];
     664                            $tier_w_coupon = $tier;
    663665                        }
    664666                    }
  • customer-reviews-woocommerce/trunk/ivole.php

    r3464600 r3472287  
    44Description: Customer Reviews for WooCommerce plugin helps you get more customer reviews for your shop by sending automated reminders and coupons.
    55Plugin URI: https://wordpress.org/plugins/customer-reviews-woocommerce/
    6 Version: 5.101.0
     6Version: 5.102.0
    77Author: CusRev
    88Author URI: https://www.cusrev.com/business/
  • customer-reviews-woocommerce/trunk/readme.txt

    r3464600 r3472287  
    55Tested up to: 6.9
    66Requires PHP: 7.2
    7 Stable tag: 5.101.0
     7Stable tag: 5.102.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl.html
     
    235235== Changelog ==
    236236
     237= 5.102.0 =
     238* Bug fix: discount tiers didn't take into account the number of uploaded files for onsite reviews
     239* Bug fix: vulnerability in the search function for [cusrev_all_reviews] shortcode
    237240= 5.101.0 =
    238241* Bug fix: a link to an incorrect form template could be copied from WooCommerce Orders page for some languages
Note: See TracChangeset for help on using the changeset viewer.