Plugin Directory

Changeset 3479759


Ignore:
Timestamp:
03/11/2026 07:03:12 AM (3 weeks ago)
Author:
enituretechnology
Message:

5.3.8 - 2026-03-11

  • Update: Added product-level offset days functionality to allow more granular shipment timing control.
  • Update: Added Quote Information Preference setting to control whether quote information is recorded and displayed in the Additional Order Details widget.
  • Fix: Resolved Broken Access Control vulnerability to improve overall plugin security.

Ticket 23708293437

Location:
small-package-quotes-wwe-edition
Files:
6 deleted
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • small-package-quotes-wwe-edition/tags/5.3.8/carrier_service.php

    r3390867 r3479759  
    127127                if ($wwe_small_delivery_estimates == 'delivery_days' || $wwe_small_delivery_estimates == 'delivery_date') {
    128128                    $orderCutoffTime = get_option('wwe_small_orderCutoffTime');
    129                     $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays');
     129
     130                    // Use product-level fulfillment offset days if available, otherwise use global setting
     131                    if (isset($package['max_fulfillment_offset_days']) && is_numeric($package['max_fulfillment_offset_days']) && $package['max_fulfillment_offset_days'] > 0) {
     132                        $shipmentOffsetDays = $package['max_fulfillment_offset_days'];
     133                    } else {
     134                        $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays');
     135                    }
     136
    130137                    $modifyShipmentDateTime = ($orderCutoffTime != '' || $shipmentOffsetDays != '' || (is_array($shipmentWeekDays) && count($shipmentWeekDays) > 0)) ? 1 : 0;
    131138                    $storeDateTime = gmdate('Y-m-d H:i:s', current_time('timestamp'));
     
    10061013
    10071014        $cachable_data['modifyShipmentDateTime'] = $request_data['modifyShipmentDateTime'];
     1015        $cachable_data['OrderCutoffTime'] = $request_data['OrderCutoffTime'];
     1016        $cachable_data['shipmentOffsetDays'] = $request_data['shipmentOffsetDays'];
     1017        $cachable_data['shipmentWeekDays'] = $request_data['shipmentWeekDays'];
    10081018        $cachable_data['residentials_delivery'] = $request_data['residentials_delivery'];
    10091019        $cachable_data['residentials_pickup'] = $request_data['residentials_pickup'];
     
    10191029            $cachable_data['addressLine2'] = (isset($request_data['addressLine2'])) ? $request_data['addressLine2'] : '';
    10201030            $cachable_data['defaultRADAddressType'] = $request_data['defaultRADAddressType'];
     1031            $cachable_data['defaultRADWithoutStreetAddress'] = isset($request_data['defaultRADWithoutStreetAddress']) ? $request_data['defaultRADWithoutStreetAddress'] : '';
    10211032            $cachable_data['poboxAddressValidation'] = $request_data['poboxAddressValidation'];
    10221033        }
  • small-package-quotes-wwe-edition/tags/5.3.8/css/small_packges_style.css

    r3430551 r3479759  
    725725.woocommerce_variable_attributes.wc-metabox-content [class^="_nmfc_number"],
    726726.woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"],
     727.woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"],
    727728.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"],
    728729.woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"],
     
    748749.woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"],
    749750.woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"],
     751.woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"],
    750752.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"],
    751753.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedDimension"],
     
    757759.woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_flat_rate_price"] span.woocommerce-help-tip,
    758760.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_en_product_markup"] span.woocommerce-help-tip,
     761.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_eniture_product_level_fulfillment_offset_days"] span.woocommerce-help-tip,
    759762.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedPercentage"] span.woocommerce-help-tip,
    760763.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedDimension"] span.woocommerce-help-tip,
  • small-package-quotes-wwe-edition/tags/5.3.8/group_small_shipment.php

    r3430551 r3479759  
    3333    public $destination_Address_wwe_spq;
    3434    public $origin = [];
     35    private $parent_nesting_enabled = false;
    3536
    3637    /**
     
    189190                $ptype = $this->wwe_small_check_product_type($freight_enable_class, $exceedWeight, $product_weight, $en_multiple_package);
    190191                $insurance = $this->en_insurance_checked($values, $_product);
    191                 $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $product_id, $values['quantity'], $product_price);
     192                $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $values['product_id'], $values['quantity'], $product_price);
     193                $product_level_fulfillment_offset = $this->wwe_small_get_product_level_fulfillment_offset_days($_product, $values['variation_id'], $values['product_id']);
    192194                $locationId = (isset($origin_address['locationId'])) ? $origin_address['locationId'] : 0;
    193195                $locationZip = (isset($origin_address['zip'])) ? $origin_address['zip'] : '';
     
    227229                if (!empty($origin_address) && ($product_weight <= $weight_threshold || $en_multiple_package == 'yes')) {
    228230                    // Nested Material
     231                    $this->parent_nesting_enabled = false;
    229232                    $nested_material = $this->en_nested_material($values, $_product);
    230233                    if ($nested_material == "yes") {
     
    241244                    $hm_status = (!is_array($hm_plan) && $hazardous_material == 'yes') ? TRUE : FALSE;
    242245
    243                     $product_title = str_replace(array("'", '"', '’'), '', $_product->get_title());
     246                    $product_title = str_replace(array("'", '"', '’'), '', $_product->get_name());
    244247
    245248                    // Shippable handling units
     
    291294                            'product_quantity' => $product_quantity,
    292295                            'product_price' => $product_price,
     296                            'fulfillment_offset_days' => $product_level_fulfillment_offset,
    293297                        );
    294298
     
    340344                            $sm_package[$locationId]['product_prices'] = (floatval($_product->get_price()) * floatval($values['quantity']));
    341345                        }
     346
     347                         // Track maximum fulfillment offset days
     348                        if (is_numeric($product_level_fulfillment_offset) && $product_level_fulfillment_offset > 0) {
     349                            if (!isset($sm_package[$locationId]['max_fulfillment_offset_days']) || $product_level_fulfillment_offset > $sm_package[$locationId]['max_fulfillment_offset_days']) {
     350                                $sm_package[$locationId]['max_fulfillment_offset_days'] = $product_level_fulfillment_offset;
     351                            }
     352                        }
    342353                    }
    343354
     
    401412
    402413            // Micro Warehouse
    403             $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes');
    404             $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small');
     414            if (!empty($this->dropship_location_array)) {
     415                $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes');
     416                $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small');
     417            }
     418           
    405419            do_action("eniture_debug_mood", "Product Detail (s)", $sm_package);
    406420            return $sm_package;
    407421        }
     422       
    408423        return false;
    409424    }
     
    563578            $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id();
    564579            $nested_material = get_post_meta($post_id, '_nestedMaterials', true);
     580            $this->parent_nesting_enabled = true;
    565581        }
    566582
     
    664680            $post_id = isset($values['product_id']) ? $values['product_id'] : $post_id;
    665681            $enable_dropship = get_post_meta($post_id, '_enable_dropship', true);
     682            $post_id = empty($enable_dropship) ? $values['variation_id'] : $post_id;
    666683        }
    667684
     
    923940
    924941        // check property in parent
    925         if (isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled)) {
     942        if ($this->parent_nesting_enabled || (isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled))) {
    926943            $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id();
    927944            $property_enabled = get_post_meta($post_id, $property_key, true);
     
    930947        return $property_enabled;
    931948    }
     949
     950    function wwe_small_get_product_level_fulfillment_offset_days($_product, $variation_id, $product_id)
     951    {
     952        $fulfillment_offset_days = '';
     953        $field_name = '_eniture_product_level_fulfillment_offset_days';
     954
     955        if ($_product->get_type() == 'variation' && $variation_id > 0) {
     956            $fulfillment_offset_days = get_post_meta($variation_id, $field_name, true);
     957
     958            if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) {
     959                $parent_id = $_product->get_parent_id();
     960                if ($parent_id > 0) {
     961                    $fulfillment_offset_days = get_post_meta($parent_id, $field_name, true);
     962                }
     963            }
     964        } else {
     965            $fulfillment_offset_days = get_post_meta($_product->get_id(), $field_name, true);
     966        }
     967
     968        if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) {
     969            $fulfillment_offset_days = get_post_meta($product_id, $field_name, true);
     970        }
     971
     972        // Validate and sanitize the value before returning
     973        if (is_numeric($fulfillment_offset_days)) {
     974            $value = intval($fulfillment_offset_days);
     975            return $value;
     976        }
     977
     978        // Return empty string if invalid
     979        return '';
     980    }
    932981}
  • small-package-quotes-wwe-edition/tags/5.3.8/js/en-speedship.js

    r3393484 r3479759  
    439439        if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays < 1) {
    440440
    441             jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Days should not be less than 1.</p></div>');
     441            jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be greater than or equal to 1.</p></div>');
    442442            jQuery('html, body').animate({
    443443                'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top
     
    446446            return false
    447447        }
    448         if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 8) {
    449 
    450             jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Days should be less than or equal to 8.</p></div>');
     448        if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 20) {
     449
     450            jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be less than or equal to 20.</p></div>');
    451451            jQuery('html, body').animate({
    452452                'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top
     
    456456        }
    457457
    458         var numberOnlyRegex = /^[0-9]+$/;
    459 
     458        const numberOnlyRegex = /^[0-9]+$/;
    460459        if (wwe_small_shipmentOffsetDays != "" && !numberOnlyRegex.test(wwe_small_shipmentOffsetDays)) {
    461460
    462             jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Entered Days are not valid.</p></div>');
     461            jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be a number.</p></div>');
    463462            jQuery('html, body').animate({
    464463                'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top
  • small-package-quotes-wwe-edition/tags/5.3.8/product/en-product-detail.php

    r3244589 r3479759  
    191191                ],
    192192                [
     193                    'type' => 'input_field',
     194                    'input_type' => 'number',
     195                    'id' => '_eniture_product_level_fulfillment_offset_days',
     196                    'class' => '_eniture_product_level_fulfillment_offset_days short',
     197                    'label' => __( 'Fulfillment Offset Days', 'woocommerce' ),
     198                    'placeholder' => 'Fulfillment offset days, e.g. 2',
     199                    'description' => "The number of days the ship date needs to be moved to allow for the processing of the order. If set, this will override the global Fulfillment Offset Days setting for this product.",
     200                    'custom_attributes' => [
     201                        'min' => '1',
     202                        'max' => '20',
     203                        'step' => '1',
     204                        'title' => 'Value must be greater than or equal to 1 and less than or equal to 20',
     205                        'oninvalid' => "this.setCustomValidity(this.validity.rangeUnderflow ? 'Value must be greater than or equal to 1' : this.validity.rangeOverflow ? 'Value must be less than or equal to 20' : '')",
     206                        'oninput' => "this.setCustomValidity('')"
     207                    ]
     208                ],
     209                [
    193210                    'type' => 'checkbox',
    194211                    'id' => '_hazardousmaterials',
     
    309326            }
    310327
     328            // Add input type if specified (e.g., 'number')
     329            if (isset($custom_field['input_type'])) {
     330                $custom_input_field['type'] = $custom_field['input_type'];
     331            }
     332
     333            // Add custom attributes if specified (e.g., min, max, step)
     334            if (isset($custom_field['custom_attributes'])) {
     335                $custom_input_field['custom_attributes'] = $custom_field['custom_attributes'];
     336            }
     337
    311338            woocommerce_wp_text_input($custom_input_field);
    312339        }
     
    377404                    $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : '';
    378405                    $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field(wp_unslash($_POST[$custom_field][$postId])) : '';
     406
     407                    if ($custom_field == '_dropship_location') {
     408                        $en_updated_product = maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product);
     409                    } elseif ($custom_field == '_eniture_product_level_fulfillment_offset_days') {
     410                        $en_updated_product = $this->sanitize_fulfillment_offset_days($en_updated_product);
     411                    } else {
     412                        $en_updated_product = esc_attr($en_updated_product);
     413                    }
     414                   
    379415                    update_post_meta($postId, $custom_field, $en_updated_product);
    380416                }
    381417            }
     418        }
     419
     420        private function sanitize_fulfillment_offset_days($value)
     421        {
     422            $value = trim($value);
     423            if ($value === '' || $value === null) return '';
     424
     425            $value = preg_replace('/[^0-9.-]/', '', $value);
     426            if (!is_numeric($value)) return '';
     427
     428            $value = intval(floor(floatval($value)));
     429            return $value < 0 ? '' : strval($value);
    382430        }
    383431
  • small-package-quotes-wwe-edition/tags/5.3.8/readme.txt

    r3472383 r3479759  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 5.3.7
     6Stable tag: 5.3.8
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    142142== Changelog ==
    143143
    144 = 5.3.7 - 2026-03-02 =
    145 * Fix: Resolved JS files minification conflict with the WP Rocket plugin to ensure compatibility with asset optimization.
     144= 5.3.8 - 2026-03-11 =
     145* Update: Added product-level offset days functionality to allow more granular shipment timing control.
     146* Update: Added Quote Information Preference setting to control whether quote information is recorded and displayed in the Additional Order Details widget.
     147* Fix: Resolved Broken Access Control vulnerability to improve overall plugin security.
    146148
    147149= 5.3.6 - 2026-01-01 =
  • small-package-quotes-wwe-edition/tags/5.3.8/small_packages_shipping_class.php

    r3430551 r3479759  
    563563                // apply minimum shipping charge shipping rules (Cart level) and get updated rates
    564564                $en_rates = $this->get_updated_rates($sm_package, $en_rates, $en_is_shipment);
     565                $save_order_meta_data = get_option('wwe_small_quote_information_preference');
     566                $save_packaging_data = get_option('box_sizing_packaging_solution_preference');
    565567
    566568                foreach ($en_rates as $accessorial => $rate) {
     
    597599                        // Images for FDO
    598600                        $rate['meta_data']['en_fdo_image_urls'] = wp_json_encode($image_urls);
     601
     602                         // Remove meta data and packaging data if not required
     603                        if ($save_order_meta_data == 'no') unset($rate['meta_data']['en_fdo_meta_data']);
     604                        if ($save_packaging_data == 'no') unset($rate['meta_data']['bin_packaging']);
    599605                    }
    600606
  • small-package-quotes-wwe-edition/tags/5.3.8/small_packages_tab_class_woocommrece.php

    r3393484 r3479759  
    464464                        'id' => 'shipping_methods_do_not_sort_by_price'
    465465                    ),
     466                     'wwe_small_quote_information_preference' => array(
     467                        'name' => __('Quote Information Preference', 'woocommerce-settings-fedex_small_quotes'),
     468                        'type' => 'radio',
     469                        'default' => 'yes',
     470                        'id' => 'wwe_small_quote_information_preference',
     471                        'options' => array(
     472                            'yes' => __('Record it in the Additional Order Details widget. (Default)', 'woocommerce-settings-fedex_small_quotes'),
     473                            'no' => __('Don\'t record it in the Additional Order Details widget.', 'woocommerce-settings-fedex_small_quotes'),
     474                        ),
     475                    ),
    466476
    467477                    // Package rating method when Standard Box Sizes isn't in use
     
    516526                    ),
    517527                    'shipmentOffsetDays_wwe_small' => array(
    518                         'name' => __('Fulfilment Offset Days ', 'small-package-quotes-wwe-edition'),
    519                         'type' => 'text',
    520                         'desc' => 'The number of days the ship date needs to be moved to allow the processing of the order.',
    521                         'placeholder' => 'Fulfilment Offset Days, e.g. 2',
     528                        'name' => __('Fulfillment Offset Days ', 'small-package-quotes-wwe-edition'),
     529                        'type' => 'text',
     530                        'desc' => 'The number of days the ship date needs to be moved to allow for the processing of the order.',
     531                        'placeholder' => 'Fulfillment Offset Days, e.g. 2',
    522532                        'id' => 'wwe_small_shipmentOffsetDays',
    523533                        'class' => $disable_cot_sdo,
  • small-package-quotes-wwe-edition/tags/5.3.8/update-plan.php

    r3313674 r3479759  
    2727            $plugin_info = get_plugins();
    2828            $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : '';
    29 
    3029            $domain = eniture_wwe_small_get_domain();
    31             $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    3230
    3331            $post_data = array(
     
    3533                'carrier' => '2',
    3634                'store_url' => $domain,
    37                 'webhook_url' => $plugin_dir_url,
     35                'webhook_url' => '',
    3836                'plugin_version' => $plugin_version,
    3937            );
     
    7876        $plugin_info = get_plugins();
    7977        $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : '';
    80 
    8178        $domain = eniture_wwe_small_get_domain();
    82         $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    8379
    8480        $post_data = array(
     
    8682            'carrier' => '2',
    8783            'store_url' => $domain,
    88             'webhook_url' => $plugin_dir_url,
     84            'webhook_url' => '',
    8985            'plugin_version' => $plugin_version,
    9086        );
  • small-package-quotes-wwe-edition/tags/5.3.8/woocommerceShip.php

    r3472383 r3479759  
    66  Author: Eniture Technology
    77  Author URI: https://eniture.com/
    8   Version: 5.3.7
     8  Version: 5.3.8
    99  Text Domain: small-package-quotes-wwe-edition
    10   License: GPLv2 or later
    11   Requires Plugins: woocommerce
     10  License: GPL-2.0-or-later
    1211 */
    1312/*
     
    161160{
    162161    wp_enqueue_script('jquery');
    163     wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1.7');
     162    wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1.8');
    164163    wp_localize_script('en_speedship_script', 'en_speedship_admin_script', array(
    165164        'plugins_url' => plugins_url(),
     
    231230function eniture_wwe_smpkg_admin_script()
    232231{
    233     wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2.7');
     232    wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2.8');
    234233    wp_enqueue_style('small_packges_style');
    235234
  • small-package-quotes-wwe-edition/trunk/carrier_service.php

    r3390867 r3479759  
    127127                if ($wwe_small_delivery_estimates == 'delivery_days' || $wwe_small_delivery_estimates == 'delivery_date') {
    128128                    $orderCutoffTime = get_option('wwe_small_orderCutoffTime');
    129                     $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays');
     129
     130                    // Use product-level fulfillment offset days if available, otherwise use global setting
     131                    if (isset($package['max_fulfillment_offset_days']) && is_numeric($package['max_fulfillment_offset_days']) && $package['max_fulfillment_offset_days'] > 0) {
     132                        $shipmentOffsetDays = $package['max_fulfillment_offset_days'];
     133                    } else {
     134                        $shipmentOffsetDays = get_option('wwe_small_shipmentOffsetDays');
     135                    }
     136
    130137                    $modifyShipmentDateTime = ($orderCutoffTime != '' || $shipmentOffsetDays != '' || (is_array($shipmentWeekDays) && count($shipmentWeekDays) > 0)) ? 1 : 0;
    131138                    $storeDateTime = gmdate('Y-m-d H:i:s', current_time('timestamp'));
     
    10061013
    10071014        $cachable_data['modifyShipmentDateTime'] = $request_data['modifyShipmentDateTime'];
     1015        $cachable_data['OrderCutoffTime'] = $request_data['OrderCutoffTime'];
     1016        $cachable_data['shipmentOffsetDays'] = $request_data['shipmentOffsetDays'];
     1017        $cachable_data['shipmentWeekDays'] = $request_data['shipmentWeekDays'];
    10081018        $cachable_data['residentials_delivery'] = $request_data['residentials_delivery'];
    10091019        $cachable_data['residentials_pickup'] = $request_data['residentials_pickup'];
     
    10191029            $cachable_data['addressLine2'] = (isset($request_data['addressLine2'])) ? $request_data['addressLine2'] : '';
    10201030            $cachable_data['defaultRADAddressType'] = $request_data['defaultRADAddressType'];
     1031            $cachable_data['defaultRADWithoutStreetAddress'] = isset($request_data['defaultRADWithoutStreetAddress']) ? $request_data['defaultRADWithoutStreetAddress'] : '';
    10211032            $cachable_data['poboxAddressValidation'] = $request_data['poboxAddressValidation'];
    10221033        }
  • small-package-quotes-wwe-edition/trunk/css/small_packges_style.css

    r3430551 r3479759  
    725725.woocommerce_variable_attributes.wc-metabox-content [class^="_nmfc_number"],
    726726.woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"],
     727.woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"],
    727728.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"],
    728729.woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"],
     
    748749.woocommerce_variable_attributes.wc-metabox-content [class^="en_flat_rate_price"],
    749750.woocommerce_variable_attributes.wc-metabox-content [class^="_en_product_markup"],
     751.woocommerce_variable_attributes.wc-metabox-content [class^="_eniture_product_level_fulfillment_offset_days"],
    750752.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedPercentage"],
    751753.woocommerce_variable_attributes.wc-metabox-content [class^="_nestedDimension"],
     
    757759.woocommerce_variable_attributes.wc-metabox-content .data p[class*="en_flat_rate_price"] span.woocommerce-help-tip,
    758760.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_en_product_markup"] span.woocommerce-help-tip,
     761.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_eniture_product_level_fulfillment_offset_days"] span.woocommerce-help-tip,
    759762.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedPercentage"] span.woocommerce-help-tip,
    760763.woocommerce_variable_attributes.wc-metabox-content .data p[class*="_nestedDimension"] span.woocommerce-help-tip,
  • small-package-quotes-wwe-edition/trunk/group_small_shipment.php

    r3430551 r3479759  
    3333    public $destination_Address_wwe_spq;
    3434    public $origin = [];
     35    private $parent_nesting_enabled = false;
    3536
    3637    /**
     
    189190                $ptype = $this->wwe_small_check_product_type($freight_enable_class, $exceedWeight, $product_weight, $en_multiple_package);
    190191                $insurance = $this->en_insurance_checked($values, $_product);
    191                 $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $product_id, $values['quantity'], $product_price);
     192                $product_level_markup = $this->wwe_small_get_product_level_markup($_product, $values['variation_id'], $values['product_id'], $values['quantity'], $product_price);
     193                $product_level_fulfillment_offset = $this->wwe_small_get_product_level_fulfillment_offset_days($_product, $values['variation_id'], $values['product_id']);
    192194                $locationId = (isset($origin_address['locationId'])) ? $origin_address['locationId'] : 0;
    193195                $locationZip = (isset($origin_address['zip'])) ? $origin_address['zip'] : '';
     
    227229                if (!empty($origin_address) && ($product_weight <= $weight_threshold || $en_multiple_package == 'yes')) {
    228230                    // Nested Material
     231                    $this->parent_nesting_enabled = false;
    229232                    $nested_material = $this->en_nested_material($values, $_product);
    230233                    if ($nested_material == "yes") {
     
    241244                    $hm_status = (!is_array($hm_plan) && $hazardous_material == 'yes') ? TRUE : FALSE;
    242245
    243                     $product_title = str_replace(array("'", '"', '’'), '', $_product->get_title());
     246                    $product_title = str_replace(array("'", '"', '’'), '', $_product->get_name());
    244247
    245248                    // Shippable handling units
     
    291294                            'product_quantity' => $product_quantity,
    292295                            'product_price' => $product_price,
     296                            'fulfillment_offset_days' => $product_level_fulfillment_offset,
    293297                        );
    294298
     
    340344                            $sm_package[$locationId]['product_prices'] = (floatval($_product->get_price()) * floatval($values['quantity']));
    341345                        }
     346
     347                         // Track maximum fulfillment offset days
     348                        if (is_numeric($product_level_fulfillment_offset) && $product_level_fulfillment_offset > 0) {
     349                            if (!isset($sm_package[$locationId]['max_fulfillment_offset_days']) || $product_level_fulfillment_offset > $sm_package[$locationId]['max_fulfillment_offset_days']) {
     350                                $sm_package[$locationId]['max_fulfillment_offset_days'] = $product_level_fulfillment_offset;
     351                            }
     352                        }
    342353                    }
    343354
     
    401412
    402413            // Micro Warehouse
    403             $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes');
    404             $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small');
     414            if (!empty($this->dropship_location_array)) {
     415                $eniureLicenceKey = get_option('wc_settings_plugin_licence_key_wwe_small_packages_quotes');
     416                $sm_package = apply_filters('en_micro_warehouse', $sm_package, $this->products, $this->dropship_location_array, $this->destination_Address_wwe_spq, $this->origin, $smallPluginExist, $items, $items_shipment, $this->warehouse_products, $eniureLicenceKey, 'small');
     417            }
     418           
    405419            do_action("eniture_debug_mood", "Product Detail (s)", $sm_package);
    406420            return $sm_package;
    407421        }
     422       
    408423        return false;
    409424    }
     
    563578            $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id();
    564579            $nested_material = get_post_meta($post_id, '_nestedMaterials', true);
     580            $this->parent_nesting_enabled = true;
    565581        }
    566582
     
    664680            $post_id = isset($values['product_id']) ? $values['product_id'] : $post_id;
    665681            $enable_dropship = get_post_meta($post_id, '_enable_dropship', true);
     682            $post_id = empty($enable_dropship) ? $values['variation_id'] : $post_id;
    666683        }
    667684
     
    923940
    924941        // check property in parent
    925         if (isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled)) {
     942        if ($this->parent_nesting_enabled || (isset($values['variation_id']) && $values['variation_id'] > 0 && empty($property_enabled))) {
    926943            $post_id = isset($values['product_id']) ? $values['product_id'] : $_product->get_parent_id();
    927944            $property_enabled = get_post_meta($post_id, $property_key, true);
     
    930947        return $property_enabled;
    931948    }
     949
     950    function wwe_small_get_product_level_fulfillment_offset_days($_product, $variation_id, $product_id)
     951    {
     952        $fulfillment_offset_days = '';
     953        $field_name = '_eniture_product_level_fulfillment_offset_days';
     954
     955        if ($_product->get_type() == 'variation' && $variation_id > 0) {
     956            $fulfillment_offset_days = get_post_meta($variation_id, $field_name, true);
     957
     958            if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) {
     959                $parent_id = $_product->get_parent_id();
     960                if ($parent_id > 0) {
     961                    $fulfillment_offset_days = get_post_meta($parent_id, $field_name, true);
     962                }
     963            }
     964        } else {
     965            $fulfillment_offset_days = get_post_meta($_product->get_id(), $field_name, true);
     966        }
     967
     968        if (empty($fulfillment_offset_days) || !is_numeric($fulfillment_offset_days)) {
     969            $fulfillment_offset_days = get_post_meta($product_id, $field_name, true);
     970        }
     971
     972        // Validate and sanitize the value before returning
     973        if (is_numeric($fulfillment_offset_days)) {
     974            $value = intval($fulfillment_offset_days);
     975            return $value;
     976        }
     977
     978        // Return empty string if invalid
     979        return '';
     980    }
    932981}
  • small-package-quotes-wwe-edition/trunk/js/en-speedship.js

    r3393484 r3479759  
    439439        if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays < 1) {
    440440
    441             jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Days should not be less than 1.</p></div>');
     441            jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be greater than or equal to 1.</p></div>');
    442442            jQuery('html, body').animate({
    443443                'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top
     
    446446            return false
    447447        }
    448         if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 8) {
    449 
    450             jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Days should be less than or equal to 8.</p></div>');
     448        if (wwe_small_shipmentOffsetDays != "" && wwe_small_shipmentOffsetDays > 20) {
     449
     450            jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be less than or equal to 20.</p></div>');
    451451            jQuery('html, body').animate({
    452452                'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top
     
    456456        }
    457457
    458         var numberOnlyRegex = /^[0-9]+$/;
    459 
     458        const numberOnlyRegex = /^[0-9]+$/;
    460459        if (wwe_small_shipmentOffsetDays != "" && !numberOnlyRegex.test(wwe_small_shipmentOffsetDays)) {
    461460
    462             jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Entered Days are not valid.</p></div>');
     461            jQuery("#mainform .quote_section_class_smpkg").prepend('<div id="message" class="error inline wwe_small_orderCutoffTime_error"><p><strong>Error! </strong>Fulfillment Offset Days must be a number.</p></div>');
    463462            jQuery('html, body').animate({
    464463                'scrollTop': jQuery('.wwe_small_orderCutoffTime_error').position().top
  • small-package-quotes-wwe-edition/trunk/product/en-product-detail.php

    r3244589 r3479759  
    191191                ],
    192192                [
     193                    'type' => 'input_field',
     194                    'input_type' => 'number',
     195                    'id' => '_eniture_product_level_fulfillment_offset_days',
     196                    'class' => '_eniture_product_level_fulfillment_offset_days short',
     197                    'label' => __( 'Fulfillment Offset Days', 'woocommerce' ),
     198                    'placeholder' => 'Fulfillment offset days, e.g. 2',
     199                    'description' => "The number of days the ship date needs to be moved to allow for the processing of the order. If set, this will override the global Fulfillment Offset Days setting for this product.",
     200                    'custom_attributes' => [
     201                        'min' => '1',
     202                        'max' => '20',
     203                        'step' => '1',
     204                        'title' => 'Value must be greater than or equal to 1 and less than or equal to 20',
     205                        'oninvalid' => "this.setCustomValidity(this.validity.rangeUnderflow ? 'Value must be greater than or equal to 1' : this.validity.rangeOverflow ? 'Value must be less than or equal to 20' : '')",
     206                        'oninput' => "this.setCustomValidity('')"
     207                    ]
     208                ],
     209                [
    193210                    'type' => 'checkbox',
    194211                    'id' => '_hazardousmaterials',
     
    309326            }
    310327
     328            // Add input type if specified (e.g., 'number')
     329            if (isset($custom_field['input_type'])) {
     330                $custom_input_field['type'] = $custom_field['input_type'];
     331            }
     332
     333            // Add custom attributes if specified (e.g., min, max, step)
     334            if (isset($custom_field['custom_attributes'])) {
     335                $custom_input_field['custom_attributes'] = $custom_field['custom_attributes'];
     336            }
     337
    311338            woocommerce_wp_text_input($custom_input_field);
    312339        }
     
    377404                    $custom_field = (isset($custom_field['id'])) ? $custom_field['id'] : '';
    378405                    $en_updated_product = (isset($_POST[$custom_field][$postId])) ? sanitize_text_field(wp_unslash($_POST[$custom_field][$postId])) : '';
     406
     407                    if ($custom_field == '_dropship_location') {
     408                        $en_updated_product = maybe_serialize(is_array($en_updated_product) ? array_map('intval', $en_updated_product) : $en_updated_product);
     409                    } elseif ($custom_field == '_eniture_product_level_fulfillment_offset_days') {
     410                        $en_updated_product = $this->sanitize_fulfillment_offset_days($en_updated_product);
     411                    } else {
     412                        $en_updated_product = esc_attr($en_updated_product);
     413                    }
     414                   
    379415                    update_post_meta($postId, $custom_field, $en_updated_product);
    380416                }
    381417            }
     418        }
     419
     420        private function sanitize_fulfillment_offset_days($value)
     421        {
     422            $value = trim($value);
     423            if ($value === '' || $value === null) return '';
     424
     425            $value = preg_replace('/[^0-9.-]/', '', $value);
     426            if (!is_numeric($value)) return '';
     427
     428            $value = intval(floor(floatval($value)));
     429            return $value < 0 ? '' : strval($value);
    382430        }
    383431
  • small-package-quotes-wwe-edition/trunk/readme.txt

    r3472383 r3479759  
    44Requires at least: 6.4
    55Tested up to: 6.9
    6 Stable tag: 5.3.7
     6Stable tag: 5.3.8
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    142142== Changelog ==
    143143
    144 = 5.3.7 - 2026-03-02 =
    145 * Fix: Resolved JS files minification conflict with the WP Rocket plugin to ensure compatibility with asset optimization.
     144= 5.3.8 - 2026-03-11 =
     145* Update: Added product-level offset days functionality to allow more granular shipment timing control.
     146* Update: Added Quote Information Preference setting to control whether quote information is recorded and displayed in the Additional Order Details widget.
     147* Fix: Resolved Broken Access Control vulnerability to improve overall plugin security.
    146148
    147149= 5.3.6 - 2026-01-01 =
  • small-package-quotes-wwe-edition/trunk/small_packages_shipping_class.php

    r3430551 r3479759  
    563563                // apply minimum shipping charge shipping rules (Cart level) and get updated rates
    564564                $en_rates = $this->get_updated_rates($sm_package, $en_rates, $en_is_shipment);
     565                $save_order_meta_data = get_option('wwe_small_quote_information_preference');
     566                $save_packaging_data = get_option('box_sizing_packaging_solution_preference');
    565567
    566568                foreach ($en_rates as $accessorial => $rate) {
     
    597599                        // Images for FDO
    598600                        $rate['meta_data']['en_fdo_image_urls'] = wp_json_encode($image_urls);
     601
     602                         // Remove meta data and packaging data if not required
     603                        if ($save_order_meta_data == 'no') unset($rate['meta_data']['en_fdo_meta_data']);
     604                        if ($save_packaging_data == 'no') unset($rate['meta_data']['bin_packaging']);
    599605                    }
    600606
  • small-package-quotes-wwe-edition/trunk/small_packages_tab_class_woocommrece.php

    r3393484 r3479759  
    464464                        'id' => 'shipping_methods_do_not_sort_by_price'
    465465                    ),
     466                     'wwe_small_quote_information_preference' => array(
     467                        'name' => __('Quote Information Preference', 'woocommerce-settings-fedex_small_quotes'),
     468                        'type' => 'radio',
     469                        'default' => 'yes',
     470                        'id' => 'wwe_small_quote_information_preference',
     471                        'options' => array(
     472                            'yes' => __('Record it in the Additional Order Details widget. (Default)', 'woocommerce-settings-fedex_small_quotes'),
     473                            'no' => __('Don\'t record it in the Additional Order Details widget.', 'woocommerce-settings-fedex_small_quotes'),
     474                        ),
     475                    ),
    466476
    467477                    // Package rating method when Standard Box Sizes isn't in use
     
    516526                    ),
    517527                    'shipmentOffsetDays_wwe_small' => array(
    518                         'name' => __('Fulfilment Offset Days ', 'small-package-quotes-wwe-edition'),
    519                         'type' => 'text',
    520                         'desc' => 'The number of days the ship date needs to be moved to allow the processing of the order.',
    521                         'placeholder' => 'Fulfilment Offset Days, e.g. 2',
     528                        'name' => __('Fulfillment Offset Days ', 'small-package-quotes-wwe-edition'),
     529                        'type' => 'text',
     530                        'desc' => 'The number of days the ship date needs to be moved to allow for the processing of the order.',
     531                        'placeholder' => 'Fulfillment Offset Days, e.g. 2',
    522532                        'id' => 'wwe_small_shipmentOffsetDays',
    523533                        'class' => $disable_cot_sdo,
  • small-package-quotes-wwe-edition/trunk/update-plan.php

    r3313674 r3479759  
    2727            $plugin_info = get_plugins();
    2828            $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : '';
    29 
    3029            $domain = eniture_wwe_small_get_domain();
    31             $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    3230
    3331            $post_data = array(
     
    3533                'carrier' => '2',
    3634                'store_url' => $domain,
    37                 'webhook_url' => $plugin_dir_url,
     35                'webhook_url' => '',
    3836                'plugin_version' => $plugin_version,
    3937            );
     
    7876        $plugin_info = get_plugins();
    7977        $plugin_version = isset($plugin_info[$index]['Version']) ? $plugin_info[$index]['Version'] : '';
    80 
    8178        $domain = eniture_wwe_small_get_domain();
    82         $plugin_dir_url = plugin_dir_url(__FILE__) . 'en-hit-to-update-plan.php';
    8379
    8480        $post_data = array(
     
    8682            'carrier' => '2',
    8783            'store_url' => $domain,
    88             'webhook_url' => $plugin_dir_url,
     84            'webhook_url' => '',
    8985            'plugin_version' => $plugin_version,
    9086        );
  • small-package-quotes-wwe-edition/trunk/woocommerceShip.php

    r3472383 r3479759  
    66  Author: Eniture Technology
    77  Author URI: https://eniture.com/
    8   Version: 5.3.7
     8  Version: 5.3.8
    99  Text Domain: small-package-quotes-wwe-edition
    10   License: GPLv2 or later
    11   Requires Plugins: woocommerce
     10  License: GPL-2.0-or-later
    1211 */
    1312/*
     
    161160{
    162161    wp_enqueue_script('jquery');
    163     wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1.7');
     162    wp_enqueue_script('en_speedship_script', plugin_dir_url(__FILE__) . 'js/en-speedship.js', [], '1.1.8');
    164163    wp_localize_script('en_speedship_script', 'en_speedship_admin_script', array(
    165164        'plugins_url' => plugins_url(),
     
    231230function eniture_wwe_smpkg_admin_script()
    232231{
    233     wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2.7');
     232    wp_register_style('small_packges_style', plugin_dir_url(__FILE__) . '/css/small_packges_style.css', false, '2.2.8');
    234233    wp_enqueue_style('small_packges_style');
    235234
Note: See TracChangeset for help on using the changeset viewer.