Changeset 3345146
- Timestamp:
- 08/15/2025 12:31:09 PM (7 months ago)
- Location:
- wiser-review/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wiser-review.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wiser-review/trunk/readme.txt
r3344301 r3345146 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 1. 68 Stable tag: 1.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 112 112 = 1.6 = 113 113 Fix- Product ID & SKU id issues, After update, submit the key again 114 115 = 1.7 = 116 Fix- we separate the shortcode and toggle display, star rating position, data-lgin support -
wiser-review/trunk/wiser-review.php
r3344301 r3345146 4 4 * Plugin URI: https://wiserreview.com 5 5 * Description: Wiser Review module helps you collect and display product reviews, star ratings, and nudges. It also automates review requests via email to boost custom engagement and conversions. 6 * Version: 1. 66 * Version: 1.7 7 7 * Author: Wiser Notify 8 8 * Requires Plugins: woocommerce … … 163 163 add_action( 'woocommerce_single_product_summary', 'wiserrw_show_rating_count', 5 ); 164 164 // fix for the kadence theme 165 add_action( 'woocommerce_after_add_to_cart_button', 'wiserrw_show_rating_count' ); 165 if ( wp_get_theme()->get( 'Name' ) === 'Kadence' ) { 166 add_action( 'woocommerce_after_add_to_cart_button', 'wiserrw_show_rating_count' ); 167 } 168 166 169 167 170 /** … … 180 183 $product_id = get_the_ID(); 181 184 $product = wc_get_product( $product_id ); 185 if ( ! $product ) { 186 return; 187 } 182 188 $sku = $product->get_sku(); 183 189 … … 208 214 function wiserrw_product_review() { 209 215 ob_start(); 216 $product_id = get_the_ID(); 217 $product = wc_get_product( $product_id ); 218 if ( ! $product ) { 219 return; 220 } 210 221 $wiserrw_api_settings = get_option( 'wiserrw_api_settings' ); 211 222 if ( $wiserrw_api_settings && '1' === $wiserrw_api_settings['wiserrw_live_mode_checkbox'] && '1' === $wiserrw_api_settings['wiserrw_product_review_enabled'] ) { 212 $product_id = get_the_ID(); 213 $product = wc_get_product( $product_id ); 214 $sku = $product->get_sku(); 223 224 $sku = $product->get_sku(); 215 225 $wiserrw_api_data = get_option( 'wiserrw_api_data' ); 216 $product_review_section_pid = preg_replace( "/data-pid='(.*?)'/", "data-pid='$product_id'", $wiserrw_api_data->product_review_section ); 226 if ( is_user_logged_in() ) { 227 $data_in_value = 'true'; 228 } else { 229 $data_in_value = 'false'; 230 } 231 232 // If data-login exists, replace it; otherwise, add it to the first tag 233 if ( preg_match( "/data-lgin=['\"](.*?)['\"]/", $wiserrw_api_data->product_review_section ) ) { 234 $product_review_section_loggedin = preg_replace( 235 "/data-lgin=['\"](.*?)['\"]/", 236 "data-lgin='{$data_in_value}'", 237 $wiserrw_api_data->product_review_section 238 ); 239 } else { 240 $product_review_section_loggedin = preg_replace( 241 '/<(\w+)/', 242 "<$1 data-lgin='{$data_in_value}'", 243 $wiserrw_api_data->product_review_section, 244 1 // only add to the first tag 245 ); 246 } 247 $product_review_section_pid = preg_replace( "/data-pid='(.*?)'/", "data-pid='$product_id'", $product_review_section_loggedin ); 248 217 249 $product_review_section = preg_replace( "/data-skuid='(.*?)'/", "data-skuid='$sku'", $product_review_section_pid ); 218 250 219 251 $product_rating_count = preg_replace( "/data-pid='(.*?)'/", "data-pid='$product_id'", $wiserrw_api_data->product_rating_count ); 220 $product_rating_count = preg_replace( "/data-skuid='(.*?)'/", "data- pid='$sku'", $wiserrw_api_data->product_rating_count );252 $product_rating_count = preg_replace( "/data-skuid='(.*?)'/", "data-skuid='$sku'", $wiserrw_api_data->product_rating_count ); 221 253 222 254 $nudges_section = preg_replace( "/data-pid='(.*?)'/", "data-pid='$product_id'", $wiserrw_api_data->nudges_section ); … … 244 276 function wiserrw_product_nudges() { 245 277 ob_start(); 278 $product_id = get_the_ID(); 279 $product = wc_get_product( $product_id ); 280 if ( ! $product ) { 281 return; 282 } 246 283 $wiserrw_api_settings = get_option( 'wiserrw_api_settings' ); 247 284 if ( $wiserrw_api_settings && '1' === $wiserrw_api_settings['wiserrw_live_mode_checkbox'] && '1' === $wiserrw_api_settings['wiserrw_review_nudges_enabled'] ) { 248 285 $wiserrw_api_data = get_option( 'wiserrw_api_data' ); 249 $product_id = get_the_ID();250 $product_id = get_the_ID();251 $product = wc_get_product( $product_id );252 286 $sku = $product->get_sku(); 253 287
Note: See TracChangeset
for help on using the changeset viewer.