Plugin Directory

Changeset 3159775


Ignore:
Timestamp:
09/30/2024 11:27:01 AM (18 months ago)
Author:
seuroficial
Message:

v2.2.12

Location:
seur/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • seur/trunk/classes/class-seur-collections.php

    r2847513 r3159775  
    1313class Seur_Collections {
    1414
    15     public function __construct() {
     15    private string $seur_adr;
     16    /**
     17     * @var false|mixed
     18     */
     19    private mixed $client_secret;
     20    /**
     21     * @var false|mixed
     22     */
     23    private mixed $accountnumber;
     24    /**
     25     * @var false|mixed
     26     */
     27    private mixed $nif;
     28    /**
     29     * @var false|mixed
     30     */
     31    private mixed $phone;
     32    private string $name;
     33    /**
     34     * @var false|mixed
     35     */
     36    private mixed $email;
     37    private string $streetname;
     38    /**
     39     * @var false|mixed
     40     */
     41    private mixed $cityname;
     42    /**
     43     * @var false|mixed
     44     */
     45    private mixed $postalcode;
     46    /**
     47     * @var false|mixed
     48     */
     49    private mixed $country;
     50    private string $token;
     51
     52    public function __construct() {
    1653        $this->seur_adr      = seur()->get_api_addres() . SEUR_COLLECTIONS;
    1754        $this->client_secret = seur()->client_secret();
  • seur/trunk/classes/class-seur-global.php

    r3130893 r3159775  
    1212
    1313class Seur_Global {
     14
     15    /**
     16     * @var WC_Logger
     17     */
     18    private $log;
    1419
    1520    public function __construct() {
     
    947952    public function is_seur_order($order_id) {
    948953        global $wpdb;
    949         $query = "SELECT distinct o.order_id 
     954        $query = "SELECT distinct o.order_id
    950955            FROM {$wpdb->prefix}woocommerce_order_items o
    951956            inner join {$wpdb->prefix}woocommerce_order_itemmeta om on om.order_item_id = o.order_item_id
     
    957962    public function is_seur_local_method($custom_rate_id) {
    958963        global $wpdb;
    959         $query = "SELECT ID 
     964        $query = "SELECT ID
    960965            FROM {$wpdb->prefix}seur_custom_rates
    961966            where rate like '%2SHOP' and ID = ".$custom_rate_id;
  • seur/trunk/classes/class-seur-seguimiento.php

    r3130893 r3159775  
    2323        'wc-seur-corrected-doc' => 'DOCUMENTACIÓN RECTIFICADA',
    2424    ];
    25 
    26     public function __construct() {
     25    /**
     26     * @var false|mixed
     27     */
     28    private mixed $client_secret;
     29    /**
     30     * @var false|mixed
     31     */
     32    private mixed $accountnumber;
     33    /**
     34     * @var false|mixed
     35     */
     36    private mixed $nif;
     37    /**
     38     * @var false|mixed
     39     */
     40    private mixed $phone;
     41    private string $name;
     42    /**
     43     * @var false|mixed
     44     */
     45    private mixed $email;
     46    private string $streetname;
     47    /**
     48     * @var false|mixed
     49     */
     50    private mixed $cityname;
     51    /**
     52     * @var false|mixed
     53     */
     54    private mixed $postalcode;
     55    /**
     56     * @var false|mixed
     57     */
     58    private mixed $country;
     59    private string $seur_adr;
     60    private string $token;
     61    private string $reftype;
     62    /**
     63     * @var false|mixed
     64     */
     65    private mixed $full_account_number;
     66    private string $accoun_number;
     67    /**
     68     * @var false|mixed
     69     */
     70    private mixed $business_unit;
     71
     72    public function __construct() {
    2773
    2874        $this->client_secret       = seur()->client_secret();
  • seur/trunk/classes/tcpdf/include/tcpdf_static.php

    r3130893 r3159775  
    141141        }
    142142        if (PHP_VERSION_ID < 50300) {
    143             @set_magic_quotes_runtime($mqr);
     143            //@set_magic_quotes_runtime($mqr);
    144144        }
    145145    }
     
    451451            return $iv.substr($text, 0, -16);
    452452        }
    453         $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND);
    454         $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv);
     453        $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-128-cbc'));
     454        $text = openssl_encrypt($text, 'aes-128-cbc', $key, OPENSSL_RAW_DATA, $iv);
    455455        $text = $iv.$text;
    456456        return $text;
     
    473473            return substr($text, 0, -16);
    474474        }
    475         $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));
    476         $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv);
     475        $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-128-cbc'));
     476        $text = openssl_encrypt($text, 'aes-128-cbc', $key, OPENSSL_RAW_DATA, $iv);
    477477        return $text;
    478478    }
     
    491491     */
    492492    public static function _RC4($key, $text, &$last_enc_key, &$last_enc_key_c) {
    493         if (function_exists('mcrypt_encrypt') AND ($out = @mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, ''))) {
    494             // try to use mcrypt function if exist
    495             return $out;
    496         }
     493        if (function_exists('openssl_encrypt')) {
     494            $out = openssl_encrypt($text, 'rc4', $key, OPENSSL_RAW_DATA);
     495            if ($out !== false) {
     496                return $out;
     497            }
     498        }
    497499        if ($last_enc_key != $key) {
    498500            $k = str_repeat($key, ((256 / strlen($key)) + 1));
     
    18351837        curl_setopt($crs, CURLOPT_NOBODY, true);
    18361838        curl_setopt($crs, CURLOPT_FAILONERROR, true);
    1837         if ((ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) {
    1838             curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true);
    1839         }
     1839        if (ini_get('open_basedir') == '') {
     1840            curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true);
     1841        }
    18401842        curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5);
    18411843        curl_setopt($crs, CURLOPT_TIMEOUT, 30);
     
    19661968                curl_setopt($crs, CURLOPT_FAILONERROR, true);
    19671969                curl_setopt($crs, CURLOPT_RETURNTRANSFER, true);
    1968                 if ((ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) {
    1969                     curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true);
    1970                 }
     1970                if (ini_get('open_basedir') == '') {
     1971                    curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true);
     1972                }
    19711973                curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5);
    19721974                curl_setopt($crs, CURLOPT_TIMEOUT, 30);
  • seur/trunk/classes/tcpdf/tcpdf.php

    r3120329 r3159775  
    18361836    // METHODS
    18371837    //------------------------------------------------------------
    1838 
    1839     /**
     1838    private XMLParser $parser;
     1839
     1840    /**
    18401841     * This is the class constructor.
    18411842     * It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes).
     
    1092910930                $this->Error('AES encryption requires openssl/aes-256-cbc cypher.');
    1093010931            }
    10931             if (extension_loaded('mcrypt') && mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) {
     10932            /*if (extension_loaded('mcrypt') && mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) {
    1093210933                $this->Error('AES encryption requires MCRYPT_RIJNDAEL_128 cypher.');
    10933             }
     10934            }*/
    1093410935            if (($mode == 3) AND !function_exists('hash')) {
    1093510936                // the Hash extension requires no external libraries and is enabled by default as of PHP 5.1.2.
     
    1636216363        $selfclosingtags = array('area','base','basefont','br','hr','input','img','link','meta');
    1636316364        // remove all unsupported tags (the line below lists all supported tags)
    16364         $html = strip_tags($html, '<marker/><a><b><blockquote><body><br><br/><dd><del><div><dl><dt><em><font><form><h1><h2><h3><h4><h5><h6><hr><hr/><i><img><input><label><li><ol><option><p><pre><s><select><small><span><strike><strong><sub><sup><table><tablehead><tcpdf><td><textarea><th><thead><tr><tt><u><ul>');
    16365         //replace some blank characters
     16365        $html = strip_tags($html, '<marker><a><b><blockquote><body><br><dd><del><div><dl><dt><em><font><form><h1><h2><h3><h4><h5><h6><hr><i><img><input><label><li><ol><option><p><pre><s><select><small><span><strike><strong><sub><sup><table><tablehead><tcpdf><td><textarea><th><thead><tr><tt><u><ul>');
     16366        //replace some blank characters
    1636616367        $html = preg_replace('/<pre/', '<xre', $html); // preserve pre tag
    1636716368        $html = preg_replace('/<(table|tr|td|th|tcpdf|blockquote|dd|div|dl|dt|form|h1|h2|h3|h4|h5|h6|br|hr|li|ol|ul|p)([^\>]*)>[\n\r\t]+/', '<\\1\\2>', $html);
  • seur/trunk/core/functions/functions.php

    r3130893 r3159775  
    1212use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
    1313use Automattic\WooCommerce\Utilities\OrderUtil;
    14 require_once ABSPATH . 'wp-content/plugins/woocommerce/includes/admin/wc-admin-functions.php';
     14require_once WP_PLUGIN_DIR . '/woocommerce/includes/admin/wc-admin-functions.php';
    1515
    1616/**
  • seur/trunk/core/labels-cpt/labels-cpt.php

    r3130893 r3159775  
    447447            $order_manifest['id'] =  $id_order;
    448448            $order_manifest['reference'] =  $order->get_meta('_seur_shipping_id_number');
    449             $order_manifest['consig_name'] =  $order->get_billing_first_name()." ".$order->get_billing_last_name();
     449            $order_manifest['consig_name'] =  $order->get_shipping_first_name()." ".$order->get_shipping_last_name();
    450450            $order_manifest['consig_address'] =  $order->get_shipping_address_1();
    451451            $order_manifest['consig_postalcode'] =  $order->get_shipping_postcode();
  • seur/trunk/core/pages/rates/seur-edit-form.php

    r3119152 r3159775  
    8383                        } else {
    8484                            $countries = array();
    85                             $countries = include_once SEUR_PLUGIN_PATH . 'core/places/countries.php';
    86                             $countries = asort( $countries );
     85                            $countries = include(SEUR_PLUGIN_PATH . 'core/places/countries.php');
     86                            asort( $countries );
    8787                            echo '<option value="*">' . esc_html__( 'All Countries', 'seur' ) . '</option>';
    8888                            foreach ( $countries as $country => $value ) {
     
    123123                        }
    124124                    }
    125                     if ( ! $states ) {
     125                    if ( !$states ) {
    126126                        $currentstate = $getrate->state;
    127127                        echo '<input title="' . esc_html__( 'State', 'seur' ) . '" type="text" name="state" class="form-control" placeholder="' . esc_html__( 'State', 'seur' ) . '" value="' . esc_html( $currentstate ) . '">';
    128                     }
    129                     if ( '*' === $country ) {
    130                         echo '<input title="' . esc_html__( 'No needed', 'seur' ) . '" type="text" name="state" class="form-control" placeholder="' . esc_html__( 'No needed', 'seur' ) . '" value="*" readonly>';
    131128                    }
    132129                    ?>
  • seur/trunk/core/pages/seur-settings.php

    r2826393 r3159775  
    4242                settings_fields( 'seur-user-settings-section' );
    4343                do_settings_sections( 'seur-user-settings-options' );
    44                 wp_kses_post( _e( '(<sup>*</sup>) This data is provided by SEUR', 'seur' ) );
     44                echo wp_kses_post( __( '(<sup>*</sup>) This data is provided by SEUR', 'seur' ) );
    4545            } else {
    4646                ?>
  • seur/trunk/core/woocommerce/includes/class-seur_local_shipping_method.php

    r3119152 r3159775  
    1717class Seur_Local_Shipping_Method extends WC_Shipping_Method {
    1818
    19     /**
     19    /**
     20     * @var WC_Logger
     21     */
     22    private $log;
     23
     24    /**
    2025     * Constructor. The instance ID is passed to this.
    2126     *
     
    6974        $package_price = $package['contents_cost'];
    7075        if ( $rates_type != 'price' ) {
    71             $weight        = 0;
     76            $weight        = 0.0;
    7277
    7378            foreach ( $package['contents'] as $item_id => $values ) {
    7479                $_product = $values['data'];
    75                 $weight   = (int) $weight + (int) $_product->get_weight() * (int) $values['quantity'];
     80                $weight   = (float)$weight + ((float)$_product->get_weight() * (float)$values['quantity']);
    7681            }
    7782            $package_price = wc_get_weight( $weight, 'kg' );
     
    151156            $seur_local_shipping_method = new Seur_Local_Shipping_Method();
    152157            $weightlimit                = (int) 20;
    153             $weight                     = 0;
     158            $weight                     = 0.0;
    154159            foreach ( $package['contents'] as $item_id => $values ) {
    155160                $_product = $values['data'];
    156                 $weight   = $weight + $_product->get_weight() * $values['quantity'];
     161                $weight   = (float)$weight + ((float)$_product->get_weight() * (float)$values['quantity']);
    157162            }
    158163            $weight = wc_get_weight( $weight, 'kg' );
     
    488493        $order->update_meta_data('_seur_2shop_depot', str_pad( $depot, 2, '0', STR_PAD_LEFT ) );
    489494        $order->update_meta_data('_seur_2shop_postcode', $postcode );
    490         $order->update_meta_data('_seur_2shop_codCentro', str_pad( $cod_centro, 3, '0', STR_PAD_LEFT ) );
     495        $order->update_meta_data('_seur_2shop_codCentro', $pudoId );
    491496        $order->update_meta_data('_seur_2shop_title', $title );
    492497        $order->update_meta_data('_seur_2shop_type', $type );
     
    500505        $order->update_meta_data('_seur_2shop_timetable', $timetable );
    501506        $order->save_meta_data();
     507
     508        // Set order shipping address to pick-up location address
     509        $shipping_address = $order->get_address('shipping');
     510        $shipping_address['address_1'] = __( 'Pickup store', 'seur' ) . ": {$title} - {$pudoId}";
     511        $shipping_address['address_2'] = "{$streettype} {$address} {$numvia}";
     512        $shipping_address['city'] = $city;
     513        $shipping_address['postcode'] = $postcode;
     514        $order->set_address($shipping_address , 'shipping' );
     515        $order->save();
    502516    }
    503517}
  • seur/trunk/core/woocommerce/includes/class-wc-shipping-seur.php

    r3119152 r3159775  
    1818 */
    1919class WC_Shipping_SEUR extends WC_Shipping_Method {
     20
     21    /**
     22     * @var WC_Logger
     23     */
     24    private $log;
     25
     26    /**
     27     * @var bool
     28     */
     29    public $debug;
     30
     31    /**
     32     * @var string
     33     */
     34    public $title;
     35
     36    /**
     37     * @var string
     38     */
     39    public $simple_advanced;
     40
     41    /**
     42     * @var string
     43     */
     44    public $user_id;
     45
     46    /**
     47     * @var string
     48     */
     49    public $password;
     50
     51    /**
     52     * @var string
     53     */
     54    public $access_key;
     55
     56    /**
     57     * @var string
     58     */
     59    public $shipper_number;
     60
     61    /**
     62     * @var bool
     63     */
     64    public $origin_addressline;
     65
     66    /**
     67     * @var string
     68     */
     69    public $origin_city;
     70
     71    /**
     72     * @var string
     73     */
     74    public $origin_postcode;
     75
     76    /**
     77     * @var string
     78     */
     79    public $origin_country_state;
     80
     81    /**
     82     * @var string
     83     */
     84    public $pickup;
     85
     86    /**
     87     * @var bool
     88     */
     89    public $residential;
     90
     91    /**
     92     * @var string
     93     */
     94    public $offer_rates;
     95
     96    /**
     97     * @var string
     98     */
     99    public $fallback;
     100
     101    /**
     102     * @var string
     103     */
     104    public $packing_method;
     105
     106    /**
     107     * @var array
     108     */
     109    public $seur_packaging;
     110
     111    /**
     112     * @var array
     113     */
     114    public $custom_services;
     115
     116    /**
     117     * @var array
     118     */
     119    public $boxes;
     120
     121    /**
     122     * @var bool
     123     */
     124    public $insuredvalue;
     125
     126    /**
     127     * @var string|bool
     128     */
     129    public $units;
     130
     131    /**
     132     * @var string
     133     */
     134    public $weight_unit;
     135
     136    /**
     137     * @var string
     138     */
     139    public $dim_unit;
     140
     141    /**
     142     * @var string
     143     */
     144    public $origin_country;
     145
     146    /**
     147     * @var string
     148     */
     149    public $origin_state;
    20150
    21151    /**
  • seur/trunk/core/woocommerce/includes/seur-woo-functions.php

    r3130893 r3159775  
    7979    }
    8080
    81     $items = $order->get_items();
    82     $total_weight = 0;
    83     foreach ($items as $item) {
    84         $product_quantity = $item->get_quantity();
    85         $product_weight = $item->get_product()->get_weight(); // Obtiene el peso del producto
    86         $total_weight += $product_weight * $product_quantity;
    87     }
    88 
    89     $order->update_meta_data('_seur_cart_weight', $total_weight );
     81    // Compute total order weight if not computed already (by seur_add_cart_weight())
     82    if ( empty($order->get_meta('_seur_cart_weight')) ) {
     83        $items        = $order->get_items();
     84        $total_weight = 0.0;
     85        foreach ( $items as $item ) {
     86            $hidden = $item->get_meta( '_bundled_item_hidden' );
     87            // Do not add the hidden items inside the pack
     88            if ( $hidden != 'yes' ) {
     89                $product_quantity = $item->get_quantity();
     90                $product_weight   = $item->get_product()->get_weight(); // Obtiene el peso del producto
     91                $total_weight    += (float) $product_weight * (float) $product_quantity;
     92            }
     93        }
     94
     95        $order->update_meta_data( '_seur_cart_weight', $total_weight );
     96    }
     97
    9098    $order->save_meta_data();
     99}
     100// When the event woocommerce_checkout_update_order_meta is triggered we can obtain the cart weight
     101// from Woocommerce (which should more accurate that any calculation we can perform).
     102// But the event is not triggered in all versions (see bug), so there is a second point where weight is computed (above).
     103add_action('woocommerce_checkout_update_order_meta', 'seur_add_cart_weight');
     104function seur_add_cart_weight( $order_id ) {
     105    global $woocommerce;
     106
     107    $weight = $woocommerce->cart->cart_contents_weight;
     108    update_post_meta( $order_id, '_seur_cart_weight', $weight );
    91109}
    92110
     
    508526        <select name="_shop_order_seur_shipping_method" id="dropdown_shop_order_seur_shipping_method">
    509527            <option value=""><?php esc_html_e( 'All', 'seur' ); ?></option>
    510             <option value="seur" 
     528            <option value="seur"
    511529            <?php
    512530            if ( ( esc_attr( isset( $_GET['_shop_order_seur_shipping_method'] ) ) ) && ( esc_attr( $_GET['_shop_order_seur_shipping_method'] ) == 'seur' ) ) {
  • seur/trunk/data/seur-products.php

    r3120329 r3159775  
    2525     * SEUR 72H Estándar ->     Servicio = 13, Producto 2   --> ES            -> all -> ESTANDAR
    2626     * SEUR 2SHOP ->            Servicio = 1,  Producto 48  --> AD/ES/PT      -> all -> ESTANDAR
     27     * SEUR 13:30 Documentos -> Servicio = 9,  Producto 54  --> AD/ES/PT      -> all -> ESTANDAR
    2728     *
    2829     * Internacional
     
    122123            'field' => 'seur_13f'
    123124        ),
     125        'SEUR 13:30 Documentos'             => array(
     126            'service'   => '9',
     127            'product'   => '54',
     128            'tipo'      => 'ESTANDAR',
     129            'pais'      => array(
     130                'AD',
     131                'ES',
     132                'PT'
     133            ),
     134            'provincia' => array(
     135                'all',
     136            ),
     137            'field' => 'seur_13d'
     138        ),
    124139        'SEUR 24H Estándar'               => array(
    125140            'service'   => '1',
  • seur/trunk/languages/seur-es_ES.po

    r3120329 r3159775  
    704704msgid "https://www.joseconti.com/"
    705705msgstr "https://www.joseconti.com/"
    706 
    707 #. Author of the plugin
    708 msgid "SEUR"
    709 msgstr "SEUR"
    710706
    711707#. Plugin URI of the plugin
     
    22572253msgid "Activate Change Service"
    22582254msgstr "Activar el servicio 'cambio'"
     2255
     2256msgid "Pickup store"
     2257msgstr "Punto de recogida"
  • seur/trunk/loader.php

    r3130893 r3159775  
    44 * Plugin URI: http://www.seur.com/
    55 * Description: Add SEUR shipping method to WooCommerce. The SEUR plugin for WooCommerce allows you to manage your order dispatches in a fast and easy way
    6  * Version: 2.2.11
     6 * Version: 2.2.12
    77 * Author: SEUR Oficial
    88 * Author URI: http://www.seur.com/
     
    1818 **/
    1919
    20 define( 'SEUR_OFFICIAL_VERSION', '2.2.11' );
     20define( 'SEUR_OFFICIAL_VERSION', '2.2.12' );
    2121define( 'SEUR_DB_VERSION', '1.0.4' );
    2222define( 'SEUR_TABLE_VERSION', '1.0.4' );
  • seur/trunk/readme.txt

    r3130893 r3159775  
    44Requires at least: 4.0
    55Tested up to: 6.2
    6 Stable tag: 2.2.11
     6Stable tag: 2.2.12
    77WC requires at least: 3.0
    88WC tested up to: 7.4
     
    9393
    9494== Changelog ==
     95
     96== 2.2.12 ==
     97
     98* ADDED: Add new service 13:30 Documentos
     99* ADDED: PHP8.2 compatibility
     100* CHANGED: Change _seur_2shop_codCentro value
     101* FIXED: Fix manifest consig_name
     102* FIXED: Fix plugins path include
     103* FIXED: Set shipping address to pick-up location address for pick-up orders
     104* FIXED: Order weight is computed in excess when the order contains product packs
     105* FIXED: Cannot select country when editing custom rate
     106* FIXED: Erroneous rate calculation for local service SEUR 2SHOP
    95107
    96108== 2.2.11 ==
  • seur/trunk/uninstall.php

    r3119152 r3159775  
    7979    'seur_13e_max_price_field',
    8080    'seur_13f_max_price_field',
     81    'seur_13d_max_price_field',
    8182    'seur_48h_max_price_field',
    8283    'seur_72h_max_price_field',
     
    8889    'seur_13e_custom_name_field',
    8990    'seur_13f_custom_name_field',
     91    'seur_13d_custom_name_field',
    9092    'seur_48h_custom_name_field',
    9193    'seur_72h_custom_name_field',
Note: See TracChangeset for help on using the changeset viewer.