Plugin Directory

Changeset 2858776


Ignore:
Timestamp:
02/02/2023 06:57:12 AM (3 years ago)
Author:
trackship
Message:

version update 1.5.1

Location:
trackship-for-woocommerce/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trackship-for-woocommerce/trunk/includes/api/class-trackship-rest-api-controller.php

    r2852880 r2858776  
    247247                as_schedule_single_action( time(), 'ts_status_change_trigger', array( $order_id, $previous_status, $tracking_event_status, $tracking_number ), 'TrackShip' );
    248248
    249                 // Add the note
    250                 if ( get_option( 'enable_debug_log' ) ) {
    251                     /* translators: %s: search for a tag */
    252                     $note = sprintf( __( 'Tracking Status (%s - %s) was updated to %s. (TrackShip)' ), $tracking_item['tracking_provider'], $tracking_item['tracking_number'], apply_filters('trackship_status_filter', $tracking_event_status) );
    253                     $order->add_order_note( $note );
    254                 }
    255                
    256249                // hook for send SMS
    257250                // depricated after version 1.4.8
  • trackship-for-woocommerce/trunk/includes/class-wc-trackship-actions.php

    r2852880 r2858776  
    352352            }
    353353            update_option( 'enable_email_widget', wc_clean( $_POST[ 'enable_email_widget' ] ) );
    354             update_option( 'enable_debug_log', wc_clean( $_POST[ 'enable_debug_log' ] ) );
    355354            echo json_encode( array('success' => 'true') );
    356355            die();
  • trackship-for-woocommerce/trunk/includes/class-wc-trackship-api-call.php

    r2852847 r2858776  
    109109                            update_option( 'user_plan', $body['user_plan'] );
    110110                        }
    111                         // The text for the note
    112                         $note = sprintf( __( 'Shipping information (%s - %s) was sent to TrackShip.', 'trackship-for-woocommerce' ), $tracking_provider, $tracking_number );
    113                         // Add the note
    114                         $order->add_order_note( $note );
    115111                       
    116112                        $ts_shipment_status = $order->get_meta( 'ts_shipment_status', true );
  • trackship-for-woocommerce/trunk/includes/class-wc-trackship-front.php

    r2852847 r2858776  
    810810    }
    811811
     812    /** 
     813     * Function for check if order is Shipped and order has only 1 Shipment
     814     */
     815    public function shipped_order_has_one_shipment( $tracking_items, $order ) {
     816        $order_status  = $order->get_status();
     817        if ( 1 == count( $tracking_items ) && in_array( $order_status, apply_filters( 'allowed_order_status_for_delivered', array( 'completed', 'updated-tracking', 'shipped', 'delivered' ) ) ) ) {
     818            return true;
     819        }
     820        return false;
     821    }
     822
    812823    public function get_notifications_option ( $order_id ) {
    813824        if ( get_option( 'enable_email_widget' ) ) {
  • trackship-for-woocommerce/trunk/includes/customizer/trackship-customizer.php

    r2852803 r2858776  
    195195            'email_iframe_url'      => add_query_arg( array( 'shipment-email-customizer-preview' => '1' ), home_url( '' ) ),
    196196            'tracking_iframe_url'   => add_query_arg( array( 'action' => 'preview_tracking_page' ), home_url( '' ) ),
     197            'form_iframe_url'       => $this->get_tracking_form_preview_url()
    197198        ));
    198199    }
  • trackship-for-woocommerce/trunk/includes/shipments/class-wc-trackship-shipments.php

    r2852803 r2858776  
    193193        if( count( $ep_tracker['tracking_events'] ) == 0 )return 0;     
    194194        $first = reset($ep_tracker['tracking_events']);
     195        $first = (array) $first;
     196
    195197        $first_date = $first['datetime'];
    196        
    197198        $last_date = $ep_tracker['last_event_time'];
    198199       
  • trackship-for-woocommerce/trunk/includes/smswoo/class-smswoo-sms-gateway.php

    r2633538 r2858776  
    8686
    8787        /**
    88          * Print send log
    89          *
    90          * @since   1.0.0
    91          * @return  void
    92          */
    93         public function print_log() {
    94 
    95             error_log( print_r( $this->_log, true ) );
    96             //update_option( 'smswoo_debug_log', print_r( $this->_log, true ) );
    97 
    98         }
    99 
    100         /**
    10188         * Add log send log
    10289         *
     
    10895         */
    10996        public function write_log( $args ) {
    110            
    111             $smswoo_enable_log = get_option( 'smswoo_enable_log', 1 );
    112            
    113             if ( $smswoo_enable_log ) {
    114                 $context = array( 'source' => 'smswoo' );
    115    
    116                 $log = strtoupper( ( 'test' != $args['type'] ? 'Order #' . $args['order'] . ' - ' : '' ) . $args['type'] . ' MESSAGE' ) . "\r\n";
    117                 $log .= 'Status: ' . ( $args['success'] ? 'SUCCESS' : 'FAILED - ' . $args['status_message'] ) . "\r\n";
    118                 $log .= 'Phone: ' . $args['phone'] . "\r\n";
    119                 $log .= 'Message: ' . $args['message'] . "\r\n";
    120    
    121                 if ( $args['success'] ) {
    122                     $this->_logger->info( $log, $context );
    123                 } else {
    124                     $this->_logger->error( $log, $context );
    125                 }
     97
     98            if ( ! apply_filters( 'ts_sms_wc_log', true ) ) {
     99                return;
     100            }
     101
     102            $context = array( 'source' => 'ts4wc-sms' );
     103
     104            $log = strtoupper( ( 'test' != $args['type'] ? 'Order #' . $args['order'] . ' - ' : '' ) . $args['type'] . ' MESSAGE' ) . "\r\n";
     105            $log .= 'Status: ' . ( $args['success'] ? 'SUCCESS' : 'FAILED - ' . $args['status_message'] ) . "\r\n";
     106            $log .= 'Phone: ' . $args['phone'] . "\r\n";
     107            $log .= 'Message: ' . $args['message'] . "\r\n";
     108
     109            if ( $args['success'] ) {
     110                $this->_logger->info( $log, $context );
     111            } else {
     112                $this->_logger->error( $log, $context );
    126113            }
    127114        }
  • trackship-for-woocommerce/trunk/includes/smswoo/class-smswoo-sms-notification.php

    r2852847 r2858776  
    260260
    261261        $sms_gateway->write_log( $log_args );
    262 
    263         $smswoo_enable_order_note_log = get_option( 'smswoo_enable_order_note_log', 1 );
    264         if ( $this->_customer_sms && $smswoo_enable_order_note_log ) {
    265 
    266             $order = $this->order;
    267 
    268             ob_start();
    269             ?>
    270             TrackShip SMS
    271             <?php esc_html_e( 'Status', 'trackship-for-woocommerce' ); ?>: <?php echo esc_html( $status_message ); ?>
    272             <br />
    273             <?php esc_html_e( 'Content', 'trackship-for-woocommerce' ); ?>: <?php echo esc_html( $message ); ?>
    274             <?php
    275 
    276             $this->order_note['text'] = ob_get_clean();
    277             $this->order_note['id']   = $order->add_order_note( $this->order_note['text'] );
    278 
    279         }
    280262
    281263        return $success;
  • trackship-for-woocommerce/trunk/includes/trackship-email-manager.php

    r2852880 r2858776  
    4646        if ( ! $enable || ! $for_amazon_order || '0' == $receive_email ) {
    4747            return;
     48        }
     49
     50        if ( 'delivered_status' == $status ) {
     51            $toggle = get_option( 'all-shipment-status-delivered' );
     52            $all_delivered = trackship_for_woocommerce()->ts_actions->is_all_shipments_delivered( $order_id );
     53           
     54            if ( $toggle && !$all_delivered ) {
     55                return;
     56            }
    4857        }
    4958
  • trackship-for-woocommerce/trunk/includes/views/front/layout1_tracking_details.php

    r2852803 r2858776  
    1919}
    2020$tracking_items = trackship_for_woocommerce()->get_tracking_items( $order_id );
    21 $tpi_order = $this->check_if_tpi_order( $tracking_items, wc_get_order( $order_id ) );
    22 if ( $tpi_order ){
     21if ( $this->check_if_tpi_order( $tracking_items, wc_get_order( $order_id ) ) || $this->shipped_order_has_one_shipment( $tracking_items, wc_get_order( $order_id ) ) ){
    2322    $tab_array[ 'product_details' ] = array(
    2423        'label' => $labels_name['items_label'],
     
    6463                                        <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong>
    6564                                        <p>
    66                                         <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?>
    67                                         <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?>
    68                                         <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span>
     65                                            <?php
     66                                            $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message );
     67                                            $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city );
     68                                            $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city;
     69                                           
     70                                            $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city );
     71                                            echo esc_html( $single_event );
     72                                            ?>
    6973                                        </p>
    7074                                    </li>
     
    8589                                        <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong>
    8690                                        <p>
    87                                         <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?>
    88                                         <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?>
    89                                         <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span>
     91                                            <?php
     92                                            $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message );
     93                                            $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city );
     94                                            $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city;
     95                                           
     96                                            $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city );
     97                                            echo esc_html( $single_event );
     98                                            ?>
    9099                                        </p>
    91100                                    </li>
     
    112121                                    <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong>
    113122                                    <p>
    114                                         <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?>
    115                                         <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?>
    116                                         <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span>
     123                                        <?php
     124                                        $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message );
     125                                        $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city );
     126                                        $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city;
     127                                       
     128                                        $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city );
     129                                        echo esc_html( $single_event );
     130                                        ?>
    117131                                    </p>
    118132                                </li>
     
    133147                                    <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong>
    134148                                    <p>
    135                                         <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?>
    136                                         <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?>
    137                                     <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span>
     149                                        <?php
     150                                        $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message );
     151                                        $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city );
     152                                        $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city;
     153                                       
     154                                        $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city );
     155                                        echo esc_html( $single_event );
     156                                        ?>
    138157                                    </p>
    139158                                </li>
     
    159178                                    <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong>
    160179                                    <p>
    161                                         <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?>
    162                                         <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?>
    163                                         <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span>
     180                                        <?php
     181                                        $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message );
     182                                        $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city );
     183                                        $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city;
     184                                       
     185                                        $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city );
     186                                        echo esc_html( $single_event );
     187                                        ?>
    164188                                    </p>
    165189                                </li>
     
    180204                                <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong>
    181205                                <p>
    182                                 <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?>
    183                                 <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?>
    184                                 <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span>
     206                                    <?php
     207                                    $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message );
     208                                    $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city );
     209                                    $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city;
     210                                   
     211                                    $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city );
     212                                    echo esc_html( $single_event );
     213                                    ?>
    185214                                </p>
    186215                            </li>
  • trackship-for-woocommerce/trunk/includes/views/settings.php

    r2852847 r2858776  
    9191                    </label>
    9292                </div>
    93                 <div class="settings_toogle">
    94                     <input type="hidden" name="enable_debug_log" value="0"/>
    95                     <input class="ast-tgl ast-tgl-flat " id="enable_debug_log" name="enable_debug_log" data-settings="enable_debug_log" type="checkbox"
    96                     <?php echo get_option( 'enable_debug_log' ) ? 'checked' : ''; ?> value="1"/>
    97                     <label class="ast-tgl-btn ast-tgl-btn-green" for="enable_debug_log"></label>
    98                     <label class="setting_ul_tgl_checkbox_label" for="enable_debug_log">
    99                         <span><?php esc_html_e( 'Debug Mode for shipment status change', 'trackship-for-woocommerce' ); ?></span>
    100                         <span class="woocommerce-help-tip tipTip" title="<?php esc_html_e( 'Enable this option to add a note to your orders for every shipment status update by TrackShip.', 'trackship-for-woocommerce' ); ?>"></span>
    101                     </label>
    102                 </div>
    10393            </div>
    10494        </div>
  • trackship-for-woocommerce/trunk/readme.txt

    r2852862 r2858776  
    55Tested up to: 6.1.1
    66Requires PHP: 7.2
    7 Stable tag: 1.5.0
     7Stable tag: 1.5.1
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    112112
    113113== Changelog ==
    114 = 1.5.0 - 2022-01-23 =
     114= 1.5.1 - 2023-02-02 =
     115* Dev - Do not add order notes for shipment status and SMS notification
     116* Fix - Fatal error for count shipment object/array length
     117* Enhancement - Add order items to the tracking page widget for shipped orders with one tracking number.
     118* Fix - issue with shipment email when all shipments are delivered option is checked
     119
     120= 1.5.0 - 2023-01-23 =
    115121* Dev - Compatibility added with Yith order tracking plugin
    116122* Dev - Compatibility added with WooCommerce Order Tracking plugin
  • trackship-for-woocommerce/trunk/trackship-for-woocommerce.php

    r2852847 r2858776  
    33 * Plugin Name: TrackShip for WooCommerce
    44 * Description: TrackShip for WooCommerce integrates TrackShip into your WooCommerce Store and auto-tracks your orders, automates your post-shipping workflow and allows you to provide a superior Post-Purchase experience to your customers.
    5  * Version: 1.5.0
     5 * Version: 1.5.1
    66 * Author: TrackShip
    77 * Author URI: https://trackship.com/
     
    2424     * @var string
    2525    */
    26     public $version = '1.5.0';
     26    public $version = '1.5.1';
    2727
    2828    /**
Note: See TracChangeset for help on using the changeset viewer.