Plugin Directory

Changeset 3454933


Ignore:
Timestamp:
02/05/2026 08:20:51 PM (8 weeks ago)
Author:
infixs
Message:

Update to 1.7.1

Location:
infixs-correios-automatico
Files:
314 added
3 edited

Legend:

Unmodified
Added
Removed
  • infixs-correios-automatico/trunk/infixs-correios-automatico.php

    r3440429 r3454933  
    1313 * Plugin Name:             Correios Automático - Rastreio, Frete, Etiqueta, Declaração e Devolução
    1414 * Description:             Integração com correios automatizada (Tudo em um), com ou sem contrato, código de rastreio automático, geração de etiquetas, devolução e muito mais.
    15  * Version:                 1.7.0
     15 * Version:                 1.7.1
    1616 * Requires at least:       6.0
    1717 * Requires PHP:            7.4
     
    3030//Define globals
    3131define( 'INFIXS_CORREIOS_AUTOMATICO_PLUGIN_NAME', 'infixs-correios-automatico' );
    32 define( 'INFIXS_CORREIOS_AUTOMATICO_PLUGIN_VERSION', '1.7.0' );
     32define( 'INFIXS_CORREIOS_AUTOMATICO_PLUGIN_VERSION', '1.7.1' );
    3333define( 'INFIXS_CORREIOS_AUTOMATICO_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    3434define( 'INFIXS_CORREIOS_AUTOMATICO_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
  • infixs-correios-automatico/trunk/readme.txt

    r3440429 r3454933  
    55Requires PHP: 7.4
    66Tested up to: 6.9
    7 Stable tag: 1.7.0
     7Stable tag: 1.7.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    140140== Changelog ==
    141141
     142= 1.7.1 2026-02-05 =
     143* Fix Bugs e Calculo mais rápido
     144
    142145= 1.7.0 2026-01-15 =
    143146* Melhoria da compatibilidade com WhatsApp ( Pingo Notify )
  • infixs-correios-automatico/trunk/src/Services/ShippingService.php

    r3407532 r3454933  
    568568        $url = "https://brasilapi.com.br/api/cep/v1/{$postcode}";
    569569        $response = wp_remote_get( $url, [
    570             'timeout' => 10,
     570            'timeout' => 5,
    571571            'headers' => [
    572572                'Accept' => 'application/json',
     
    598598
    599599    protected function fetchAddress( $postcode ) {
    600         $address = $this->fetchViacepAddress( $postcode );
     600
     601        if ( Config::boolean( 'auth.active' ) ) {
     602            $address = $this->correiosService->fetch_postcode( $postcode );
     603
     604            if ( $address && ! is_wp_error( $address ) ) {
     605                return $address;
     606            }
     607        }
     608
     609        $address = $this->fetchBrasilApiAddress( $postcode );
    601610
    602611        if ( $address ) {
     
    604613        }
    605614
    606         $address = $this->correiosService->fetch_postcode( $postcode );
     615        $address = $this->fetchViacepAddress( $postcode );
     616
     617        if ( $address ) {
     618            return $address;
     619        }
     620
     621        $address = $this->infixsApi->fetchAddress( $postcode );
    607622
    608623        if ( $address && ! is_wp_error( $address ) ) {
     
    610625        }
    611626
    612         $address = $this->fetchBrasilApiAddress( $postcode );
     627        return false;
     628    }
     629
     630    /**
     631     * Get address by postcode
     632     *
     633     * When success return array with address data, otherwise return false
     634     *
     635     * @param string $postcode
     636     *
     637     * @return array|bool
     638     */
     639    public function getAddressByPostcode( string $postcode ) {
     640
     641        $postcode = Sanitizer::numeric_text( $postcode );
     642
     643        $transient_key = "infixs_correios_address_{$postcode}";
     644
     645        $address = get_transient( $transient_key );
    613646
    614647        if ( $address ) {
     
    616649        }
    617650
    618         $address = $this->infixsApi->fetchAddress( $postcode );
    619 
    620         if ( $address && ! is_wp_error( $address ) ) {
    621             return $address;
    622         }
    623 
    624         return false;
    625     }
    626 
    627     /**
    628      * Get address by postcode
    629      *
    630      * When success return array with address data, otherwise return false
    631      *
    632      * @param string $postcode
    633      *
    634      * @return array|bool
    635      */
    636     public function getAddressByPostcode( string $postcode ) {
    637 
    638         $postcode = Sanitizer::numeric_text( $postcode );
    639 
    640         $transient_key = "infixs_correios_address_{$postcode}";
    641 
    642         $address = get_transient( $transient_key );
    643 
    644         if ( $address ) {
    645             return $address;
    646         }
    647 
    648651        $address = $this->fetchAddress( $postcode );
    649652
     
    660663        $api_url = "https://viacep.com.br/ws/{$postcode}/json/";
    661664
    662         $response = wp_remote_get( $api_url );
     665        $response = wp_remote_get( $api_url,
     666            [
     667                "timeout" => 5,
     668            ]
     669        );
    663670
    664671        if ( is_wp_error( $response ) ) {
Note: See TracChangeset for help on using the changeset viewer.