Plugin Directory

Changeset 3356427


Ignore:
Timestamp:
09/05/2025 04:46:18 AM (7 months ago)
Author:
transdirect
Message:

Update to version 8.0.1 from GitHub

Location:
transdirect-shipping
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • transdirect-shipping/tags/8.0.1/includes/OrderSync.php

    r3347335 r3356427  
    239239    {
    240240        $apiDetails = $this->td_get_api_details(true);
    241         if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on' || $apiDetails->mode == 'no_display_mode')) {
     241        if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on') || (isset($apiDetails->mode) && $apiDetails->mode == 'no_display_mode')) {
    242242
    243243            $filters = [
     
    338338        $apiDetails = $this->td_get_api_details(true);
    339339
    340         if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on' || $apiDetails->mode == 'no_display_mode')) {
     340        if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on') || (isset($apiDetails->mode) && $apiDetails->mode == 'no_display_mode')) {
    341341            if (!wp_get_schedule('td_cron_order_sync')) {
    342342                wp_schedule_event(time(), '5mins', 'td_cron_order_sync');
  • transdirect-shipping/tags/8.0.1/includes/ProductSync.php

    r3347335 r3356427  
    9090                    }
    9191
    92                     if (count($data['products']) >= 10) {
     92                    if (!empty($data['products']) && is_array($data['products']) && count($data['products']) >= 10) {
    9393                        $this->send_to_api($data);
    9494                        $data = [];
  • transdirect-shipping/tags/8.0.1/includes/TransdirectShipping.php

    r3347335 r3356427  
    126126        $this->loader->add_filter('https_local_ssl_verify', $this, 'return_false');
    127127        $this->loader->add_filter('https_ssl_verify', $this, 'return_false');
    128         $this->loader->add_filter('woocommerce_shipping_methods', $this, 'woocommerce_transdirect_shipping');
     128        $this->loader->add_filter('woocommerce_shipping_methods', $this, 'woocommerce_transdirect_shipping', 10, 1);
    129129    }
    130130
     
    225225     * The class responsible for transdirect's woocommerce shipping integration.
    226226     */
    227     public function woocommerce_transdirect_shipping()
     227    public function woocommerce_transdirect_shipping($methods)
    228228    {
    229229        $methods['woocommerce_transdirect'] = WCTransdirectShipping::class;
  • transdirect-shipping/tags/8.0.1/includes/TransdirectShippingTrait.php

    r3347335 r3356427  
    1919        if ($init) {
    2020            $settings = $this->get_instance_settings();
    21             $apiKey = $settings->api_key;
    22             $timeout = $settings->timeout;
     21            $apiKey = isset($settings->api_key) ? $settings->api_key : '';
     22            $timeout = isset($settings->timeout) ? $settings->timeout : 30;
    2323            $api_array['timeout'] = $timeout;
    2424            $args = $this->td_request_method_headers($apiKey, $api_array, 'GET');
  • transdirect-shipping/tags/8.0.1/transdirect-shipping.php

    r3347335 r3356427  
    99 *
    1010 * @link              https://transdirect.com.au/
    11  * @since             8.0.0
     11 * @since             8.0.1
    1212 * @package           Transdirect_Shipping
    1313 *
     
    1616 * Plugin URI:        https://www.transdirect.com.au/e-commerce/woo-commerce/
    1717 * Description:       This plugin allows you to calculate shipping as per your delivery location.
    18  * Version:           8.0.0
     18 * Version:           8.0.1
    1919 * Author:            Transdirect
    2020 * Author URI:        https://transdirect.com.au/
     
    3535/**
    3636 * Currently plugin version.
    37  * Start at version 8.0.0 and use SemVer - https://semver.org
     37 * Start at version 8.0.1 and use SemVer - https://semver.org
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define('TRANSDIRECT_SHIPPING_VERSION', '8.0.0');
     40define('TRANSDIRECT_SHIPPING_VERSION', '8.0.1');
    4141
    4242/**
     
    233233*
    234234*/
    235 add_action('init', 'add_custom_shipping_zone_and_method');
     235register_activation_hook(__FILE__, 'add_custom_shipping_zone_and_method');
    236236function add_custom_shipping_zone_and_method() {
    237237    if (!class_exists('WC_Shipping_Zones') || !class_exists('WC_Shipping_Zone')) {
  • transdirect-shipping/trunk/includes/OrderSync.php

    r3347335 r3356427  
    239239    {
    240240        $apiDetails = $this->td_get_api_details(true);
    241         if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on' || $apiDetails->mode == 'no_display_mode')) {
     241        if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on') || (isset($apiDetails->mode) && $apiDetails->mode == 'no_display_mode')) {
    242242
    243243            $filters = [
     
    338338        $apiDetails = $this->td_get_api_details(true);
    339339
    340         if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on' || $apiDetails->mode == 'no_display_mode')) {
     340        if ((isset($apiDetails->enable_sync) && $apiDetails->enable_sync == 'on') || (isset($apiDetails->sync_all_order) && $apiDetails->sync_all_order == 'on') || (isset($apiDetails->mode) && $apiDetails->mode == 'no_display_mode')) {
    341341            if (!wp_get_schedule('td_cron_order_sync')) {
    342342                wp_schedule_event(time(), '5mins', 'td_cron_order_sync');
  • transdirect-shipping/trunk/includes/ProductSync.php

    r3347335 r3356427  
    9090                    }
    9191
    92                     if (count($data['products']) >= 10) {
     92                    if (!empty($data['products']) && is_array($data['products']) && count($data['products']) >= 10) {
    9393                        $this->send_to_api($data);
    9494                        $data = [];
  • transdirect-shipping/trunk/includes/TransdirectShipping.php

    r3347335 r3356427  
    126126        $this->loader->add_filter('https_local_ssl_verify', $this, 'return_false');
    127127        $this->loader->add_filter('https_ssl_verify', $this, 'return_false');
    128         $this->loader->add_filter('woocommerce_shipping_methods', $this, 'woocommerce_transdirect_shipping');
     128        $this->loader->add_filter('woocommerce_shipping_methods', $this, 'woocommerce_transdirect_shipping', 10, 1);
    129129    }
    130130
     
    225225     * The class responsible for transdirect's woocommerce shipping integration.
    226226     */
    227     public function woocommerce_transdirect_shipping()
     227    public function woocommerce_transdirect_shipping($methods)
    228228    {
    229229        $methods['woocommerce_transdirect'] = WCTransdirectShipping::class;
  • transdirect-shipping/trunk/includes/TransdirectShippingTrait.php

    r3347335 r3356427  
    1919        if ($init) {
    2020            $settings = $this->get_instance_settings();
    21             $apiKey = $settings->api_key;
    22             $timeout = $settings->timeout;
     21            $apiKey = isset($settings->api_key) ? $settings->api_key : '';
     22            $timeout = isset($settings->timeout) ? $settings->timeout : 30;
    2323            $api_array['timeout'] = $timeout;
    2424            $args = $this->td_request_method_headers($apiKey, $api_array, 'GET');
  • transdirect-shipping/trunk/transdirect-shipping.php

    r3347335 r3356427  
    99 *
    1010 * @link              https://transdirect.com.au/
    11  * @since             8.0.0
     11 * @since             8.0.1
    1212 * @package           Transdirect_Shipping
    1313 *
     
    1616 * Plugin URI:        https://www.transdirect.com.au/e-commerce/woo-commerce/
    1717 * Description:       This plugin allows you to calculate shipping as per your delivery location.
    18  * Version:           8.0.0
     18 * Version:           8.0.1
    1919 * Author:            Transdirect
    2020 * Author URI:        https://transdirect.com.au/
     
    3535/**
    3636 * Currently plugin version.
    37  * Start at version 8.0.0 and use SemVer - https://semver.org
     37 * Start at version 8.0.1 and use SemVer - https://semver.org
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define('TRANSDIRECT_SHIPPING_VERSION', '8.0.0');
     40define('TRANSDIRECT_SHIPPING_VERSION', '8.0.1');
    4141
    4242/**
     
    233233*
    234234*/
    235 add_action('init', 'add_custom_shipping_zone_and_method');
     235register_activation_hook(__FILE__, 'add_custom_shipping_zone_and_method');
    236236function add_custom_shipping_zone_and_method() {
    237237    if (!class_exists('WC_Shipping_Zones') || !class_exists('WC_Shipping_Zone')) {
Note: See TracChangeset for help on using the changeset viewer.