Plugin Directory

Changeset 3778831


Ignore:
Timestamp:
11/02/2026 02:03:48 AM (3 days ago)
Author:
ivole
Message:

5.127.0

Location:
customer-reviews-woocommerce
Files:
889 added
12 edited

Legend:

Unmodified
Added
Removed
  • customer-reviews-woocommerce/trunk/blocks/build/reviews-grid/block.json

    r3681630 r3778831  
    122122    "color_stars": {
    123123      "type": "string",
    124       "default": "#FFD707"
     124      "default": "#FFBC00"
    125125    }
    126126  },
  • customer-reviews-woocommerce/trunk/blocks/src/reviews-grid/block.json

    r3413656 r3778831  
    110110                "color_stars": {
    111111                        "type": "string",
    112                         "default": "#FFD707"
     112                        "default": "#FFBC00"
    113113                }
    114114        },
  • customer-reviews-woocommerce/trunk/class-ivole.php

    r3765311 r3778831  
    8989
    9090class Ivole {
    91         const CR_VERSION = '5.126.0';
     91        const CR_VERSION = '5.127.0';
    9292
    9393        public function __construct() {
  • customer-reviews-woocommerce/trunk/includes/analytics/class-cr-reminders-log.php

    r3500253 r3778831  
    140140                                        $status = 'error';
    141141                                        $reminder['errorDetails'] = $result[1];
     142                                        CR_Error_Log::record(
     143                                                'reminder_sending',
     144                                                sprintf(
     145                                                        /* translators: %1$s: order ID, %2$s: error description. */
     146                                                        __( 'A review reminder for order %1$s could not be sent. %2$s', 'customer-reviews-woocommerce' ),
     147                                                        $order_id,
     148                                                        $result[1]
     149                                                ),
     150                                                array(
     151                                                        'label' => __( 'View reminders', 'customer-reviews-woocommerce' ),
     152                                                        'url' => add_query_arg(
     153                                                                array( 'tab' => 'sent', 'status' => 'rmd_error' ),
     154                                                                admin_url( 'admin.php?page=cr-reviews-reminders' )
     155                                                        )
     156                                                )
     157                                        );
    142158                                }
    143159                        }
  • customer-reviews-woocommerce/trunk/includes/blocks/class-cr-reviews-grid.php

    r3765311 r3778831  
    1616                private $min_chars;
    1717                private $attributes;
     18
     19                private const COLOR_DEFAULTS = array(
     20                        'color_ex_brdr' => '#ebebeb',
     21                        'color_brdr' => '#ebebeb',
     22                        'color_ex_bcrd' => '',
     23                        'color_bcrd' => '#ffffff',
     24                        'color_pr_bcrd' => '#f4f4f4',
     25                        'color_stars' => '#FFBC00',
     26                );
    1827
    1928                /**
    … …  
    6271
    6372                public function render_reviews_grid( $attributes ) {
     73                        $attributes = CR_Reviews::sanitize_review_display_attributes( $attributes, self::COLOR_DEFAULTS );
    6474                        wp_enqueue_script( 'cr-colcade' );
    6575                        $this->attributes = $attributes;
    … …  
    490500                public function render_reviews_grid_shortcode( $attributes ) {
    491501                        // Convert shortcode attributes to block attributes
    492                         $attributes = shortcode_atts( array(
     502                        $defaults = array(
    493503                                'count' => 3,
    494504                                'show_products' => true,
    … …  
    498508                                'categories' => array(),
    499509                                'products' => 'current',
    500                                 'color_ex_brdr' => '#ebebeb',
    501                                 'color_brdr' => '#ebebeb',
    502                                 'color_ex_bcrd' => '',
    503                                 'color_bcrd' => '#ffffff',
    504                                 'color_pr_bcrd' => '#f4f4f4',
    505                                 'color_stars' => '#FFBC00',
    506510                                'shop_reviews' => 'false',
    507511                                'count_shop_reviews' => 1,
    … …  
    518522                                'schema_markup' => 'false',
    519523                                'comment__not_in' => []
    520                         ), $attributes, 'cusrev_reviews_grid' );
     524                        );
     525                        $defaults = array_merge( $defaults, self::COLOR_DEFAULTS );
     526                        $attributes = shortcode_atts( $defaults, $attributes, 'cusrev_reviews_grid' );
     527                        $attributes = CR_Reviews::sanitize_review_display_attributes( $attributes, $defaults );
    521528
    522529                        $attributes['count'] = absint( $attributes['count'] );
    … …  
    563570                        } else {
    564571                                $attributes['products'] = array_map( 'intval', $attributes['products'] );
    565                         }
    566 
    567                         if(
    568                                 ! empty( $attributes['product_tags'] ) &&
    569                                 ! is_array( $attributes['product_tags'] )
    570                         ) {
    571                                 $attributes['product_tags'] = array_filter( array_map( 'trim', explode( ',', $attributes['product_tags'] ) ) );
    572                         }
    573 
    574                         if(
    575                                 ! empty( $attributes['tags'] ) &&
    576                                 ! is_array( $attributes['tags'] )
    577                         ) {
    578                                 $attributes['tags'] = array_filter( array_map( 'trim', explode( ',', $attributes['tags'] ) ) );
    579572                        }
    580573
    … …  
    878871                                                break;
    879872                                        case 'product_tags':
    880                                                 $new_val = array();
    881                                                 if ( is_array( $val ) && count( $val ) ) {
    882                                                         foreach( $val as $item ) {
    883                                                                 $new_val[] = strval( $item );
    884                                                         }
    885                                                         $val = $new_val;
    886                                                 }
     873                                        case 'tags':
     874                                                $val = CR_Reviews::sanitize_review_tags( wp_unslash( $val ) );
    887875                                                break;
    888                                         case 'tags':
    889                                                 $new_val = array();
    890                                                 if ( is_array( $val ) && count( $val ) ) {
    891                                                         foreach( $val as $item ) {
    892                                                                 $new_val[] = strval( $item );
    893                                                         }
    894                                                         $val = $new_val;
    895                                                 }
     876                                        case 'color_ex_brdr':
     877                                        case 'color_brdr':
     878                                        case 'color_ex_bcrd':
     879                                        case 'color_bcrd':
     880                                        case 'color_pr_bcrd':
     881                                        case 'color_stars':
     882                                                $val = wp_unslash( $val );
    896883                                                break;
    897884                                        default:
  • customer-reviews-woocommerce/trunk/includes/blocks/class-cr-reviews-slider.php

    r3765311 r3778831  
    4747
    4848                public function render_reviews_slider( $attributes ) {
     49                        $attributes = CR_Reviews::sanitize_review_display_attributes( $attributes, array(
     50                                'color_ex_brdr' => '#ebebeb',
     51                                'color_brdr' => '#ebebeb',
     52                                'color_ex_bcrd' => '',
     53                                'color_bcrd' => '#ffffff',
     54                                'color_pr_bcrd' => '#f4f4f4',
     55                                'color_stars' => '#FFD707',
     56                        ) );
    4957                        wp_enqueue_script( 'cr-reviews-slider' );
    5058                        $max_reviews = $attributes['count'];
    … …  
    395403                public function render_reviews_slider_shortcode( $attributes ) {
    396404                        // Convert shortcode attributes
    397                         $attributes = shortcode_atts( array(
     405                        $defaults = array(
    398406                                'slides_to_show' => 3,
    399407                                'count' => 5,
    … …  
    421429                                'show_dots' => true,
    422430                                'custom_ratings' => 'true',
    423                         ), $attributes, 'cusrev_reviews_slider' );
    424 
    425                         $attributes['slides_to_shows'] = absint( $attributes['slides_to_show'] ) >= absint( $attributes['count'] ) ? absint( $attributes['count'] ) : absint( $attributes['slides_to_show'] );
     431                        );
     432                        $attributes = shortcode_atts( $defaults, $attributes, 'cusrev_reviews_slider' );
     433                        $attributes = CR_Reviews::sanitize_review_display_attributes( $attributes, $defaults );
     434
     435                        $attributes['slides_to_show'] = absint( $attributes['slides_to_show'] ) >= absint( $attributes['count'] ) ? absint( $attributes['count'] ) : absint( $attributes['slides_to_show'] );
    426436                        $attributes['count'] = absint( $attributes['count'] );
    427437                        $attributes['show_products'] = ( $attributes['show_products'] !== 'false' && boolval( $attributes['count'] ) );
    … …  
    469479                        }
    470480
    471                         if( $attributes['slides_to_shows'] <= 0 ) {
    472                                 $attributes['slides_to_shows'] = 1;
    473                         }
    474 
    475                         if( ! empty( $attributes['product_tags'] ) ) {
    476                                 $attributes['product_tags'] = array_filter( array_map( 'trim', explode( ',', $attributes['product_tags'] ) ) );
    477                         }
    478 
    479                         if ( ! empty( $attributes['tags'] ) ) {
    480                                 $attributes['tags'] = array_filter( array_map( 'trim', explode( ',', $attributes['tags'] ) ) );
     481                        if( $attributes['slides_to_show'] <= 0 ) {
     482                                $attributes['slides_to_show'] = 1;
    481483                        }
    482484
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-reviews.php

    r3727896 r3778831  
    18141814        }
    18151815
     1816        public static function sanitize_review_display_attributes( $attributes, $defaults ) {
     1817                foreach ( $defaults as $key => $default ) {
     1818                        if ( 0 === strpos( $key, 'color_' ) ) {
     1819                                $attributes[$key] = self::sanitize_review_color( isset( $attributes[$key] ) ? $attributes[$key] : $default, $default );
     1820                        }
     1821                }
     1822                foreach ( array( 'tags', 'product_tags' ) as $key ) {
     1823                        $attributes[$key] = self::sanitize_review_tags( isset( $attributes[$key] ) ? $attributes[$key] : array() );
     1824                }
     1825                return $attributes;
     1826        }
     1827
     1828        public static function sanitize_review_tags( $tags ) {
     1829                if ( ! is_array( $tags ) ) {
     1830                        $tags = explode( ',', sanitize_text_field( $tags ) );
     1831                }
     1832                $result = array();
     1833                foreach ( $tags as $tag ) {
     1834                        $tag = sanitize_text_field( $tag );
     1835                        if ( '' !== $tag ) {
     1836                                $result[] = $tag;
     1837                        }
     1838                }
     1839                return $result;
     1840        }
     1841
     1842        public static function sanitize_review_color( $color, $default ) {
     1843                if ( ! is_string( $color ) ) {
     1844                        return $default;
     1845                }
     1846                $color = trim( $color );
     1847                if ( '' === $color ) {
     1848                        return $default;
     1849                }
     1850                if ( preg_match( '/\A#(?:[a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})\z/i', $color ) ) {
     1851                        return $color;
     1852                }
     1853                return $default;
     1854        }
     1855
    18161856        public static function get_star_rating_svg( $rating, $count, $color ) {
    18171857                $templateFile = plugin_dir_path( dirname( dirname( __FILE__ ) ) ) . '/templates/cr-rating-icon.php';
  • customer-reviews-woocommerce/trunk/ivole.php

    r3765311 r3778831  
    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.126.0
     6Version: 5.127.0
    77Author: CusRev
    88Author URI: https://www.cusrev.com/business/
  • customer-reviews-woocommerce/trunk/js/frontend.js

    r3765311 r3778831  
    591591                                $spinner.hide();
    592592                                $this.show();
    593                                 $this.parent().append('<div style="color:#cd2653;text-align:center;display:block;">'+response.responseText+'</div>');
     593                                $this.parent().append( jQuery( '<div style="color:#cd2653;text-align:center;display:block;"></div>' ).text( response.responseText ) );
    594594                        });
    595595                });
    … …  
    638638                        }).fail(function(response) {
    639639                                $spinner.hide();
    640                                 $this.parent().append('<div style="color: #cd2653;text-align: center;display: block;">'+response.responseText+'</div>');
     640                                $this.parent().append( jQuery( '<div style="color: #cd2653;text-align: center;display: block;"></div>' ).text( response.responseText ) );
    641641                        });
    642642
  • customer-reviews-woocommerce/trunk/languages/customer-reviews-woocommerce.pot

    r3765311 r3778831  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Customer Reviews for WooCommerce 5.126.0\n"
     5"Project-Id-Version: Customer Reviews for WooCommerce 5.127.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/customer-reviews-woocommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-10-25T22:08:57+00:00\n"
     12"POT-Creation-Date: 2026-11-02T01:54:41+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    6666msgstr ""
    6767
    68 #: includes/analytics/class-cr-reminders-log.php:383
     68#. translators: %1$s: order ID, %2$s: error description.
     69#: includes/analytics/class-cr-reminders-log.php:146
     70#, php-format
     71msgid "A review reminder for order %1$s could not be sent. %2$s"
     72msgstr ""
     73
     74#: includes/analytics/class-cr-reminders-log.php:151
     75msgid "View reminders"
     76msgstr ""
     77
     78#: includes/analytics/class-cr-reminders-log.php:399
    6979#: includes/reminders/class-cr-reminders-log-table.php:94
    7080#: templates/reminders-admin-page.php:23
    … …  
    7484msgstr ""
    7585
    76 #: includes/analytics/class-cr-reminders-log.php:386
     86#: includes/analytics/class-cr-reminders-log.php:402
    7787#: includes/misc/class-cr-admin-menu-diagnostics.php:364
    7888#: includes/reminders/class-cr-local-forms.php:298
    … …  
    8191msgstr ""
    8292
    83 #: includes/analytics/class-cr-reminders-log.php:389
     93#: includes/analytics/class-cr-reminders-log.php:405
    8494msgid "Reminder Opened"
    8595msgstr ""
    8696
    87 #: includes/analytics/class-cr-reminders-log.php:392
     97#: includes/analytics/class-cr-reminders-log.php:408
    8898msgid "Form Opened"
    8999msgstr ""
    90100
    91 #: includes/analytics/class-cr-reminders-log.php:395
     101#: includes/analytics/class-cr-reminders-log.php:411
    92102msgid "Canceled"
    93103msgstr ""
    94104
    95 #: includes/analytics/class-cr-reminders-log.php:407
     105#: includes/analytics/class-cr-reminders-log.php:423
    96106#: includes/google/class-cr-product-fields.php:90
    97107#: includes/google/class-cr-product-fields.php:259
    … …  
    111121msgstr ""
    112122
    113 #: includes/analytics/class-cr-reminders-log.php:410
     123#: includes/analytics/class-cr-reminders-log.php:426
    114124#: includes/google/class-cr-product-fields.php:91
    115125#: includes/google/class-cr-product-fields.php:260
    … …  
    129139msgstr ""
    130140
    131 #: includes/analytics/class-cr-reminders-log.php:422
     141#: includes/analytics/class-cr-reminders-log.php:438
    132142#: includes/reminders/class-cr-manual.php:399
    133143#: includes/settings/class-cr-settings-emails.php:113
    … …  
    141151msgstr ""
    142152
    143 #: includes/analytics/class-cr-reminders-log.php:425
     153#: includes/analytics/class-cr-reminders-log.php:441
    144154#: includes/reminders/class-cr-manual.php:403
    145155msgid "WhatsApp"
    146156msgstr ""
    147157
    148 #: includes/analytics/class-cr-reminders-log.php:437
     158#: includes/analytics/class-cr-reminders-log.php:453
    149159#: includes/analytics/class-cr-reviews-top-charts.php:261
    150160msgid "Manual"
    151161msgstr ""
    152162
    153 #: includes/analytics/class-cr-reminders-log.php:440
     163#: includes/analytics/class-cr-reminders-log.php:456
    154164#: includes/analytics/class-cr-reviews-top-charts.php:254
    155165#: includes/reminders/class-cr-reminders-list-table.php:69
    … …  
    251261
    252262#: includes/blocks/class-cr-all-reviews.php:963
    253 #: includes/blocks/class-cr-reviews-grid.php:994
     263#: includes/blocks/class-cr-reviews-grid.php:981
    254264#: includes/reviews/class-cr-reviews.php:525
    255265#, php-format
    … …  
    260270
    261271#: includes/blocks/class-cr-all-reviews.php:984
    262 #: includes/blocks/class-cr-reviews-grid.php:1016
     272#: includes/blocks/class-cr-reviews-grid.php:1003
    263273#: includes/reviews/class-cr-reviews.php:1772
    264274#: templates/cr-review-form.php:31
    … …  
    293303
    294304#: includes/blocks/class-cr-all-reviews.php:1187
    295 #: includes/blocks/class-cr-reviews-grid.php:1025
     305#: includes/blocks/class-cr-reviews-grid.php:1012
    296306#: includes/reviews/class-cr-reviews.php:550
    297307#, php-format
    … …  
    425435msgstr ""
    426436
    427 #: includes/blocks/class-cr-reviews-grid.php:398
    428 #: includes/blocks/class-cr-reviews-slider.php:295
     437#: includes/blocks/class-cr-reviews-grid.php:408
     438#: includes/blocks/class-cr-reviews-slider.php:303
    429439#: includes/reviews/class-cr-admin-menu-reviews.php:663
    430440#: includes/reviews/class-cr-reviews-list-table.php:1265
    … …  
    433443msgstr ""
    434444
    435 #: includes/blocks/class-cr-reviews-grid.php:402
    436 #: includes/blocks/class-cr-reviews-grid.php:404
    437 #: includes/blocks/class-cr-reviews-grid.php:409
    438 #: includes/blocks/class-cr-reviews-grid.php:411
    439 #: includes/blocks/class-cr-reviews-slider.php:299
    440 #: includes/blocks/class-cr-reviews-slider.php:301
    441 #: includes/blocks/class-cr-reviews-slider.php:306
    442 #: includes/blocks/class-cr-reviews-slider.php:308
     445#: includes/blocks/class-cr-reviews-grid.php:412
     446#: includes/blocks/class-cr-reviews-grid.php:414
     447#: includes/blocks/class-cr-reviews-grid.php:419
     448#: includes/blocks/class-cr-reviews-grid.php:421
     449#: includes/blocks/class-cr-reviews-slider.php:307
     450#: includes/blocks/class-cr-reviews-slider.php:309
     451#: includes/blocks/class-cr-reviews-slider.php:314
     452#: includes/blocks/class-cr-reviews-slider.php:316
    443453#: includes/reviews/class-cr-reviews-list-table.php:655
    444454#: includes/reviews/class-cr-reviews.php:1053
    … …  
    449459msgstr ""
    450460
    451 #: includes/blocks/class-cr-reviews-grid.php:405
    452 #: includes/blocks/class-cr-reviews-grid.php:412
    453 #: includes/blocks/class-cr-reviews-slider.php:302
    454 #: includes/blocks/class-cr-reviews-slider.php:309
     461#: includes/blocks/class-cr-reviews-grid.php:415
     462#: includes/blocks/class-cr-reviews-grid.php:422
     463#: includes/blocks/class-cr-reviews-slider.php:310
     464#: includes/blocks/class-cr-reviews-slider.php:317
    455465#: includes/reviews/class-cr-reviews.php:1064
    456466#: includes/reviews/class-cr-reviews.php:1133
    … …  
    458468msgstr ""
    459469
    460 #: includes/blocks/class-cr-reviews-grid.php:1024
     470#: includes/blocks/class-cr-reviews-grid.php:1011
    461471#: includes/reviews/class-cr-reviews.php:549
    462472#, php-format
    … …  
    470480msgstr ""
    471481
    472 #: includes/blocks/class-cr-reviews-slider.php:281
     482#: includes/blocks/class-cr-reviews-slider.php:289
    473483msgid "No reviews to show"
    474484msgstr ""
  • customer-reviews-woocommerce/trunk/readme.txt

    r3765311 r3778831  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 5.126.0
     7Stable tag: 5.127.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl.html
    … …  
    247247== Changelog ==
    248248
     249= 5.127.0 =
     250* Improvement: display review reminder sending errors on the Reviews page in WordPress admin console
     251* Security: normalize reviews slider shortcode slide counts and escape slider settings in HTML attributes
     252* Security: display reviews grid AJAX error responses as plain text instead of HTML
     253* Security: validate reviews grid and slider colors and normalize review and product tag filters
    249254= 5.126.0 =
    250255* New feature: sort reviews by the number of attached media files using sort_by="media" in the [cusrev_all_reviews] and [cusrev_reviews_slider] shortcodes
  • customer-reviews-woocommerce/trunk/templates/reviews-slider.php

    r3753772 r3778831  
    44}
    55?>
    6 <div class="cr-reviews-slider" id="<?php echo $id; ?>" data-slick='<?php echo wp_json_encode( $slider_settings ); ?>' style="<?php echo esc_attr( $section_style ); ?>">
     6<div class="cr-reviews-slider" id="<?php echo $id; ?>" data-slick="<?php echo esc_attr( wp_json_encode( $slider_settings ) ); ?>" style="<?php echo esc_attr( $section_style ); ?>">
    77        <?php foreach ( $reviews as $i => $review ):
    88                $rating = intval( get_comment_meta( $review->comment_ID, 'rating', true ) );
Note: See TracChangeset for help on using the changeset viewer.