Plugin Directory

Changeset 3392565


Ignore:
Timestamp:
11/10/2025 12:54:18 AM (5 months ago)
Author:
ivole
Message:

5.88.0

Location:
customer-reviews-woocommerce
Files:
876 added
23 edited

Legend:

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

    r3389261 r3392565  
    8585
    8686class Ivole {
    87     const CR_VERSION = '5.87.0';
     87    const CR_VERSION = '5.88.0';
    8888
    8989    public function __construct() {
  • customer-reviews-woocommerce/trunk/css/admin.css

    r3389261 r3392565  
    631631    margin-bottom: 0.6em;
    632632}
     633.cr-reviews-list-table .cr-comment-head-text {
     634    font-size: 16px;
     635    font-weight: 600;
     636    margin: 0.6em 0;
     637}
    633638.cr-qna-admin-details,
    634639.cr-all-reviews-details {
     
    820825    display: flex;
    821826    align-items: flex-start;
     827    margin: 2px 0;
    822828}
    823829.cr-reviews-list-table .cr-review-country-cont .cr-review-country-icon {
  • customer-reviews-woocommerce/trunk/css/frontend.css

    r3389261 r3392565  
    105105    margin: 0;
    106106}
    107 .cr-all-reviews-shortcode .comment_container .avatar {
    108     position: absolute;
    109     float: left;
    110     padding: 0;
    111     top: 0;
    112     left: 0;
    113     margin: 0;
     107.cr-all-reviews-shortcode .comment_container .avatar,
     108.cr-ajax-reviews-list .comment_container .avatar {
     109    display: none;
    114110}
    115111.cr-comment-videos .cr-comment-video .cr-comment-video-close {
     
    14361432.cr-all-reviews-shortcode ol.commentlist li .cr-comment-text p,
    14371433.cr-reviews-ajax-reviews .cr-reviews-ajax-comments .cr-ajax-reviews-list .cr-comment-text p {
    1438     margin: 1em 0;
     1434    margin: 9px 0 16px 0;
    14391435    text-align: left;
    14401436}
     
    20512047    margin: 0;
    20522048}
     2049.cr-review-form-wrap .cr-onsite-key-question {
     2050    display: block;
     2051    margin: 1.5em 0;
     2052    position: relative;
     2053    width: 100%;
     2054}
     2055.cr-review-form-wrap .cr-onsite-key-question label {
     2056    font-size: 16px;
     2057}
     2058.cr-review-form-wrap .cr-onsite-key-question .cr-onsite-question-inp {
     2059    font-size: 16px;
     2060    width: 100%;
     2061}
    20532062.cr-onsite-questions .cr-onsite-question {
    20542063    display: block;
     
    28712880    padding-bottom: 1em;
    28722881}
     2882.cr-comment-text .cr-comment-head-text {
     2883    font-size: 18px;
     2884    font-weight: 600;
     2885    margin: 0 0 9px 0;
     2886}
     2887.comment-text .cr-comment-head-text {
     2888    font-size: 18px;
     2889    font-weight: 600;
     2890    margin: 0 0 0.5em 0;
     2891}
    28732892.cr-reviews-ajax-reviews .cr-ajax-reviews-wpml-switch {
    28742893    text-align: center;
     
    33613380    margin: 0 15px 0 15px;
    33623381    line-height: 0;
     3382}
     3383.cr-reviews-grid .cr-review-card .cr-comment-head-text {
     3384    font-size: 20px;
     3385    font-weight: 600;
     3386    margin: 0 15px 10px 15px;
     3387    padding: 0;
     3388    line-height: normal;
     3389    color: #203741;
     3390}
     3391.cr-reviews-slider .cr-review-card .cr-comment-head-text {
     3392    font-size: 20px;
     3393    font-weight: 600;
     3394    margin: 0 10px 10px 10px;
     3395    padding: 0;
     3396    line-height: normal;
     3397    color: #203741;
    33633398}
    33643399.cr-reviews-slider .cr-review-card .rating-row {
  • customer-reviews-woocommerce/trunk/includes/blocks/class-cr-all-reviews.php

    r3389261 r3392565  
    11961196                    'cr_form_permissions' => $cr_form_permissions,
    11971197                    'cr_form_checkbox' => $cr_form_checkbox,
    1198                     'cr_form_checkbox_text' => wp_specialchars_decode( $cr_form_checkbox_text, ENT_QUOTES )
     1198                    'cr_form_checkbox_text' => wp_specialchars_decode( $cr_form_checkbox_text, ENT_QUOTES ),
     1199                    'cr_form_settings_array' => $form_settings
    11991200                ),
    12001201                'customer-reviews-woocommerce',
  • customer-reviews-woocommerce/trunk/includes/emails/class-cr-email-func.php

    r3330640 r3392565  
    448448                }
    449449                $data_string = json_encode( $data );
    450                 //error_log( $data_string );
    451450                $ch = curl_init();
    452451                curl_setopt( $ch, CURLOPT_URL, $api_url );
     
    525524                }
    526525                $data_string = json_encode( $data );
    527                 //error_log( $data_string );
    528526                $ch = curl_init();
    529527                curl_setopt( $ch, CURLOPT_URL, $api_url );
  • customer-reviews-woocommerce/trunk/includes/emails/class-cr-email.php

    r3318495 r3392565  
    728728            $wp_locale = get_locale();
    729729            $wp_lang = explode( '_', $wp_locale );
    730             if( is_array( $wp_lang ) && 0 < count( $wp_lang ) ) {
     730            if (
     731                'PT_BR' === strtoupper( $wp_locale )
     732            ) {
     733                // a special case for historical reasons
     734                $language = 'BR';
     735            } elseif (
     736                is_array( $wp_lang ) && 0 < count( $wp_lang )
     737            ) {
    731738                $language = strtoupper( $wp_lang[0] );
    732739            } else {
  • customer-reviews-woocommerce/trunk/includes/emails/class-cr-sender.php

    r3259474 r3392565  
    194194                $e = new Ivole_Email( $order_id, $sequence );
    195195                $result = $e->trigger2( $order_id, null, $schedule );
    196                 // logging
    197                 $log = new CR_Reminders_Log();
    198                 $l_result = $log->add(
    199                     $order_id,
    200                     apply_filters( 'cr_reminders_table_type_log', 'a', $sequence ),
    201                     'email',
    202                     $result
    203                 );
     196                // logging for reminders except when sent via CR Cron
     197                // if sent via CR Cron, then loggin in CusRev dashboard
     198                if ( ! $schedule ) {
     199                    $log = new CR_Reminders_Log();
     200                    $l_result = $log->add(
     201                        $order_id,
     202                        apply_filters( 'cr_reminders_table_type_log', 'a', $sequence ),
     203                        'email',
     204                        $result
     205                    );
     206                }
    204207                // end of logging
    205208            }
  • customer-reviews-woocommerce/trunk/includes/reminders/class-cr-manual.php

    r3372938 r3392565  
    191191                $e = new Ivole_Email( $order_id, 1 );
    192192                $result = $e->trigger2( $order_id, null, $schedule );
    193                 // logging
    194                 $log = new CR_Reminders_Log();
    195                 $l_result = $log->add(
    196                     $order_id,
    197                     'm',
    198                     'email',
    199                     $result
    200                 );
    201                 if (
    202                     is_array( $l_result ) &&
    203                     isset( $l_result['code'] ) &&
    204                     0 !== $l_result['code'] &&
    205                     isset( $l_result['text'] )
    206                 ) {
    207                     $l_msg = ';<br>' . esc_html( $l_result['text'] );
     193                // logging for reminders except when sent via CR Cron
     194                // if sent via CR Cron, then loggin in CusRev dashboard
     195                if ( 'cr' !== $mailer ) {
     196                    $log = new CR_Reminders_Log();
     197                    $l_result = $log->add(
     198                        $order_id,
     199                        'm',
     200                        'email',
     201                        $result
     202                    );
     203                    if (
     204                        is_array( $l_result ) &&
     205                        isset( $l_result['code'] ) &&
     206                        0 !== $l_result['code'] &&
     207                        isset( $l_result['text'] )
     208                    ) {
     209                        $l_msg = ';<br>' . esc_html( $l_result['text'] );
     210                    }
    208211                }
    209212                // end of logging
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-admin-menu-reviews.php

    r3372938 r3392565  
    2626            add_action( 'ivole_admin_review_reply_form', array( $this, 'review_reply' ) );
    2727            add_action( 'wp_ajax_ivole-replyto-comment', array( $this, 'wp_ajax_ivole_replyto_comment' ) );
     28            add_action( 'add_meta_boxes', array( $this, 'add_title_meta_box' ), 8, 2 );
    2829            add_action( 'add_meta_boxes', array( $this, 'add_reviewer_meta_box' ), 9, 2 );
    2930            add_action( 'add_meta_boxes', array( $this, 'add_review_meta_box' ), 10, 2 );
     
    491492            $x->add( $response );
    492493            $x->send();
     494        }
     495
     496        public function add_title_meta_box( $post_type, $comment ) {
     497            if ( 'comment' === $post_type ) {
     498                $rating = get_comment_meta( $comment->comment_ID, 'rating', true );
     499                if ( $rating ) {
     500                    add_meta_box(
     501                        'cr_title_meta_box',
     502                        __( 'Review Title', 'customer-reviews-woocommerce' ),
     503                        array( $this, 'render_title_meta_box' ),
     504                        $post_type,
     505                        'normal',
     506                        'default'
     507                    );
     508                }
     509            }
    493510        }
    494511
     
    604621        }
    605622
     623        public function render_title_meta_box( $comment ) {
     624            $title = get_comment_meta( $comment->comment_ID, 'cr_rev_title', true );
     625            ?>
     626                <p>
     627                    <input type="text" name="cr_rev_title" id="cr_rev_title" value="<?php echo esc_attr( $title ); ?>" class="widefat" />
     628                </p>
     629            <?php
     630            wp_nonce_field( 'cr_title', 'cr_title_nonce' );
     631        }
     632
    606633        public function render_reviewer_meta_box( $comment ) {
    607634            $options = array(
     
    660687                $meta[] = __( 'This reply was originally posted on CusRev portal. This copy of the reply was modified and might be different from the original reply published on CusRev portal.', 'customer-reviews-woocommerce' );
    661688                update_comment_meta( $comment_ID, 'ivole_reply', $meta );
     689            }
     690            if (
     691                isset( $_POST['cr_rev_title'] ) &&
     692                wp_verify_nonce( $_POST['cr_title_nonce'], 'cr_title' )
     693            ) {
     694                update_comment_meta( $comment_ID, 'cr_rev_title', sanitize_text_field( $_POST['cr_rev_title'] ) );
    662695            }
    663696        }
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-custom-questions.php

    r3272816 r3392565  
    218218        }
    219219
    220         public static function review_form_questions( $comment_form ) {
     220        public static function review_form_questions( $comment_form, $hash ) {
    221221            $onsite_form = CR_Forms_Settings::get_default_form_settings();
    222222            $rs = '';
     
    226226                is_array( $onsite_form )
    227227            ) {
    228                 $hash = random_int( 0, 99 ) . '_';
    229228                $shared_index = 0;
    230229                // if there are any custom ratings, display them
     
    445444
    446445        // display a rating block on a review form
    447         public static function review_form_rating( $item_id ) {
    448             $hash = random_int( 0, 99 ) . '_';
     446        public static function review_form_rating( $item_id, $hash ) {
    449447            $out = self::display_rating(
    450448                __( 'Rating', 'customer-reviews-woocommerce' ),
     
    459457            //
    460458            if ( 0 < $item_id ) {
    461                 $out = self::review_form_questions( $out );
     459                $out = self::review_form_questions( $out, $hash );
    462460            }
    463461            echo $out;
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-reviews-list-table.php

    r3389261 r3392565  
    965965        <?php
    966966
     967        $title = get_comment_meta( $comment->comment_ID, 'cr_rev_title', true );
     968        if ( $title ) {
     969            echo '<div class="cr-comment-head-text">' . esc_html( $title ) . '</div>';
     970        }
     971
    967972        if( $this->cr_ajax_enabled ) {
    968973            if( 0 < get_comment_meta( $comment->comment_ID, 'ivole_featured', true ) ) {
  • customer-reviews-woocommerce/trunk/includes/reviews/class-cr-reviews.php

    r3389261 r3392565  
    116116            add_action( 'woocommerce_review_before_comment_text', array( $this, 'display_featured' ), 9 );
    117117            add_action( 'woocommerce_before_single_product', array( $this, 'custom_avatars' ) );
    118             add_filter( 'cr_review_form_before_comment', array( 'CR_Custom_Questions', 'review_form_questions' ) );
     118            add_filter( 'cr_review_form_before_comment', array( 'CR_Custom_Questions', 'review_form_questions' ), 10, 2 );
    119119            add_action( 'wp_insert_comment', array( 'CR_Custom_Questions', 'submit_onsite_questions' ) );
    120120            add_action( 'comment_post', array( $this, 'action_after_review_added' ), 10, 3 );
    121             add_action( 'cr_review_form_rating', array( 'CR_Custom_Questions', 'review_form_rating' ) );
     121            add_action( 'cr_review_form_rating', array( 'CR_Custom_Questions', 'review_form_rating' ), 10, 2 );
    122122            // standard WooCommerce review template
    123123            add_action( 'woocommerce_review_after_comment_text', array( $this, 'display_incentivized_badge' ), 8 );
     
    11641164    public function display_verified_badge_only( $comment ) {
    11651165        if( 0 === intval( $comment->comment_parent ) ) {
     1166            //
     1167            $title = get_comment_meta( $comment->comment_ID, 'cr_rev_title', true );
     1168            if ( $title ) {
     1169                echo '<div class="cr-comment-head-text">' . esc_html( $title ) . '</div>';
     1170            }
     1171            //
    11661172            $output = '';
    11671173            // check if a badge should be shown for the review
     
    12061212
    12071213    public function display_featured( $comment ) {
    1208         if( 0 === intval( $comment->comment_parent ) ) {
     1214        if ( 0 === intval( $comment->comment_parent ) ) {
     1215            $title = get_comment_meta( $comment->comment_ID, 'cr_rev_title', true );
     1216            if ( $title ) {
     1217                echo '<div class="cr-comment-head-text">' . esc_html( $title ) . '</div>';
     1218            }
    12091219            if( 0 < $comment->comment_karma ) {
    12101220                // display 'featured' badge
     
    16981708            if ( ! $review_from_aggregated ) {
    16991709                $customer_email = isset( $commentdata['comment_author_email'] ) ? $commentdata['comment_author_email'] : '';
    1700                 if ( $customer_email ) {
     1710                if (
     1711                    $customer_email &&
     1712                    'spam' !== $comment_approved
     1713                ) {
    17011714                    $ec = new CR_Email_Coupon( 0 );
    17021715                    $ec->maybe_send_coupon(
  • customer-reviews-woocommerce/trunk/includes/settings/class-cr-admin-menu-settings.php

    r3267586 r3392565  
    6767                __( 'Settings', 'customer-reviews-woocommerce' ),
    6868                __( 'Settings', 'customer-reviews-woocommerce' ),
    69                 'manage_options',
     69                apply_filters( 'cr_settings_permissions', 'manage_options' ),
    7070                $this->menu_slug,
    7171                array( $this, 'display_settings_admin_page' )
  • customer-reviews-woocommerce/trunk/includes/settings/class-cr-settings-forms.php

    r3363526 r3392565  
    107107                    )
    108108                );
    109                 $update_ivole_review_forms = false;
    110109                // save the additional ratings
    111110                if ( ! empty( $_POST ) && isset( $_POST['ivole_rating_criteria'] ) ) {
     
    113112                    $rtn_crta = array_slice( $rtn_crta, 0, CR_Forms_Settings_Rating::get_max_rating_criteria() );
    114113                    $ivole_review_forms[0]['rtn_crta'] = $rtn_crta;
    115                     $update_ivole_review_forms = true;
    116114                }
    117115                // save the customer attributes
     
    120118                    $cus_atts = array_slice( $cus_atts, 0, self::get_max_cus_atts() );
    121119                    $ivole_review_forms[0]['cus_atts'] = $cus_atts;
    122                     $update_ivole_review_forms = true;
    123120                }
    124121                // save the review permissions
     
    126123                    $rev_perm = strval( $_POST['ivole_review_permissions'] );
    127124                    $ivole_review_forms[0]['rev_perm'] = $rev_perm;
    128                     $update_ivole_review_forms = true;
    129125                }
    130126                // save the terms and privacy checkbox
     
    138134                        $ivole_review_forms[0]['chbx'] = '';
    139135                    }
    140                     $update_ivole_review_forms = true;
    141136                }
    142137                // save the terms and privacy text
    143138                if ( ! empty( $_POST ) && isset( $_POST['ivole_onsite_form_checkbox_text'] ) ) {
    144139                    $ivole_review_forms[0]['chbx_text'] = esc_html( $_POST['ivole_onsite_form_checkbox_text'] );
    145                     $update_ivole_review_forms = true;
    146140                }
    147141                //
    148                 if ( $update_ivole_review_forms ) {
    149                     $_POST['ivole_review_forms'] = $ivole_review_forms;
    150                 }
     142                $ivole_review_forms = apply_filters( 'cr_settings_save_onsite_form', $ivole_review_forms );
     143                //
     144                $_POST['ivole_review_forms'] = $ivole_review_forms;
    151145                // save the geolocation setting
    152146                if( ! empty( $_POST ) ) {
     
    487481            }
    488482
    489             $this->settings = apply_filters( 'cr_settings_forms', $this->settings );
     483            $this->settings = apply_filters( 'cr_settings_forms', $this->settings, $form_settings );
    490484            ksort( $this->settings );
    491485        }
  • customer-reviews-woocommerce/trunk/ivole.php

    r3389261 r3392565  
    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.87.0
     6Version: 5.88.0
    77Author: CusRev
    88Author URI: https://www.cusrev.com/business/
  • customer-reviews-woocommerce/trunk/js/admin-import.js

    r3382233 r3392565  
    66        jQuery('#cr-import-cancel').on('click', function(event) {
    77          event.preventDefault();
    8           crImporter.cancel_import();
     8          crImporter.cancelImport();
    99        });
    1010
  • customer-reviews-woocommerce/trunk/js/frontend.js

    r3389261 r3392565  
    17641764        refElement.closest( ".cr-review-form-wrap" ).find( ".cr-onsite-questions .cr-onsite-question input[type = 'number']" ).val('');
    17651765
     1766        // reset the key custom questions
     1767        refElement.closest( ".cr-review-form-wrap" ).find( ".cr-onsite-key-question" ).removeClass( "cr-review-form-error" );
     1768        refElement.closest( ".cr-review-form-wrap" ).find( ".cr-onsite-key-question input[type = 'text']" ).val('');
     1769        refElement.closest( ".cr-review-form-wrap" ).find( ".cr-onsite-key-question input[type = 'number']" ).val('');
     1770
    17661771        // reset the media files
    17671772        refElement.closest( ".cr-review-form-wrap" ).find( ".cr-form-item-media .cr-upload-images-containers" ).remove();
  • customer-reviews-woocommerce/trunk/readme.txt

    r3389261 r3392565  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 5.87.0
     7Stable tag: 5.88.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl.html
     
    234234== Changelog ==
    235235
     236= 5.88.0 =
     237* Improvement: a check that a review is not SPAM before triggering sending of a discount coupon
     238* Improvement: a new filter 'cr_settings_permissions' to allow modification of permissions required to edit the plugin's settings
     239* Improvement: compatibility with WPML plugin to prevent double avatars
     240* Improvement: exclude review reminders scheduled via CR Cron from the Reminders page
     241* Bug fix: button to cancel import of reviews didn't work
     242* Bug fix: translations of aggregated review forms in Portuguese (Brazil) weren't selected correctly
    236243= 5.87.0 =
    237244* New feature: support of 'location' field in the utility for import / export of reviews
  • customer-reviews-woocommerce/trunk/templates/cr-ajax-product-reviews.php

    r3315486 r3392565  
    155155                        'cr_form_permissions' => $cr_form_permissions,
    156156                        'cr_form_checkbox' => $cr_form_checkbox,
    157                         'cr_form_checkbox_text' => wp_specialchars_decode( $cr_form_checkbox_text, ENT_QUOTES )
     157                        'cr_form_checkbox_text' => wp_specialchars_decode( $cr_form_checkbox_text, ENT_QUOTES ),
     158                        'cr_form_settings_array' => $form_settings
    158159                    ),
    159160                    'customer-reviews-woocommerce',
  • customer-reviews-woocommerce/trunk/templates/cr-review-form.php

    r3291197 r3392565  
    8888        </div>
    8989
    90         <?php do_action( 'cr_review_form_rating', $cr_item_id ); ?>
     90        <?php
     91            $cr_hash = random_int( 0, 99 ) . '_';
     92            do_action( 'cr_review_form_header', $cr_item_id, $cr_form_settings_array, $cr_hash );
     93            do_action( 'cr_review_form_rating', $cr_item_id, $cr_hash );
     94        ?>
    9195
    9296        <div class="cr-review-form-comment">
  • customer-reviews-woocommerce/trunk/templates/cr-single-product-reviews.php

    r3053016 r3392565  
    143143                }
    144144
    145                 $comment_form['comment_field'] = apply_filters( 'cr_review_form_before_comment', $comment_form['comment_field'] );
     145                $cr_hash = random_int( 0, 99 ) . '_';
     146                $comment_form['comment_field'] = apply_filters( 'cr_review_form_before_comment', $comment_form['comment_field'], $cr_hash );
    146147
    147148                $comment_form['comment_field'] .= '<p class="comment-form-comment"><label for="comment">' . esc_html__( 'Your review', 'woocommerce' ) . '&nbsp;<span class="required">*</span></label><textarea id="comment" name="comment" cols="45" rows="8" required class="cr-review-form-textbox"></textarea></p>';
  • customer-reviews-woocommerce/trunk/templates/reviews-grid.php

    r3376803 r3392565  
    143143                            </div>
    144144                        </div>
     145                        <?php
     146                            if ( 0 === intval( $review->comment_parent ) ) {
     147                                $rev_title = get_comment_meta( $review->comment_ID, 'cr_rev_title', true );
     148                                if ( $rev_title ) {
     149                                    echo '<div class="cr-comment-head-text">' . esc_html( $rev_title ) . '</div>';
     150                                }
     151                            }
     152                        ?>
    145153                        <div class="middle-row">
    146154                            <div class="review-content">
  • customer-reviews-woocommerce/trunk/templates/reviews-slider.php

    r3372938 r3392565  
    6060                    </div>
    6161                </div>
     62                <?php
     63                    if ( 0 === intval( $review->comment_parent ) ) {
     64                        $rev_title = get_comment_meta( $review->comment_ID, 'cr_rev_title', true );
     65                        if ( $rev_title ) {
     66                            echo '<div class="cr-comment-head-text">' . esc_html( $rev_title ) . '</div>';
     67                        }
     68                    }
     69                ?>
    6270                <?php
    6371                    do_action( 'cr_slider_before_review_text', $review );
Note: See TracChangeset for help on using the changeset viewer.