Plugin Directory

Changeset 3044915


Ignore:
Timestamp:
03/04/2024 10:37:48 AM (2 years ago)
Author:
postiwp
Message:

Update to version 2.5.0 from GitHub

Location:
posti-warehouse
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • posti-warehouse/tags/2.5.0/README.md

    r3037923 r3044915  
    9797
    9898## Version history
     99- 2.5.0:
     100    - Changed "Hide outdoor pickup points" option to support non-Posti pickup points.
     101    - Changed sorting in "Posti warehouse" to prefer Posti services.
     102    - Removed "Other" pickup point option.
     103    - "Verbose logging" setting moved to developer view.
    99104- 2.4.7: Changed product handling to strip HTML tags when sending product to warehouse.
    100105- 2.4.6:
     
    111116    - Changed number of log entries 50 -> 100.
    112117- 2.3.6: Support email update. WP banner update.
    113 - 2.3.4: Remove contract number field from settings page.
     118- 2.3.4: Removed contract number field from settings page.
    114119- 2.3.3: Bug fix: Settings link not shown when plugin is installed from shop.
    115120- 2.3.2: Limit "Hide outdoor pickup points" option to Posti pickup points.
  • posti-warehouse/tags/2.5.0/classes/class-api.php

    r3037923 r3044915  
    1414    private $last_status = false;
    1515    private $token_option = 'posti_wh_api_auth';
    16     private $user_agent = 'woo-wh-client/2.4.7';
     16    private $user_agent = 'woo-wh-client/2.5.0';
    1717
    1818    public function __construct(Posti_Warehouse_Logger $logger, array &$options) {
  • posti-warehouse/tags/2.5.0/classes/class-frontend.php

    r3031993 r3044915  
    552552            }
    553553
    554             $options_array['other'] = array(
    555                 'text' => Posti_Warehouse_Text::pickup_point_other(),
    556             );
    557 
    558554            return $options_array;
    559555        }
  • posti-warehouse/tags/2.5.0/classes/class-settings.php

    r3037801 r3044915  
    321321            [
    322322                'label_for' => 'posti_wh_field_verbose_logging',
    323                 'class' => 'posti_wh_row',
     323                'class' => $developer_fields_class,
    324324                'posti_wh_custom_data' => 'custom',
    325325            ]
  • posti-warehouse/tags/2.5.0/classes/class-shipping.php

    r3031993 r3044915  
    217217                                                                        <?php echo esc_html(Posti_Warehouse_Text::pickup_points_title()); ?>
    218218                                                            </label>
    219                                                             <?php if (substr($service_name, 0, strlen('Posti:')) === 'Posti:'): ?>
    220                                                                 <div id="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints][options]'; ?>">
    221                                                                     <label> -
    222                                                                         <input type="checkbox"
    223                                                                                 name="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints_hideoutdoors]'; ?>"
    224                                                                                 value="yes" <?php echo ( ( !empty($values[$method_id][$service_id]['pickuppoints_hideoutdoors']) && 'yes' === $values[$method_id][$service_id]['pickuppoints_hideoutdoors'] )) ? 'checked' : ''; ?>>
    225                                                                                 <?php echo esc_html(Posti_Warehouse_Text::pickup_points_hide_outdoor()); ?>
    226                                                                     </label>
    227                                                                 </div>
    228                                                             <?php endif; ?>
     219                                                            <div id="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints][options]'; ?>">
     220                                                                <label> -
     221                                                                    <input type="checkbox"
     222                                                                            name="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints_hideoutdoors]'; ?>"
     223                                                                            value="yes" <?php echo ( ( !empty($values[$method_id][$service_id]['pickuppoints_hideoutdoors']) && 'yes' === $values[$method_id][$service_id]['pickuppoints_hideoutdoors'] )) ? 'checked' : ''; ?>>
     224                                                                            <?php echo esc_html(Posti_Warehouse_Text::pickup_points_hide_outdoor()); ?>
     225                                                                </label>
     226                                                            </div>
    229227                                                        </p>
    230228                                                    </div>
     
    294292                foreach ($all_shipping_methods as $shipping_method) {
    295293                    $value = isset($shipping_method->description[$user_lang]) ? $shipping_method->description[$user_lang] : $shipping_method->description['en'];
    296                     $services[strval($shipping_method->id)] = sprintf('%1$s: %2$s', $shipping_method->deliveryOperator, $value); // note: condition on $service_name starting with 'Posti:'
    297                 }
    298 
    299                 ksort($services);
     294                    $services[strval($shipping_method->id)] = sprintf('%1$s: %2$s', $shipping_method->deliveryOperator, $value);
     295                }
     296
     297                uasort($services, function ($a, $b) {
     298                    $pa = substr($a, 0, 6) === 'Posti:';
     299                    $ba = substr($b, 0, 6) === 'Posti:';
     300                    if ($pa && $ba) {
     301                        return strnatcmp($a, $b);
     302                    }
     303                    elseif ($pa) {
     304                        return -1;
     305                    }
     306                    elseif ($ba) {
     307                        return 1;
     308                    }
     309
     310                    return strnatcmp($a, $b);
     311                });
    300312
    301313                return $services;
  • posti-warehouse/tags/2.5.0/classes/class-text.php

    r3035680 r3044915  
    4747    public static function pickup_point_select() {
    4848        return __('Select a pickup point', 'posti-warehouse');
    49     }
    50    
    51     public static function pickup_point_other() {
    52         return __('Other', 'posti-warehouse');
    5349    }
    5450   
  • posti-warehouse/tags/2.5.0/posti-warehouse.php

    r3037923 r3044915  
    33/**
    44 * Plugin Name: Posti Warehouse
    5  * Version: 2.4.7
     5 * Version: 2.5.0
    66 * Description: Provides integration to Posti warehouse and dropshipping services.
    77 * Author: Posti
  • posti-warehouse/tags/2.5.0/readme.txt

    r3037923 r3044915  
    55Tested up to: 6.4.3
    66Requires PHP: 7.1
    7 Stable tag: 2.4.7
     7Stable tag: 2.5.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
  • posti-warehouse/trunk/README.md

    r3037923 r3044915  
    9797
    9898## Version history
     99- 2.5.0:
     100    - Changed "Hide outdoor pickup points" option to support non-Posti pickup points.
     101    - Changed sorting in "Posti warehouse" to prefer Posti services.
     102    - Removed "Other" pickup point option.
     103    - "Verbose logging" setting moved to developer view.
    99104- 2.4.7: Changed product handling to strip HTML tags when sending product to warehouse.
    100105- 2.4.6:
     
    111116    - Changed number of log entries 50 -> 100.
    112117- 2.3.6: Support email update. WP banner update.
    113 - 2.3.4: Remove contract number field from settings page.
     118- 2.3.4: Removed contract number field from settings page.
    114119- 2.3.3: Bug fix: Settings link not shown when plugin is installed from shop.
    115120- 2.3.2: Limit "Hide outdoor pickup points" option to Posti pickup points.
  • posti-warehouse/trunk/classes/class-api.php

    r3037923 r3044915  
    1414    private $last_status = false;
    1515    private $token_option = 'posti_wh_api_auth';
    16     private $user_agent = 'woo-wh-client/2.4.7';
     16    private $user_agent = 'woo-wh-client/2.5.0';
    1717
    1818    public function __construct(Posti_Warehouse_Logger $logger, array &$options) {
  • posti-warehouse/trunk/classes/class-frontend.php

    r3031993 r3044915  
    552552            }
    553553
    554             $options_array['other'] = array(
    555                 'text' => Posti_Warehouse_Text::pickup_point_other(),
    556             );
    557 
    558554            return $options_array;
    559555        }
  • posti-warehouse/trunk/classes/class-settings.php

    r3037801 r3044915  
    321321            [
    322322                'label_for' => 'posti_wh_field_verbose_logging',
    323                 'class' => 'posti_wh_row',
     323                'class' => $developer_fields_class,
    324324                'posti_wh_custom_data' => 'custom',
    325325            ]
  • posti-warehouse/trunk/classes/class-shipping.php

    r3031993 r3044915  
    217217                                                                        <?php echo esc_html(Posti_Warehouse_Text::pickup_points_title()); ?>
    218218                                                            </label>
    219                                                             <?php if (substr($service_name, 0, strlen('Posti:')) === 'Posti:'): ?>
    220                                                                 <div id="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints][options]'; ?>">
    221                                                                     <label> -
    222                                                                         <input type="checkbox"
    223                                                                                 name="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints_hideoutdoors]'; ?>"
    224                                                                                 value="yes" <?php echo ( ( !empty($values[$method_id][$service_id]['pickuppoints_hideoutdoors']) && 'yes' === $values[$method_id][$service_id]['pickuppoints_hideoutdoors'] )) ? 'checked' : ''; ?>>
    225                                                                                 <?php echo esc_html(Posti_Warehouse_Text::pickup_points_hide_outdoor()); ?>
    226                                                                     </label>
    227                                                                 </div>
    228                                                             <?php endif; ?>
     219                                                            <div id="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints][options]'; ?>">
     220                                                                <label> -
     221                                                                    <input type="checkbox"
     222                                                                            name="<?php echo esc_html($field_key) . '[' . esc_attr($method_id) . '][' . esc_attr($service_id) . '][pickuppoints_hideoutdoors]'; ?>"
     223                                                                            value="yes" <?php echo ( ( !empty($values[$method_id][$service_id]['pickuppoints_hideoutdoors']) && 'yes' === $values[$method_id][$service_id]['pickuppoints_hideoutdoors'] )) ? 'checked' : ''; ?>>
     224                                                                            <?php echo esc_html(Posti_Warehouse_Text::pickup_points_hide_outdoor()); ?>
     225                                                                </label>
     226                                                            </div>
    229227                                                        </p>
    230228                                                    </div>
     
    294292                foreach ($all_shipping_methods as $shipping_method) {
    295293                    $value = isset($shipping_method->description[$user_lang]) ? $shipping_method->description[$user_lang] : $shipping_method->description['en'];
    296                     $services[strval($shipping_method->id)] = sprintf('%1$s: %2$s', $shipping_method->deliveryOperator, $value); // note: condition on $service_name starting with 'Posti:'
    297                 }
    298 
    299                 ksort($services);
     294                    $services[strval($shipping_method->id)] = sprintf('%1$s: %2$s', $shipping_method->deliveryOperator, $value);
     295                }
     296
     297                uasort($services, function ($a, $b) {
     298                    $pa = substr($a, 0, 6) === 'Posti:';
     299                    $ba = substr($b, 0, 6) === 'Posti:';
     300                    if ($pa && $ba) {
     301                        return strnatcmp($a, $b);
     302                    }
     303                    elseif ($pa) {
     304                        return -1;
     305                    }
     306                    elseif ($ba) {
     307                        return 1;
     308                    }
     309
     310                    return strnatcmp($a, $b);
     311                });
    300312
    301313                return $services;
  • posti-warehouse/trunk/classes/class-text.php

    r3035680 r3044915  
    4747    public static function pickup_point_select() {
    4848        return __('Select a pickup point', 'posti-warehouse');
    49     }
    50    
    51     public static function pickup_point_other() {
    52         return __('Other', 'posti-warehouse');
    5349    }
    5450   
  • posti-warehouse/trunk/posti-warehouse.php

    r3037923 r3044915  
    33/**
    44 * Plugin Name: Posti Warehouse
    5  * Version: 2.4.7
     5 * Version: 2.5.0
    66 * Description: Provides integration to Posti warehouse and dropshipping services.
    77 * Author: Posti
  • posti-warehouse/trunk/readme.txt

    r3037923 r3044915  
    55Tested up to: 6.4.3
    66Requires PHP: 7.1
    7 Stable tag: 2.4.7
     7Stable tag: 2.5.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset for help on using the changeset viewer.