Plugin Directory

Changeset 3094250


Ignore:
Timestamp:
05/29/2024 05:35:04 AM (23 months ago)
Author:
intia
Message:

1.0.28

Location:
infast
Files:
5 deleted
9 edited
13 copied

Legend:

Unmodified
Added
Removed
  • infast/tags/1.0.28/README.txt

    r3094190 r3094250  
    44Requires at least: 5.6
    55Tested up to: 6.5.3
    6 Requires PHP: 7.2
    7 Stable tag: 1.0.27
     6Requires PHP: 7.0*
     7Stable tag: 1.0.28
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    127127
    128128== Changelog ==
     129= Version 1.0.28 =
     130- Amélioration interne
     131
    129132= Version 1.0.27 =
    130133- Amélioration interne : Vérification que le plugin WooCommerce est activé
  • infast/tags/1.0.28/admin/class-infast-woocommerce-admin-settings.php

    r3094190 r3094250  
    138138
    139139        $options = get_option( 'infast_woocommerce' );
    140         $value = '';
    141         if( is_array($options) ) {
    142             $value = $options['client_id'];
    143         }
    144 
    145         ?>
    146         <input type='text' name='infast_woocommerce[client_id]' id="infast-client-id" value='<?php  echo esc_attr( $value ); ?>'>
     140        $client_id = '';
     141        if( is_array($options) && array_key_exists('client_id', $options)) {
     142            $client_id = $options['client_id'];
     143        }
     144
     145        ?>
     146        <input type='text' name='infast_woocommerce[client_id]' id="infast-client-id" value='<?php  echo esc_attr( $client_id ); ?>'>
    147147        <?php
    148148
     
    157157
    158158        $options = get_option( 'infast_woocommerce' );
    159         if ( $options && array_key_exists( 'client_secret', $options ) ) {
    160             $value = $options['client_secret'];
    161             if ( ! empty( $value ) )
    162                 $value = '*******************************';
    163         } else
    164             $value = '';
    165         ?>
    166         <input type='text' name='infast_woocommerce[client_secret]' id="infast-client-secret" value='<?php echo esc_attr( $value ); ?>'>
     159        $client_secret = '';
     160        if ( is_array($options) && array_key_exists( 'client_secret', $options ) ) {
     161            $client_secret = $options['client_secret'];
     162            if ( ! empty( $client_secret ) )
     163                $client_secret = '*******************************';
     164        }
     165        ?>
     166        <input type='text' name='infast_woocommerce[client_secret]' id="infast-client-secret" value='<?php echo esc_attr( $client_secret ); ?>'>
    167167        <?php
    168168    }
     
    176176
    177177        $options = get_option( 'infast_woocommerce' );
    178         ?>
    179         <input type="checkbox" name="infast_woocommerce[enable_email]" value="1" <?php if ( isset( $options['enable_email'] ) ) checked( $options['enable_email'], 1 ); ?>
     178        $enable_email = false;
     179        if( is_array($options) && array_key_exists('enable_email', $options)) {
     180            $enable_email = $options['enable_email'];
     181        }
     182        ?>
     183        <input type="checkbox" name="infast_woocommerce[enable_email]" value="1" <?php if ( isset ( $enable_email ) ) checked( $enable_email, 1 ); ?>
    180184        <?php
    181185
     
    190194
    191195        $options = get_option( 'infast_woocommerce' );
    192         ?>
    193         <input type="email" name="infast_woocommerce[cc_email]" value="<?php if ( isset ( $options['cc_email'] ) ) echo esc_attr( $options['cc_email'] ); ?>" />
     196        $cc_email = false;
     197        if( is_array($options) && array_key_exists('cc_email', $options)) {
     198            $cc_email = $options['cc_email'];
     199        }
     200        ?>
     201        <input type="email" name="infast_woocommerce[cc_email]" value="<?php if ( isset ( $cc_email ) ) echo esc_attr( $cc_email ); ?>" />
    194202        <?php
    195203
     
    204212
    205213        $options = get_option( 'infast_woocommerce' );
    206         ?>
    207         <input type="checkbox" name="infast_woocommerce[omit_item_description]" value="1" <?php if ( isset( $options['omit_item_description'] ) ) checked( $options['omit_item_description'], 1 ); ?> />
     214        $omit_item_description = false;
     215        if( is_array($options) && array_key_exists('omit_item_description', $options)) {
     216            $omit_item_description = $options['omit_item_description'];
     217        }
     218        ?>
     219        <input type="checkbox" name="infast_woocommerce[omit_item_description]" value="1" <?php if ( isset( $omit_item_description ) ) checked( $omit_item_description, 1 ); ?> />
    208220        <?php
    209221
     
    369381
    370382        if ( $option == 'infast_woocommerce' ) {
    371             if ( ( ! empty( $value['client_id'] ) && ! empty( $value['client_secret'] ) ) &&
    372                  ( $value['client_id'] != $old_value['client_id'] ||
    373                  $value['client_secret'] != $old_value['client_secret'] ) ) {
     383            $old_client_id = '';
     384            $old_client_secret = '';
     385            $new_client_id = '';
     386            $new_client_secret = '';
     387            if( is_array($value) && array_key_exists('client_id', $value)) {
     388                $new_client_id = $value['client_id'];
     389            }
     390            if( is_array($value) && array_key_exists('client_secret', $value)) {
     391                $new_client_secret = $value['client_secret'];
     392            }
     393            if( is_array($old_value) && array_key_exists('client_id', $old_value)) {
     394                $old_client_id = $old_value['client_id'];
     395            }
     396            if( is_array($old_value) && array_key_exists('client_secret', $old_value)) {
     397                $old_client_secret = $old_value['client_secret'];
     398            }
     399
     400            if ( ( ! empty( $new_client_id ) && ! empty( $new_client_secret ) ) &&
     401                 ( $new_client_id != $old_client_id ||
     402                 $new_client_secret != $old_client_secret ) ) {
    374403
    375404                $infast_auth_api = Infast_Woocommerce_Auth_Api::getInstance();
  • infast/tags/1.0.28/admin/class-infast-woocommerce-admin.php

    r3094190 r3094250  
    264264
    265265    public function http_headers_useragent( $user_agent, $url) {
    266         return $user_agent . '; infast-plugin-version/1.0.27';
     266        return $user_agent . '; infast-plugin-version/1.0.28';
    267267    }   
    268268
  • infast/tags/1.0.28/includes/class-infast-woocommerce-activator.php

    r2608798 r3094250  
    3535        if ( ! $stored_saltkey1 || empty( $stored_saltkey1 ) ) {
    3636            $salt_key1 = bin2hex( random_bytes( 20 ) );
    37             add_option( 'infast_saltkey_1', $salt_key1, 'no' );           
     37            add_option( 'infast_saltkey_1', $salt_key1 );           
    3838        }
    3939
     
    4141        if ( ! $stored_saltkey2 || empty( $stored_saltkey2 ) ) {
    4242            $salt_key2 = bin2hex( random_bytes( 20 ) );
    43             add_option( 'infast_saltkey_2', $salt_key2, 'no' );           
     43            add_option( 'infast_saltkey_2', $salt_key2 );           
    4444        }
    4545
  • infast/tags/1.0.28/includes/infast-api/class-infast-woocommerce-auth-api.php

    r3094021 r3094250  
    8888        $url = INFAST_API_URL . 'oauth2/token';
    8989
     90        $client_id = '';
     91        $client_secret = '';
     92
    9093        $options = get_option( 'infast_woocommerce' );
    91         $client_secret = $this->decrypt_key( $options['client_secret'] );
     94        if( is_array($options) && array_key_exists('client_id', $options)) {
     95            $client_id = $options['client_id'];
     96        }
     97        if( is_array($options) && array_key_exists('client_secret', $options)) {
     98            $client_secret = $options['client_secret'];
     99        }
     100
     101        $client_secret = $this->decrypt_key( $client_secret );
    92102        $body = array(
    93             'client_id'     => $options['client_id'],
     103            'client_id'     => $client_id ,
    94104            'client_secret' => $client_secret,
    95105            'grant_type'    => 'client_credentials',
  • infast/tags/1.0.28/includes/infast-api/class-infast-woocommerce-item-api.php

    r2873870 r3094250  
    5555    public function get_product_description( $product ) {
    5656        $description = '';
     57
     58        $omit_item_description = false;
    5759        $options = get_option( 'infast_woocommerce' );
    58         if ( !$options['omit_item_description'] ) {
     60        if( is_array($options) && array_key_exists('omit_item_description', $options)) {
     61            $omit_item_description = $options['omit_item_description'];
     62        }
     63
     64        if ( !$omit_item_description ) {
    5965            // $description =
    6066            //     $product->get_description()
  • infast/tags/1.0.28/infast-woocommerce.php

    r3094190 r3094250  
    1717 * Plugin URI:        https://intia.fr/fr/plugin-woocommerce
    1818 * Description:       Create and email compliant invoices automatically with every order placed on your WooCommerce e-shop.
    19  * Version:           1.0.27
     19 * Version:           1.0.28
    2020 * Author:            INTIA
    2121 * Author URI:        https://intia.fr
     
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define( 'INFAST_WOOCOMMERCE_VERSION', '1.0.27' );
     40define( 'INFAST_WOOCOMMERCE_VERSION', '1.0.28' );
    4141
    4242/**
  • infast/trunk/README.txt

    r3094190 r3094250  
    44Requires at least: 5.6
    55Tested up to: 6.5.3
    6 Requires PHP: 7.2
    7 Stable tag: 1.0.27
     6Requires PHP: 7.0*
     7Stable tag: 1.0.28
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    127127
    128128== Changelog ==
     129= Version 1.0.28 =
     130- Amélioration interne
     131
    129132= Version 1.0.27 =
    130133- Amélioration interne : Vérification que le plugin WooCommerce est activé
  • infast/trunk/admin/class-infast-woocommerce-admin-settings.php

    r3094190 r3094250  
    138138
    139139        $options = get_option( 'infast_woocommerce' );
    140         $value = '';
    141         if( is_array($options) ) {
    142             $value = $options['client_id'];
    143         }
    144 
    145         ?>
    146         <input type='text' name='infast_woocommerce[client_id]' id="infast-client-id" value='<?php  echo esc_attr( $value ); ?>'>
     140        $client_id = '';
     141        if( is_array($options) && array_key_exists('client_id', $options)) {
     142            $client_id = $options['client_id'];
     143        }
     144
     145        ?>
     146        <input type='text' name='infast_woocommerce[client_id]' id="infast-client-id" value='<?php  echo esc_attr( $client_id ); ?>'>
    147147        <?php
    148148
     
    157157
    158158        $options = get_option( 'infast_woocommerce' );
    159         if ( $options && array_key_exists( 'client_secret', $options ) ) {
    160             $value = $options['client_secret'];
    161             if ( ! empty( $value ) )
    162                 $value = '*******************************';
    163         } else
    164             $value = '';
    165         ?>
    166         <input type='text' name='infast_woocommerce[client_secret]' id="infast-client-secret" value='<?php echo esc_attr( $value ); ?>'>
     159        $client_secret = '';
     160        if ( is_array($options) && array_key_exists( 'client_secret', $options ) ) {
     161            $client_secret = $options['client_secret'];
     162            if ( ! empty( $client_secret ) )
     163                $client_secret = '*******************************';
     164        }
     165        ?>
     166        <input type='text' name='infast_woocommerce[client_secret]' id="infast-client-secret" value='<?php echo esc_attr( $client_secret ); ?>'>
    167167        <?php
    168168    }
     
    176176
    177177        $options = get_option( 'infast_woocommerce' );
    178         ?>
    179         <input type="checkbox" name="infast_woocommerce[enable_email]" value="1" <?php if ( isset( $options['enable_email'] ) ) checked( $options['enable_email'], 1 ); ?>
     178        $enable_email = false;
     179        if( is_array($options) && array_key_exists('enable_email', $options)) {
     180            $enable_email = $options['enable_email'];
     181        }
     182        ?>
     183        <input type="checkbox" name="infast_woocommerce[enable_email]" value="1" <?php if ( isset ( $enable_email ) ) checked( $enable_email, 1 ); ?>
    180184        <?php
    181185
     
    190194
    191195        $options = get_option( 'infast_woocommerce' );
    192         ?>
    193         <input type="email" name="infast_woocommerce[cc_email]" value="<?php if ( isset ( $options['cc_email'] ) ) echo esc_attr( $options['cc_email'] ); ?>" />
     196        $cc_email = false;
     197        if( is_array($options) && array_key_exists('cc_email', $options)) {
     198            $cc_email = $options['cc_email'];
     199        }
     200        ?>
     201        <input type="email" name="infast_woocommerce[cc_email]" value="<?php if ( isset ( $cc_email ) ) echo esc_attr( $cc_email ); ?>" />
    194202        <?php
    195203
     
    204212
    205213        $options = get_option( 'infast_woocommerce' );
    206         ?>
    207         <input type="checkbox" name="infast_woocommerce[omit_item_description]" value="1" <?php if ( isset( $options['omit_item_description'] ) ) checked( $options['omit_item_description'], 1 ); ?> />
     214        $omit_item_description = false;
     215        if( is_array($options) && array_key_exists('omit_item_description', $options)) {
     216            $omit_item_description = $options['omit_item_description'];
     217        }
     218        ?>
     219        <input type="checkbox" name="infast_woocommerce[omit_item_description]" value="1" <?php if ( isset( $omit_item_description ) ) checked( $omit_item_description, 1 ); ?> />
    208220        <?php
    209221
     
    369381
    370382        if ( $option == 'infast_woocommerce' ) {
    371             if ( ( ! empty( $value['client_id'] ) && ! empty( $value['client_secret'] ) ) &&
    372                  ( $value['client_id'] != $old_value['client_id'] ||
    373                  $value['client_secret'] != $old_value['client_secret'] ) ) {
     383            $old_client_id = '';
     384            $old_client_secret = '';
     385            $new_client_id = '';
     386            $new_client_secret = '';
     387            if( is_array($value) && array_key_exists('client_id', $value)) {
     388                $new_client_id = $value['client_id'];
     389            }
     390            if( is_array($value) && array_key_exists('client_secret', $value)) {
     391                $new_client_secret = $value['client_secret'];
     392            }
     393            if( is_array($old_value) && array_key_exists('client_id', $old_value)) {
     394                $old_client_id = $old_value['client_id'];
     395            }
     396            if( is_array($old_value) && array_key_exists('client_secret', $old_value)) {
     397                $old_client_secret = $old_value['client_secret'];
     398            }
     399
     400            if ( ( ! empty( $new_client_id ) && ! empty( $new_client_secret ) ) &&
     401                 ( $new_client_id != $old_client_id ||
     402                 $new_client_secret != $old_client_secret ) ) {
    374403
    375404                $infast_auth_api = Infast_Woocommerce_Auth_Api::getInstance();
  • infast/trunk/admin/class-infast-woocommerce-admin.php

    r3094190 r3094250  
    264264
    265265    public function http_headers_useragent( $user_agent, $url) {
    266         return $user_agent . '; infast-plugin-version/1.0.27';
     266        return $user_agent . '; infast-plugin-version/1.0.28';
    267267    }   
    268268
  • infast/trunk/includes/class-infast-woocommerce-activator.php

    r2608798 r3094250  
    3535        if ( ! $stored_saltkey1 || empty( $stored_saltkey1 ) ) {
    3636            $salt_key1 = bin2hex( random_bytes( 20 ) );
    37             add_option( 'infast_saltkey_1', $salt_key1, 'no' );           
     37            add_option( 'infast_saltkey_1', $salt_key1 );           
    3838        }
    3939
     
    4141        if ( ! $stored_saltkey2 || empty( $stored_saltkey2 ) ) {
    4242            $salt_key2 = bin2hex( random_bytes( 20 ) );
    43             add_option( 'infast_saltkey_2', $salt_key2, 'no' );           
     43            add_option( 'infast_saltkey_2', $salt_key2 );           
    4444        }
    4545
  • infast/trunk/includes/infast-api/class-infast-woocommerce-auth-api.php

    r3094021 r3094250  
    8888        $url = INFAST_API_URL . 'oauth2/token';
    8989
     90        $client_id = '';
     91        $client_secret = '';
     92
    9093        $options = get_option( 'infast_woocommerce' );
    91         $client_secret = $this->decrypt_key( $options['client_secret'] );
     94        if( is_array($options) && array_key_exists('client_id', $options)) {
     95            $client_id = $options['client_id'];
     96        }
     97        if( is_array($options) && array_key_exists('client_secret', $options)) {
     98            $client_secret = $options['client_secret'];
     99        }
     100
     101        $client_secret = $this->decrypt_key( $client_secret );
    92102        $body = array(
    93             'client_id'     => $options['client_id'],
     103            'client_id'     => $client_id ,
    94104            'client_secret' => $client_secret,
    95105            'grant_type'    => 'client_credentials',
  • infast/trunk/includes/infast-api/class-infast-woocommerce-item-api.php

    r2873870 r3094250  
    5555    public function get_product_description( $product ) {
    5656        $description = '';
     57
     58        $omit_item_description = false;
    5759        $options = get_option( 'infast_woocommerce' );
    58         if ( !$options['omit_item_description'] ) {
     60        if( is_array($options) && array_key_exists('omit_item_description', $options)) {
     61            $omit_item_description = $options['omit_item_description'];
     62        }
     63
     64        if ( !$omit_item_description ) {
    5965            // $description =
    6066            //     $product->get_description()
  • infast/trunk/infast-woocommerce.php

    r3094190 r3094250  
    1717 * Plugin URI:        https://intia.fr/fr/plugin-woocommerce
    1818 * Description:       Create and email compliant invoices automatically with every order placed on your WooCommerce e-shop.
    19  * Version:           1.0.27
     19 * Version:           1.0.28
    2020 * Author:            INTIA
    2121 * Author URI:        https://intia.fr
     
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define( 'INFAST_WOOCOMMERCE_VERSION', '1.0.27' );
     40define( 'INFAST_WOOCOMMERCE_VERSION', '1.0.28' );
    4141
    4242/**
Note: See TracChangeset for help on using the changeset viewer.