Plugin Directory

Changeset 3453503


Ignore:
Timestamp:
02/04/2026 06:10:38 AM (2 weeks ago)
Author:
ThemeHigh
Message:

V2.1.6

Location:
woo-checkout-field-editor-pro/trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-form-block-field.php

    r3370969 r3453503  
    380380    private function render_form_field_checkbox( $section = '' ){
    381381        $value_props = $this->field_props['value'];
    382         $value_props['label'] = __('Value', 'woocommerce');
     382        $value_props['label'] = __('Value', 'woo-checkout-field-editor-pro');
    383383
    384384        ?>
     
    469469        ?>
    470470        <tr>
    471             <td class="sub-title"><?php esc_html_e('Options', 'woocommerce'); ?></td>
     471            <td class="sub-title"><?php esc_html_e('Options', 'woo-checkout-field-editor-pro'); ?></td>
    472472            <?php $this->render_form_fragment_tooltip(); ?>
    473473            <td></td>
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-form.php

    r3221414 r3453503  
    205205            foreach($field['options'] as $value => $label){
    206206                $selected = $value === $fvalue ? 'selected' : '';
    207                 $field_html .= '<option value="'. esc_attr(trim($value)) .'" '.esc_attr($selected).'>'. esc_html__($label, 'woo-checkout-field-editor-pro') .'</option>';
     207                $label = THWCFD_Utils::translate_dynamic_text($label, 'option');
     208                $field_html .= '<option value="'. esc_attr(trim($value)) .'" '.esc_attr($selected).'>'. esc_html($label) .'</option>';
    208209            }
    209210            $field_html .= '</select>';
     
    229230            foreach($field['options'] as $value => $label){
    230231                //$selected = $value === $fvalue ? 'selected' : '';
    231                 $field_html .= '<option value="'. esc_attr(trim($value)) .'" >'. esc_html__($label, 'woo-checkout-field-editor-pro') .'</option>';
     232                $label = THWCFD_Utils::translate_dynamic_text($label, 'option');
     233                $field_html .= '<option value="'. esc_attr(trim($value)) .'" >'. esc_html($label) .'</option>';
    232234            }
    233235            $field_html .= '</select>';
     
    250252                        $value = $value.$field['glue'].trim($label);
    251253                    }
    252 
    253                     $field_html .= '<option value="'. esc_attr($value) .'">'. esc_html__($label, 'woo-checkout-field-editor-pro') .'</option>';
     254                    $label = THWCFD_Utils::translate_dynamic_text($label, 'option');
     255                    $field_html .= '<option value="'. esc_attr($value) .'">'. esc_html($label) .'</option>';
    254256                }
    255257
     
    289291
    290292            $fid    = $args['id_prefix']. $field['name'];
    291             $flabel = isset($field['label']) && !empty($field['label']) ? __($field['label'], 'woo-checkout-field-editor-pro') : '';
     293            $flabel = isset($field['label']) && !empty($field['label']) ? THWCFD_Utils::translate_dynamic_text($field['label'], 'label') : '';
    292294
    293295            $field_props  = $this->prepare_form_field_props($field, $atts);
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-advanced.php

    r3188388 r3453503  
    218218       
    219219        $imp_exp_fields = array(
    220             'section_import_export' => array('title'=>__('Backup and Import Settings', 'woo-checkout-field-editor'), 'type'=>'separator', 'colspan'=>'3'),
     220            'section_import_export' => array('title'=>__('Backup and Import Settings', 'woo-checkout-field-editor-pro'), 'type'=>'separator', 'colspan'=>'3'),
    221221            'settings_data' => array(
    222                 'name'=>'settings_data', 'label'=>__('Plugin Settings Data', 'woo-checkout-field-editor'), 'type'=>'textarea', 'value' => $plugin_settings,
    223                 'sub_label'=>__('You can transfer the saved settings data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click "Import Settings".', 'woo-checkout-field-editor'),
     222                'name'=>'settings_data', 'label'=>__('Plugin Settings Data', 'woo-checkout-field-editor-pro'), 'type'=>'textarea', 'value' => $plugin_settings,
     223                'sub_label'=>__('You can transfer the saved settings data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click "Import Settings".', 'woo-checkout-field-editor-pro'),
    224224            ),
    225225        );
     
    238238                            <td colspan="2">&nbsp;</td>
    239239                            <td class="submit">
    240                                 <input type="submit" name="save_plugin_settings" class="btn btn-small btn-primary" value="<?php esc_attr_e('Import Settings', 'woo-checkout-field-editor'); ?>">
     240                                <input type="submit" name="save_plugin_settings" class="btn btn-small btn-primary" value="<?php esc_attr_e('Import Settings', 'woo-checkout-field-editor-pro'); ?>">
    241241                                <?php wp_nonce_field( 'import_wcfd_settings', 'import_wcfd_nonce' ); ?>
    242242                            </td>
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-block-fields.php

    r3370969 r3453503  
    184184                               
    185185                                if(isset($property['status']) && $property['status'] == 1){
    186                                     $statusHtml = $pvalue == 1 ? '<span class="dashicons dashicons-yes tips" data-tip="'. esc_attr(__('Yes', 'woocommerce')).'"></span>' : '-';
     186                                    $statusHtml = $pvalue == 1 ? '<span class="dashicons dashicons-yes tips" data-tip="'. esc_attr(__('Yes', 'woo-checkout-field-editor-pro')).'"></span>' : '-';
    187187                                    ?>
    188188                                    <td class="td_<?php echo esc_attr($pname); ?> status"><?php echo wp_kses($statusHtml, array('span' => array('class' => true))); ?></td>
     
    319319            if(THWCFD_Utils_Section::is_valid_section($section)){
    320320                $f_names = !empty( $_POST['f_name'] ) ? $_POST['f_name'] : array();
     321                $f_names = array_map('sanitize_key', $f_names);
    321322                if(empty($f_names)){
    322323                    echo '<div class="error"><p> '. esc_html__('Your changes were not saved due to no fields found.', 'woo-checkout-field-editor-pro') .'</p></div>';
     
    325326               
    326327                $f_order   = !empty( $_POST['f_order'] ) ? $_POST['f_order'] : array();
     328                $f_order = array_map('absint', $f_order);
    327329                $f_deleted = !empty( $_POST['f_deleted'] ) ? $_POST['f_deleted'] : array();
    328                 $f_enabled = !empty( $_POST['f_enabled'] ) ? $_POST['f_enabled'] : array();     
     330                $f_deleted = array_map('absint', $f_deleted);
     331                $f_enabled = !empty( $_POST['f_enabled'] ) ? $_POST['f_enabled'] : array();
     332                $f_enabled = array_map('absint', $f_enabled);       
    329333                $sname = $section->get_property('name');
    330334                $field_set = THWCFD_Utils_Section::get_fields($section);
     
    515519        $c_url = $this->get_admin_url($this->page_id, 'classic');
    516520        $b_url = $this->get_admin_url($this->page_id, 'block');
    517         $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woocommerce-checkout-field-editor-pro');
    518         if ( !empty( $_GET['c_type'] ) && 'block' == $_GET['c_type'] ) {
    519             $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woocommerce-checkout-field-editor-pro');
     521        $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro');
     522        if ( !empty( $_GET['c_type'] ) && 'block' == sanitize_key($_GET['c_type'] )) {
     523            $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro');
    520524        }
    521525        ?>
     
    555559       
    556560        $result = false;
    557         $s_action = isset($_POST['s_action']) ? $_POST['s_action'] : false;
     561        $s_action = isset($_POST['s_action']) ? sanitize_text_field(wp_unslash($_POST['s_action'])) : false;
    558562
    559563        if($s_action == 'edit'){
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-general.php

    r3370969 r3453503  
    153153                        $label = isset($field['label']) ? $field['label'] : '';
    154154                        $placeholder = isset($field['placeholder']) ? $field['placeholder'] : '';
     155                        $label = THWCFD_Utils::translate_dynamic_text($label, 'label');
     156                        $placeholder = THWCFD_Utils::translate_dynamic_text($placeholder, 'placeholder');
    155157                        $validate = isset($field['validate']) ? $field['validate'] : '';
    156158                        $required = isset($field['required']) && $field['required'] ? 1 : 0;
     
    185187                            <td class="td_name"><?php echo esc_html( $name ); ?></td>
    186188                            <td class="td_type"><?php echo esc_html($type); ?></td>
    187                             <td class="td_label"><?php echo esc_html_e($label, 'woo-checkout-field-editor-pro'); ?></td>
    188                             <td class="td_placeholder"><?php echo esc_html_e($placeholder, 'woo-checkout-field-editor-pro'); ?></td>
     189                            <?php /*
     190                            // The following lines were removed because they violate WordPress i18n rules.
     191                            <td class="td_placeholder"><?php echo esc_html_e($placeholder, 'woo-checkout-field-editor-pro'); ?></td>
     192                            <td class="td_placeholder"><?php echo esc_html_e($placeholder, 'woo-checkout-field-editor-pro'); ?></td>
     193                            */ ?>
     194                            <td class="td_label"><?php echo esc_html($label); ?></td>
     195                            <td class="td_placeholder"><?php echo esc_html($placeholder); ?></td>
    189196                            <td class="td_validate"><?php echo esc_html($validate); ?></td>
    190197                            <td class="td_required status"><?php echo wp_kses($required_status, array('span' => array('class' => true))); ?></td>
     
    461468                    if(!empty($value)){
    462469                        $value = THWCFD_Utils::get_option_text($field, $value);
    463                         $label = isset($field['label']) && $field['label'] ? esc_html($field['label'], 'woo-checkout-field-editor-pro') : $name;
     470                        $label = isset($field['label']) && $field['label'] ? esc_html(THWCFD_Utils::translate_dynamic_text($field['label'], 'label')) : $name;
    464471                        $html .= '<p><strong>'. esc_html($label) .':</strong><br/> '. wp_kses_post(wptexturize($value)) .'</p>';
    465472                    }
     
    513520        $c_url = $this->get_admin_url($this->page_id, 'classic');
    514521        $b_url = $this->get_admin_url($this->page_id, 'block');
    515         $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woocommerce-checkout-field-editor-pro');
    516         if ( !empty( $_GET['c_type'] ) && 'block' == $_GET['c_type'] ) {
    517             $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woocommerce-checkout-field-editor-pro');
     522        $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro');
     523        if ( !empty( $_GET['c_type'] ) && 'block' == sanitize_key($_GET['c_type'] )) {
     524            $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro');
    518525        }
    519526        ?>
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-pro.php

    r3118023 r3453503  
    4646
    4747        if($now > $render_time){
    48             $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source=free&utm_medium=premium_tab&utm_campaign=wcfe_upgrade_link";
     48            $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_premium_tab_upgrade_link";
    4949        }else{
    50             $url = "https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=free&utm_medium=premium_tab&utm_campaign=wcfe_upgrade_link";
     50            $url = "https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_premium_tab_upgrade_link";
    5151        }
    5252
     
    7676                    <h3 class="trydemo-heading">The Golden Perks that Come with the Checkout Field Editor Pro</h3>
    7777                    <p class="try-demo-desc">The numerous advanced features that accompany the Checkout Field Editor Pro for WooCommerce plugin lets you create an organized and flawless checkout page. Why wait? Go pro and advance your checkout page to the next level now.</p>
    78                     <div class="th-pro-btn"><a class="btn-get-pro" onclick="this.classList.add('clicked')" href="<?php echo esc_url($url); ?>" target="_blank" rel="noopener noreferrer" >Get Pro</a><a class="btn-try-demo" href="https://flydemos.com/wcfe/?utm_source=free&utm_medium=banner&utm_campaign=trydemo"
     78                    <div class="th-pro-btn"><a class="btn-get-pro" onclick="this.classList.add('clicked')" href="<?php echo esc_url($url); ?>" target="_blank" rel="noopener noreferrer" >Get Pro</a><a class="btn-try-demo" href="https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=premium_tab_try_demo"
    7979                        target="_blank" rel="noopener noreferrer" onclick="this.classList.add('clicked')" >Try Demo</a></div>
    8080                    <!-- <img class="vedio" src="" alt="no img">  ADD vedio tutorial-->
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-themehigh-plugins.php

    r3160299 r3453503  
    231231                    // The plugin is already active.
    232232                    $button = array(
    233                         'message' => esc_attr__( 'Activated', 'storefront' ),
     233                        'message' => esc_attr__( 'Activated', 'woo-checkout-field-editor-pro' ),
    234234                        'url'     => '#',
    235235                        'classes' => array('button', 'disabled' ),
     
    244244                    // The plugin exists but isn't activated yet.
    245245                    $button = array(
    246                         'message' => esc_attr__( 'Activate', 'storefront' ),
     246                        'message' => esc_attr__( 'Activate', 'woo-checkout-field-editor-pro' ),
    247247                        'url'     => $url,
    248248                        'classes' => array( 'activate-now', 'button' ),
     
    265265                    );
    266266                    $button = array(
    267                         'message' => esc_attr__( 'Install now', 'storefront' ),
     267                        'message' => esc_attr__( 'Install now', 'woo-checkout-field-editor-pro' ),
    268268                        'url'     => $url,
    269269                        'classes' => array('button-primary', 'install-now', 'install-' . $plugin_slug ),
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings.php

    r3370969 r3453503  
    157157       
    158158            $ftype     = isset($field['type']) ? $field['type'] : 'text';
    159             $flabel    = isset($field['label']) && !empty($field['label']) ? __($field['label'], 'woo-checkout-field-editor-pro') : '';
    160             $sub_label = isset($field['sub_label']) && !empty($field['sub_label']) ? __($field['sub_label'], 'woo-checkout-field-editor-pro') : '';
    161             $tooltip   = isset($field['hint_text']) && !empty($field['hint_text']) ? __($field['hint_text'], 'woo-checkout-field-editor-pro') : '';
     159            $flabel    = isset($field['label']) && !empty($field['label']) ? $field['label'] : '';
     160            $sub_label = isset($field['sub_label']) && !empty($field['sub_label']) ? $field['sub_label'] : '';
     161            $tooltip   = isset($field['hint_text']) && !empty($field['hint_text']) ? $field['hint_text'] : '';
    162162           
    163163            $field_html = '';
     
    258258       
    259259            $fid    = 'a_f'. $field['name'];
    260             $flabel = isset($field['label']) && !empty($field['label']) ? __($field['label'], 'woo-checkout-field-editor-pro') : '';
     260            $flabel = isset($field['label']) && !empty($field['label']) ? $field['label'] : '';
    261261           
    262262            $field_props  = $this->prepare_form_field_props($field, $atts);
  • woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin.php

    r3370969 r3453503  
    7070        $settings_link = '<a href="'.esc_url(admin_url('admin.php?page=checkout_form_designer')).'">'. __('Settings', 'woo-checkout-field-editor-pro') .'</a>';
    7171        array_unshift($links, $settings_link);
    72         $pro_link = '<a style="color:green; font-weight:bold" target="_blank" href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=free&utm_medium=plugin_action_link&utm_campaign=wcfe_upgrade_link">'. __('Get Pro', 'woo-checkout-field-editor-pro') .'</a>';
     72        $pro_link = '<a style="color:green; font-weight:bold" target="_blank" href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_settings_upgrade_link">'. __('Get Pro', 'woo-checkout-field-editor-pro') .'</a>';
    7373        array_push($links,$pro_link);
    7474
     
    8686        if ( 'woo-checkout-field-editor-pro/checkout-form-designer.php' === $plugin_file ) {
    8787            $plugin_meta[] = '<a href="https://www.facebook.com/groups/themehigh/" target="_blank">' . esc_html__( 'Join Community', 'woo-checkout-field-editor-pro' ) . '</a>';
    88             $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews/?filter=5" target="_blank">' . esc_html__( 'Review us', 'woo-checkout-field-editor-pro' ) . '</a>';
     88            $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews/" target="_blank">' . esc_html__( 'Review us', 'woo-checkout-field-editor-pro' ) . '</a>';
    8989        }
    9090        return $plugin_meta;
     
    9696        echo '<h2>'. esc_html__('Checkout Form', 'woo-checkout-field-editor-pro') .'</h2>';
    9797        $tab = $this->get_current_tab();
    98         $c_type = isset( $_GET['c_type'] ) ? esc_attr( $_GET['c_type'] ) : 'classic';
     98        $c_type = isset( $_GET['c_type'] ) ? sanitize_key( $_GET['c_type'] ) : 'classic';
    9999
    100100        echo '<div class="thwcfd-wrap">';
     
    138138                    <span class="th-warning-message-panel__inner-text">
    139139                    <?php
     140                       
    140141                        printf(
     142                            /* translators: %s: Support team link */
    141143                            esc_html__("Our Checkout Field Editor now supports WooCommerce Checkout Blocks! Currently, a few field types are available, and more will be added soon.
    142144                            If you're using Block Checkout, make sure to switch to the Block Checkout Fields tab, otherwise, your changes won’t be reflected. Have questions or need help?
    143                             Reach out to our  %s .", 'woocommerce-checkout-field-editor-pro'),
     145                            Reach out to our  %s .", 'woo-checkout-field-editor-pro'),
    144146                            '<a href="https://www.themehigh.com/docs/support/" target="_blank" class="quick-widget-support-link">' . esc_html__(' Support team', 'woo-checkout-field-editor-pro') . '</a>'
    145147                        );
     
    513515        $dismiss_url = $admin_url . '&thwcfd_discount_popup_dismiss=true&thwcfd_discount_popup_nonce=' . wp_create_nonce( 'thwcfd_discount_popup_security');
    514516
    515         $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source=free&utm_medium=premium_tab&utm_campaign=wcfe_upgrade_link";
     517        $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_premium_tab_upgrade_link";
    516518
    517519        $current_page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash($_GET['page']))  : '';
     
    615617                                    </svg>
    616618                                </div>
    617                                 <a href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=free&utm_medium=quicklinks&utm_campaign=wcfe_upgrade_link" target="_blank" class="quick-widget-doc-link">Upgrade to Premium</a></li>
     619                                <a href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_settings_upgrade_link" target="_blank" class="quick-widget-doc-link">Upgrade to Premium</a></li>
    618620                            <li>
    619621
     
    726728        return true;
    727729    }
     730
     731    public function remove_welcome_page_menu() {
     732        remove_submenu_page( 'index.php', 'thwcfd-welcome' );
     733    }
    728734}
    729735
  • woo-checkout-field-editor-pro/trunk/admin/thwcfd-landing-page.php

    r3370969 r3453503  
    1818        <meta name="viewport" content="width=device-width" />
    1919        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    20         <title><?php esc_html_e( 'Checkout field editor Landing page', 'woocommerce-checkout-field-editor-pro' ); ?></title>
     20        <title><?php esc_html_e( 'Checkout field editor Landing page', 'woo-checkout-field-editor-pro' ); ?></title>
    2121    </head>
    2222    <body class="thwcfd-admin-page thwcfd-landing-page wp-core-ui">
     
    3636                    </div>
    3737                </div>
    38                 <h1 style="font-weight: 700;"><?php esc_html_e("Welcome to Checkout Field Editor!", 'woocommerce-checkout-field-editor-pro' ); ?></h1>
     38                <h1 style="font-weight: 700;"><?php esc_html_e("Welcome to Checkout Field Editor!", 'woo-checkout-field-editor-pro' ); ?></h1>
    3939                <p class ="th-desc-head" >
    40                 <?php esc_html_e( "We’re excited to have you on board! Now, you can easily customize your WooCommerce checkout using both the Block Checkout Editor and the Classic Checkout Field Editor. Enjoy complete flexibility and control! " , 'woocommerce-checkout-field-editor-pro' ); ?>
     40                <?php esc_html_e( "We’re excited to have you on board! Now, you can easily customize your WooCommerce checkout using both the Block Checkout Editor and the Classic Checkout Field Editor. Enjoy complete flexibility and control! " , 'woo-checkout-field-editor-pro' ); ?>
    4141                </p>
    4242               
    4343                <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=classic')); ?>" class="th-get-started-btn">
    44                     <?php esc_html_e("Get Started" , 'woocommerce-checkout-field-editor-pro' ); ?>
     44                    <?php esc_html_e("Get Started" , 'woo-checkout-field-editor-pro' ); ?>
    4545                </a>
    4646
    4747                <div class="th-read-more">
    48                     <p> <?php esc_html_e("Learn more about both editors to make the most out of your checkout", 'woocommerce-checkout-field-editor-pro' ); ?>  </p>
     48                    <p> <?php esc_html_e("Learn more about both editors to make the most out of your checkout", 'woo-checkout-field-editor-pro' ); ?>  </p>
    4949                    <!-- <button>
    50                     <?php //esc_html_e("Read More!", 'woocommerce-checkout-field-editor-pro' ); ?>
     50                    <?php //esc_html_e("Read More!", 'woo-checkout-field-editor-pro' ); ?>
    5151                    </button> -->
    5252                    <a href="https://www.themehigh.com/docs/classic-vs-block-checkout/" target="_blank" rel="noopener noreferrer">
    5353                        <button type="button">
    54                             <?php esc_html_e("Read More!", 'woocommerce-checkout-field-editor-pro' ); ?>
     54                            <?php esc_html_e("Read More!", 'woo-checkout-field-editor-pro' ); ?>
    5555                        </button>
    5656                    </a>
     
    5858
    5959                <div class="th-sub-content" style="">
    60                     <p ><?php esc_html_e("We support both Classic and Block Checkout. Choose the one you're using", 'woocommerce-checkout-field-editor-pro' ); ?></p>
    61                     <h2><?php esc_html_e("Which Checkout Fields should you use?", 'woocommerce-checkout-field-editor-pro' ); ?> </h2>
     60                    <p ><?php esc_html_e("We support both Classic and Block Checkout. Choose the one you're using", 'woo-checkout-field-editor-pro' ); ?></p>
     61                    <h2><?php esc_html_e("Which Checkout Fields should you use?", 'woo-checkout-field-editor-pro' ); ?> </h2>
    6262
    6363                    <div class="th-diff-box-wrap">
     
    7070                                </svg>
    7171                                <div>
    72                                     <h3><?php esc_html_e("Classic Checkout", 'woocommerce-checkout-field-editor-pro' ); ?></h3>
     72                                    <h3><?php esc_html_e("Classic Checkout", 'woo-checkout-field-editor-pro' ); ?></h3>
    7373                                    <ul>
    7474                                        <li>
     
    7676                                                <use xlink:href="#bullet-icon"></use>
    7777                                            </svg> 
    78                                             <p><?php esc_html_e("Use this if you’re still using the traditional WooCommerce checkout page.", 'woocommerce-checkout-field-editor-pro' ); ?></p>
     78                                            <p><?php esc_html_e("Use this if you’re still using the traditional WooCommerce checkout page.", 'woo-checkout-field-editor-pro' ); ?></p>
    7979                                        </li>
    8080                                        <li>
     
    8282                                                <use xlink:href="#bullet-icon"></use>
    8383                                            </svg>
    84                                             <p><?php esc_html_e("Compatible with older checkout layouts.", 'woocommerce-checkout-field-editor-pro' ); ?></p>
     84                                            <p><?php esc_html_e("Compatible with older checkout layouts.", 'woo-checkout-field-editor-pro' ); ?></p>
    8585                                        </li>
    8686                                        <li>
     
    8888                                                <use xlink:href="#bullet-icon"></use>
    8989                                            </svg>
    90                                             <p><?php esc_html_e("Best for users who prefer the classic, non-block experience.", 'woocommerce-checkout-field-editor-pro' ); ?> </p>
     90                                            <p><?php esc_html_e("Best for users who prefer the classic, non-block experience.", 'woo-checkout-field-editor-pro' ); ?> </p>
    9191                                        </li>
    9292                                    </ul>
     
    101101                            <div class="th-diff-box-content">
    102102                                <div>
    103                                     <h3 style="font-weight: bold;"><?php esc_html_e("Block Checkout", 'woocommerce-checkout-field-editor-pro' ); ?></h3>
     103                                    <h3 style="font-weight: bold;"><?php esc_html_e("Block Checkout", 'woo-checkout-field-editor-pro' ); ?></h3>
    104104                                    <ul>
    105105                                        <li>
     
    107107                                                <use xlink:href="#bullet-icon"></use>
    108108                                            </svg>
    109                                             <p> <?php esc_html_e("Use this if you’ve transitioned to WooCommerce’s new Block-based checkout.", 'woocommerce-checkout-field-editor-pro' ); ?></p>
     109                                            <p> <?php esc_html_e("Use this if you’ve transitioned to WooCommerce’s new Block-based checkout.", 'woo-checkout-field-editor-pro' ); ?></p>
    110110                                        </li>
    111111                                        <li>
     
    113113                                                <use xlink:href="#bullet-icon"></use>
    114114                                            </svg>
    115                                             <p> <?php esc_html_e( "Easier to customize with block elements.", 'woocommerce-checkout-field-editor-pro'); ?> </p>
     115                                            <p> <?php esc_html_e( "Easier to customize with block elements.", 'woo-checkout-field-editor-pro'); ?> </p>
    116116                                        </li>
    117117                                        <li>
     
    119119                                                <use xlink:href="#bullet-icon"></use>
    120120                                            </svg>
    121                                             <p> <?php esc_html_e("Best for users looking for a more modern, flexible checkout design",'woocommerce-checkout-field-editor-pro'); ?>.</p>
     121                                            <p> <?php esc_html_e("Best for users looking for a more modern, flexible checkout design",'woo-checkout-field-editor-pro'); ?>.</p>
    122122                                        </li>
    123123                                    </ul>
     
    130130                    <div class="th-btn-box">
    131131                        <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=classic')); ?>" class="th-choose-btn">
    132                             <?php esc_html_e('Go with Classic Checkout Editor', 'woocommerce-checkout-field-editor-pro') ?>
     132                            <?php esc_html_e('Go with Classic Checkout Editor', 'woo-checkout-field-editor-pro') ?>
    133133                        </a>
    134134                        <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=block')); ?>" class="th-choose-btn">
    135                             <?php esc_html_e('Go with Block Checkout Editor', 'woocommerce-checkout-field-editor-pro') ?>
     135                            <?php esc_html_e('Go with Block Checkout Editor', 'woo-checkout-field-editor-pro') ?>
    136136                        </a>
    137137                    </div>
    138138                </div>
    139139                <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=classic')); ?>" class="th-get-started-btn">
    140                     <?php esc_html_e("Let's Get started", 'woocommerce-checkout-field-editor-pro' ); ?>
     140                    <?php esc_html_e("Let's Get started", 'woo-checkout-field-editor-pro' ); ?>
    141141                </a>
    142142            </div>
  • woo-checkout-field-editor-pro/trunk/block/assets/dist/style-additional-sections-frontend-rtl.css

    r3370969 r3453503  
    1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:0 2.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}
     1.wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em 2.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}.wc-block-checkout__additional-fields__field{margin-top:10px}
  • woo-checkout-field-editor-pro/trunk/block/assets/dist/style-additional-sections-frontend.css

    r3370969 r3453503  
    1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:0 calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}
     1.wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}.wc-block-checkout__additional-fields__field{margin-top:10px}
  • woo-checkout-field-editor-pro/trunk/block/assets/dist/style-contact-info-section-frontend-rtl.css

    r3370969 r3453503  
    1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:0 2.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}
     1.wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em 2.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}
  • woo-checkout-field-editor-pro/trunk/block/assets/dist/style-contact-info-section-frontend.css

    r3370969 r3453503  
    1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:0 calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}
     1.wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}
  • woo-checkout-field-editor-pro/trunk/block/class-thwcfd-block-order-data.php

    r3221414 r3453503  
    259259
    260260            if($title){
    261                 $title    = __($title, 'woo-checkout-field-editor-pro');
     261                //$title    = __($title, 'woo-checkout-field-editor-pro');
     262                $title    = THWCFD_Utils::translate_dynamic_text($title, 'label');
    262263                $subtitle = $section->get_property('subtitle');
    263264                $subtitle = apply_filters('thwcfe_section_subtitle', $subtitle, $section->name, $context);
    264                 $subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';
     265                //$subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';
    265266
    266267                if($context === self::VIEW_ADMIN_ORDER){
     
    396397            if($title || $subtitle){
    397398                if($esc_attr_label){
    398                     $title    = $title ? __($title,'woo-checkout-field-editor-pro') : '';
    399                     $subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';
     399                    $title    = $title ? THWCFD_Utils::translate_dynamic_text($title, 'label') : '';
     400                    //$subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';
    400401                }else{
    401                     $title    = $title ? __($title,'woo-checkout-field-editor-pro') : '';
    402                     $subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';
     402                    $title    = $title ? THWCFD_Utils::translate_dynamic_text($title, 'label') : '';
     403                    //$subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';
    403404                }
    404405
     
    417418            if(!empty($value) || (($value === '0') && apply_filters( 'thwcfe_accept_value_zero',false))){
    418419                $title = $field->get_property('title') ? $field->get_property('title') : $name;
    419                 $title = $esc_attr_label ? __($title, 'woo-checkout-field-editor-pro') : __($title, 'woo-checkout-field-editor-pro');
     420                $title = THWCFD_Utils::translate_dynamic_text( $title, 'label' );
    420421
    421422                if($type === 'file'){
  • woo-checkout-field-editor-pro/trunk/block/class-thwcfd-block.php

    r3370969 r3453503  
    7474           
    7575            if (isset($field_data['label'])) {
    76                 $field_data['label'] = __($field_data['label'], 'woo-checkout-field-editor-pro');
     76                //$field_data['label'] = __($field_data['label'], 'woo-checkout-field-editor-pro');
     77                $field_data['label'] = THWCFD_Utils::translate_dynamic_text($field_data['label'], 'label');
    7778            }
    7879            woocommerce_register_additional_checkout_field(
     
    8283                    'optionalLabel' =>  $remove_optional ? $field_data['label'] : sprintf(
    8384                        /* translators: %s Field label. */
    84                         __( '%s (optional)', 'woocommerce' ),
     85                        __( '%s (optional)', 'woocommerce' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
    8586                        $field_data['label']
    8687                    ),
     
    103104        $field_options = array();
    104105        foreach ($options as $option) {
     106            $option['text'] = THWCFD_Utils::translate_dynamic_text($option['text'], 'option');
    105107            $field_options[] = array(
    106108                'label' => $option['text'],
     
    171173            }
    172174            if (isset($field_set[$key])) {
    173                 $field['index'] = $field_set[$key]['priority'] ?? $field['index'];
     175                //$field['index'] = $field_set[$key]['priority'] ?? $field['index'];
     176                $field['index'] = ! empty( $field_set[$key]['priority'] )? $field_set[$key]['priority'] : $field['index'];
    174177               
    175178                if(apply_filters('thwcfe_block_address_field_dynamic_label', true)){
     
    194197
    195198            if(isset($field['label'])){
    196                 $field['label'] = __($field['label'], 'woo-checkout-field-editor-pro');
     199               // $field['label'] = __($field['label'], 'woo-checkout-field-editor-pro');
     200                $field['label'] = THWCFD_Utils::translate_dynamic_text($field['label'], 'label');
    197201            }
    198202        }
     
    225229
    226230            if(isset($field['label'])){
    227                 $field['label'] = __($field['label'], 'woo-checkout-field-editor-pro');
     231                //$field['label'] = __($field['label'], 'woo-checkout-field-editor-pro');
     232                $field['label'] = THWCFD_Utils::translate_dynamic_text($field['label'], 'label');
    228233            }
    229234        }
     
    252257                case 'email':
    253258                    if (!empty($field_value) && !is_email($field_value)) {
    254                         // Translators: %s is the title of the field being validated.
    255259                        $errors->add(
    256260                            'invalid_email_field',
    257261                            sprintf(
     262                                /* translators: %s is the title of the field being validated. */
    258263                                __('The provided %s is not a valid email address.', 'woo-checkout-field-editor-pro'),
    259264                                esc_html($field_properties['title'] ?? 'value')
     
    265270                case 'phone':
    266271                    if (!empty($field_value) && !\WC_Validation::is_phone($field_value)) {
    267                         // Translators: %s is the title of the field being validated.
     272                       
    268273                        $errors->add(
    269274                            'invalid_phone_field',
    270275                            sprintf(
     276                                // translators: %s is the title of the field being validated.
    271277                                __('The provided %s is not a valid phone number.', 'woo-checkout-field-editor-pro'),
    272278                                esc_html($field_properties['title'] ?? 'value')
     
    278284                case 'postcode':
    279285                    if (!empty($field_value) && !\WC_Validation::is_postcode($field_value)) {
    280                         // Translators: %s is the title of the field being validated.
     286                       
    281287                        $errors->add(
    282288                            'invalid_postcode',
    283289                            sprintf(
     290                                // translators: %s is the title of the field being validated.
    284291                                __('The provided %s is not a valid postcode.', 'woo-checkout-field-editor-pro'),
    285292                                esc_html($field_properties['title'] ?? 'value')
  • woo-checkout-field-editor-pro/trunk/changelog.txt

    r3370969 r3453503  
    11== Changelog ==
     2= 2.1.6 =
     3* Added compatiblity for Archiva for WooCommerce.
     4* Improved dynamic string translation for WPML.
     5* Added WooCommerce 10.4 compatibility.
     6* Added WordPress 6.9 compatibility.
     7
    28= 2.1.5 =
    39* Added required validation for the checkbox field in the block checkout (WC 9.8+).
  • woo-checkout-field-editor-pro/trunk/checkout-form-designer.php

    r3370969 r3453503  
    44 * Description: Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields).
    55 * Author:      ThemeHigh
    6  * Version:     2.1.5
     6 * Version:     2.1.6
    77 * Author URI:  https://www.themehigh.com
    88 * Plugin URI:  https://www.themehigh.com
     9 * License:     GPLv2 or later
    910 * Text Domain: woo-checkout-field-editor-pro
    1011 * Domain Path: /languages
    1112 * WC requires at least: 3.0.0
    12  * WC tested up to: 10.2
     13 * WC tested up to: 10.4
    1314 */
    1415 
     
    2627
    2728if(is_woocommerce_active()) {
    28     define('THWCFD_VERSION', '2.1.5');
     29    define('THWCFD_VERSION', '2.1.6');
    2930    !defined('THWCFD_BASE_NAME') && define('THWCFD_BASE_NAME', plugin_basename( __FILE__ ));
    3031    !defined('THWCFD_PATH') && define('THWCFD_PATH', plugin_dir_path( __FILE__ ));
  • woo-checkout-field-editor-pro/trunk/includes/class-thwcfd.php

    r3370969 r3453503  
    3232    public function init(){
    3333        $this->define_constants();
    34         $this->set_locale();
     34        //$this->set_locale();
    3535        $this->define_admin_hooks();
    3636        $this->define_public_hooks();
     
    5353    }
    5454
    55     private function set_locale() {
    56         add_action('plugins_loaded', array($this, 'load_plugin_textdomain'));
    57     }
    58 
    59     public function load_plugin_textdomain(){
     55    /************ Note: Manual loading of the plugin text domain is intentionally omitted.
     56     * Since WordPress 4.6+, translations for plugins hosted on WordPress.org are loaded automatically using Just-In-Time (JIT) loading.
     57     * This plugin requires WordPress 4.9 or higher, so no explicit call to load_plugin_textdomain is needed here.
     58    */
     59
     60    /*private function set_locale() {
     61        // WordPress 4.6+ JIT loading of textdomains. This for backward compatibility logging purpose only.
     62        $domain = self::TEXT_DOMAIN;
     63        if ( is_textdomain_loaded( $domain ) ) {
     64            return;
     65        }
     66        // Determine locale safely (WP 5.0+)
     67        $locale = function_exists( 'determine_locale' )
     68            ? determine_locale()
     69            : get_locale();
     70
     71        $mofile = WP_LANG_DIR . '/plugins/' . $domain . '-' . $locale . '.mo';
     72        if ( file_exists( $mofile ) ) {
     73            load_textdomain( $domain, $mofile );
     74            return;
     75        }
     76        load_plugin_textdomain(
     77            $domain,
     78            false,
     79            dirname( THWCFD_BASE_NAME ) . '/languages/'
     80        );
     81        //plugins_loaded hook not required as load_plugin_textdomain called in init method
     82        //add_action('plugins_loaded', array($this, 'load_plugin_textdomain')); 
     83    }*/
     84
     85    /* plugins_loaded hook not required as load_plugin_textdomain called in init method
     86    public function load_plugin_textdomain(){
    6087        $locale = apply_filters('plugin_locale', get_locale(), self::TEXT_DOMAIN);
    6188   
    6289        load_textdomain(self::TEXT_DOMAIN, WP_LANG_DIR.'/woo-checkout-field-editor-pro/'.self::TEXT_DOMAIN.'-'.$locale.'.mo');
    6390        load_plugin_textdomain(self::TEXT_DOMAIN, false, dirname(THWCFD_BASE_NAME) . '/languages/');
    64     }
     91    }*/
    6592
    6693    private function define_admin_hooks() {
     
    82109        add_action( 'admin_init', array($plugin_admin, 'landing_page' ), 10 );
    83110        add_action( 'admin_init', array($plugin_admin, 'redirect_to_landing_page'), 10 );
     111        add_action( 'admin_head', array($plugin_admin, 'remove_welcome_page_menu'));
    84112       
    85113        $themehigh_plugins = new THWCFD_Admin_Settings_Themehigh_Plugins();
  • woo-checkout-field-editor-pro/trunk/includes/utils/class-thwcfd-utils-block.php

    r3370969 r3453503  
    2323        self::get_default_block_sections();
    2424    }
    25 
     25    // phpcs:disable WordPress.WP.I18n.TextDomainMismatch
    2626    public static function get_default_block_fields(){
    2727
     
    186186            // ];
    187187
    188         return $core_fields ;
     188        return apply_filters( 'thwcfd_default_block_checkout_fields', $core_fields );
    189189    }
    190190    public static function get_default_block_section_fields($section_name){
     
    305305        return $field_objects;
    306306    }
    307 
     307    // phpcs:disable WordPress.WP.I18n.TextDomainMismatch
    308308    public static function get_core_fields() {
    309309       
  • woo-checkout-field-editor-pro/trunk/includes/utils/class-thwcfd-utils.php

    r3221414 r3453503  
    152152                        'type'        => 'textarea',
    153153                        'class'       => array('notes'),
    154                         'label'       => __('Order Notes', 'woocommerce'),
    155                         'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce')
     154                        'label'       => __('Order Notes', 'woocommerce'), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
     155                        'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce') // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
    156156                    )
    157157                );
     
    248248            if(isset($options[$value]) && !empty($options[$value])){
    249249                $value = $options[$value];
     250                $value = THWCFD_Utils::translate_dynamic_text($value, 'option');
    250251            }
    251252        }elseif($type === 'checkboxgroup' || $type === 'multiselect'){
     
    257258                $new_value = array();
    258259                foreach($value_arr as $single_value){
     260                   
    259261                    if(isset($options[$single_value]) && !empty($options[$single_value])){
    260                         $new_value[] = $options[$single_value];
     262                        $new_value[] = THWCFD_Utils::translate_dynamic_text($options[$single_value], 'option') ;
    261263                    }else{
    262                         $new_value[] = $single_value;
     264                        $new_value[] = THWCFD_Utils::translate_dynamic_text($single_value, 'option') ;
    263265                    }
    264266                }
     
    269271               
    270272        }
    271 
    272273        return $value;
    273274    }
     
    384385     ----- i18n functions - START ------
    385386     ***********************************/
     387
     388    /**
     389     * Legacy helper function.
     390     *
     391     * This method is no longer responsible for translation.
     392     * It is kept for backward compatibility, as it may still be
     393     * referenced by older code or third-party integrations.
     394     *
     395     * @param string $text Text to be escaped.
     396     * @return string Escaped text.
     397     */
    386398    public static function t($text){
    387         if(!empty($text)){ 
     399
     400        /*if(!empty($text)){   
    388401            $otext = $text;                     
    389             $text = __($text, 'woo-checkout-field-editor-pro');
     402            $text = esc_html($text);   
    390403            if($text === $otext){
    391404                $text = __($text, 'woocommerce');
    392405            }
    393406        }
    394         return $text;
    395     }
    396 
     407        return $text;*/
     408        return esc_html( $text);
     409    }
     410
     411    /**
     412     * Legacy echo helper function.
     413     *
     414     * This method no longer performs translation.
     415     * It is retained for backward compatibility to avoid
     416     * breaking existing usages that expect this static method.
     417     *
     418     * @param string $text Text to be escaped and echoed.
     419     * @return void
     420     */
    397421    public static function et($text){
    398         if(!empty($text)){ 
    399             $otext = $text;                     
    400             $text = __($text, 'woo-checkout-field-editor-pro');
    401             if($text === $otext){
    402                 $text = __($text, 'woocommerce');
    403             }
    404         }
     422        // if(!empty($text)){   
     423        // $otext = $text;                     
     424        // $text = __($text, 'woo-checkout-field-editor-pro');
     425        // if($text === $otext){
     426        //      $text = __($text, 'woocommerce');
     427        // }
     428        // }
    405429        echo esc_html($text);
    406430    }
     
    493517        return $str;
    494518    }
     519
     520    /**
     521     * Translate dynamic/admin-entered strings with proper fallbacks.
     522     *
     523     * Translation order:
     524     * 1. WPML (string translation)
     525     * 2. Plugin gettext (backward compatibility)
     526     * 3. WooCommerce core gettext
     527     *
     528     * @param string $text      Original text.
     529     * @param string $text_type Type of text: label|placeholder|option.
     530     * @return string Translated text.
     531     */
     532    public static function translate_dynamic_text( $text, $text_type = 'label' ) {
     533
     534        if ( empty( $text ) ) {
     535            return '';
     536        }
     537
     538        // Build WPML string key (kept for backward compatibility)
     539        $key = 'Field label - ' . $text;
     540        if ( $text_type === 'placeholder' ) {
     541            $key = 'Field placeholder - ' . $text;
     542        } elseif ( $text_type === 'option' ) {
     543            $key = 'Field option text - ' . $text;
     544        }
     545
     546        // WPML – preferred for dynamic/admin strings
     547        if ( has_filter( 'wpml_translate_single_string' ) ) {
     548            $translated = apply_filters(
     549                'wpml_translate_single_string',
     550                $text,
     551                'woo-checkout-field-editor-pro',
     552                $key
     553            );
     554
     555            if ( $translated !== $text ) {
     556                return $translated;
     557            }
     558        }
     559
     560        // Plugin gettext fallback (backward compatibility)
     561        // Supports existing .mo translations before WPML integration.
     562        // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
     563        $plugin_translation = __( $text, 'woo-checkout-field-editor-pro' );
     564
     565        if ( $plugin_translation !== $text ) {
     566            return $plugin_translation;
     567        }
     568
     569        // WooCommerce core fallback
     570        // Used only when WooCommerce already provides a translation
     571        // in the current locale.
     572        // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch
     573        return __( $text, 'woocommerce' );
     574    }
    495575}
    496576
  • woo-checkout-field-editor-pro/trunk/languages/woo-checkout-field-editor-pro.pot

    r3370969 r3453503  
    1 # Copyright (C) 2025 ThemeHigh
    2 # This file is distributed under the same license as the Checkout Field Editor for WooCommerce plugin.
     1# Copyright (C) 2026 ThemeHigh
     2# This file is distributed under the GPLv2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Checkout Field Editor for WooCommerce 2.1.5\n"
     5"Project-Id-Version: Checkout Field Editor for WooCommerce 2.1.6\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-checkout-field-editor-pro\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-09-25T09:17:45+00:00\n"
     12"POT-Creation-Date: 2026-01-11T19:23:12+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.8.1\n"
     14"X-Generator: WP-CLI 2.9.0\n"
    1515"X-Domain: woo-checkout-field-editor-pro\n"
    1616
     
    3030#. Author of the plugin
    3131msgid "ThemeHigh"
     32msgstr ""
     33
     34#: admin/class-thwcfd-admin-form-block-field.php:382
     35msgid "Value"
     36msgstr ""
     37
     38#: admin/class-thwcfd-admin-form-block-field.php:471
     39#: admin/class-thwcfd-admin-form-field.php:675
     40msgid "Options"
    3241msgstr ""
    3342
     
    238247msgstr ""
    239248
    240 #: admin/class-thwcfd-admin-form-field.php:675
    241 msgid "Options"
    242 msgstr ""
    243 
    244249#: admin/class-thwcfd-admin-form-field.php:683
    245250#: admin/assets/js/inc/thwcfd-admin-field.js:442
     
    291296
    292297#: admin/class-thwcfd-admin-settings-advanced.php:135
    293 #: admin/class-thwcfd-admin-settings-general.php:259
    294 #: admin/class-thwcfd-admin-settings-general.php:321
     298#: admin/class-thwcfd-admin-settings-general.php:266
     299#: admin/class-thwcfd-admin-settings-general.php:328
    295300msgid "Your changes were saved."
    296301msgstr ""
     
    298303#: admin/class-thwcfd-admin-settings-advanced.php:137
    299304#: admin/class-thwcfd-admin-settings-advanced.php:299
    300 #: admin/class-thwcfd-admin-settings-general.php:261
    301 #: admin/class-thwcfd-admin-settings-general.php:323
     305#: admin/class-thwcfd-admin-settings-general.php:268
     306#: admin/class-thwcfd-admin-settings-general.php:330
    302307msgid "Your changes were not saved due to an error (or you made none!)."
    303308msgstr ""
     
    305310#: admin/class-thwcfd-admin-settings-advanced.php:170
    306311msgid "Are you sure you want to reset to default settings? all your changes will be deleted."
     312msgstr ""
     313
     314#: admin/class-thwcfd-admin-settings-advanced.php:220
     315msgid "Backup and Import Settings"
     316msgstr ""
     317
     318#: admin/class-thwcfd-admin-settings-advanced.php:222
     319msgid "Plugin Settings Data"
     320msgstr ""
     321
     322#: admin/class-thwcfd-admin-settings-advanced.php:223
     323msgid "You can transfer the saved settings data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click \"Import Settings\"."
     324msgstr ""
     325
     326#: admin/class-thwcfd-admin-settings-advanced.php:240
     327msgid "Import Settings"
    307328msgstr ""
    308329
     
    323344#: admin/class-thwcfd-admin-settings-block-fields.php:65
    324345#: admin/class-thwcfd-admin-settings-general.php:98
    325 #: admin/class-thwcfd-admin-settings-general.php:194
     346#: admin/class-thwcfd-admin-settings-general.php:201
    326347msgid "Edit"
    327348msgstr ""
     
    363384#: admin/class-thwcfd-admin-settings-block-fields.php:103
    364385msgid "Actions"
     386msgstr ""
     387
     388#: admin/class-thwcfd-admin-settings-block-fields.php:186
     389#: block/class-thwcfd-block-order-data.php:415
     390#: block/class-thwcfd-block-order-data.php:543
     391#: admin/assets/js/inc/thwcfd-admin.js:97
     392#: admin/assets/js/thwcfd-admin.js:1281
     393msgid "Yes"
    365394msgstr ""
    366395
     
    380409
    381410#: admin/class-thwcfd-admin-settings-block-fields.php:322
    382 #: admin/class-thwcfd-admin-settings-general.php:279
     411#: admin/class-thwcfd-admin-settings-general.php:286
    383412msgid "Your changes were not saved due to no fields found."
    384413msgstr ""
     
    429458msgstr ""
    430459
    431 #: admin/class-thwcfd-admin-settings-general.php:264
    432 #: admin/class-thwcfd-admin-settings-general.php:326
     460#: admin/class-thwcfd-admin-settings-general.php:271
     461#: admin/class-thwcfd-admin-settings-general.php:333
    433462msgid "Your changes were not saved due to an error."
    434463msgstr ""
     
    440469#: admin/class-thwcfd-admin-settings-themehigh-plugins.php:184
    441470msgid "Other Plugins"
     471msgstr ""
     472
     473#: admin/class-thwcfd-admin-settings-themehigh-plugins.php:233
     474msgid "Activated"
     475msgstr ""
     476
     477#: admin/class-thwcfd-admin-settings-themehigh-plugins.php:246
     478msgid "Activate"
     479msgstr ""
     480
     481#: admin/class-thwcfd-admin-settings-themehigh-plugins.php:267
     482msgid "Install now"
    442483msgstr ""
    443484
     
    471512msgstr ""
    472513
    473 #: admin/class-thwcfd-admin.php:144
     514#. translators: %s: Support team link
     515#: admin/class-thwcfd-admin.php:143
     516msgid ""
     517"Our Checkout Field Editor now supports WooCommerce Checkout Blocks! Currently, a few field types are available, and more will be added soon. \n"
     518"\t\t\t\t\t\t\tIf you're using Block Checkout, make sure to switch to the Block Checkout Fields tab, otherwise, your changes won’t be reflected. Have questions or need help? \n"
     519"\t\t\t\t\t\t\tReach out to our  %s ."
     520msgstr ""
     521
     522#: admin/class-thwcfd-admin.php:146
    474523msgid " Support team"
     524msgstr ""
     525
     526#: admin/thwcfd-landing-page.php:20
     527msgid "Checkout field editor Landing page"
     528msgstr ""
     529
     530#: admin/thwcfd-landing-page.php:38
     531msgid "Welcome to Checkout Field Editor!"
     532msgstr ""
     533
     534#: admin/thwcfd-landing-page.php:40
     535msgid "We’re excited to have you on board! Now, you can easily customize your WooCommerce checkout using both the Block Checkout Editor and the Classic Checkout Field Editor. Enjoy complete flexibility and control! "
     536msgstr ""
     537
     538#: admin/thwcfd-landing-page.php:44
     539msgid "Get Started"
     540msgstr ""
     541
     542#: admin/thwcfd-landing-page.php:48
     543msgid "Learn more about both editors to make the most out of your checkout"
     544msgstr ""
     545
     546#: admin/thwcfd-landing-page.php:54
     547msgid "Read More!"
     548msgstr ""
     549
     550#: admin/thwcfd-landing-page.php:60
     551msgid "We support both Classic and Block Checkout. Choose the one you're using"
     552msgstr ""
     553
     554#: admin/thwcfd-landing-page.php:61
     555msgid "Which Checkout Fields should you use?"
     556msgstr ""
     557
     558#: admin/thwcfd-landing-page.php:72
     559msgid "Classic Checkout"
     560msgstr ""
     561
     562#: admin/thwcfd-landing-page.php:78
     563msgid "Use this if you’re still using the traditional WooCommerce checkout page."
     564msgstr ""
     565
     566#: admin/thwcfd-landing-page.php:84
     567msgid "Compatible with older checkout layouts."
     568msgstr ""
     569
     570#: admin/thwcfd-landing-page.php:90
     571msgid "Best for users who prefer the classic, non-block experience."
     572msgstr ""
     573
     574#: admin/thwcfd-landing-page.php:103
     575msgid "Block Checkout"
     576msgstr ""
     577
     578#: admin/thwcfd-landing-page.php:109
     579msgid "Use this if you’ve transitioned to WooCommerce’s new Block-based checkout."
     580msgstr ""
     581
     582#: admin/thwcfd-landing-page.php:115
     583msgid "Easier to customize with block elements."
     584msgstr ""
     585
     586#: admin/thwcfd-landing-page.php:121
     587msgid "Best for users looking for a more modern, flexible checkout design"
     588msgstr ""
     589
     590#: admin/thwcfd-landing-page.php:132
     591msgid "Go with Classic Checkout Editor"
     592msgstr ""
     593
     594#: admin/thwcfd-landing-page.php:135
     595msgid "Go with Block Checkout Editor"
     596msgstr ""
     597
     598#: admin/thwcfd-landing-page.php:140
     599msgid "Let's Get started"
    475600msgstr ""
    476601
     
    480605msgstr ""
    481606
    482 #: block/class-thwcfd-block-order-data.php:414
    483 #: block/class-thwcfd-block-order-data.php:542
    484 #: admin/assets/js/inc/thwcfd-admin.js:97
    485 #: admin/assets/js/thwcfd-admin.js:1281
    486 msgid "Yes"
    487 msgstr ""
    488 
    489 #: block/class-thwcfd-block-order-data.php:414
    490 #: block/class-thwcfd-block-order-data.php:542
     607#: block/class-thwcfd-block-order-data.php:415
     608#: block/class-thwcfd-block-order-data.php:543
    491609msgid "No"
    492610msgstr ""
    493611
    494612#. translators: %s Field label.
    495 #: block/class-thwcfd-block.php:184
     613#: block/class-thwcfd-block.php:186
    496614msgid "%s (optional)"
    497615msgstr ""
    498616
    499 #: block/class-thwcfd-block.php:258
     617#. translators: %s is the title of the field being validated.
     618#: block/class-thwcfd-block.php:262
    500619msgid "The provided %s is not a valid email address."
    501620msgstr ""
    502621
    503 #: block/class-thwcfd-block.php:271
     622#. translators: %s is the title of the field being validated.
     623#: block/class-thwcfd-block.php:276
    504624msgid "The provided %s is not a valid phone number."
    505625msgstr ""
    506626
    507 #: block/class-thwcfd-block.php:284
     627#. translators: %s is the title of the field being validated.
     628#: block/class-thwcfd-block.php:290
    508629msgid "The provided %s is not a valid postcode."
    509630msgstr ""
    510631
    511 #: includes/class-thwcfd.php:148
     632#: includes/class-thwcfd.php:176
    512633msgid "Quick Feedback"
    513634msgstr ""
    514635
    515 #: includes/class-thwcfd.php:153
    516 #: includes/class-thwcfd.php:184
     636#: includes/class-thwcfd.php:181
     637#: includes/class-thwcfd.php:212
    517638msgid "Get Support"
    518639msgstr ""
    519640
    520 #: includes/class-thwcfd.php:157
     641#: includes/class-thwcfd.php:185
    521642msgid "If you have a moment, please let us know why you want to deactivate this plugin"
    522643msgstr ""
    523644
    524 #: includes/class-thwcfd.php:176
     645#: includes/class-thwcfd.php:204
    525646msgid "This form is only for getting your valuable feedback. We do not collect your personal data. To know more read our "
    526647msgstr ""
    527648
    528 #: includes/class-thwcfd.php:176
     649#: includes/class-thwcfd.php:204
    529650msgid "Privacy Policy"
    530651msgstr ""
    531652
    532 #: includes/class-thwcfd.php:180
     653#: includes/class-thwcfd.php:208
    533654msgid "Skip & Deactivate"
    534655msgstr ""
    535656
    536 #: includes/class-thwcfd.php:186
     657#: includes/class-thwcfd.php:214
    537658msgid "Submit and Deactivate"
    538659msgstr ""
    539660
    540 #: includes/class-thwcfd.php:187
     661#: includes/class-thwcfd.php:215
    541662msgid "Cancel"
    542663msgstr ""
    543664
    544 #: includes/class-thwcfd.php:408
     665#: includes/class-thwcfd.php:436
    545666msgid "Deactivate and "
    546667msgstr ""
    547668
    548 #: includes/class-thwcfd.php:410
     669#: includes/class-thwcfd.php:438
    549670msgid "leave a review"
    550671msgstr ""
    551672
    552 #: includes/class-thwcfd.php:414
     673#: includes/class-thwcfd.php:442
    553674msgid "Upgraded"
    554675msgstr ""
    555676
    556 #: includes/class-thwcfd.php:484
     677#: includes/class-thwcfd.php:512
    557678msgid "Upgraded to premium."
    558679msgstr ""
    559680
    560 #: includes/class-thwcfd.php:491
     681#: includes/class-thwcfd.php:519
    561682msgid "A specific feature is missing"
    562683msgstr ""
    563684
    564 #: includes/class-thwcfd.php:493
     685#: includes/class-thwcfd.php:521
    565686msgid "Type in the feature"
    566687msgstr ""
    567688
    568 #: includes/class-thwcfd.php:498
     689#: includes/class-thwcfd.php:526
    569690msgid "Found an error in the plugin/ Plugin was not working"
    570691msgstr ""
    571692
    572 #: includes/class-thwcfd.php:500
     693#: includes/class-thwcfd.php:528
    573694msgid "Specify the issue"
    574695msgstr ""
    575696
    576 #: includes/class-thwcfd.php:505
     697#: includes/class-thwcfd.php:533
    577698msgid "It was hard to use"
    578699msgstr ""
    579700
    580 #: includes/class-thwcfd.php:507
     701#: includes/class-thwcfd.php:535
    581702msgid "How can we improve your experience?"
    582703msgstr ""
    583704
    584 #: includes/class-thwcfd.php:512
     705#: includes/class-thwcfd.php:540
    585706msgid "I found a better Plugin"
    586707msgstr ""
    587708
    588 #: includes/class-thwcfd.php:514
    589 #: includes/class-thwcfd.php:528
     709#: includes/class-thwcfd.php:542
     710#: includes/class-thwcfd.php:556
    590711msgid "Could you please mention the plugin?"
    591712msgstr ""
    592713
    593 #: includes/class-thwcfd.php:526
     714#: includes/class-thwcfd.php:554
    594715msgid "It’s a temporary deactivation - I’m troubleshooting an issue"
    595716msgstr ""
    596717
    597 #: includes/class-thwcfd.php:533
     718#: includes/class-thwcfd.php:561
    598719msgid "Not mentioned here"
    599720msgstr ""
    600721
    601 #: includes/class-thwcfd.php:535
     722#: includes/class-thwcfd.php:563
    602723msgid "Kindly tell us your reason, so that we can improve"
    603724msgstr ""
    604725
    605 #: public/class-thwcfd-public-checkout.php:543
     726#. translators: %s: Field label
     727#: public/class-thwcfd-public-checkout.php:548
    606728msgid "<strong>%s</strong> is not a valid number."
    607729msgstr ""
    608730
    609 #: public/class-thwcfd-public-checkout.php:547
     731#. translators: %s: Field label
     732#: public/class-thwcfd-public-checkout.php:553
    610733msgid "<strong>%s</strong> is not a valid url."
    611734msgstr ""
  • woo-checkout-field-editor-pro/trunk/public/class-thwcfd-public-checkout.php

    r3370969 r3453503  
    196196    }
    197197
    198     public function get_posted_value($key){
    199         $value = isset($_POST[$key]) ? stripslashes($_POST[$key]) : '';
    200 
    201         if(!$value){
    202             $post_data = isset($_POST['post_data']) ? $_POST['post_data'] : '';
    203 
    204             if($post_data){
    205                 parse_str($post_data, $post_data_arr);
    206                 $value = isset($post_data_arr[$key]) ? stripslashes($post_data_arr[$key]) : '';
    207             }
    208         }
    209 
     198    public function get_posted_value( $key ) {
     199        $value = '';
     200        if ( isset( $_POST[ $key ] ) ) {
     201            $value = wp_unslash( $_POST[ $key ] );
     202        }
     203        if ( '' === $value && isset( $_POST['post_data'] ) ) {
     204            $post_data = wp_unslash( $_POST['post_data'] );
     205
     206            if ( is_string( $post_data ) ) {
     207                parse_str( $post_data, $post_data_arr );
     208
     209                if ( isset( $post_data_arr[ $key ] ) ) {
     210                    $value = $post_data_arr[ $key ];
     211                }
     212            }
     213        }
    210214        return $value;
    211215    }
     
    481485                            $options = array();
    482486                            foreach($options_arr as $key => $value) {
    483                                 $options[$key] = __($value, 'woo-checkout-field-editor-pro');
     487                                $value = $this->translate_text($value, 'option');
     488                                $options[$key] = $value;
    484489                            }
    485490                            $new_field['options'] = $options;
     
    492497                   
    493498                    if(isset($new_field['label'])){
    494                         $new_field['label'] = __($new_field['label'], 'woo-checkout-field-editor-pro');
     499                        //$new_field['label'] = __($new_field['label'], 'woo-checkout-field-editor-pro');
     500                        $new_field['label'] = $this->translate_text($new_field['label'], 'label');
    495501                    }
    496502
    497503                    if(isset($new_field['placeholder'])){
    498                         $new_field['placeholder'] = __($new_field['placeholder'], 'woo-checkout-field-editor-pro');
     504                        $new_field['placeholder'] = $this->translate_text($new_field['placeholder'], 'placeholder');
     505                        //
     506                        //$new_field['placeholder'] = __($new_field['placeholder'], 'woo-checkout-field-editor-pro');
    499507                    }
    500508                   
     
    541549                if($vname === 'number'){
    542550                    if(!is_numeric($value)){
     551                        /* translators: %s: Field label */
    543552                        $err_msg = sprintf( __( '<strong>%s</strong> is not a valid number.', 'woo-checkout-field-editor-pro' ), $flabel );
    544553                    }
    545554                }else if($vname === 'url'){
    546555                    if (!filter_var($value, FILTER_VALIDATE_URL)) {
     556                        /* translators: %s: Field label */
    547557                        $err_msg = sprintf( __( '<strong>%s</strong> is not a valid url.', 'woo-checkout-field-editor-pro' ), $flabel );
    548558                    }
     
    670680
    671681                    $f_type = isset($field['type']) ? $field['type'] : 'text';
    672                     $value = esc_html__($value, 'woo-checkout-field-editor-pro');
     682                    $value = esc_html($this->translate_text($value, 'option'));
    673683                    if($f_type == 'textarea'){
    674684                        $value =  nl2br($value);
     
    676686                   
    677687                    $custom_field = array();
    678                     $custom_field['label'] = wp_kses_post(__($label, 'woo-checkout-field-editor-pro'));
     688                    $custom_field['label'] = wp_kses_post($this->translate_text($label, 'label'));
    679689                    $custom_field['value'] = $value;
    680690                   
     
    691701     */
    692702    public function order_details_after_customer_details($order){
     703
     704        if ( ! $order instanceof WC_Order ) {
     705            return;
     706        }
    693707        $order_id = THWCFD_Utils::get_order_id($order);
    694708        $fields = THWCFD_Utils::get_checkout_fields($order);
     
    698712            foreach($fields as $key => $field){
    699713                if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order'] && !THWCFD_Utils::is_wc_handle_custom_field($field)){
    700                     $order = wc_get_order( $order_id );
    701                
     714                    // Compatibility for Archiva for WooCommerce.
     715                    /*if (wc_get_order( $order_id ) && is_a( wc_get_order( $order_id ), 'WC_Order' )) {
     716                        $order = wc_get_order( $order_id ); // Kept old code unchanged.
     717                    } else {
     718                        // Check if $order is a valid WC_Order object
     719                        $order = is_a($order, 'WC_Order') ? $order : false;
     720                        if (!$order) {
     721                            return;
     722                        }
     723                    }*/
     724
    702725                    // $value = get_post_meta( $order_id, $key, true );
    703726                    $value = $order->get_meta( $key, true );
     
    706729                        $label = isset($field['label']) && $field['label'] ? $field['label'] : $key;
    707730                        //$label = esc_attr($label);
    708                         $label = wp_kses_post(__($label, 'woo-checkout-field-editor-pro'));
     731                        $label = $this->translate_text($label, 'label');
     732                        $label = wp_kses_post($label);
    709733                        //$value = wptexturize($value);
    710734                        $value = THWCFD_Utils::get_option_text($field, $value);
    711735
    712736                        $f_type = isset($field['type']) ? $field['type'] : 'text';
    713                         $value = esc_html__($value, 'woo-checkout-field-editor-pro');
     737                        $value = $this->translate_text($value, 'option');
     738                        $value = esc_html($value);
    714739                        if($f_type == 'textarea'){
    715740                            $value =  nl2br($value);
     
    762787                $required        ='&nbsp;<span class="required" aria-hidden="true">*</span>';
    763788            }else{
    764                 $required        = '&nbsp;<abbr class="required" title="' . esc_attr__( 'required', 'woocommerce' ) . '">*</abbr>';
     789                // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
     790                $required        = '&nbsp;<abbr class="required" title="' . esc_attr__( 'required', 'woocommerce' ) . '">*</abbr>';
    765791            }       
    766792        } else {
     793            // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
    767794            $required = '&nbsp;<span class="optional">(' . esc_html__( 'optional', 'woocommerce' ) . ')</span>';
    768795        }
     
    822849
    823850                if (!empty($args['options'])) {
    824                     $field .= '<select name="' . esc_attr($key) . '[]" id="' . esc_attr($key) . '" class="select ' . esc_attr(implode(' ', $args['input_class'])) . '" multiple="multiple" ' . esc_attr(implode(' ', $custom_attributes)) . ' data-placeholder="' . esc_html__($args['placeholder'], 'woo-checkout-field-editor-pro') . '" >';
    825                     foreach ($args['options'] as $option_key => $option_text) {
    826                         $field .= '<option value="' . esc_attr($option_key) . '" ' . selected(in_array($option_key, $value), 1, false) . '>' . esc_html__($option_text, 'woo-checkout-field-editor-pro') . '</option>';
     851                    $placeholder = !empty($args['placeholder']) ? $this->translate_text($args['placeholder'], 'placeholder') : '';
     852                    $field .= '<select name="' . esc_attr($key) . '[]" id="' . esc_attr($key) . '" class="select ' . esc_attr(implode(' ', $args['input_class'])) . '" multiple="multiple" ' . esc_attr(implode(' ', $custom_attributes)) . ' data-placeholder="' . esc_attr($placeholder) . '" >';
     853                    foreach ($args['options'] as $option_key => $option_text) {
     854                        $option_text = $this->translate_text( $option_text, 'option' );
     855                        $field .= '<option value="' . esc_attr($option_key) . '" ' . selected(in_array($option_key, $value), 1, false) . '>' . esc_html($option_text) . '</option>';
    827856                    }
    828857                    $field .= ' </select>';
     
    854883
    855884                    foreach ($args['options'] as $option_key => $option_text) {
    856                         $field .= '<label><input type="checkbox" name="' . esc_attr($key) . '[]" value="' . esc_attr($option_key) . '"' . checked(in_array($option_key, $value), 1, false) . ' /> ' . esc_html__($option_text, 'woo-checkout-field-editor-pro') . '</label>';
     885                        $option_text = $this->translate_text( $option_text, 'option' );
     886                        $field .= '<label><input type="checkbox" name="' . esc_attr($key) . '[]" value="' . esc_attr($option_key) . '"' . checked(in_array($option_key, $value), 1, false) . ' /> ' . esc_html($option_text) . '</label>';
    857887                    }
    858888
     
    910940
    911941            if ($args['label'] && 'checkbox' !== $args['type']) {
    912                 $field_html .= '<label for="' . esc_attr($label_id) . '" class="' . esc_attr(implode(' ', $args['label_class'])) . '">' . esc_html__($args['label'], 'woo-checkout-field-editor-pro') . $required . '</label>';
     942                $f_label = $this->translate_text($args['label'], 'label');
     943                $field_html .= '<label for="' . esc_attr($label_id) . '" class="' . esc_attr(implode(' ', $args['label_class'])) . '">' . esc_html($f_label) . $required . '</label>';
    913944            }
    914945
     
    941972       
    942973        if(isset($args['label']) && !empty($args['label'])){
    943             $field  = '<p class="form-row '.esc_attr(implode(' ', $args['class'])).'" id="'.esc_attr($key).'_field" name="'.esc_attr($key).'" >'. esc_html__($args['label'], 'woo-checkout-field-editor-pro') .'</ p >';
     974            $f_label = $this->translate_text($args['label'], 'label');
     975            $field  = '<p class="form-row '.esc_attr(implode(' ', $args['class'])).'" id="'.esc_attr($key).'_field" name="'.esc_attr($key).'" >'. esc_html_($f_label) .'</ p >';
    944976        }
    945977
     
    955987        if(isset($args['label']) && !empty($args['label'])){
    956988            $title_type  = isset($args['title_type']) && !empty($args['title_type']) ? $args['title_type'] : 'label';
    957 
    958             $heading_html .= '<'. esc_attr($title_type) .' class="'. esc_attr(implode(' ', $args['label_class'])) .'" >'. esc_html__($args['label'], 'woo-checkout-field-editor-pro') .'</'. $title_type .'>';
     989            $f_label = $this->translate_text($args['label'], 'label');
     990            $heading_html .= '<'. esc_attr($title_type) .' class="'. esc_attr(implode(' ', $args['label_class'])) .'" >'. esc_html($f_label) .'</'. $title_type .'>';
    959991        }
    960992
     
    9721004
    9731005    }
     1006
     1007    /**
     1008     * Translate dynamic strings with WPML / Polylang,
     1009     * fallback to WooCommerce core translations when applicable.
     1010     *
     1011     * @param string $text Original text.
     1012     * @param string $key  Stable translation key.
     1013     * @return string
     1014     */
     1015    private function translate_text( $text, $text_type = 'label' ) {
     1016
     1017        if ( empty( $text ) ) {
     1018            return '';
     1019        }
     1020        $key = 'Field label - ' . $text;
     1021        if ( $text_type === 'placeholder' ) {
     1022            $key = 'Field placeholder - ' . $text;
     1023        } elseif ( $text_type === 'option' ) {
     1024            $key = 'Field option text - ' . $text;
     1025        }
     1026
     1027        // WPML (preferred for dynamic/admin strings)
     1028        if ( has_filter( 'wpml_translate_single_string' ) ) {
     1029            $translated = apply_filters(
     1030                'wpml_translate_single_string',
     1031                $text,
     1032                'woo-checkout-field-editor-pro',
     1033                $key
     1034            );
     1035
     1036            if ( $translated !== $text ) {
     1037                return $translated;
     1038            }
     1039        }
     1040
     1041        // Polylang, 2nd preference for dynamic/admin strings, consider when add support for Polylang is requested
     1042        // if ( function_exists( 'pll__' ) ) {
     1043        //  $translated = pll__( $text );
     1044        //  if ( $translated !== $text ) {
     1045        //      return $translated;
     1046        //  }
     1047        // }
     1048
     1049        // Plugin gettext fallback.
     1050        // This is kept for backward compatibility to support existing translations
     1051        // that rely on the plugin text domain (.mo files) before WPML integration.
     1052        // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
     1053        $plugin_translation = __( $text, 'woo-checkout-field-editor-pro' );
     1054
     1055        if ( $plugin_translation !== $text ) {
     1056            return $plugin_translation;
     1057        }
     1058
     1059        // WooCommerce core fallback, Used only when WooCommerce already provides a translation for this string in the current locale.
     1060        // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch
     1061        return __( $text, 'woocommerce' );
     1062    }
    9741063   
    9751064}
  • woo-checkout-field-editor-pro/trunk/readme.txt

    r3370969 r3453503  
    44Tags: Checkout  Manager, Checkout Field Editor, WooCommerce Checkout, WooCommerce Checkout Field, Custom fields
    55Requires at least: 4.9
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 2.1.5
     8Stable tag: 2.1.6
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2525==How WooCommerce Checkout Field Editor (Checkout Manager) simplifies customization? ==
    2626
     27[youtube  https://youtu.be/eMGjviRHyfo?si=IC5et0Mqe7Yf1Nk_]
     28
    2729✳️ **Complete Checkout Field Customization →** Effortlessly add, edit, remove, and rearrange fields.               
    2830
     
    3739**👉Note:** Block Compatibility → Our Checkout Field Editor (Checkout Manager) for WooCommerce now supports WooCommerce Checkout Blocks, allowing customization with Text, Select, Radio, and Checkbox fields, plus validation for Email, Phone, and URL. More field types will be added in upcoming updates.
    3840
    39 [Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=help_docs) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=wcfe_upgrade_link)
     41[Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=pro_doc) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link)
    4042
    4143==🔥 EXPLORE WHAT OUR FREE VERSION OFFERS  ==
     
    7476Users can **edit, delete and enable/disable these fields**. With the simple drag-and-drop interface, users can also easily **reposition fields** to meet their business needs effortlessly.
    7577
     78[youtube https://youtu.be/6UXexzGIn-8?si=sUiapwT3z6tb5NrY]
     79
    7680= ✅ VALIDATE THE CHECKOUT FIELDS =
    7781Validate both custom and default checkout fields to prevent incomplete or incorrect submissions, enhancing the user experience and reducing errors during checkout.
     
    101105==🔥 WHY SWITCH TO PRO?==
    102106
    103 While the free version of [Checkout Field Editor for WooCommerce](https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=try_demo%29) offers essential features to enhance your checkout pages, the premium version offers full control over your checkout process & easily customize WooCommerce Checkout Fields – Works with Both Classic & Block Checkout!—ensuring a better customer experience and higher revenue such as:
     107While the free version of [Checkout Field Editor for WooCommerce](https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=try_demo) offers essential features to enhance your checkout pages, the premium version offers full control over your checkout process & easily customize WooCommerce Checkout Fields – Works with Both Classic & Block Checkout!—ensuring a better customer experience and higher revenue such as:
    104108
    105109**👉 4 additional field types for more flexibility**
     
    111115**👉 Compatibility with third-party plugins for extended functionality**
    112116
    113 [GET FULL ACCESS WITH PREMIUM NOW !](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/)
     117[GET FULL ACCESS WITH PREMIUM NOW !](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link)
    114118
    115119= 👉 WPML Compatibility =
    116 The Extra product options plugin is WPML compatible and it lets you create product pages in multiple languages.
     120The WooCommerce Checkout Field Editor works smoothly with WPML, allowing you to translate checkout field labels and text into multiple languages for a better multilingual checkout experience.
    117121
    118122== 🔥 SEE  OUR  PREMIUM FEATURES ==
    119 [Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=help_docs) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=wcfe_upgrade_link)
     123[Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=pro_doc) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link)
    120124
    121125= ✅  ADD 4 ADDITIONAL FIELDS TYPES TO CHECKOUT PAGE =
     
    126130    4.  Label
    127131
    128     🆕 **👉 Note:** The Pro version  lets you add an extra checkout field type **Date Picker** when using Block Checkout.
     132🆕 **👉 Note:** The Pro version  lets you add an extra checkout field type **Date Picker** when using Block Checkout.
    129133   
    130134= ✅ POSITION SECTIONS AT 14 POSITIONS  =
     
    255259
    256260== OTHER USEFUL LINKS==
    257 👉 [VIEW ALL FEATURES](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/)
    258 👉 [GET DOCUMENTATION](https://www.themehigh.com/docs/category/checkout-field-editor-for-woocommerce/)
    259 👉 [GET THEMEHIGH SUPPORT](https://www.themehigh.com/docs/support/)
     261👉 [VIEW ALL FEATURES](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link)
     262👉 [GET DOCUMENTATION](https://www.themehigh.com/docs/category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=pro_doc)
     263👉 [GET THEMEHIGH SUPPORT](https://www.themehigh.com/docs/support/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=cfe_support)
    260264👉 [JOIN COMMUNITY](https://www.facebook.com/groups/themehigh/)
    261265👉 FOLLOW US ON [Facebook](https://www.facebook.com/ThemeHigh-319611541768603/), [LinkedIn](https://www.linkedin.com/company/themehigh/), [Twitter](https://twitter.com/themehigh/) , [YouTube](https://www.youtube.com/channel/UC-_uMXaC_21j1Y2_nGjTyvg/) & [Reddit](https://www.reddit.com/r/themehigh).
     
    328332== Screenshots ==
    3293331. WooCommerce > Checkout Form
    330 2. Add new field
     3342. Add and edit field
    3313353. New field popup form
    332 4. Edit existing field
    333 5. Edit field popup form
    334 6. Rearrange fields (change field's display order)
    335 7. Reset to default settings
    336 8. Save changes
    337 9. Locale override settings
     3364. Edit field popup form
     3375. Rearrange fields (change field's display order)
     3386. Reset and save fields
     3397. Advance settings
     3408. Custom field (Text)
     3419. Custom field (Radio)
     34210. Custom field (Date)
     34311. Block Data fields
     34412. Block checkout custom fields( Radio and Text)
    338345
    339346== Changelog ==
     347= 2.1.6 =
     348* Added compatiblity for Archiva for WooCommerce.
     349* Improved dynamic string translation for WPML.
     350* Added WooCommerce 10.4 compatibility.
     351* Added WordPress 6.9 compatibility.
    340352
    341353= 2.1.5 =
     
    344356* Added WooCommerce 10.2 compatibility.
    345357
    346 
    347358= 2.1.4 =
    348359* Fixed shipping calculation issue when "Hide shipping costs until an address is entered" is enabled (WooCommerce 9.8+ compatibility).
Note: See TracChangeset for help on using the changeset viewer.