Plugin Directory

Changeset 3281053


Ignore:
Timestamp:
04/24/2025 02:18:40 PM (10 months ago)
Author:
wpwham
Message:

Version 2.2.1 update

Location:
checkout-files-upload-woocommerce/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • checkout-files-upload-woocommerce/trunk/checkout-files-upload-woocommerce.php

    r3143042 r3281053  
    44Plugin URI: https://wpwham.com/products/checkout-files-upload-for-woocommerce/
    55Description: Let your customers upload files on (or after) WooCommerce checkout.
    6 Version: 2.2.0
     6Version: 2.2.1
    77Author: WP Wham
    8 Author URI: https://wpwham.com
     8Author URI: https://wpwham.com/
    99Text Domain: checkout-files-upload-woocommerce
    1010Domain Path: /langs
    11 Copyright: © 2018-2024 WP Wham
    12 WC tested up to: 9.2
     11Copyright: © 2018-2025 WP Wham
    1312License: GNU General Public License v3.0
    1413License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3938
    4039if ( ! defined( 'WPWHAM_CHECKOUT_FILES_UPLOAD_VERSION' ) ) {
    41     define( 'WPWHAM_CHECKOUT_FILES_UPLOAD_VERSION', '2.2.0' );
     40    define( 'WPWHAM_CHECKOUT_FILES_UPLOAD_VERSION', '2.2.1' );
    4241}
    4342if ( ! defined( 'WPWHAM_CHECKOUT_FILES_UPLOAD_DBVERSION' ) ) {
     
    6867 *
    6968 * @class   Alg_WC_Checkout_Files_Upload
    70  * @version 2.2.0
     69 * @version 2.2.1
    7170 * @since   1.0.0
    7271 */
     
    8281     * @since 1.0.0
    8382     */
    84     public $version = '2.2.0';
     83    public $version = '2.2.1';
    8584
    8685    /**
     
    110109     * Alg_WC_Checkout_Files_Upload Constructor.
    111110     *
    112      * @version 2.1.0
     111     * @version 2.2.1
    113112     * @since   1.0.0
    114113     * @access  public
     
    117116
    118117        // Set up localisation
    119         load_plugin_textdomain( 'checkout-files-upload-woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/langs/' );
     118        add_action( 'init', array( $this, 'load_localization' ) );
    120119
    121120        // Include required files
     
    146145        }
    147146
     147    }
     148
     149    /**
     150     * @since   2.2.1
     151     */
     152    public function load_localization() {
     153        load_plugin_textdomain( 'checkout-files-upload-woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/langs/' );
    148154    }
    149155   
  • checkout-files-upload-woocommerce/trunk/includes/class-alg-wc-checkout-files-upload.php

    r3143042 r3281053  
    33 * Checkout Files Upload
    44 *
    5  * @version 2.2.0
     5 * @version 2.2.1
    66 * @since   1.0.0
    77 * @author  Algoritmika Ltd.
     
    5858     * language_shortcode.
    5959     *
    60      * @version 1.4.5
     60     * @version 2.2.1
    6161     * @since   1.4.5
    6262     */
     
    6565        if ( isset( $atts['lang_text'] ) && isset( $atts['not_lang_text'] ) && ! empty( $atts['lang'] ) ) {
    6666            return ( ! defined( 'ICL_LANGUAGE_CODE' ) || ! in_array( strtolower( ICL_LANGUAGE_CODE ), array_map( 'trim', explode( ',', strtolower( $atts['lang'] ) ) ) ) ) ?
    67                 $atts['not_lang_text'] : $atts['lang_text'];
     67                esc_html( $atts['not_lang_text'] ) : esc_html( $atts['lang_text'] );
    6868        }
    6969        // E.g.: `[alg_wc_cfu_translate lang="EN,DE"]Translation for EN and DE[/alg_wc_cfu_translate][alg_wc_cfu_translate not_lang="EN,DE"]Translation for other languages[/alg_wc_cfu_translate]`
     
    7171            ( ! empty( $atts['lang'] )     && ( ! defined( 'ICL_LANGUAGE_CODE' ) || ! in_array( strtolower( ICL_LANGUAGE_CODE ), array_map( 'trim', explode( ',', strtolower( $atts['lang'] ) ) ) ) ) ) ||
    7272            ( ! empty( $atts['not_lang'] ) &&     defined( 'ICL_LANGUAGE_CODE' ) &&   in_array( strtolower( ICL_LANGUAGE_CODE ), array_map( 'trim', explode( ',', strtolower( $atts['not_lang'] ) ) ) ) )
    73         ) ? '' : $content;
     73        ) ? '' : esc_html( $content );
    7474    }
    7575   
     
    680680     * validate_on_checkout.
    681681     *
    682      * @version 2.1.0
     682     * @version 2.2.1
    683683     * @since   1.0.0
    684684     */
     
    691691            $local_session_started = true;
    692692        }
    693        
     693
     694        $checkout_content = get_post_field( 'post_content', get_option( 'woocommerce_checkout_page_id' ) );
     695        $has_shortcode = has_shortcode( $checkout_content, 'wpwham_checkout_files_uploader' );
     696
    694697        $total_number = apply_filters( 'alg_wc_checkout_files_upload_option', 1, 'total_number' );
    695698        for ( $i = 1; $i <= $total_number; $i++ ) {
     
    697700                'yes' === get_option( 'alg_checkout_files_upload_enabled_' . $i, 'yes' ) &&
    698701                $this->is_visible( $i ) &&
    699                 'disable' != get_option( 'alg_checkout_files_upload_hook_' . $i, 'woocommerce_before_checkout_form' )
     702                (
     703                    get_option( 'alg_checkout_files_upload_hook_' . $i, 'woocommerce_before_checkout_form' ) !== 'disable' ||
     704                    $has_shortcode
     705                )
    700706            ) {
    701707           
  • checkout-files-upload-woocommerce/trunk/readme.txt

    r3143042 r3281053  
    33Tags: woocommerce, checkout files upload, checkout, woo commerce
    44Requires at least: 4.4
    5 Tested up to: 6.6
    6 Stable tag: 2.2.0
     5Tested up to: 6.8
     6Stable tag: 2.2.1
    77License: GNU General Public License v3.0
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    7676
    7777== Changelog ==
     78
     79= 2.2.1 - 2025-04-24 =
     80* FIX: "file required" not working if uploader placed outside of main checkout form via shortcode (#89416).
     81* FIX: PHP notice.
     82* FIX: escape text in translation shortcodes.
    7883
    7984= 2.2.0 - 2024-08-28 =
Note: See TracChangeset for help on using the changeset viewer.