Plugin Directory

Changeset 3390436


Ignore:
Timestamp:
11/05/2025 12:15:14 PM (4 months ago)
Author:
wisernotify
Message:

Updating trunk to version 2.7

Location:
wiser-review/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wiser-review/trunk/readme.txt

    r3379720 r3390436  
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 2.6
     8Stable tag: 2.7
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    139139= 2.6 =
    140140SEO-Friendly Product Reviews & Rich Snippet Display with UI Enhancements
     141
     142= 2.7=
     143Fixed encoding and special character issues for Rich snippts, support added for international and domestic orders
  • wiser-review/trunk/wiser-review.php

    r3379720 r3390436  
    44 * Plugin URI: https://wiserreview.com
    55 * 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: 2.6
     6 * Version: 2.7
    77 * Author: Wiser Notify
    88 * Requires Plugins: woocommerce
     
    2222define( 'WISERRW_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2323define( 'WISERRW_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    24 define( 'WISERRW_PLUGIN_VERSION', 2.6 );
     24define( 'WISERRW_PLUGIN_VERSION', 2.7);
    2525define( 'WISERRW_API_HOST', 'https://api.wiserreview.com/api/woocommerce/' );
    2626
     
    692692    $date_created = $order->get_date_created();
    693693    $wiserrw_order_data['cdt'] = $date_created ? $date_created->format('Y-m-d H:i:s') : current_time('mysql');
     694     
     695    /* Shipping Details */
     696     $country = $order->get_shipping_country();
     697    $state   = $order->get_shipping_state();
     698    // Fallback to billing if shipping not available
     699    if ( empty( $country ) ) {
     700        $country = $order->get_billing_country();
     701    }
     702    if ( empty( $state ) ) {
     703        $state = $order->get_billing_state();
     704    }   
    694705
    695706    /* Customer Details */
     
    698709    $customer_data['first_name'] = $order->get_billing_first_name();
    699710    $customer_data['last_name'] = $order->get_billing_last_name();
     711
     712    // Address
     713    $customer_data['cntry'] = $country;
     714    $customer_data['state'] = $state;
     715
    700716    $wiserrw_order_data['customer'] = $customer_data;
    701717
     
    875891    if ( $fp ) {
    876892        if ( $is_first_chunk ) {
    877             fputcsv( $fp, array('Order Id', 'First Name', 'Last Name', 'Phone', 'Email', 'Product Title', 'Product URL', 'Product Image URL', 'Product ID', 'Reviewer Image URL', 'Order Date' ) );
     893            fputcsv( $fp, array('Order Id', 'First Name', 'Last Name', 'Phone', 'Email', 'Country', 'State', 'Product Title', 'Product URL', 'Product Image URL', 'Product ID', 'Reviewer Image URL', 'Order Date' ) );
    878894        }
    879895
    880896        foreach ( $chunk_ids as $order) {
    881897            $order_id = $order->get_id();
    882            
    883898            $user_id = $order->get_user_id();
     899
     900
     901            $country = $order->get_shipping_country();
     902            $state   = $order->get_shipping_state();           
     903
     904            // Fallback to billing if shipping not available
     905            if ( empty( $country ) ) {
     906                $country = $order->get_billing_country();
     907            }
     908            if ( empty( $state ) ) {
     909                $state = $order->get_billing_state();
     910            }   
     911
    884912            /* Product Details */
    885913            $items = $order->get_items();
     
    907935                        $order->get_billing_phone(),
    908936                        $order->get_billing_email(),
     937                        $country,
     938                        $state,
    909939                        $product->get_name(),
    910940                        $url,
     
    10221052                ? $order->get_date_created()->format('Y-m-d H:i:s') // ✅ Clean date format
    10231053                : current_time('mysql');
     1054                 
     1055            /* Shipping Details */
     1056            $country = $order->get_shipping_country();
     1057            $state   = $order->get_shipping_state();           
     1058
     1059            // Fallback to billing if shipping not available
     1060
     1061            if ( empty( $country ) ) {
     1062                $country = $order->get_billing_country();
     1063            }
     1064            if ( empty( $state ) ) {
     1065                $state = $order->get_billing_state();
     1066            }         
     1067
     1068               
    10241069
    10251070            /* Customer Details */
     
    10291074                'first_name' => $order->get_billing_first_name(),
    10301075                'last_name'  => $order->get_billing_last_name(),
     1076               
    10311077            );
     1078           
     1079            $wiserrw_order_data['cntry'] = $country;
     1080            $wiserrw_order_data['state'] = $state;         
    10321081            $wiserrw_order_data['customer'] = $customer_data;
    10331082
     
    20752124    // ✅ Save or delete only once, after loop
    20762125    if ( $reviewCount > 0 ) {
    2077         update_post_meta( $p_id, 'wiserrw_schema_json', json_encode( $schema_array, JSON_UNESCAPED_SLASHES ) );
     2126        update_post_meta( $p_id, 'wiserrw_schema_json', json_encode( $schema_array, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ) );
    20782127    } else {
    20792128        delete_post_meta( $p_id, 'wiserrw_schema_json' );
Note: See TracChangeset for help on using the changeset viewer.