Plugin Directory

Changeset 3202007


Ignore:
Timestamp:
12/04/2024 12:03:57 AM (16 months ago)
Author:
rgwebdev
Message:

New versione 1.0.1

Location:
easytab/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • easytab/trunk/admin/debug-log.php

    r3195878 r3202007  
    11<?php
    22
    3     defined('ABSPATH') || exit;
     3    defined('ABSPATH') || exit;
    44
    55    function easytab_dl_page() {
     
    77        add_submenu_page(
    88            'easytab',
    9             __('Activity Log', 'easytab'),
    10             __('Activity Log', 'easytab'),
     9            __('Activity Log', EASYTAB_DOMAIN),
     10            __('Activity Log', EASYTAB_DOMAIN),
    1111            'manage_options',
    1212            'easytab_debug_log',
     
    1818    add_action('admin_menu', 'easytab_dl_page');
    1919
    20 
    2120    function easytab_debug_log_page() {
    2221
     
    2524        ?>
    2625
     26        <img class="easytab-logo" src="<?php echo EASYTAB_URL . 'assets/img/easytab-logo.png' ?>" style="margin-left: -18px;">
     27
    2728        <h2>Debug Log</h2>
    2829
    29         <div id="easytab-debug-log"><?php echo wp_kses_post($log); ?></div>
     30        <div id="easytab-debug-log"><?php echo wp_kses_post(wp_unslash($log)); ?></div>
    3031
    3132        <?php
  • easytab/trunk/admin/meta-box.php

    r3195878 r3202007  
    11<?php
    22
    3     defined('ABSPATH') || exit;
     3defined( 'ABSPATH' ) || exit;
     4function easytab_add_metabox() {
     5    add_meta_box(
     6        'easytab_product_tabs',
     7        'EasyTab',
     8        'easytab_product_tabs_metabox',
     9        'product',
     10        'normal'
     11    );
     12}
    413
     14add_action( 'add_meta_boxes', 'easytab_add_metabox' );
     15function easytab_product_tabs_metabox(  $post  ) {
     16    $wc_tabs = easytab_helper_get_woo_default_product_tabs();
     17    foreach ( $wc_tabs as $wc_tab_key => $wc_tab_data ) {
     18        $wc_tab = get_post_meta( $post->ID, 'easytab_' . str_replace( '-', '_', $wc_tab_key ) . '_tab', true );
     19        ?>
     20   
     21            <div style="margin: 10px 0;">
     22                <label for="easytab-<?php
     23        echo esc_html( str_replace( '_', '-', $wc_tab_key ) );
     24        ?>-tab">
     25                    <strong>
     26                        <?php
     27        echo esc_html( $wc_tab_data['title'] );
     28        ?>
     29                    </strong>
     30                </label>
     31                <br>
     32                <textarea
     33                    name="easytab_<?php
     34        echo esc_html( str_replace( '-', '_', $wc_tab_key ) );
     35        ?>_tab"
     36                    id="easytab-<?php
     37        echo esc_html( str_replace( '_', '-', $wc_tab_key ) );
     38        ?>-tab"
     39                    rows="4"
     40                    style="width: 100%;"><?php
     41        echo wp_kses_post( $wc_tab );
     42        ?></textarea>
     43                <small>
     44                    <i>
     45                        <?php
     46        esc_html_e( 'Remove the text to regenerate the content!', EASYTAB_DOMAIN );
     47        ?>
     48                    </i>
     49                </small>
     50            </div>
     51   
     52            <?php
     53    }
     54    wp_nonce_field( 'easytab_product_tabs_nonce', 'easytab_product_tabs_nonce' );
     55}
    556
    6     function easytab_add_metabox() {
     57function easytab_product_tabs_save_metabox(  $post_id, $post, $update  ) {
     58    $nonce = ( !empty( $_POST['easytab_product_tabs_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['easytab_product_tabs_nonce'] ) ) : null );
     59    if ( !isset( $nonce ) || !wp_verify_nonce( $nonce, 'easytab_product_tabs_nonce' ) ) {
     60        return;
     61    }
     62    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
     63        return;
     64    }
     65    if ( !current_user_can( 'edit_post', $post_id ) ) {
     66        return;
     67    }
     68    if ( get_post_type( $post_id ) !== 'product' ) {
     69        return;
     70    }
     71    $wc_tabs = easytab_helper_get_woo_default_product_tabs();
     72    foreach ( $wc_tabs as $wc_tab_key => $wc_tab_data ) {
     73        $tab = ( !empty( $_POST['easytab_' . str_replace( '-', '_', $wc_tab_key ) . '_tab'] ) ? wp_kses_post( wp_unslash( $_POST['easytab_' . str_replace( '-', '_', $wc_tab_key ) . '_tab'] ) ) : null );
     74        update_post_meta( $post_id, 'easytab_' . str_replace( '-', '_', $wc_tab_key ) . '_tab', $tab );
     75    }
     76}
    777
    8         add_meta_box(
    9             'easytab_product_tabs',
    10             'EasyTab',
    11             'easytab_product_tabs_metabox',
    12             'product',
    13             'normal'
    14         );
    15 
    16     }
    17 
    18     add_action('add_meta_boxes', 'easytab_add_metabox');
    19 
    20 
    21     function easytab_product_tabs_metabox($post) {
    22 
    23         $wc_tabs = easytab_helper_get_woo_default_product_tabs();
    24 
    25         foreach ($wc_tabs as $wc_tab_key => $wc_tab_data) {
    26 
    27             $wc_tab = get_post_meta($post->ID, 'easytab_' . str_replace('-', '_', $wc_tab_key) . '_tab', true);
    28 
    29     ?>
    30 
    31         <div style="margin: 10px 0;">
    32             <label for="easytab-<?php echo esc_html(str_replace('_', '-', $wc_tab_key)); ?>-tab"><strong><?php echo esc_html($wc_tab_data['title']); ?></strong></label>
    33             <br>
    34             <textarea
    35                 name="easytab_<?php echo esc_html(str_replace('-', '_', $wc_tab_key)); ?>_tab"
    36                 id="easytab-<?php echo esc_html(str_replace('_', '-', $wc_tab_key)); ?>-tab" rows="4" style="width: 100%;"><?php echo esc_textarea($wc_tab); ?></textarea>
    37             <small><i><?php esc_html_e('Remove the text to regenerate the content!', 'easytab'); ?></i></small>
    38         </div>
    39 
    40     <?php
    41 
    42         }
    43 
    44         wp_nonce_field('easytab_product_tabs_nonce', 'easytab_product_tabs_nonce');
    45 
    46     }
    47 
    48 
    49     function easytab_product_tabs_save_metabox($post_id, $post, $update) {
    50 
    51         $nonce = !empty($_POST['easytab_product_tabs_nonce']) ? sanitize_text_field(wp_unslash($_POST['easytab_product_tabs_nonce'])) : null;
    52 
    53         if (!isset($nonce) ||
    54             !wp_verify_nonce($nonce, 'easytab_product_tabs_nonce')) {
    55             return;
    56         }
    57 
    58         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    59             return;
    60         }
    61 
    62         if (!current_user_can('edit_post', $post_id)) {
    63             return;
    64         }
    65 
    66         if (get_post_type($post_id) !== 'product') return;
    67 
    68         $wc_tabs = easytab_helper_get_woo_default_product_tabs();
    69 
    70         foreach ($wc_tabs as $wc_tab_key => $wc_tab_data) {
    71             $tab = !empty($_POST['easytab_' . str_replace('-', '_', $wc_tab_key) . '_tab']) ? sanitize_textarea_field(wp_unslash($_POST['easytab_' . str_replace('-', '_', $wc_tab_key) . '_tab'])) : null;
    72             update_post_meta($post_id, 'easytab_' . str_replace('-', '_', $wc_tab_key) . '_tab', $tab);
    73         }
    74 
    75     }
    76 
    77     add_action('save_post_product', 'easytab_product_tabs_save_metabox', 20, 3);
     78add_action(
     79    'save_post_product',
     80    'easytab_product_tabs_save_metabox',
     81    20,
     82    3
     83);
  • easytab/trunk/admin/settings-page.php

    r3195878 r3202007  
    11<?php
    22
    3     defined('ABSPATH') || exit;
    4 
    5 
    6     function easytab_options_page() {
    7 
    8         add_menu_page(
    9             __('EasyTab', 'easytab'),
    10             __('EasyTab', 'easytab'),
    11             'manage_options',
    12             'easytab',
    13             'easytab_option_page',
    14             'dashicons-admin-generic',
    15             50
    16         );
    17 
    18     }
    19 
    20     add_action('woocommerce_init', 'easytab_options_page');
    21 
    22 
    23     function easytab_option_page() {
    24 
    25         if (!current_user_can('manage_options')) {
    26             return;
    27         }
    28 
    29     ?>
    30 
     3defined( 'ABSPATH' ) || exit;
     4function easytab_options_page() {
     5    add_menu_page(
     6        __( 'EasyTab', EASYTAB_DOMAIN ),
     7        __( 'EasyTab', EASYTAB_DOMAIN ),
     8        'manage_options',
     9        'easytab',
     10        'easytab_option_page',
     11        'dashicons-admin-generic',
     12        50
     13    );
     14}
     15
     16add_action( 'admin_menu', 'easytab_options_page' );
     17function easytab_option_page() {
     18    if ( !current_user_can( 'manage_options' ) ) {
     19        return;
     20    }
     21    ?>
     22       
    3123        <div id="easytab-pro-banner">
    3224
    33             <img src="<?php echo EASYTAB_URL; ?>assets/img/easytab-logo.png">
    34 
    35             <a href="https://easytab.pro" rel="nofollow" target="_blank"><button><?php esc_html_e('GET PRO VERSION!', 'easytab'); ?></button></a>
    36             <a href="https://youtu.be/rS05e_R8KdM?si=6mQn3JLoaowy88Qz" rel="nofollow" target="_blank"><button><?php esc_html_e('EASYTAB PRO PREVIEW', 'easytab'); ?></button></a>
     25            <img src="<?php
     26    echo EASYTAB_URL;
     27    ?>assets/img/easytab-logo.png">
     28
     29            <a href="https://easytab.pro" rel="nofollow" target="_blank"><button><?php
     30    esc_html_e( 'GET PRO VERSION!', EASYTAB_DOMAIN );
     31    ?></button></a>
     32            <a href="https://youtu.be/rS05e_R8KdM?si=6mQn3JLoaowy88Qz" rel="nofollow" target="_blank"><button><?php
     33    esc_html_e( 'EASYTAB PRO PREVIEW', EASYTAB_DOMAIN );
     34    ?></button></a>
    3735
    3836            <div>
    39                 <h4><b><?php esc_html_e('EasyTab Pro', 'easytab'); ?></b><?php esc_html_e(' features', 'easytab'); ?></h4>
     37                <h4><b><?php
     38    esc_html_e( 'EasyTab Pro', EASYTAB_DOMAIN );
     39    ?></b><?php
     40    esc_html_e( ' features', 'easytab' );
     41    ?></h4>
    4042                <ul>
    41                     <li><?php esc_html_e('Anthropic\'s Claude AI', 'easytab'); ?></li>
    42                     <li><?php esc_html_e('Powered AI Prompt Wizard', 'easytab'); ?></li>
    43                     <li><?php esc_html_e('More efficient and configurable', 'easytab'); ?></li>
    44                     <li><?php esc_html_e('Continuous assistance and support', 'easytab'); ?></li>
     43                    <li><?php
     44    esc_html_e( 'OpenAI\'s ChatGPT and Anthropic\'s Claude AI', EASYTAB_DOMAIN );
     45    ?></li>
     46                    <li><?php
     47    esc_html_e( 'Powered AI Prompt Wizard', EASYTAB_DOMAIN );
     48    ?></li>
     49                    <li><?php
     50    esc_html_e( 'Infinite Tabs', EASYTAB_DOMAIN );
     51    ?></li>
     52                    <li><?php
     53    esc_html_e( 'More efficient and configurable', EASYTAB_DOMAIN );
     54    ?></li>
     55                    <li><?php
     56    esc_html_e( 'Continuous assistance and support', EASYTAB_DOMAIN );
     57    ?></li>
    4558                </ul>
    4659            </div>
     
    4861        </div>
    4962
     63        <?php
     64    ?>
     65
    5066        <div class="wrap">
    51             <h1><?php esc_html(get_admin_page_title()); ?></h1>
     67            <h1><?php
     68    esc_html( get_admin_page_title() );
     69    ?></h1>
    5270            <form action="options.php" method="post" id="easytab-ai-prompt">
    5371
    54     <?php
    55 
    56         // Security field
    57         settings_fields('easytab_options');
    58 
    59         do_settings_sections('easytab');
    60 
    61         $ai = (get_option('easytab_ai')) ? get_option('easytab_ai') : null;
    62 
    63         if (empty($ai)) return;
    64 
    65         $wc_tabs = easytab_helper_get_woo_default_product_tabs();
    66 
    67         foreach ($ai as $ai_key => $ai_value) {
    68 
    69     ?>
    70 
    71                 <div class="ai-section <?php echo esc_html(str_replace('_', '-', $ai_key)); ?>" style="display: none;">
    72 
    73     <?php
    74 
    75             do_settings_sections('easytab_' . str_replace('-', '_', $ai_key));
    76 
    77     ?>
     72        <?php
     73    // Security field
     74    settings_fields( 'easytab_options' );
     75    do_settings_sections( 'easytab' );
     76    $ai = ( get_option( 'easytab_ai' ) ? get_option( 'easytab_ai' ) : null );
     77    if ( empty( $ai ) ) {
     78        return;
     79    }
     80    $wc_tabs = easytab_helper_get_woo_default_product_tabs();
     81    foreach ( $ai as $ai_key => $ai_value ) {
     82        ?>
     83
     84                <div class="ai-section <?php
     85        echo esc_html( str_replace( '_', '-', $ai_key ) );
     86        ?>" style="display: none;">
     87
     88        <?php
     89        do_settings_sections( 'easytab_' . str_replace( '-', '_', $ai_key ) );
     90        ?>
    7891
    7992                    <div class="wc-tabs" style="margin-top: 50px;">
    8093
    81     <?php
    82 
    83             $default_open = true;
    84 
    85             foreach ($wc_tabs as $wc_tab_key => $wc_tab_value) {
    86 
    87     ?>
    88 
    89                         <button class="wc-tabs-link<?php echo esc_html($default_open) ? ' active' : ''; ?>" data-wctab="<?php echo esc_html(str_replace('_', '-', $wc_tab_key)); ?>"><?php echo esc_html($wc_tab_value['title']); ?></button>
    90 
    91     <?php
    92 
    93                 $default_open = false;
    94 
    95             }
    96 
    97     ?>
     94        <?php
     95        $default_open = true;
     96        foreach ( $wc_tabs as $wc_tab_key => $wc_tab_value ) {
     97            ?>
     98
     99                        <button
     100                            class="wc-tabs-link<?php
     101            echo ( esc_html( $default_open ) ? ' active' : '' );
     102            ?>"
     103                            data-wctab="<?php
     104            echo esc_html( str_replace( '_', '-', $wc_tab_key ) );
     105            ?>">
     106                            <?php
     107            echo esc_html( $wc_tab_value['title'] );
     108            ?>
     109                        </button>
     110
     111        <?php
     112            $default_open = false;
     113        }
     114        ?>
    98115
    99116                    </div>
    100117
    101     <?php
    102 
    103             $default_open = true;
    104 
    105             foreach ($wc_tabs as $wc_tab_key => $wc_tab_value) {
    106 
    107     ?>
    108 
    109                     <div id="wc-tab-section-<?php echo esc_html(str_replace('_', '-', $wc_tab_key)); ?>-<?php echo esc_html(str_replace('_', '-', $ai_key)); ?>-ai" class="wc-tab-section <?php echo esc_html(str_replace('_', '-', $ai_key . ' ' . $wc_tab_key)); ?>"<?php echo (!$default_open) ? ' style="display: none;"' : '';?>>
    110 
    111     <?php
    112 
    113                         do_settings_sections('easytab_' . str_replace('-', '_', $ai_key) . '_wc_' . str_replace('-', '_', $wc_tab_key) . '_tab');
    114 
    115     ?>
     118        <?php
     119        $default_open = true;
     120        foreach ( $wc_tabs as $wc_tab_key => $wc_tab_value ) {
     121            ?>
     122
     123                    <div
     124                        id="wc-tab-section-<?php
     125            echo esc_html( str_replace( '_', '-', $wc_tab_key ) );
     126            ?>-<?php
     127            echo esc_html( str_replace( '_', '-', $ai_key ) );
     128            ?>-ai"
     129                        class="wc-tab-section <?php
     130            echo esc_html( str_replace( '_', '-', $ai_key . ' ' . $wc_tab_key ) );
     131            ?>"
     132                        <?php
     133            echo ( !$default_open ? ' style="display: none;"' : '' );
     134            ?>>
     135
     136        <?php
     137            do_settings_sections( 'easytab_' . str_replace( '-', '_', $ai_key ) . '_wc_' . str_replace( '-', '_', $wc_tab_key ) . '_tab' );
     138            ?>
    116139
    117140                    </div>
    118141
    119     <?php
    120 
    121                 $default_open = false;
    122 
    123             }
    124 
    125     ?>
     142        <?php
     143            $default_open = false;
     144        }
     145        ?>
    126146
    127147                </div>
    128148
    129     <?php
    130 
    131         }
    132 
    133         submit_button(__('Save Settings', 'easytab'));
    134 
    135     ?>
     149        <?php
     150    }
     151    submit_button( __( 'Save Settings', EASYTAB_DOMAIN ) );
     152    ?>
    136153
    137154            </form>
    138155        </div>
    139156
    140     <?php
    141 
    142     }
    143 
    144 
    145     function easytab_settings_init() {
    146 
    147         register_setting('easytab_options', 'easytab_settings', 'easytab_sanitize_options');
    148 
    149         $ai = (get_option('easytab_ai')) ? get_option('easytab_ai') : null;
    150 
    151         if (empty($ai)) return;
    152 
    153         $wc_tabs = easytab_helper_get_woo_default_product_tabs();
    154 
    155         add_settings_section(
    156             'easytab_section',
    157             __('Prompt Configuration Wizard for AI', 'easytab'),
    158             null,
    159             'easytab'
    160         );
    161 
    162         add_settings_field(
    163             'easytab_ai_field',
    164             __('Select AI', 'easytab'),
    165             'easytab_ai_field_cb',
    166             'easytab',
    167             'easytab_section',
    168             array('ai' => $ai)
    169         );
    170 
     157        <?php
     158}
     159
     160function easytab_settings_init() {
     161    register_setting( 'easytab_options', 'easytab_settings', 'easytab_helper_sanitize_options' );
     162    $ai = ( get_option( 'easytab_ai' ) ? get_option( 'easytab_ai' ) : null );
     163    if ( empty( $ai ) ) {
     164        return;
     165    }
     166    $wc_tabs = easytab_helper_get_woo_default_product_tabs();
     167    add_settings_section(
     168        'easytab_section',
     169        __( 'AI Prompt Wizard', EASYTAB_DOMAIN ),
     170        null,
     171        'easytab'
     172    );
     173    add_settings_field(
     174        'easytab_ai_field',
     175        __( 'Select AI', EASYTAB_DOMAIN ),
     176        'easytab_ai_field_cb',
     177        'easytab',
     178        'easytab_section',
     179        array(
     180            'ai' => $ai,
     181        )
     182    );
     183    add_settings_field(
     184        'easytab_prompt_language_output_response_field',
     185        __( 'Select language', EASYTAB_DOMAIN ),
     186        'easytab_prompt_language_output_response_field_cb',
     187        'easytab',
     188        'easytab_section',
     189        array(
     190            'ai' => $ai,
     191        )
     192    );
     193    foreach ( $ai as $ai_key => $ai_value ) {
     194        $ai_key = str_replace( '-', '_', $ai_key );
     195        add_settings_section(
     196            'easytab_' . $ai_key . '_section',
     197            __( 'Generating the prompt for ', EASYTAB_DOMAIN ) . $ai_value,
     198            null,
     199            'easytab_' . $ai_key
     200        );
    171201        add_settings_field(
    172             'easytab_prompt_language_output_response_field',
    173             __('Select a language', 'easytab'),
    174             'easytab_prompt_language_output_response_field_cb',
    175             'easytab',
    176             'easytab_section',
    177             array('ai' => $ai)
    178         );
    179 
    180         foreach ($ai as $ai_key => $ai_value) {
    181 
    182             $ai_key = str_replace('-', '_', $ai_key);
    183 
    184             add_settings_section(
    185                 'easytab_' . $ai_key . '_section',
    186                 __('Generating the prompt for ', 'easytab') . $ai_value,
    187                 null,
    188                 'easytab_' . $ai_key
    189             );
    190 
    191             /**/
    192 
     202            'easytab_ai_' . $ai_key . '_api_key_field',
     203            __( 'Provide the API KEY', EASYTAB_DOMAIN ),
     204            'easytab_ai_api_key_field_cb',
     205            'easytab_' . $ai_key,
     206            'easytab_' . $ai_key . '_section',
     207            array(
     208                'ai' => $ai_key,
     209            )
     210        );
     211        add_settings_field(
     212            'easytab_max_words_for_' . $ai_key . '_ai_field',
     213            __( 'Max. words number', EASYTAB_DOMAIN ),
     214            'easytab_generate_output_max_words_field_cb',
     215            'easytab_' . $ai_key,
     216            'easytab_' . $ai_key . '_section',
     217            array(
     218                'ai' => $ai_key,
     219            )
     220        );
     221        add_settings_field(
     222            'easytab_shop_target_description_for_' . $ai_key . '_ai_field',
     223            __( 'Shop Description', EASYTAB_DOMAIN ),
     224            'easytab_shop_target_description_field_cb',
     225            'easytab_' . $ai_key,
     226            'easytab_' . $ai_key . '_section',
     227            array(
     228                'ai' => $ai_key,
     229            )
     230        );
     231        foreach ( $wc_tabs as $wc_tab_key => $wc_tab_value ) {
     232            $wc_tab_key = str_replace( '-', '_', $wc_tab_key );
     233            add_settings_section(
     234                'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab_section',
     235                '<span style="font-size: 16px;">' . __( 'Specific information for the Woocommerce Tab ', EASYTAB_DOMAIN ) . '"' . $wc_tab_value['title'] . '"</span>',
     236                null,
     237                'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab'
     238            );
    193239            add_settings_field(
    194                 'easytab_ai_' . $ai_key . '_api_key_field',
    195                 __('Enter the API KEY', 'easytab'),
    196                 'easytab_ai_api_key_field_cb',
    197                 'easytab_' . $ai_key,
    198                 'easytab_' . $ai_key . '_section',
    199                 array('ai' => $ai_key)
     240                'easytab_specific_wc_' . $wc_tab_key . '_tab_instructions_for_' . $ai_key . '_ai_field',
     241                __( 'Additional Instructions', EASYTAB_DOMAIN ),
     242                'easytab_specific_wc_tab_instructions_field_cb',
     243                'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab',
     244                'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab_section',
     245                array(
     246                    'ai'     => $ai_key,
     247                    'wc_tab' => [
     248                        'key'   => $wc_tab_key,
     249                        'value' => $wc_tab_value['title'],
     250                    ],
     251                )
    200252            );
    201 
    202             add_settings_field(
    203                 'easytab_max_chars_for_' . $ai_key . '_ai_field',
    204                 __('Max. number of characters', 'easytab'),
    205                 'easytab_generate_output_max_chars_field_cb',
    206                 'easytab_' . $ai_key,
    207                 'easytab_' . $ai_key . '_section',
    208                 array('ai' => $ai_key)
    209             );
    210 
    211             add_settings_field(
    212                 'easytab_shop_target_description_for_' . $ai_key . '_ai_field',
    213                 __('Shop Description', 'easytab'),
    214                 'easytab_shop_target_description_field_cb',
    215                 'easytab_' . $ai_key,
    216                 'easytab_' . $ai_key . '_section',
    217                 array('ai' => $ai_key)
    218             );
    219 
    220             foreach ($wc_tabs as $wc_tab_key => $wc_tab_value) {
    221 
    222                 $wc_tab_key = str_replace('-', '_', $wc_tab_key);
    223 
    224                 add_settings_section(
    225                     'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab_section',
    226                     '<span style="font-size: 16px;">' . __('Specific information for the Woocommerce Tab ', 'easytab') . '"' . $wc_tab_value['title'] . '"</span>',
    227                     null,
    228                     'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab'
    229                 );
    230 
    231                 add_settings_field(
    232                     'easytab_specific_wc_' . $wc_tab_key . '_tab_instructions_for_' . $ai_key . '_ai_field',
    233                     __('Additional Instructions', 'easytab'),
    234                     'easytab_specific_wc_tab_instructions_field_cb',
    235                     'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab',
    236                     'easytab_' . $ai_key . '_wc_' . $wc_tab_key . '_tab_section',
    237                     array('ai' => $ai_key, 'wc_tab' => ['key' => $wc_tab_key, 'value' => $wc_tab_value['title']])
    238                 );
    239 
    240             }
    241 
    242253        }
    243 
    244     }
    245 
    246     add_action('admin_init', 'easytab_settings_init');
    247 
    248 
    249     /**/
    250 
    251 
    252     function easytab_ai_field_cb($args) {
    253 
    254         $ai = $args['ai'];
    255 
    256         $options = get_option('easytab_settings');
    257 
    258     ?>
     254    }
     255}
     256
     257add_action( 'admin_init', 'easytab_settings_init' );
     258function easytab_ai_field_cb(  $args  ) {
     259    $ai = $args['ai'];
     260    $options = get_option( 'easytab_settings' );
     261    ?>
    259262
    260263        <div>
    261264
    262265            <select name="easytab_settings[ai]" id="ai-select">
    263                 <option value="">-- <?php esc_html_e('AI available', 'easytab'); ?> --</option>
    264             <?php foreach ($ai as $key => $value) { ?>
    265                 <option value="<?php echo esc_html($key); ?>" <?php echo $options['ai'] === $key ? 'selected' : ''; ?>><?php echo esc_html($value); ?></option>
    266             <?php } ?>
     266                <option value="">-- <?php
     267    esc_html_e( 'AI available', EASYTAB_DOMAIN );
     268    ?> --</option>
     269            <?php
     270    foreach ( $ai as $key => $value ) {
     271        ?>
     272                <option value="<?php
     273        echo esc_html( $key );
     274        ?>" <?php
     275        echo ( !empty( $options['ai'] ) && $options['ai'] === $key ? 'selected' : '' );
     276        ?>>
     277                    <?php
     278        echo esc_html( $value );
     279        ?>
     280                </option>
     281            <?php
     282    }
     283    ?>
    267284            </select>
    268285
     
    272289
    273290        <details>
    274             <summary><?php esc_html_e('Select an AI', 'easytab'); ?></summary>
     291            <summary><?php
     292    esc_html_e( 'Choose your AI. ', EASYTAB_DOMAIN );
     293    ?></summary>
    275294            <div class="info">
    276                 <p><?php esc_html_e('Chat-GPT is a chat bot based on artificial intelligence and machine learning, developed by OpenAI and specialized in conversation with a human user. ', 'easytab'); ?></p>
     295                <p><?php
     296    esc_html_e( 'Chat-GPT is a chat bot based on artificial intelligence and machine learning, developed by OpenAI and specialized in conversation with a human user. ', EASYTAB_DOMAIN );
     297    ?></p>
     298                <p><?php
     299    esc_html_e( 'Claude is a conversational AI assistant developed by Anthropic, which leverages advanced natural language processing and deep learning techniques. ', EASYTAB_DOMAIN );
     300    ?></p>
    277301            </div>
    278302        </details>
    279303
    280     <?php
    281 
    282     }
    283 
    284 
    285     function easytab_prompt_language_output_response_field_cb($args) {
    286 
    287         $options = get_option('easytab_settings');
    288 
    289         $languages = include_once(EASYTAB_PATH . '/vendor/umpirsky/language-list/data/' . get_locale() . '/language.php');
    290 
    291         if ($languages === false) $languages = include_once(EASYTAB_PATH . '/vendor/umpirsky/language-list/data/en_US/language.php');
    292 
     304        <?php
     305}
     306
     307function easytab_prompt_language_output_response_field_cb(  $args  ) {
     308    $options = get_option( 'easytab_settings' );
     309    $languages = (include_once EASYTAB_PATH . '/vendor/umpirsky/language-list/data/' . get_locale() . '/language.php');
     310    if ( $languages === false ) {
     311        $languages = (include_once EASYTAB_PATH . '/vendor/umpirsky/language-list/data/en_US/language.php');
     312    }
    293313    ?>
    294314
     
    296316
    297317            <select name="easytab_settings[prompt_language_output_response]" id="prompt-language-output-response">
    298                 <option value="">-- <?php esc_html_e('Select a language', 'easytab'); ?> --</option>
    299                 <?php foreach ($languages as $language_key => $language_value) { ?>
    300                     <option value="<?php echo esc_html($language_key); ?>" <?php echo $options['prompt_language_output_response'] === $language_key ? 'selected' : ''; ?>><?php echo esc_html(ucfirst($language_value)); ?></option>
    301                 <?php } ?>
     318                <option value="">-- <?php
     319    esc_html_e( 'Languages', EASYTAB_DOMAIN );
     320    ?> --</option>
     321                <?php
     322    foreach ( $languages as $language_key => $language_value ) {
     323        ?>
     324                    <option value="<?php
     325        echo esc_html( $language_key );
     326        ?>" <?php
     327        echo ( !empty( $options['prompt_language_output_response'] ) && $options['prompt_language_output_response'] === $language_key ? 'selected' : '' );
     328        ?>>
     329                        <?php
     330        echo esc_html( ucfirst( $language_value ) );
     331        ?>
     332                    </option>
     333                <?php
     334    }
     335    ?>
    302336            </select>
    303337
     
    307341
    308342        <details>
    309             <summary><?php esc_html_e('Select a language', 'easytab'); ?></summary>
     343            <summary><?php
     344    esc_html_e( 'Select a language. ', EASYTAB_DOMAIN );
     345    ?></summary>
    310346            <div class="info">
    311                 <p><?php esc_html_e('The content will be generated by the AI in the selected language. ', 'easytab'); ?></p>
     347                <p><?php
     348    esc_html_e( 'The content will be generated by the AI in the selected language. ', EASYTAB_DOMAIN );
     349    ?></p>
    312350            </div>
    313351        </details>
    314352
    315     <?php
    316 
    317     }
    318 
    319 
    320     function easytab_ai_api_key_field_cb($args) {
    321 
    322         $options = get_option('easytab_settings');
    323 
    324     ?>
    325 
    326         <div class="<?php echo esc_html(str_replace('_', '-', $args['ai'])); ?>">
     353        <?php
     354}
     355
     356function easytab_ai_api_key_field_cb(  $args  ) {
     357    $options = get_option( 'easytab_settings' );
     358    ?>
     359
     360        <div class="<?php
     361    echo esc_html( str_replace( '_', '-', $args['ai'] ) );
     362    ?>">
    327363
    328364            <input
    329365                type="password"
    330                 name="easytab_settings[<?php echo esc_html(str_replace('-', '_', $args['ai'])); ?>_ai_api_key]"
    331                 id="<?php echo esc_html(str_replace('_', '-', $args['ai'])); ?>-ai-api-key"
    332                 value="<?php echo !empty($options[str_replace('-', '_', $args['ai']) . '_ai_api_key']) ? esc_html($options[str_replace('-', '_', $args['ai']) . '_ai_api_key']) : ''; ?>"
     366                name="easytab_settings[<?php
     367    echo esc_html( str_replace( '-', '_', $args['ai'] ) );
     368    ?>_ai_api_key]"
     369                id="<?php
     370    echo esc_html( str_replace( '_', '-', $args['ai'] ) );
     371    ?>-ai-api-key"
     372                value="<?php
     373    echo ( !empty( $options[str_replace( '-', '_', $args['ai'] ) . '_ai_api_key'] ) ? esc_html( $options[str_replace( '-', '_', $args['ai'] ) . '_ai_api_key'] ) : '' );
     374    ?>"
    333375                autocomplete="off"
    334                 placeholder="<?php esc_html_e('AI API KEY', 'easytab'); ?>">
     376                placeholder="<?php
     377    esc_html_e( 'AI API KEY', EASYTAB_DOMAIN );
     378    ?>">
    335379
    336380        </div>
     
    339383
    340384        <details>
    341             <summary><?php esc_html_e('Enter the API key for the chosen AI', 'easytab'); ?></summary>
     385            <summary><?php
     386    esc_html_e( 'Enter the API KEY for the chosen AI. ', EASYTAB_DOMAIN );
     387    ?></summary>
    342388            <div class="info">
    343                 <p><?php esc_html_e('An API Key is a unique code used to authenticate and authorize access to a software API. It functions as a "password" that allows one to connect to the chosen service and interact with the AI model, ensuring that only authorized users can send requests and receive responses. ', 'easytab'); ?></p>
    344                 <p><?php esc_html_e('To generate an API Key ', 'easytab'); ?><u><a href="<?php echo esc_html(easytab_helper_help_link(str_replace('-', '_', $args['ai']), 'how-generate-api-key')); ?>" rel="nofollow" target="_blank"><?php esc_html_e('click here!', 'easytab'); ?></a></u></p>
     389                <p><?php
     390    esc_html_e( 'An API KEY is a unique code used to authenticate and authorize access to a software API. It functions as a "password" that allows one to connect to the chosen service and interact with the AI model, ensuring that only authorized users can send requests and receive responses. ', EASYTAB_DOMAIN );
     391    ?></p>
     392                <p>
     393                    <?php
     394    esc_html_e( 'To generate an API Key ', EASYTAB_DOMAIN );
     395    ?>
     396                    <u>
     397                        <a
     398                            href="<?php
     399    echo esc_html( easytab_helper_help_link( str_replace( '-', '_', $args['ai'] ), 'how-generate-api-key' ) );
     400    ?>"
     401                            rel="nofollow"
     402                            target="_blank">
     403                            <?php
     404    esc_html_e( 'click here!', EASYTAB_DOMAIN );
     405    ?>
     406                        </a>
     407                    </u>
     408                </p>
    345409            </div>
    346410        </details>
    347411
    348     <?php
    349 
    350     }
    351 
    352 
    353     function easytab_generate_output_max_chars_field_cb($args) {
    354 
    355         $options = get_option('easytab_settings');
    356 
    357     ?>
    358 
    359         <div class="<?php echo esc_html(str_replace('_', '-', $args['ai'])); ?>">
    360 
    361             <input
    362                 type="number"
    363                 name="easytab_settings[generate_output_max_chars_for_<?php echo esc_html(str_replace('-', '_', $args['ai'])); ?>_ai]"
    364                 id="<?php echo 'generate-output-max-chars-for-' . esc_html(str_replace('_', '-', $args['ai'])); ?>-ai"
    365                 min="512"
    366                 max="2048"
    367                 step="8"
    368                 value="<?php echo (!empty($options['generate_output_max_chars_for_' . str_replace('-', '_', $args['ai']) . '_ai'])) ? esc_html($options['generate_output_max_chars_for_' . str_replace('-', '_', $args['ai']) . '_ai']) : 512; ?>">
    369 
    370         </div>
     412        <?php
     413}
     414
     415function easytab_generate_output_max_words_field_cb(  $args  ) {
     416    $options = get_option( 'easytab_settings' );
     417    ?>
     418
     419            <div class="<?php
     420    echo esc_html( str_replace( '_', '-', $args['ai'] ) );
     421    ?>">
     422
     423                <input
     424                    type="number"
     425                    name="easytab_settings[generate_output_max_words_for_<?php
     426    echo esc_html( str_replace( '-', '_', $args['ai'] ) );
     427    ?>_ai]"
     428                    id="<?php
     429    echo 'generate-output-max-words-for-' . esc_html( str_replace( '_', '-', $args['ai'] ) );
     430    ?>-ai"
     431                    min="50"
     432                    max="500"
     433                    step="5"
     434                    value="<?php
     435    echo ( !empty( $options['generate_output_max_words_for_' . str_replace( '-', '_', $args['ai'] ) . '_ai'] ) ? esc_html( $options['generate_output_max_words_for_' . str_replace( '-', '_', $args['ai'] ) . '_ai'] ) : 50 );
     436    ?>">
     437
     438            </div>
     439
     440            <br>
     441
     442            <details>
     443                <summary><?php
     444    esc_html_e( 'Set the max words number to be generated. ', EASYTAB_DOMAIN );
     445    ?></summary>
     446                <div class="info">
     447                    <p><?php
     448    esc_html_e( 'The greater the number of words of text to be generated the greater the cost per single call to the AI API. ', EASYTAB_DOMAIN );
     449    ?></p>
     450                </div>
     451            </details>
     452
     453            <?php
     454}
     455
     456function easytab_shop_target_description_field_cb(  $args  ) {
     457    $options = get_option( 'easytab_settings' );
     458    ?>
     459
     460        <div class="<?php
     461    echo esc_html( str_replace( '_', '-', $args['ai'] ) );
     462    ?>">
     463
     464            <textarea
     465                name="easytab_settings[shop_target_description_for_<?php
     466    echo esc_html( str_replace( '-', '_', $args['ai'] ) );
     467    ?>_ai]"
     468                id="<?php
     469    echo 'shop-target-description-for-' . esc_html( str_replace( '_', '-', $args['ai'] ) ) . '-ai';
     470    ?>"
     471                autocomplete="off"
     472                placeholder="<?php
     473    esc_html_e( 'Description', EASYTAB_DOMAIN );
     474    ?>"
     475                rows="4" cols="50"><?php
     476    echo ( !empty( $options['shop_target_description_for_' . str_replace( '-', '_', $args['ai'] ) . '_ai'] ) ? esc_html( $options['shop_target_description_for_' . str_replace( '-', '_', $args['ai'] ) . '_ai'] ) : '' );
     477    ?></textarea>
     478
     479        </div>
    371480
    372481        <br>
    373482
    374483        <details>
    375             <summary><?php esc_html_e('Set the length of the content to be generated', 'easytab'); ?></summary>
    376             <div class="info">
    377                 <p><?php esc_html_e('The greater the number of characters of text to be generated the greater the cost per single call to the AI API.', 'easytab'); ?></p>
    378             </div>
    379         </details>
    380 
    381     <?php
    382 
    383     }
    384 
    385 
    386     function easytab_shop_target_description_field_cb($args) {
    387 
    388         $options = get_option('easytab_settings');
    389 
    390     ?>
    391 
    392         <div class="<?php echo esc_html(str_replace('_', '-', $args['ai'])); ?>">
    393 
    394             <textarea
    395                 name="easytab_settings[shop_target_description_for_<?php echo esc_html(str_replace('-', '_', $args['ai'])); ?>_ai]"
    396                 id="<?php echo 'shop-target-description-for-' . esc_html(str_replace('_', '-', $args['ai'])) . '-ai'; ?>"
    397                 autocomplete="off"
    398                 placeholder="<?php esc_html_e('Description', 'easytab'); ?>"
    399                 rows="4" cols="50"><?php echo (!empty($options['shop_target_description_for_' . str_replace('-', '_', $args['ai']) . '_ai'])) ? esc_html($options['shop_target_description_for_' . str_replace('-', '_', $args['ai']) . '_ai']) : ''; ?></textarea>
    400 
    401         </div>
    402 
    403         <br>
    404 
    405         <details>
    406             <summary><?php esc_html_e('Describe the type of products your store sells and the target users', 'easytab'); ?></summary>
     484            <summary><?php
     485    esc_html_e( 'Describe the type of products your store sells. ', EASYTAB_DOMAIN );
     486    ?></summary>
    407487            <div class="info">
    408                 <p><?php esc_html_e('In the description, try to be as clear and comprehensive as possible, to achieve greater accuracy on the content generated.', 'easytab'); ?></p>
     488                <p><?php
     489    esc_html_e( 'In the description, try to be as clear and comprehensive as possible, to achieve greater accuracy on the content generated. ', EASYTAB_DOMAIN );
     490    ?></p>
    409491            </div>
    410492        </details>
    411493
    412     <?php
    413 
    414     }
    415 
    416 
    417     function easytab_specific_wc_tab_instructions_field_cb($args) {
    418 
    419         $options = get_option('easytab_settings');
    420 
    421     ?>
    422 
    423         <div class="<?php echo esc_html(str_replace('_', '-', $args['ai'])); ?>">
     494        <?php
     495}
     496
     497function easytab_specific_wc_tab_instructions_field_cb(  $args  ) {
     498    $options = get_option( 'easytab_settings' );
     499    ?>
     500
     501        <div class="<?php
     502    echo esc_html( str_replace( '_', '-', $args['ai'] ) );
     503    ?>">
    424504
    425505            <textarea
    426                 name="easytab_settings[specific_wc_<?php echo esc_html(str_replace('-', '_', $args['wc_tab']['key'])); ?>_tab_instructions_for_<?php echo esc_html(str_replace('-', '_', $args['ai'])); ?>_ai]"
    427                 id="<?php echo 'specific-wc-' . esc_html(str_replace('_', '-', $args['wc_tab']['key'])) . '-tab-instructions-for-' . esc_html(str_replace('_', '-', $args['ai'])) . '-ai'; ?>"
     506                name="easytab_settings[specific_wc_<?php
     507    echo esc_html( str_replace( '-', '_', $args['wc_tab']['key'] ) );
     508    ?>_tab_instructions_for_<?php
     509    echo esc_html( str_replace( '-', '_', $args['ai'] ) );
     510    ?>_ai]"
     511                id="<?php
     512    echo 'specific-wc-' . esc_html( str_replace( '_', '-', $args['wc_tab']['key'] ) ) . '-tab-instructions-for-' . esc_html( str_replace( '_', '-', $args['ai'] ) ) . '-ai';
     513    ?>"
    428514                class="not-require"
    429                 placeholder="<?php esc_html_e('Description', 'easytab'); ?>"
     515                placeholder="<?php
     516    esc_html_e( 'Description', EASYTAB_DOMAIN );
     517    ?>"
    430518                autocomplete="off"
    431                 rows="4" cols="50"><?php echo (!empty($options['specific_wc_' . str_replace('-', '_', $args['wc_tab']['key']) . '_tab_instructions_for_' . str_replace('-', '_', $args['ai']) . '_ai'])) ? esc_html($options['specific_wc_' . str_replace('-', '_', $args['wc_tab']['key']) . '_tab_instructions_for_' . str_replace('-', '_', $args['ai']) . '_ai']) : ''; ?></textarea>
     519                rows="4" cols="50"><?php
     520    echo ( !empty( $options['specific_wc_' . str_replace( '-', '_', $args['wc_tab']['key'] ) . '_tab_instructions_for_' . str_replace( '-', '_', $args['ai'] ) . '_ai'] ) ? esc_html( $options['specific_wc_' . str_replace( '-', '_', $args['wc_tab']['key'] ) . '_tab_instructions_for_' . str_replace( '-', '_', $args['ai'] ) . '_ai'] ) : '' );
     521    ?></textarea>
    432522
    433523        </div>
     
    436526
    437527        <details>
    438             <summary><?php esc_html_e('Insert specific instructions for this tab to be incorporated into the prompt intended for AI', 'easytab'); ?></summary>
     528            <summary><?php
     529    esc_html_e( 'Provide specific instructions for this tab to be incorporated into the prompt intended for IA. ', EASYTAB_DOMAIN );
     530    ?></summary>
    439531            <div class="info">
    440                 <p><?php esc_html_e('Additional instructions to consider for this specific Woocommerce tab.', 'easytab'); ?></p>
     532                <p><?php
     533    esc_html_e( 'Additional instructions to consider for this specific Woocommerce tab. ', EASYTAB_DOMAIN );
     534    ?></p>
    441535            </div>
    442536        </details>
    443537
    444     <?php
    445 
    446     }
     538    <?php
     539}
  • easytab/trunk/assets/css/easytab.css

    r3195878 r3202007  
    1 form#easytab-ai-prompt details {
     1form#easytab-pro-ai-prompt details {
    22    width: 50%;
    33    cursor: pointer;
    44}
    55
    6 form#easytab-ai-prompt details summary {
     6form#easytab-pro-ai-prompt details summary {
    77    display: flex;
    88    flex-direction: row;
     
    1111}
    1212
    13 form#easytab-ai-prompt details div.info {
     13form#easytab-pro-ai-prompt details div.info {
    1414    display: flex;
    1515    flex-direction: column;
     
    2525}
    2626
    27 form#easytab-ai-prompt details summary::before {
     27form#easytab-pro-ai-prompt details summary::before {
    2828    content: "";
    2929    display: block;
     
    3535    height: 15px;
    3636    padding-right: 10px;
    37 }
    38 
    39 div.repeater-field {
    40     display: flex;
    41     flex-direction: row;
    42     justify-content: flex-start;
    43     align-items: center;
    44     position: relative;
    45 }
    46 
    47 div.repeater-field-controls {
    48     width: auto;
    49     margin-left: 30px;
    50 }
    51 
    52 div.repeater-field-controls span {
    53     display: flex;
    54     flex-direction: row;
    55     justify-content: center;
    56     align-items: center;
    57 }
    58 
    59 div.repeater-field-controls span.add::after {
    60     content: "";
    61     display: block;
    62     background-size: contain;
    63     background-repeat: no-repeat;
    64     background-position: 50%;
    65     width: 15px;
    66     height: 15px;
    67 }
    68 
    69 div.repeater-field-controls span.remove::after {
    70     content: "";
    71     display: block;
    72     background-size: contain;
    73     background-repeat: no-repeat;
    74     background-position: 50%;
    75     width: 15px;
    76     height: 15px;
    7737}
    7838
  • easytab/trunk/assets/js/easytab.js

    r3195878 r3202007  
    55        const convalidateForm = (e, form, aiSelected = null, wcTabSelected = null) => {
    66            e.preventDefault();
    7             if ((typeof form === null) || (typeof form === 'undefined')) return;
     7            if ((form === null) || (typeof form === 'undefined')) return;
    88            let isValid = true;
    99            const inputsGrp1 = form.querySelectorAll('form > table select');
     
    4646        }
    4747
    48         const cloneField = (e) => {
    49             e.preventDefault();
    50             let originalField = e.target.closest('div.repeater-field');
    51             let parentNode = originalField.parentNode;
    52             let numberRepeaterFields = parentNode.querySelector('input.number-repeater-fields').value;
    53             if (isNaN(numberRepeaterFields)) numberRepeaterFields = 0;
    54             numberRepeaterFields = parseInt(numberRepeaterFields , 10) + 1;
    55             originalField.parentNode.querySelector('input.number-repeater-fields').value = numberRepeaterFields;
    56             let clonedField = parentNode.querySelector('div.to-clone').cloneNode(true);
    57             // Optional: Reset input values or make other modifications in the clonedField here
    58             clonedField.querySelectorAll('input, select, textarea').forEach((input) => {
    59                 let inputAttrName = input.getAttribute('name');
    60                 let inputAttrId = input.getAttribute('id');
    61                 input.setAttribute('name', inputAttrName.replace('%d', numberRepeaterFields));
    62                 input.setAttribute('id', inputAttrId.replace('%d', numberRepeaterFields));
    63             });
    64             originalField.insertAdjacentElement('afterend', clonedField);
    65             clonedField.style.display = 'flex';
    66             clonedField.classList = originalField.classList;
    67             // Attach the cloneField function to the 'add' button in the cloned field
    68             clonedField.querySelector('div.repeater-field-controls span.add').addEventListener('click', cloneField);
    69             clonedField.querySelector('div.repeater-field-controls span.remove').addEventListener('click', removeField);
    70         }
    71 
    72         const removeField = (e) => {
    73             e.preventDefault();
    74             let originalField = e.target.closest('div.repeater-field');
    75             let numberRepeaterFields = originalField.parentNode.querySelector('input.number-repeater-fields').value;
    76             if (isNaN(numberRepeaterFields)) numberRepeaterFields = 0;
    77             if (parseInt(numberRepeaterFields , 10) === 0) return;
    78             originalField.parentNode.querySelector('input.number-repeater-fields').value = parseInt(numberRepeaterFields , 10) - 1;
    79             originalField.remove();
    80         }
    81 
    8248        const form = document.getElementById('easytab-ai-prompt');
    8349
     
    10470        }
    10571
    106         if (document.querySelector('select#ai-select').length > 0) {
     72        if (document.querySelector('select#ai-select')?.length > 0) {
    10773            let form = document.querySelector('form');
    10874            aiSelected = document.querySelector('select#ai-select').value;
     
    13399        }
    134100
    135         document.querySelectorAll('div.repeater-field-controls span.add').forEach((addButton) => {
    136             addButton.addEventListener('click', cloneField);
    137         });
    138 
    139         document.querySelectorAll('div.repeater-field-controls span.remove').forEach((removeButton) => {
    140             removeButton.addEventListener('click', removeField);
    141         });
    142 
    143101        document.querySelectorAll('form select, form input, form textarea').forEach((input) => {
    144102            input.addEventListener('change', (e) => {
  • easytab/trunk/easytab.php

    r3195878 r3202007  
    11<?php
    22
    3     /**
    4      * Plugin Name: EasyTab
    5      * Plugin URI: https://easytab.pro
    6      * Description: EasyTab helps you optimize Woocommerce tabs with the support of artificial intelligence.
    7      * Version: 1.0.0
    8      * Author: rgwebdev
    9      * Author URI: https://riccardoguerrera.dev
    10      * Text Domain: easytab
    11      * Domain Path: /languages
    12      * Requires at least: 6.0
    13      * Requires PHP: 7.4
    14      * Copyright: Riccardo Guerrera - EasyTab
    15      * License: GNU General Public License v3.0
    16      * License URI: https://www.gnu.org/licenses/gpl.html
    17      */
    18 
    19 
    20     defined('ABSPATH') || exit;
    21 
    22 
    23     if (!function_exists('is_plugin_active')) {
    24         include_once(ABSPATH . 'wp-admin/includes/plugin.php');
    25     }
    26 
    27 
    28     define('EASYTAB_VERSION', '1.0.0');
    29 
    30     define('EASYTAB_FILE', __FILE__);
    31     define('EASYTAB_PATH', plugin_dir_path(__FILE__));
    32     define('EASYTAB_URL', plugin_dir_url(__FILE__));
    33 
    34 
    35     function easytab_check_woocommerce_dependency() {
    36 
    37         if (!is_plugin_active('woocommerce/woocommerce.php')) {
    38             add_action('admin_notices', 'easytab_show_woocommerce_dependency_notice');
    39             deactivate_plugins(plugin_basename(__FILE__));
     3/**
     4 * Plugin Name: EasyTab
     5 * Plugin URI: https://easytab.pro
     6 * Description: EasyTab helps you optimize WooCommerce Tabs with the support of artificial intelligence.
     7 * Version: 1.0.1
     8 * Author: rgwebdev
     9 * Author URI: https://riccardoguerrera.dev
     10 * Text Domain: easytab
     11 * Domain Path: /languages
     12 * Requires at least: 6.0
     13 * Requires PHP: 7.4
     14 * Requires Plugins: woocommerce
     15 */
     16defined( 'ABSPATH' ) || exit;
     17/**/
     18if ( function_exists( 'easytab_fs' ) ) {
     19    easytab_fs()->set_basename( false, __FILE__ );
     20} else {
     21    // DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE `function_exists` CALL ABOVE TO PROPERLY WORK.
     22    if ( !function_exists( 'easytab_fs' ) ) {
     23        // Create a helper function for easy SDK access.
     24        function easytab_fs() {
     25            global $easytab_fs;
     26            if ( !isset( $easytab_fs ) ) {
     27                // Include Freemius SDK.
     28                require_once dirname( __FILE__ ) . '/freemius/start.php';
     29                $easytab_fs = fs_dynamic_init( array(
     30                    'id'             => '17170',
     31                    'slug'           => 'easytab',
     32                    'premium_slug'   => 'easytab-pro',
     33                    'type'           => 'plugin',
     34                    'public_key'     => 'pk_0d7520ed443e64cd6ac71e30888dc',
     35                    'is_premium'     => false,
     36                    'premium_suffix' => 'Pro',
     37                    'has_addons'     => false,
     38                    'has_paid_plans' => true,
     39                    'menu'           => array(
     40                        'slug'    => 'easytab',
     41                        'support' => false,
     42                    ),
     43                    'is_live'        => true,
     44                ) );
     45            }
     46            return $easytab_fs;
    4047        }
    4148
     49        // Init Freemius.
     50        add_action( 'plugins_loaded', 'easytab_fs' );
     51        // Signal that SDK was initiated.
     52        do_action( 'easytab_fs_loaded' );
    4253    }
    43 
    44     function easytab_show_woocommerce_dependency_notice() {
    45 
    46         ?>
    47 
    48         <div class="error notice">
    49             <p><?php esc_html_e('The "EasyTab" plugin requires WooCommerce to work. WooCommerce is not active, so the plugin has been disabled.', 'easytab'); ?></p>
    50         </div>
    51 
    52         <?php
    53 
     54}
     55/**/
     56if ( !function_exists( 'is_plugin_active' ) ) {
     57    include_once ABSPATH . 'wp-admin/includes/plugin.php';
     58}
     59$easytab_plugin_basename = plugin_basename( __FILE__ );
     60if ( $easytab_plugin_basename === 'easytab-pro/easytab.php' ) {
     61    if ( !is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
     62        deactivate_plugins( plugin_basename( __FILE__ ) );
     63        add_action( 'admin_notices', function () {
     64            ?>
     65                <div class="error notice">
     66                    <?php
     67            ?>
     68                        <p><?php
     69            esc_html_e( 'The "EasyTab" plugin requires WooCommerce to work. WooCommerce is not active, so the plugin has been disabled.', 'easytab' );
     70            ?></p>
     71                        <?php
     72            ?>
     73                </div>
     74                <?php
     75        } );
     76    } else {
     77        if ( is_plugin_active( 'easytab/easytab.php' ) ) {
     78            deactivate_plugins( plugin_basename( 'easytab/easytab.php' ) );
     79            add_action( 'admin_notices', function () {
     80                ?>
     81                    <div class="error notice">
     82                        <p><?php
     83                esc_html_e( '"EasyTab Pro" disabled the "Easytab Free" version.', 'easytab' );
     84                ?></p>
     85                    </div>
     86                    <?php
     87            } );
     88        }
    5489    }
    55 
    56     add_action('admin_init', 'easytab_check_woocommerce_dependency');
    57 
    58 
    59     function easytab_load_textdomain() {
    60 
    61         load_plugin_textdomain('easytab', false, basename(dirname(EASYTAB_FILE)) . '/languages');
    62 
    63     }
    64 
    65     add_action('plugins_loaded', 'easytab_load_textdomain');
    66 
    67 
    68     function easytab_set_english_language_as_fallback($mofile, $domain) {
    69 
    70         if ($domain !== 'easytab') {
    71             return $mofile;
    72         }
    73 
    74         $en_mofile = EASYTAB_PATH . 'languages/' . $domain . '-en_US.mo';
    75 
    76         if (!file_exists($mofile) && file_exists($en_mofile)) {
    77             return $en_mofile;
    78         }
    79 
    80         return $mofile;
    81 
    82     }
    83 
    84     add_filter('load_textdomain_mofile', 'easytab_set_english_language_as_fallback', 10, 2);
    85 
    86 
    87     function easytab_check_and_register_option() {
    88 
    89         $ai = array(
    90             'chat_gpt'  => 'ChatGPT',
    91         );
    92 
    93         if (!get_option('easytab_ai')) {
    94             add_option('easytab_ai', $ai);
     90}
     91if ( $easytab_plugin_basename === 'easytab/easytab.php' ) {
     92    if ( !is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
     93        deactivate_plugins( plugin_basename( __FILE__ ) );
     94        add_action( 'admin_notices', function () {
     95            ?>
     96                <div class="error notice">
     97                    <?php
     98            ?>
     99                        <p><?php
     100            esc_html_e( 'The "EasyTab" plugin requires WooCommerce to work. WooCommerce is not active, so the plugin has been disabled.', 'easytab' );
     101            ?></p>
     102                        <?php
     103            ?>
     104                </div>
     105                <?php
     106        } );
     107    } else {
     108        if ( is_plugin_active( 'easytab-pro/easytab.php' ) ) {
     109            deactivate_plugins( plugin_basename( 'easytab-pro/easytab.php' ) );
     110            add_action( 'admin_notices', function () {
     111                ?>
     112                    <div class="error notice">
     113                        <p><?php
     114                esc_html_e( '"EasyTab Free" disabled the "Easytab Pro" version.', 'easytab' );
     115                ?></p>
     116                    </div>
     117                    <?php
     118            } );
    95119        }
    96 
    97120    }
    98 
    99     register_activation_hook(EASYTAB_FILE, 'easytab_check_and_register_option');
    100 
    101 
    102     function easytab_init_plugin() {
    103 
    104         $installed_version = get_option('easytab_version');
    105 
    106         if (!$installed_version) {
    107             easytab_install();
    108         } elseif (version_compare($installed_version, EASYTAB_VERSION, '<')) {
    109             easytab_update_plugin($installed_version);
    110         }
    111 
    112     }
    113 
    114     function easytab_install() {
    115 
    116         $default_ai = array(
    117             'chat_gpt'  => 'ChatGPT',
    118         );
    119 
    120         add_option('easytab_ai', $default_ai);
    121 
    122         add_option('easytab_version', EASYTAB_VERSION);
    123 
    124     }
    125 
    126     function easytab_update_plugin($installed_version) {
    127 
    128         if (version_compare($installed_version, EASYTAB_VERSION, '<')) {
    129 
    130             $updated_ai = array(
    131                 'chat_gpt'  => 'ChatGPT',
    132             );
    133 
    134             update_option('easytab_ai', $updated_ai);
    135 
    136         }
    137 
    138         update_option('easytab_version', EASYTAB_VERSION);
    139 
    140     }
    141 
    142     add_action('init', 'easytab_init_plugin');
    143 
    144 
    145     /**/
    146 
    147     function easytab_crb_load() {
    148 
    149         require_once('vendor/autoload.php');
    150 
    151         require_once 'helper/log.php';
    152         require_once 'helper/woocommerce.php';
    153         require_once 'helper/admin.php';
    154         require_once 'admin/settings-page.php';
    155         require_once 'admin/meta-box.php';
    156         require_once 'admin/debug-log.php';
    157         require_once 'includes/prompt.php';
    158         require_once 'includes/ai-connection/chat-gpt/connect.php';
    159 
    160     }
    161 
    162     add_action('plugins_loaded', 'easytab_crb_load');
    163 
    164 
    165     function easytab_script($hook) {
    166 
    167         if ($hook === 'toplevel_page_easytab') {
    168 
    169             wp_enqueue_script('easytab', plugins_url('assets/js/easytab.js', EASYTAB_FILE), array('jquery'), EASYTAB_VERSION, true);
    170             wp_enqueue_style('easytab', plugins_url('assets/css/easytab.css', EASYTAB_FILE), null, EASYTAB_VERSION);
    171 
    172         }
    173 
    174         if ($hook === 'easytab_page_easytab_debug_log') {
    175 
    176             wp_enqueue_style('easytab', plugins_url('assets/css/easytab-dl.css', EASYTAB_FILE), null, EASYTAB_VERSION);
    177 
    178         }
    179 
    180     }
    181 
    182     add_action('admin_enqueue_scripts', 'easytab_script');
     121}
     122if ( !defined( 'EASYTAB_VERSION' ) ) {
     123    define( 'EASYTAB_VERSION', '1.0.1' );
     124}
     125if ( !defined( 'EASYTAB_FILE' ) ) {
     126    define( 'EASYTAB_FILE', __FILE__ );
     127}
     128if ( !defined( 'EASYTAB_PATH' ) ) {
     129    define( 'EASYTAB_PATH', plugin_dir_path( __FILE__ ) );
     130}
     131if ( !defined( 'EASYTAB_URL' ) ) {
     132    define( 'EASYTAB_URL', plugin_dir_url( __FILE__ ) );
     133}
     134if ( !defined( 'EASYTAB_DOMAIN' ) ) {
     135    define( 'EASYTAB_DOMAIN', 'easytab' );
     136}
     137if ( file_exists( EASYTAB_PATH . 'init.php' ) ) {
     138    require_once EASYTAB_PATH . 'init.php';
     139}
  • easytab/trunk/helper/admin.php

    r3195878 r3202007  
    11<?php
    22
    3     defined('ABSPATH') || exit;
     3defined( 'ABSPATH' ) || exit;
     4function easytab_helper_sanitize_options(  $options  ) {
     5    foreach ( $options as $key => $option ) {
     6        if ( is_array( $options[$key] ) ) {
     7            foreach ( $options[$key] as $k => $opt ) {
     8                $options[$key][$k]['list'] = sanitize_text_field( $options[$key][$k]['list'] );
     9                $options[$key][$k]['info'] = sanitize_textarea_field( $options[$key][$k]['info'] );
     10            }
     11        } else {
     12            $options[$key] = sanitize_text_field( $options[$key] );
     13        }
     14    }
     15    return $options;
     16}
    417
     18function easytab_helper_help_link(  $ai = null, $info = null  ) {
     19    if ( $ai === null || $info === null ) {
     20        return;
     21    }
     22    if ( $ai === 'chat_gpt' ) {
     23        switch ( $info ) {
     24            case 'ai-models':
     25                return 'https://platform.openai.com/docs/models';
     26            case 'how-generate-api-key':
     27                return 'https://platform.openai.com/api-keys';
     28            default:
     29                break;
     30        }
     31    }
     32}
    533
    6     function easytab_sanitize_options($options) {
    7 
    8         foreach ($options as $key => $option) {
    9             $options[$key] = sanitize_text_field($options[$key]);
    10         }
    11 
    12         return $options;
    13 
    14     }
    15 
    16 
    17     function easytab_helper_help_link($ai = null, $info = null) {
    18 
    19         if (($ai === null) || ($info === null)) return;
    20 
    21         if ($ai === 'chat_gpt') {
    22 
    23             switch ($info) {
    24 
    25                 case 'ai-models':
    26                     return 'https://platform.openai.com/docs/models';
    27 
    28                 case 'how-generate-api-key':
    29                     return 'https://platform.openai.com/api-keys';
    30 
    31                 default:
    32                     break;
    33 
    34             }
    35 
    36         }
    37 
    38     }
     34function easytab_helper_log(  $txt = ''  ) {
     35    $option_name = 'easytab_debug_log';
     36    $log = get_option( $option_name, '' );
     37    $new_log_entry = gmdate( 'Y-m-d H:i:s' ) . ' - ' . $txt . "<br><br>" . $log;
     38    if ( strlen( $new_log_entry ) > 512000 ) {
     39        $new_log_entry = gmdate( 'Y-m-d H:i:s' ) . ' - ' . $txt;
     40    }
     41    update_option( $option_name, $new_log_entry );
     42}
  • easytab/trunk/helper/woocommerce.php

    r3195878 r3202007  
    11<?php
    22
    3     defined('ABSPATH') || exit;
     3defined( 'ABSPATH' ) || exit;
     4add_filter( 'woocommerce_product_tabs', 'easytab_helper_get_woo_default_product_tabs' );
     5function easytab_helper_get_woo_default_product_tabs() {
     6    $product = null;
     7    if ( function_exists( 'is_product' ) && is_product() && !is_admin() ) {
     8        $product = new WC_Product(get_the_ID());
     9    }
     10    $wc_tabs['description'] = array(
     11        'title'    => __( 'Description', EASYTAB_DOMAIN ),
     12        'priority' => 10,
     13        'callback' => 'woocommerce_product_description_tab',
     14    );
     15    if ( is_admin() || isset( $product ) && ($product->has_weight() || $product->has_dimensions()) ) {
     16        $wc_tabs['additional_information'] = array(
     17            'title'    => apply_filters( 'woocommerce_product_additional_information_heading', __( 'Additional information', EASYTAB_DOMAIN ) ),
     18            'priority' => 20,
     19            'callback' => 'woocommerce_product_additional_information_tab',
     20        );
     21    }
     22    return $wc_tabs;
     23}
    424
    5     function easytab_helper_get_woo_default_product_tabs() {
     25function easytab_helper_tabs_templates_override(  $template, $template_name, $template_path  ) {
     26    $base_dir = EASYTAB_PATH . 'wc-templates-override/';
     27    $plugin_template = $base_dir . $template_name;
     28    if ( file_exists( $plugin_template ) ) {
     29        return $plugin_template;
     30    }
     31    return $template;
     32}
    633
    7         $product = null;
    8 
    9         if (function_exists('is_product') && is_product() && !is_admin()) {
    10             $product = new WC_Product(get_the_ID());
    11         }
    12 
    13         $wc_tabs["description"] = array(
    14             "title" => __("Description", "easytab"),
    15             "priority" => 10,
    16             "callback" => "woocommerce_product_description_tab"
    17         );
    18 
    19         if (is_admin() || (isset($product) && (($product->has_weight()) || $product->has_dimensions()))) {
    20 
    21             $wc_tabs["additional_information"] = array(
    22                 "title"    => apply_filters('woocommerce_product_additional_information_heading', __('Additional information', 'easytab')),
    23                 "priority" => 20,
    24                 "callback" => "woocommerce_product_additional_information_tab"
    25             );
    26 
    27         }
    28 
    29         return $wc_tabs;
    30 
    31     }
    32 
    33     add_filter('woocommerce_product_tabs', 'easytab_helper_get_woo_default_product_tabs');
     34add_filter(
     35    'woocommerce_locate_template',
     36    'easytab_helper_tabs_templates_override',
     37    10,
     38    3
     39);
  • easytab/trunk/includes/ai-connection/chat-gpt/connect.php

    r3195878 r3202007  
    11<?php
    22
    3     defined('ABSPATH') || exit;
    4 
    5 
    6     function easytab_chatgpt_connection($request_type, $prompt = null) {
    7 
    8         $options = get_option('easytab_settings');
    9         $api_key = array_key_exists('chat_gpt_ai_api_key', $options) ? $options['chat_gpt_ai_api_key'] : null;
    10 
    11         if (empty($request_type) || empty($prompt) || empty($api_key)) return;
    12 
    13         $headers = array(
    14             'Authorization' => 'Bearer ' . $api_key,
    15             'Content-Type' => 'application/json',
    16         );
    17 
    18         if ($request_type == 'chat') {
    19 
    20             $url = 'https://api.openai.com/v1/chat/completions';
    21             $model = "gpt-4o";
    22 
    23             $data = array(
    24                 'model' => $model,
    25                 'messages' => array(array('role' => 'user', 'content' => $prompt)),
    26                 'max_tokens' => 516,
    27                 'temperature' => 1,
    28             );
    29 
    30             $response = wp_remote_post($url, array(
    31                 'headers' => $headers,
    32                 'body' => wp_json_encode($data),
    33                 'timeout' => 30,
    34             ));
    35 
    36 
    37             if (is_wp_error($response)) {
    38                 easytab_helper_log('Error');
    39                 return null;
    40             }
    41 
    42             $body = wp_remote_retrieve_body($response);
    43             $json_response = json_decode($body, true);
    44 
    45             if (!empty($json_response) && !empty($json_response['error'])) {
    46                 easytab_helper_log('Error');
    47                 return false;
    48             }
    49 
    50             easytab_helper_log($body);
    51 
    52             return $json_response["choices"][0]["message"]["content"];
    53 
    54         }
    55 
    56         return false;
    57 
    58     }
     3defined( 'ABSPATH' ) || exit;
     4function easytab_chatgpt_connection(  $request_type, $prompt = null, $tab = null  ) {
     5    $options = get_option( 'easytab_settings' );
     6    $api_key = ( array_key_exists( 'chat_gpt_ai_api_key', $options ) ? $options['chat_gpt_ai_api_key'] : null );
     7    $model = 'gpt-4o';
     8    if ( empty( $request_type ) || empty( $prompt ) || empty( $api_key ) || empty( $model ) ) {
     9        return;
     10    }
     11    $headers = array(
     12        'Authorization' => 'Bearer ' . $api_key,
     13        'Content-Type'  => 'application/json',
     14    );
     15    if ( $request_type == 'chat' ) {
     16        $url = 'https://api.openai.com/v1/chat/completions';
     17        $data = array(
     18            'model'    => $model,
     19            'messages' => array(array(
     20                'role'    => 'user',
     21                'content' => $prompt,
     22            )),
     23        );
     24        $response = wp_remote_post( $url, array(
     25            'headers' => $headers,
     26            'body'    => wp_json_encode( $data ),
     27            'timeout' => 30,
     28        ) );
     29        if ( is_wp_error( $response ) ) {
     30            easytab_helper_log( 'Wordpress Error' );
     31            return null;
     32        }
     33        $body = wp_remote_retrieve_body( $response );
     34        $json_response = json_decode( $body, true );
     35        if ( !empty( $json_response ) && !empty( $json_response['error'] ) ) {
     36            easytab_helper_log( 'API Request Error: ' . $json_response['error']['message'] );
     37            return false;
     38        }
     39        return $json_response['choices'][0]['message']['content'];
     40    }
     41    return false;
     42}
  • easytab/trunk/includes/prompt.php

    r3195878 r3202007  
    11<?php
    22
    3     defined('ABSPATH') || exit;
     3defined( 'ABSPATH' ) || exit;
     4function easytab_generate_tab_content() {
     5    if ( is_singular( 'product' ) && !is_admin() ) {
     6        $options = get_option( 'easytab_settings' );
     7        $product_id = get_the_ID();
     8        $wc_tabs = easytab_helper_get_woo_default_product_tabs();
     9        $selected_ai = str_replace( '-', '_', $options['ai'] );
     10        if ( empty( $selected_ai ) ) {
     11            return null;
     12        }
     13        $iso_639_1_code_output = $options['prompt_language_output_response'];
     14        foreach ( $wc_tabs as $wc_tab_key => $wc_tab_data ) {
     15            $wc_tab_key = str_replace( '-', '_', $wc_tab_key );
     16            $tab_content = get_post_meta( $product_id, 'easytab_' . $wc_tab_key . '_tab', true );
     17            if ( empty( $tab_content ) ) {
     18                $product = new WC_Product($product_id);
     19                $product_name = $product->get_name();
     20                $product_info = '';
     21                if ( $wc_tab_key === 'description' ) {
     22                    $product_info = $product->get_description();
     23                    $product_info = apply_filters( 'the_content', $product_info );
     24                }
     25                $product_excerpt = $product->get_short_description();
     26                $product_categories = easytab_get_product_categories_data( $product );
     27                $product_tags = easytab_get_product_tags_data( $product );
     28                $product_weight = null;
     29                $product_dimensions = null;
     30                if ( $product->has_weight() || $product->has_dimensions() ) {
     31                    $product_weight = wc_format_weight( $product->get_weight() );
     32                    $product_dimensions = wc_format_dimensions( $product->get_dimensions( false ) );
     33                } elseif ( $wc_tab_key === 'additional_information' ) {
     34                    continue;
     35                }
     36                $ecommerce_target = ( array_key_exists( 'shop_target_description_for_' . $selected_ai . '_ai', $options ) ? $options['shop_target_description_for_' . $selected_ai . '_ai'] : null );
     37                $prompt_focus = $wc_tab_data['title'];
     38                $custom_prompt = ( array_key_exists( 'specific_wc_' . $wc_tab_key . '_tab_instructions_for_' . $selected_ai . '_ai', $options ) ? $options['specific_wc_' . $wc_tab_key . '_tab_instructions_for_' . $selected_ai . '_ai'] : null );
     39                $max_words = $options['generate_output_max_words_for_' . $selected_ai . '_ai'];
     40                $request = "Generare una descrizione per un prodotto in vendita su un ecommerce, in lingua \"" . $iso_639_1_code_output . "\" (ISO-639-1-code), il cui focus sia relativo a \"{$prompt_focus}\". ";
     41                $seo = "Il processo di generazione deve avvenire in ottica SEO, attenzionando in particolare che: \n\t\t\t\t\t\t\ta) La descrizione sia originale e univoca. \n\t\t\t\t\t\t\tb) La descrizione non sembri generata da una IA. \n\t\t\t\t\t\t\tc) La descrizione non sia identificabile come contenuto duplicato. ";
     42                $no_ia = "Nel processo di generazione, evitare in modo assoluto: \n\t\t\t\t\t\t\ta) Riferimenti al fatto che la descrizione sia stata generata da una IA, sia direttamente che indirettamente. \n\t\t\t\t\t\t\tb) Di utilizzare un linguaggio e una sintassi grammaticale troppo formale e/o innaturale. \n\t\t\t\t\t\t\tc) Di utilizzare emoticons. \n\t\t\t\t\t\t\td) Di riportare problemi e/o errori, magari per via di informazioni mancanti nel prompt che stai \"leggendo\" ed elaborando. \n\t\t\t\t\t\t\te) Di chiedere maggiori informazioni\n\t\t\t\t\t\t\tf) Se non riesci a generare nulla per carenza o assenza di informazioni, restituisci il codice \"ERROR 001\". \n\t\t\t\t\t\t\tg) Di improvvisare e non rispettare le indicazioni date. ";
     43                $prompt_rules = "Leggi il seguente prompt tenendo presente che: \n\t\t\t\t\t\t\t\t\ta) I delimitatori di apertura e chiusura indicati nel prompt con i simboli @- -@ evidenziano informazioni particolarmente importanti da usare nella generazione di quanto richiesto. \n\t\t\t\t\t\t\t\t\tb) I delimitatori di apertura e chiusura indicati @- -@ non devono essere presenti nel testo generato. \n\t\t\t\t\t\t\t\t\tc) Il testo da generare non dovrebbe superare le {$max_words} parole, entro questo limite di massima, usa il numero di parole che ritieni più opportuno. \n\t\t\t\t\t\t\t\t\td) Cerca di non troncare mai in modo brusco la generazione del testo; dai priorità alla sua finalizzazione a discapito dei tokens da utilizzare. ";
     44                $prompt = $prompt_rules . " " . $request . " Le indicazioni sono: \n                            1) Il target e il settore di vendita dell'ecommerce sono @- " . $ecommerce_target . "-@. \n                            2) Il nome del prodotto è @- {$product_name} -@. \n                            3) Le informazioni di base disponibili per il prodotto sono @- " . $product_excerpt . " -@ @- " . $product_info . " -@. \n                            4) Il prodotto è stato associato a queste categorie @- " . $product_categories . " -@ e a questi tags @-" . $product_tags . "-@, ma evita di riportare l'informazione nella forma \"è stata assegnata a queste categorie\", limitati ad usare questi dati per capire di più del prodotto. \n                            5) Alcune indicazioni aggiuntive da seguire sono @- " . $custom_prompt . " -@. \n                            6) {$seo} \n                            7) {$no_ia}";
     45                if ( $wc_tab_key === 'additional_information' && ($product_weight || $product_dimensions) ) {
     46                    $prompt .= "7) Questi dati del prodotto sono relativi a: ";
     47                    if ( $product_weight ) {
     48                        $prompt .= "a) dimensioni --> @- " . $product_dimensions . " -@. ";
     49                    }
     50                    if ( $product_dimensions ) {
     51                        $prompt .= "b) peso --> @- " . $product_weight . " -@. ";
     52                    }
     53                    $prompt .= "In base a questi valori, trai una considerazione positiva del prodotto, enfatizzandone le caratteristiche.";
     54                }
     55                $ia_prompt_result = null;
     56                $ia_prompt_result = easytab_chatgpt_connection( 'chat', $prompt, $wc_tab_key );
     57                if ( !$ia_prompt_result ) {
     58                    return;
     59                }
     60                $tmp = easytab_helper_clean_html_code_in_output_response( $ia_prompt_result );
     61                $ia_prompt_result = ( !empty( $tmp[0] ) && !empty( $tmp[0][1] ) ? $tmp[0][1] : $ia_prompt_result );
     62                update_post_meta( $product_id, 'easytab_' . $wc_tab_key . '_tab', $ia_prompt_result );
     63                if ( $wc_tab_key === 'description' && empty( get_the_content( $product_id ) ) ) {
     64                    $product = array(
     65                        'ID'           => $product_id,
     66                        'post_content' => $ia_prompt_result,
     67                    );
     68                    wp_update_post( $product );
     69                }
     70                break;
     71            }
     72        }
     73    }
     74}
    475
     76add_action( 'wp', 'easytab_generate_tab_content', 1 );
     77function easytab_get_product_categories_data(  $product  ) {
     78    $product_categories = wp_get_post_terms( $product->get_id(), 'product_cat' );
     79    $tmp = '';
     80    $separator = ', ';
     81    $counter = 0;
     82    $total = count( $product_categories );
     83    foreach ( $product_categories as $product_category ) {
     84        $counter++;
     85        if ( $counter === $total ) {
     86            $separator = '';
     87        }
     88        $tmp .= $product_category->name . $separator;
     89    }
     90    $product_categories = $tmp;
     91    return $product_categories;
     92}
    593
    6     function easytab_generate_tab_content() {
    7 
    8         if (is_singular('product') && (!is_admin())) {
    9    
    10             $options = get_option('easytab_settings');
    11 
    12             $product_id = get_the_ID();
    13 
    14             $check = false;
    15 
    16             if (empty(get_the_content($product_id))) {
    17                 $product = array(
    18                     'ID'           => $product_id,
    19                     'post_content' => '...',
    20                 );
    21                 wp_update_post($product);
    22                 $check = true;
    23             }
    24 
    25             $wc_tabs = easytab_helper_get_woo_default_product_tabs();
    26 
    27             $selected_ai = str_replace('-', '_', $options['ai']);
    28 
    29             if (empty($selected_ai)) return null;
    30 
    31             $iso_639_1_code_output = $options['prompt_language_output_response'];
    32 
    33             foreach ($wc_tabs as $wc_tab_key => $wc_tab_data) {
    34 
    35                 $wc_tab_key = str_replace('-', '_', $wc_tab_key);
    36 
    37                 $tab_content = get_post_meta($product_id, 'easytab_' . $wc_tab_key . '_tab', true);
    38 
    39                 if (empty($tab_content)) {
    40 
    41                     $product = new WC_Product($product_id);
    42                     $product_name = $product->get_name();
    43                     $product_info = $product->get_description();
    44                     $product_info = apply_filters('the_content', $product_info);
    45                     $product_excerpt = $product->get_short_description();
    46 
    47                     $product_categories = wp_get_post_terms($product->get_id(), 'product_cat');
    48                     $tmp = '';
    49                     $separator = ', ';
    50                     $counter = 0;
    51                     $total = count($product_categories);
    52 
    53                     foreach ($product_categories as $product_category) {
    54                         $counter++;
    55                         if ($counter === $total) $separator = '';
    56                         $tmp .= $product_category->name . $separator;
    57                     }
    58 
    59                     $product_categories = $tmp;
    60 
    61                     $product_tags = wp_get_post_terms($product->get_id(), 'product_tag');
    62                     $tmp = '';
    63                     $separator = ', ';
    64                     $counter = 0;
    65                     $total = count($product_tags);
    66 
    67                     foreach ($product_tags as $product_tag) {
    68                         $counter++;
    69                         if ($counter === $total) $separator = '';
    70                         $tmp .= $product_tag->name . $separator;
    71                     }
    72 
    73                     $product_tags = $tmp;
    74 
    75                     $product_weight = null;
    76                     $product_dimensions = null;
    77 
    78                     if (($product->has_weight()) || ($product->has_dimensions())) {
    79                         $product_weight = wc_format_weight($product->get_weight());
    80                         $product_dimensions = wc_format_dimensions($product->get_dimensions(false));
    81                     } elseif ($wc_tab_key === 'additional_information') continue;
    82 
    83                     $ecommerce_target = array_key_exists('shop_target_description_for_' . $selected_ai . '_ai', $options) ? $options[ 'shop_target_description_for_' . $selected_ai . '_ai' ] : null;
    84                     $prompt_focus = $wc_tab_data['title'];
    85 
    86                     $custom_prompt = array_key_exists('specific_wc_' . $wc_tab_key . '_tab_instructions_for_' . $selected_ai . '_ai', $options) ? $options['specific_wc_' . $wc_tab_key . '_tab_instructions_for_' . $selected_ai . '_ai']: null;
    87 
    88                     $max_chars = $options['generate_output_max_chars_for_' . $selected_ai . '_ai'];
    89 
    90                     $request = "Generare una descrizione per un prodotto in vendita su un ecommerce, in lingua \"" . $iso_639_1_code_output . "\" (ISO-639-1-code), il cui focus sia relativo a \"$prompt_focus\".";
    91 
    92                     $seo = "Il processo di generazione deve avvenire in ottica SEO, attenzionando in particolare che:
    93                             a) La descrizione sia originale e univoca. 
    94                             b) La descrizione non sembri generata da una IA. 
    95                             c) La descrizione non sia identificabile come contenuto duplicato. ";
    96 
    97                     $no_ia = "Nel processo di generazione, evitare in modo assoluto:
    98                             a) Riferimenti al fatto che la descrizione sia stata generata da una IA, sia direttamente che indirettamente. 
    99                             b) Di utilizzare un linguaggio e una sintassi grammaticale formale e/o innaturale. 
    100                             c) Di utilizzare emoticons. 
    101                             d) Di riportare problemi e/o errori, magari per via di informazioni mancanti nel prompt che stai \"leggendo\" ed elaborando.
    102                             e) Di chiedere maggiori informazioni; se proprio non riesci a generare nulla per carenza di informazioni, non generare nulla.   
    103                             f) Di improvvisare e non rispettare queste indicazioni; genera sempre e solo quanto richiesto secondo le indicazioni fornite. ";
    104 
    105                     $prompt_rules = "Leggi il seguente prompt tenendo presente che:
    106                                     a) I delimitatori di apertura e chiusura indicati nel prompt con i simboli @- -@ evidenziano informazioni particolarmente importanti da usare nella generazione di quanto richiesto. 
    107                                     b) I delimitatori di apertura e chiusura indicati @- -@ non devono essere presenti nel testo generato.
    108                                     c) Il testo da generare non deve superare i $max_chars caratteri. ";
    109 
    110                     $prompt = $prompt_rules . " " . $request . " Le indicazioni sono:
    111                         1) Il target e il settore di vendita dell'ecommerce sono @- " . $ecommerce_target . "-@.
    112                         2) Il nome del prodotto è @- $product_name -@.
    113                         3) Le informazioni di base disponibili per il prodotto sono @- " . $product_excerpt . " -@ @- " . $product_info . " -@.
    114                         4) Il prodotto è stato associato a queste categorie @- " . $product_categories . " -@ e a questi tags @-" . $product_tags . "-@, ma evita di riportare l'informazione nella forma \"è stata assegnata a queste categorie\", limitati ad usare questi dati per capire di più del prodotto.
    115                         5) Alcune indicazioni aggiuntive da seguire sono @- " . $custom_prompt . " -@.
    116                         6) $seo
    117                         7) $no_ia";
    118 
    119                     if (($wc_tab_key === 'additional_information') && (($product_weight) || ($product_dimensions))) {
    120                         $prompt .= "8) Questi dati del prodotto sono relativi a: ";
    121                         if ($product_weight) {
    122                             $prompt .= "a) dimensioni --> @- " . $product_dimensions . " -@. ";
    123                         }
    124                         if ($product_dimensions) {
    125                             $prompt .= "b) peso --> @- " . $product_weight . " -@. ";
    126                         }
    127                         $prompt .= "Struttura questi dati in una tabella (usando tags HTML5), facendola seguire ad una breve considerazione (sempre positiva)";
    128                     }
    129 
    130                     $ia_prompt_result = null;
    131 
    132                     $ia_prompt_result = easytab_chatgpt_connection('chat', $prompt);
    133 
    134                     if (!$ia_prompt_result) return;
    135 
    136                     update_post_meta($product_id, 'easytab_' . $wc_tab_key . '_tab', $ia_prompt_result);
    137 
    138                     if (($check === true) && ($wc_tab_key === 'description')) {
    139                         $product = array(
    140                             'ID'           => $product_id,
    141                             'post_content' => $ia_prompt_result,
    142                         );
    143                         wp_update_post($product);
    144                         $check = false;
    145                     }
    146 
    147                 }
    148 
    149             }
    150 
    151         }
    152 
    153     }
    154 
    155     add_action('wp', 'easytab_generate_tab_content');
    156 
    157 
    158     function easytab_tabs_templates_override($template, $template_name, $template_path) {
    159 
    160         $base_dir = EASYTAB_PATH . 'wc-templates-override/';
    161 
    162         $plugin_template = $base_dir . $template_name;
    163 
    164         if (file_exists($plugin_template)) {
    165             return $plugin_template;
    166         }
    167 
    168         return $template;
    169 
    170     }
    171 
    172     add_filter('woocommerce_locate_template', 'easytab_tabs_templates_override', 10, 3);
     94function easytab_get_product_tags_data(  $product  ) {
     95    $product_tags = wp_get_post_terms( $product->get_id(), 'product_tag' );
     96    $tmp = '';
     97    $separator = ', ';
     98    $counter = 0;
     99    $total = count( $product_tags );
     100    foreach ( $product_tags as $product_tag ) {
     101        $counter++;
     102        if ( $counter === $total ) {
     103            $separator = '';
     104        }
     105        $tmp .= $product_tag->name . $separator;
     106    }
     107    $product_tags = $tmp;
     108    return $product_tags;
     109}
  • easytab/trunk/languages/easytab-en_US.po

    r3195878 r3202007  
    22msgid ""
    33msgstr ""
    4 "Project-Id-Version: EasyTab\n"
    5 "POT-Creation-Date: 2024-11-10 00:09+0100\n"
    6 "PO-Revision-Date: 2024-11-10 00:14+0100\n"
     4"Project-Id-Version: EasyTab Pro\n"
     5"POT-Creation-Date: 2024-11-11 23:14+0100\n"
     6"PO-Revision-Date: 2024-11-11 23:16+0100\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
    9 "Language: en\n"
     9"Language: en_US\n"
    1010"MIME-Version: 1.0\n"
    1111"Content-Type: text/plain; charset=UTF-8\n"
     
    1414"X-Poedit-Basepath: ..\n"
    1515"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
    16 "X-Poedit-WPHeader: easytab.php\n"
     16"X-Poedit-WPHeader: easytab-pro.php\n"
    1717"X-Poedit-SourceCharset: UTF-8\n"
    1818"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
     
    2727msgstr "Activity Log"
    2828
    29 #: admin/meta-box.php:34
     29#: admin/meta-box.php:44
    3030msgid "Remove the text to regenerate the content!"
    3131msgstr "Remove the text to regenerate the content!"
     
    3333#. Plugin Name of the plugin/theme
    3434#: admin/settings-page.php:6 admin/settings-page.php:7
    35 msgid "EasyTab"
    36 msgstr "EasyTab"
    37 
    38 #: admin/settings-page.php:111
     35msgid "EasyTab Pro"
     36msgstr "EasyTab Pro"
     37
     38#: admin/settings-page.php:118
    3939msgid "Save Settings"
    4040msgstr "Save Settings"
    4141
    42 #: admin/settings-page.php:135
    43 msgid "Prompt Configuration Wizard for AI"
    44 msgstr "Prompt Configuration Wizard for AI"
    45 
    4642#: admin/settings-page.php:142
     43msgid "AI Prompt Wizard"
     44msgstr "AI Prompt Wizard"
     45
     46#: admin/settings-page.php:149
    4747msgid "Select AI"
    4848msgstr "Select AI"
    4949
    50 #: admin/settings-page.php:151 admin/settings-page.php:276
    51 #: admin/settings-page.php:287
    52 msgid "Select a language"
    53 msgstr "Select a language"
    54 
    55 #: admin/settings-page.php:164
     50#: admin/settings-page.php:158
     51msgid "Select language"
     52msgstr "Select language"
     53
     54#: admin/settings-page.php:171
    5655msgid "Generating the prompt for "
    5756msgstr "Generating the prompt for "
    5857
    59 #: admin/settings-page.php:173
    60 msgid "Enter the API KEY"
    61 msgstr "Enter the API KEY"
    62 
    63 #: admin/settings-page.php:182
    64 msgid "Max. number of characters"
    65 msgstr "Max. number of characters"
    66 
    67 #: admin/settings-page.php:191
     58#: admin/settings-page.php:178
     59msgid "Provide the API KEY"
     60msgstr "Provide the API KEY"
     61
     62#: admin/settings-page.php:187
     63msgid "AI Model Selection"
     64msgstr "AI Model Selection"
     65
     66#: admin/settings-page.php:196
     67msgid "Max. characters number"
     68msgstr "Max. characters number"
     69
     70#: admin/settings-page.php:205
    6871msgid "Shop Description"
    6972msgstr "Shop Description"
    7073
    71 #: admin/settings-page.php:204
     74#: admin/settings-page.php:214
     75msgid "HTML5 Output?"
     76msgstr "HTML5 Output?"
     77
     78#: admin/settings-page.php:223
     79msgid "Taxonomies Selection"
     80msgstr "Taxonomies Selection"
     81
     82#: admin/settings-page.php:236
    7283msgid "Specific information for the Woocommerce Tab "
    7384msgstr "Specific information for the Woocommerce Tab "
    7485
    75 #: admin/settings-page.php:211
     86#: admin/settings-page.php:243
    7687msgid "Additional Instructions"
    7788msgstr "Additional Instructions"
    7889
    79 #: admin/settings-page.php:241
     90#: admin/settings-page.php:252 admin/settings-page.php:761
     91#: admin/settings-page.php:803 admin/settings-page.php:841
     92msgid "Product Meta Fields"
     93msgstr "Product Meta Fields"
     94
     95#: admin/settings-page.php:279
    8096msgid "AI available"
    8197msgstr "AI available"
    8298
    83 #: admin/settings-page.php:252
    84 msgid "Select an AI"
    85 msgstr "Select an AI"
    86 
    87 #: admin/settings-page.php:254
     99#: admin/settings-page.php:292
     100msgid "Choose your AI. "
     101msgstr "Choose your AI. "
     102
     103#: admin/settings-page.php:294
    88104msgid ""
    89105"Chat-GPT is a chat bot based on artificial intelligence and machine "
     
    95111"user. "
    96112
    97 #: admin/settings-page.php:289
     113#: admin/settings-page.php:295
     114msgid ""
     115"Claude is a conversational AI assistant developed by Anthropic, which "
     116"leverages advanced natural language processing and deep learning techniques. "
     117msgstr ""
     118"Claude is a conversational AI assistant developed by Anthropic, which "
     119"leverages advanced natural language processing and deep learning techniques. "
     120
     121#: admin/settings-page.php:317
     122msgid "Languages"
     123msgstr "Languages"
     124
     125#: admin/settings-page.php:330
     126msgid "Select a language. "
     127msgstr "Select a language. "
     128
     129#: admin/settings-page.php:332
    98130msgid "The content will be generated by the AI in the selected language. "
    99131msgstr "The content will be generated by the AI in the selected language. "
    100132
    101 #: admin/settings-page.php:312
     133#: admin/settings-page.php:355
    102134msgid "AI API KEY"
    103135msgstr "AI API KEY"
    104136
    105 #: admin/settings-page.php:319
    106 msgid "Enter the API key for the chosen AI"
    107 msgstr "Enter the API key for the chosen AI"
    108 
    109 #: admin/settings-page.php:321
    110 msgid ""
    111 "An API Key is a unique code used to authenticate and authorize access to a "
     137#: admin/settings-page.php:362
     138msgid "Enter the API KEY for the chosen AI. "
     139msgstr "Enter the API KEY for the chosen AI. "
     140
     141#: admin/settings-page.php:364
     142msgid ""
     143"An API KEY is a unique code used to authenticate and authorize access to a "
    112144"software API. It functions as a \"password\" that allows one to connect to "
    113145"the chosen service and interact with the AI model, ensuring that only "
    114146"authorized users can send requests and receive responses. "
    115147msgstr ""
    116 "An API Key is a unique code used to authenticate and authorize access to a "
     148"An API KEY is a unique code used to authenticate and authorize access to a "
    117149"software API. It functions as a \"password\" that allows one to connect to "
    118150"the chosen service and interact with the AI model, ensuring that only "
    119151"authorized users can send requests and receive responses. "
    120152
    121 #: admin/settings-page.php:322
     153#: admin/settings-page.php:366
    122154msgid "To generate an API Key "
    123155msgstr "To generate an API Key "
    124156
    125 #: admin/settings-page.php:322
     157#: admin/settings-page.php:372 admin/settings-page.php:420
    126158msgid "click here!"
    127159msgstr "click here!"
    128160
    129 #: admin/settings-page.php:353
    130 msgid "Set the length of the content to be generated"
    131 msgstr "Set the length of the content to be generated"
    132 
    133 #: admin/settings-page.php:355
     161#: admin/settings-page.php:399
     162msgid "Models"
     163msgstr "Models"
     164
     165#: admin/settings-page.php:410
     166msgid "Select one of the available AI Models. "
     167msgstr "Select one of the available AI Models. "
     168
     169#: admin/settings-page.php:412
     170msgid ""
     171"An artificial intelligence can offer different models, optimized to solve "
     172"specific tasks, such as natural language understanding, image processing or "
     173"speech recognition. "
     174msgstr ""
     175"An artificial intelligence can offer different models, optimized to solve "
     176"specific tasks, such as natural language understanding, image processing or "
     177"speech recognition. "
     178
     179#: admin/settings-page.php:414
     180msgid "If you want to learn more "
     181msgstr "If you want to learn more "
     182
     183#: admin/settings-page.php:454
     184msgid "Set the length of the content to be generated. "
     185msgstr "Set the length of the content to be generated. "
     186
     187#: admin/settings-page.php:456
    134188msgid ""
    135189"The greater the number of characters of text to be generated the greater the "
    136 "cost per single call to the AI API."
     190"cost per single call to the AI API. "
    137191msgstr ""
    138192"The greater the number of characters of text to be generated the greater the "
    139 "cost per single call to the AI API."
    140 
    141 #: admin/settings-page.php:376 admin/settings-page.php:407
    142 #: helper/woocommerce.php:12
     193"cost per single call to the AI API. "
     194
     195#: admin/settings-page.php:481
     196msgid "Yes"
     197msgstr "Yes"
     198
     199#: admin/settings-page.php:489
     200msgid "Generate formatted text according to HTML5 semantic standards? "
     201msgstr "Generate formatted text according to HTML5 semantic standards? "
     202
     203#: admin/settings-page.php:491
     204msgid ""
     205"Well-formatted text, in addition to making it easier for users to read, "
     206"could have SEO benefits. "
     207msgstr ""
     208"Well-formatted text, in addition to making it easier for users to read, "
     209"could have SEO benefits. "
     210
     211#: admin/settings-page.php:512 admin/settings-page.php:706
     212#: admin/settings-page.php:773 admin/settings-page.php:815
     213#: admin/settings-page.php:853 helper/woocommerce.php:14
    143214msgid "Description"
    144215msgstr "Description"
    145216
    146 #: admin/settings-page.php:384
    147 msgid "Describe the type of products your store sells and the target users"
    148 msgstr "Describe the type of products your store sells and the target users"
    149 
    150 #: admin/settings-page.php:386
     217#: admin/settings-page.php:522
     218msgid "Describe the type of products your store sells and the target users. "
     219msgstr "Describe the type of products your store sells and the target users. "
     220
     221#: admin/settings-page.php:524
    151222msgid ""
    152223"In the description, try to be as clear and comprehensive as possible, to "
    153 "achieve greater accuracy on the content generated."
     224"achieve greater accuracy on the content generated. "
    154225msgstr ""
    155226"In the description, try to be as clear and comprehensive as possible, to "
    156 "achieve greater accuracy on the content generated."
    157 
    158 #: admin/settings-page.php:416
    159 msgid ""
    160 "Insert specific instructions for this tab to be incorporated into the prompt "
    161 "intended for AI"
    162 msgstr ""
    163 "Insert specific instructions for this tab to be incorporated into the prompt "
    164 "intended for AI"
    165 
    166 #: admin/settings-page.php:418
    167 msgid "Additional instructions to consider for this specific Woocommerce tab."
    168 msgstr "Additional instructions to consider for this specific Woocommerce tab."
    169 
    170 #: easytab.php:44
    171 msgid ""
    172 "The \"EasyTab\" plugin requires WooCommerce to work. WooCommerce is not "
     227"achieve greater accuracy on the content generated. "
     228
     229#: admin/settings-page.php:565 admin/settings-page.php:608
     230#: admin/settings-page.php:647
     231msgid "Taxonomies"
     232msgstr "Taxonomies"
     233
     234#: admin/settings-page.php:577
     235msgid "Information and instructions specific to this taxonomy. "
     236msgstr "Information and instructions specific to this taxonomy. "
     237
     238#: admin/settings-page.php:620
     239msgid "Information and specific instructions for this taxonomy. "
     240msgstr "Information and specific instructions for this taxonomy. "
     241
     242#: admin/settings-page.php:659
     243msgid "Information and specific instructions for this taxonomy"
     244msgstr "Information and specific instructions for this taxonomy"
     245
     246#: admin/settings-page.php:682 admin/settings-page.php:876
     247msgid ""
     248"Product Meta Fields containing useful information for the selected tab. "
     249msgstr ""
     250"Product Meta Fields containing useful information for the selected tab. "
     251
     252#: admin/settings-page.php:684
     253msgid ""
     254"A taxonomy, in WordPress, is a classification system used to organize "
     255"content. Taxonomies can be hierarchical, similar to a tree structure such as "
     256"\"Categories\", or non-hierarchical, such as \"Tags.\""
     257msgstr ""
     258"A taxonomy, in WordPress, is a classification system used to organize "
     259"content. Taxonomies can be hierarchical, similar to a tree structure such as "
     260"\"Categories\", or non-hierarchical, such as \"Tags.\""
     261
     262#: admin/settings-page.php:685
     263msgid ""
     264"Choose one or more taxonomies from the list if you think it would be useful "
     265"to provide IA with the information contained in it. This will be used to "
     266"improve the generation of Woocommerce Tab content for each product page. "
     267msgstr ""
     268"Choose one or more taxonomies from the list if you think it would be useful "
     269"to provide IA with the information contained in it. This will be used to "
     270"improve the generation of Woocommerce Tab content for each product page. "
     271
     272#: admin/settings-page.php:717
     273msgid ""
     274"Provide specific instructions for this tab to be incorporated into the "
     275"prompt intended for IA. "
     276msgstr ""
     277"Provide specific instructions for this tab to be incorporated into the "
     278"prompt intended for IA. "
     279
     280#: admin/settings-page.php:719
     281msgid "Additional instructions to consider for this specific Woocommerce tab. "
     282msgstr ""
     283"Additional instructions to consider for this specific Woocommerce tab. "
     284
     285#: admin/settings-page.php:878
     286msgid ""
     287"In WordPress, a meta field is a data element associated with a post, page "
     288"or, in the case of the WooCommerce plugin, a product. Each meta field stores "
     289"additional information related to a specific piece of information, such as "
     290"the SKU, a discounted price, dimensions, or other technical specifications "
     291"of the product. "
     292msgstr ""
     293"In WordPress, a meta field is a data element associated with a post, page "
     294"or, in the case of the WooCommerce plugin, a product. Each meta field stores "
     295"additional information related to a specific piece of information, such as "
     296"the SKU, a discounted price, dimensions, or other technical specifications "
     297"of the product. "
     298
     299#: admin/settings-page.php:879
     300msgid ""
     301"Choose one or more meta fields from the list of meta fields found, if you "
     302"think it would be useful to provide the IA with the information contained in "
     303"them. They will be used to improve the generation of content for the "
     304"selected Woocommerce Tab, on each product page. "
     305msgstr ""
     306"Choose one or more meta fields from the list of meta fields found, if you "
     307"think it would be useful to provide the IA with the information contained in "
     308"them. They will be used to improve the generation of content for the "
     309"selected Woocommerce Tab, on each product page. "
     310
     311#: easytab-pro.php:43
     312msgid ""
     313"The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not "
    173314"active, so the plugin has been disabled."
    174315msgstr ""
    175 "The \"EasyTab\" plugin requires WooCommerce to work. WooCommerce is not "
     316"The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not "
    176317"active, so the plugin has been disabled."
    177318
    178 #: helper/woocommerce.php:20
     319#: helper/woocommerce.php:22
    179320#: wc-templates-override/single-product/tabs/additional-information.php:13
    180321msgid "Additional information"
     
    187328#. Description of the plugin/theme
    188329msgid ""
    189 "EasyTab helps you optimize Woocommerce tabs with the support of artificial "
    190 "intelligence."
    191 msgstr ""
    192 "EasyTab helps you optimize Woocommerce tabs with the support of artificial "
    193 "intelligence."
     330"EasyTab Pro helps you optimize Woocommerce tabs with the support of "
     331"artificial intelligence."
     332msgstr ""
     333"EasyTab Pro helps you optimize Woocommerce tabs with the support of "
     334"artificial intelligence."
    194335
    195336#. Author of the plugin/theme
    196 msgid "rgwebdev"
    197 msgstr "rgwebdev"
     337msgid "Riccardo Guerrera"
     338msgstr "Riccardo Guerrera"
    198339
    199340#. Author URI of the plugin/theme
  • easytab/trunk/languages/easytab-it_IT.po

    r3195878 r3202007  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: EasyTab\n"
    4 "POT-Creation-Date: 2024-11-10 00:09+0100\n"
    5 "PO-Revision-Date: 2024-11-10 00:12+0100\n"
     3"Project-Id-Version: EasyTab Pro\n"
     4"POT-Creation-Date: 2024-11-11 23:14+0100\n"
     5"PO-Revision-Date: 2024-11-11 23:15+0100\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    1313"X-Poedit-Basepath: ..\n"
    1414"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
    15 "X-Poedit-WPHeader: easytab.php\n"
     15"X-Poedit-WPHeader: easytab-pro.php\n"
    1616"X-Poedit-SourceCharset: UTF-8\n"
    1717"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
     
    2626msgstr "Log Attività"
    2727
    28 #: admin/meta-box.php:34
     28#: admin/meta-box.php:44
    2929msgid "Remove the text to regenerate the content!"
    3030msgstr "Rimuovi il testo per rigenerare il contenuto!"
     
    3232#. Plugin Name of the plugin/theme
    3333#: admin/settings-page.php:6 admin/settings-page.php:7
    34 msgid "EasyTab"
    35 msgstr "EasyTab"
    36 
    37 #: admin/settings-page.php:111
     34msgid "EasyTab Pro"
     35msgstr "EasyTab Pro"
     36
     37#: admin/settings-page.php:118
    3838msgid "Save Settings"
    3939msgstr "Salva Impostazioni"
    4040
    41 #: admin/settings-page.php:135
    42 msgid "Prompt Configuration Wizard for AI"
    43 msgstr "Configurazione guidata prompt per l'intelligenza artificiale"
    44 
    4541#: admin/settings-page.php:142
     42msgid "AI Prompt Wizard"
     43msgstr "Procedura guidata di prompt AI"
     44
     45#: admin/settings-page.php:149
    4646msgid "Select AI"
    4747msgstr "Seleziona AI"
    4848
    49 #: admin/settings-page.php:151 admin/settings-page.php:276
    50 #: admin/settings-page.php:287
    51 msgid "Select a language"
    52 msgstr "Seleziona una lingua"
    53 
    54 #: admin/settings-page.php:164
     49#: admin/settings-page.php:158
     50msgid "Select language"
     51msgstr "Seleziona la lingua"
     52
     53#: admin/settings-page.php:171
    5554msgid "Generating the prompt for "
    5655msgstr "Generazione del prompt per "
    5756
    58 #: admin/settings-page.php:173
    59 msgid "Enter the API KEY"
    60 msgstr "Inserisci la CHIAVE API"
    61 
    62 #: admin/settings-page.php:182
    63 msgid "Max. number of characters"
     57#: admin/settings-page.php:178
     58msgid "Provide the API KEY"
     59msgstr "Fornisci la CHIAVE API"
     60
     61#: admin/settings-page.php:187
     62msgid "AI Model Selection"
     63msgstr "Selezione del modello AI"
     64
     65#: admin/settings-page.php:196
     66msgid "Max. characters number"
    6467msgstr "Numero massimo di caratteri"
    6568
    66 #: admin/settings-page.php:191
     69#: admin/settings-page.php:205
    6770msgid "Shop Description"
    6871msgstr "Descrizione negozio"
    6972
    70 #: admin/settings-page.php:204
     73#: admin/settings-page.php:214
     74msgid "HTML5 Output?"
     75msgstr "Output in HTML5?"
     76
     77#: admin/settings-page.php:223
     78msgid "Taxonomies Selection"
     79msgstr "Selezione delle tassonomie"
     80
     81#: admin/settings-page.php:236
    7182msgid "Specific information for the Woocommerce Tab "
    7283msgstr "Informazioni specifiche per la tab Woocommerce "
    7384
    74 #: admin/settings-page.php:211
     85#: admin/settings-page.php:243
    7586msgid "Additional Instructions"
    7687msgstr "Istruzioni aggiuntive"
    7788
    78 #: admin/settings-page.php:241
     89#: admin/settings-page.php:252 admin/settings-page.php:761
     90#: admin/settings-page.php:803 admin/settings-page.php:841
     91msgid "Product Meta Fields"
     92msgstr "Campi info prodotto"
     93
     94#: admin/settings-page.php:279
    7995msgid "AI available"
    8096msgstr "AI disponibile"
    8197
    82 #: admin/settings-page.php:252
    83 msgid "Select an AI"
    84 msgstr "Seleziona un'intelligenza artificiale"
    85 
    86 #: admin/settings-page.php:254
     98#: admin/settings-page.php:292
     99msgid "Choose your AI. "
     100msgstr "Scegli la tua intelligenza artificiale. "
     101
     102#: admin/settings-page.php:294
    87103msgid ""
    88104"Chat-GPT is a chat bot based on artificial intelligence and machine "
     
    94110"conversazione con un utente umano. "
    95111
    96 #: admin/settings-page.php:289
     112#: admin/settings-page.php:295
     113msgid ""
     114"Claude is a conversational AI assistant developed by Anthropic, which "
     115"leverages advanced natural language processing and deep learning techniques. "
     116msgstr ""
     117"Claude è un assistente AI conversazionale sviluppato da Anthropic, che "
     118"sfrutta tecniche avanzate di elaborazione del linguaggio naturale e di deep "
     119"learning. "
     120
     121#: admin/settings-page.php:317
     122msgid "Languages"
     123msgstr "Lingue"
     124
     125#: admin/settings-page.php:330
     126msgid "Select a language. "
     127msgstr "Seleziona una lingua. "
     128
     129#: admin/settings-page.php:332
    97130msgid "The content will be generated by the AI in the selected language. "
    98131msgstr ""
     
    100133"selezionata. "
    101134
    102 #: admin/settings-page.php:312
     135#: admin/settings-page.php:355
    103136msgid "AI API KEY"
    104137msgstr "CHIAVE API AI"
    105138
    106 #: admin/settings-page.php:319
    107 msgid "Enter the API key for the chosen AI"
    108 msgstr "Inserisci la chiave API per l'IA scelta"
    109 
    110 #: admin/settings-page.php:321
    111 msgid ""
    112 "An API Key is a unique code used to authenticate and authorize access to a "
     139#: admin/settings-page.php:362
     140msgid "Enter the API KEY for the chosen AI. "
     141msgstr "Inserisci la CHIAVE API per l'IA scelta. "
     142
     143#: admin/settings-page.php:364
     144msgid ""
     145"An API KEY is a unique code used to authenticate and authorize access to a "
    113146"software API. It functions as a \"password\" that allows one to connect to "
    114147"the chosen service and interact with the AI model, ensuring that only "
    115148"authorized users can send requests and receive responses. "
    116149msgstr ""
    117 "Una chiave API è un codice univoco utilizzato per autenticare e autorizzare "
     150"Una API KEY è un codice univoco utilizzato per autenticare e autorizzare "
    118151"l'accesso a un'API software. Funziona come una \"password\" che consente di "
    119152"connettersi al servizio scelto e interagire con il modello di intelligenza "
     
    121154"richieste e ricevere risposte. "
    122155
    123 #: admin/settings-page.php:322
     156#: admin/settings-page.php:366
    124157msgid "To generate an API Key "
    125158msgstr "Per generare una chiave API "
    126159
    127 #: admin/settings-page.php:322
     160#: admin/settings-page.php:372 admin/settings-page.php:420
    128161msgid "click here!"
    129 msgstr "Clicca qui!"
    130 
    131 #: admin/settings-page.php:353
    132 msgid "Set the length of the content to be generated"
    133 msgstr "Imposta la lunghezza del contenuto da generare"
    134 
    135 #: admin/settings-page.php:355
     162msgstr "clicca qui!"
     163
     164#: admin/settings-page.php:399
     165msgid "Models"
     166msgstr "Modelli"
     167
     168#: admin/settings-page.php:410
     169msgid "Select one of the available AI Models. "
     170msgstr "Seleziona uno dei modelli di intelligenza artificiale disponibili. "
     171
     172#: admin/settings-page.php:412
     173msgid ""
     174"An artificial intelligence can offer different models, optimized to solve "
     175"specific tasks, such as natural language understanding, image processing or "
     176"speech recognition. "
     177msgstr ""
     178"Un'intelligenza artificiale può offrire diversi modelli, ottimizzati per "
     179"risolvere compiti specifici, come la comprensione del linguaggio naturale, "
     180"l'elaborazione delle immagini o il riconoscimento vocale. "
     181
     182#: admin/settings-page.php:414
     183msgid "If you want to learn more "
     184msgstr "Se vuoi saperne di più "
     185
     186#: admin/settings-page.php:454
     187msgid "Set the length of the content to be generated. "
     188msgstr "Imposta la lunghezza del contenuto da generare. "
     189
     190#: admin/settings-page.php:456
    136191msgid ""
    137192"The greater the number of characters of text to be generated the greater the "
    138 "cost per single call to the AI API."
     193"cost per single call to the AI API. "
    139194msgstr ""
    140195"Maggiore è il numero di caratteri di testo da generare, maggiore è il costo "
    141 "per singola chiamata all'API AI."
    142 
    143 #: admin/settings-page.php:376 admin/settings-page.php:407
    144 #: helper/woocommerce.php:12
     196"per singola chiamata all'API AI. "
     197
     198#: admin/settings-page.php:481
     199msgid "Yes"
     200msgstr "Sì"
     201
     202#: admin/settings-page.php:489
     203msgid "Generate formatted text according to HTML5 semantic standards? "
     204msgstr "Generare testo formattato secondo gli standard semantici HTML5? "
     205
     206#: admin/settings-page.php:491
     207msgid ""
     208"Well-formatted text, in addition to making it easier for users to read, "
     209"could have SEO benefits. "
     210msgstr ""
     211"Un testo ben formattato, oltre a facilitarne la lettura da parte degli "
     212"utenti, potrebbe avere vantaggi SEO. "
     213
     214#: admin/settings-page.php:512 admin/settings-page.php:706
     215#: admin/settings-page.php:773 admin/settings-page.php:815
     216#: admin/settings-page.php:853 helper/woocommerce.php:14
    145217msgid "Description"
    146218msgstr "Descrizione"
    147219
    148 #: admin/settings-page.php:384
    149 msgid "Describe the type of products your store sells and the target users"
    150 msgstr ""
    151 "Descrivi il tipo di prodotti venduti dal tuo negozio e gli utenti target"
    152 
    153 #: admin/settings-page.php:386
     220#: admin/settings-page.php:522
     221msgid "Describe the type of products your store sells and the target users. "
     222msgstr ""
     223"Descrivi il tipo di prodotti venduti dal tuo negozio e gli utenti target. "
     224
     225#: admin/settings-page.php:524
    154226msgid ""
    155227"In the description, try to be as clear and comprehensive as possible, to "
    156 "achieve greater accuracy on the content generated."
     228"achieve greater accuracy on the content generated. "
    157229msgstr ""
    158230"Nella descrizione, cerca di essere il più chiaro ed esaustivo possibile, per "
    159 "ottenere una maggiore accuratezza sui contenuti generati."
    160 
    161 #: admin/settings-page.php:416
    162 msgid ""
    163 "Insert specific instructions for this tab to be incorporated into the prompt "
    164 "intended for AI"
    165 msgstr ""
    166 "Inserire istruzioni specifiche per questa scheda da incorporare nel prompt "
    167 "destinato all'IA"
    168 
    169 #: admin/settings-page.php:418
    170 msgid "Additional instructions to consider for this specific Woocommerce tab."
    171 msgstr ""
    172 "Ulteriori istruzioni da considerare per questa specifica tab Woocommerce."
    173 
    174 #: easytab.php:44
    175 msgid ""
    176 "The \"EasyTab\" plugin requires WooCommerce to work. WooCommerce is not "
     231"ottenere una maggiore accuratezza sui contenuti generati. "
     232
     233#: admin/settings-page.php:565 admin/settings-page.php:608
     234#: admin/settings-page.php:647
     235msgid "Taxonomies"
     236msgstr "Tassonomie"
     237
     238#: admin/settings-page.php:577
     239msgid "Information and instructions specific to this taxonomy. "
     240msgstr "Informazioni e istruzioni specifiche per questa tassonomia. "
     241
     242#: admin/settings-page.php:620
     243msgid "Information and specific instructions for this taxonomy. "
     244msgstr "Informazioni e istruzioni specifiche per questa tassonomia. "
     245
     246#: admin/settings-page.php:659
     247msgid "Information and specific instructions for this taxonomy"
     248msgstr "Informazioni e istruzioni specifiche per questa tassonomia"
     249
     250#: admin/settings-page.php:682 admin/settings-page.php:876
     251msgid ""
     252"Product Meta Fields containing useful information for the selected tab. "
     253msgstr ""
     254"Meta Campi Prodotto contenenti informazioni utili per la scheda selezionata. "
     255
     256#: admin/settings-page.php:684
     257msgid ""
     258"A taxonomy, in WordPress, is a classification system used to organize "
     259"content. Taxonomies can be hierarchical, similar to a tree structure such as "
     260"\"Categories\", or non-hierarchical, such as \"Tags.\""
     261msgstr ""
     262"Una tassonomia, in WordPress, è un sistema di classificazione utilizzato per "
     263"organizzare i contenuti. Le tassonomie possono essere gerarchiche, simili a "
     264"una struttura ad albero, ad esempio \"Categorie\", o non gerarchiche, ad "
     265"esempio \"Tag\"."
     266
     267#: admin/settings-page.php:685
     268msgid ""
     269"Choose one or more taxonomies from the list if you think it would be useful "
     270"to provide IA with the information contained in it. This will be used to "
     271"improve the generation of Woocommerce Tab content for each product page. "
     272msgstr ""
     273"Scegliere una o più tassonomie dall'elenco se si ritiene utile fornire "
     274"all'IA le informazioni in essa contenute. Questo verrà utilizzato per "
     275"migliorare la generazione di contenuti della scheda Woocommerce per ogni "
     276"pagina del prodotto. "
     277
     278#: admin/settings-page.php:717
     279msgid ""
     280"Provide specific instructions for this tab to be incorporated into the "
     281"prompt intended for IA. "
     282msgstr ""
     283"Fornire istruzioni specifiche per questa scheda da incorporare nel prompt "
     284"destinato a IA. "
     285
     286#: admin/settings-page.php:719
     287msgid "Additional instructions to consider for this specific Woocommerce tab. "
     288msgstr ""
     289"Ulteriori istruzioni da considerare per questa specifica tab Woocommerce. "
     290
     291#: admin/settings-page.php:878
     292msgid ""
     293"In WordPress, a meta field is a data element associated with a post, page "
     294"or, in the case of the WooCommerce plugin, a product. Each meta field stores "
     295"additional information related to a specific piece of information, such as "
     296"the SKU, a discounted price, dimensions, or other technical specifications "
     297"of the product. "
     298msgstr ""
     299"In WordPress, un meta campo è un elemento di dati associato a un post, una "
     300"pagina o, nel caso del plugin WooCommerce, un prodotto. Ogni meta campo "
     301"memorizza informazioni aggiuntive relative a un'informazione specifica, come "
     302"lo SKU, un prezzo scontato, le dimensioni o altre specifiche tecniche del "
     303"prodotto. "
     304
     305#: admin/settings-page.php:879
     306msgid ""
     307"Choose one or more meta fields from the list of meta fields found, if you "
     308"think it would be useful to provide the IA with the information contained in "
     309"them. They will be used to improve the generation of content for the "
     310"selected Woocommerce Tab, on each product page. "
     311msgstr ""
     312"Scegli uno o più meta campi dall'elenco dei meta campi trovati, se ritieni "
     313"che possa essere utile fornire all'IA le informazioni in essi contenute. "
     314"Verranno utilizzati per migliorare la generazione di contenuti per la scheda "
     315"Woocommerce selezionata, su ogni pagina del prodotto. "
     316
     317#: easytab-pro.php:43
     318msgid ""
     319"The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not "
    177320"active, so the plugin has been disabled."
    178321msgstr ""
    179 "Il plugin \"EasyTab\" richiede WooCommerce per funzionare. WooCommerce non è "
    180 "attivo, quindi il plugin è stato disabilitato."
    181 
    182 #: helper/woocommerce.php:20
     322"Il plugin \"EasyTab Pro\" richiede WooCommerce per funzionare. WooCommerce "
     323"non è attivo, quindi il plugin è stato disabilitato."
     324
     325#: helper/woocommerce.php:22
    183326#: wc-templates-override/single-product/tabs/additional-information.php:13
    184327msgid "Additional information"
     
    191334#. Description of the plugin/theme
    192335msgid ""
    193 "EasyTab helps you optimize Woocommerce tabs with the support of artificial "
    194 "intelligence."
    195 msgstr ""
    196 "EasyTab ti aiuta a ottimizzare le schede Woocommerce con il supporto "
     336"EasyTab Pro helps you optimize Woocommerce tabs with the support of "
     337"artificial intelligence."
     338msgstr ""
     339"EasyTab Pro ti aiuta a ottimizzare le schede Woocommerce con il supporto "
    197340"dell'intelligenza artificiale."
    198341
    199342#. Author of the plugin/theme
    200 msgid "rgwebdev"
    201 msgstr "rgwebdev"
     343msgid "Riccardo Guerrera"
     344msgstr "Riccardo Guerrera"
    202345
    203346#. Author URI of the plugin/theme
  • easytab/trunk/languages/easytab.pot

    r3195878 r3202007  
    22msgid ""
    33msgstr ""
    4 "Project-Id-Version: EasyTab\n"
    5 "POT-Creation-Date: 2024-11-10 00:09+0100\n"
    6 "PO-Revision-Date: 2024-11-10 00:09+0100\n"
     4"Project-Id-Version: EasyTab Pro\n"
     5"POT-Creation-Date: 2024-11-11 23:14+0100\n"
     6"PO-Revision-Date: 2024-11-11 23:13+0100\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    1414"X-Poedit-Basepath: ..\n"
    1515"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
    16 "X-Poedit-WPHeader: easytab.php\n"
     16"X-Poedit-WPHeader: easytab-pro.php\n"
    1717"X-Poedit-SourceCharset: UTF-8\n"
    1818"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
     
    2727msgstr ""
    2828
    29 #: admin/meta-box.php:34
     29#: admin/meta-box.php:44
    3030msgid "Remove the text to regenerate the content!"
    3131msgstr ""
     
    3333#. Plugin Name of the plugin/theme
    3434#: admin/settings-page.php:6 admin/settings-page.php:7
    35 msgid "EasyTab"
    36 msgstr ""
    37 
    38 #: admin/settings-page.php:111
     35msgid "EasyTab Pro"
     36msgstr ""
     37
     38#: admin/settings-page.php:118
    3939msgid "Save Settings"
    4040msgstr ""
    4141
    42 #: admin/settings-page.php:135
    43 msgid "Prompt Configuration Wizard for AI"
    44 msgstr ""
    45 
    4642#: admin/settings-page.php:142
     43msgid "AI Prompt Wizard"
     44msgstr ""
     45
     46#: admin/settings-page.php:149
    4747msgid "Select AI"
    4848msgstr ""
    4949
    50 #: admin/settings-page.php:151 admin/settings-page.php:276
    51 #: admin/settings-page.php:287
    52 msgid "Select a language"
    53 msgstr ""
    54 
    55 #: admin/settings-page.php:164
     50#: admin/settings-page.php:158
     51msgid "Select language"
     52msgstr ""
     53
     54#: admin/settings-page.php:171
    5655msgid "Generating the prompt for "
    5756msgstr ""
    5857
    59 #: admin/settings-page.php:173
    60 msgid "Enter the API KEY"
    61 msgstr ""
    62 
    63 #: admin/settings-page.php:182
    64 msgid "Max. number of characters"
    65 msgstr ""
    66 
    67 #: admin/settings-page.php:191
     58#: admin/settings-page.php:178
     59msgid "Provide the API KEY"
     60msgstr ""
     61
     62#: admin/settings-page.php:187
     63msgid "AI Model Selection"
     64msgstr ""
     65
     66#: admin/settings-page.php:196
     67msgid "Max. characters number"
     68msgstr ""
     69
     70#: admin/settings-page.php:205
    6871msgid "Shop Description"
    6972msgstr ""
    7073
    71 #: admin/settings-page.php:204
     74#: admin/settings-page.php:214
     75msgid "HTML5 Output?"
     76msgstr ""
     77
     78#: admin/settings-page.php:223
     79msgid "Taxonomies Selection"
     80msgstr ""
     81
     82#: admin/settings-page.php:236
    7283msgid "Specific information for the Woocommerce Tab "
    7384msgstr ""
    7485
    75 #: admin/settings-page.php:211
     86#: admin/settings-page.php:243
    7687msgid "Additional Instructions"
    7788msgstr ""
    7889
    79 #: admin/settings-page.php:241
     90#: admin/settings-page.php:252 admin/settings-page.php:761
     91#: admin/settings-page.php:803 admin/settings-page.php:841
     92msgid "Product Meta Fields"
     93msgstr ""
     94
     95#: admin/settings-page.php:279
    8096msgid "AI available"
    8197msgstr ""
    8298
    83 #: admin/settings-page.php:252
    84 msgid "Select an AI"
    85 msgstr ""
    86 
    87 #: admin/settings-page.php:254
     99#: admin/settings-page.php:292
     100msgid "Choose your AI. "
     101msgstr ""
     102
     103#: admin/settings-page.php:294
    88104msgid ""
    89105"Chat-GPT is a chat bot based on artificial intelligence and machine "
     
    92108msgstr ""
    93109
    94 #: admin/settings-page.php:289
     110#: admin/settings-page.php:295
     111msgid ""
     112"Claude is a conversational AI assistant developed by Anthropic, which "
     113"leverages advanced natural language processing and deep learning techniques. "
     114msgstr ""
     115
     116#: admin/settings-page.php:317
     117msgid "Languages"
     118msgstr ""
     119
     120#: admin/settings-page.php:330
     121msgid "Select a language. "
     122msgstr ""
     123
     124#: admin/settings-page.php:332
    95125msgid "The content will be generated by the AI in the selected language. "
    96126msgstr ""
    97127
    98 #: admin/settings-page.php:312
     128#: admin/settings-page.php:355
    99129msgid "AI API KEY"
    100130msgstr ""
    101131
    102 #: admin/settings-page.php:319
    103 msgid "Enter the API key for the chosen AI"
    104 msgstr ""
    105 
    106 #: admin/settings-page.php:321
    107 msgid ""
    108 "An API Key is a unique code used to authenticate and authorize access to a "
     132#: admin/settings-page.php:362
     133msgid "Enter the API KEY for the chosen AI. "
     134msgstr ""
     135
     136#: admin/settings-page.php:364
     137msgid ""
     138"An API KEY is a unique code used to authenticate and authorize access to a "
    109139"software API. It functions as a \"password\" that allows one to connect to "
    110140"the chosen service and interact with the AI model, ensuring that only "
     
    112142msgstr ""
    113143
    114 #: admin/settings-page.php:322
     144#: admin/settings-page.php:366
    115145msgid "To generate an API Key "
    116146msgstr ""
    117147
    118 #: admin/settings-page.php:322
     148#: admin/settings-page.php:372 admin/settings-page.php:420
    119149msgid "click here!"
    120150msgstr ""
    121151
    122 #: admin/settings-page.php:353
    123 msgid "Set the length of the content to be generated"
    124 msgstr ""
    125 
    126 #: admin/settings-page.php:355
     152#: admin/settings-page.php:399
     153msgid "Models"
     154msgstr ""
     155
     156#: admin/settings-page.php:410
     157msgid "Select one of the available AI Models. "
     158msgstr ""
     159
     160#: admin/settings-page.php:412
     161msgid ""
     162"An artificial intelligence can offer different models, optimized to solve "
     163"specific tasks, such as natural language understanding, image processing or "
     164"speech recognition. "
     165msgstr ""
     166
     167#: admin/settings-page.php:414
     168msgid "If you want to learn more "
     169msgstr ""
     170
     171#: admin/settings-page.php:454
     172msgid "Set the length of the content to be generated. "
     173msgstr ""
     174
     175#: admin/settings-page.php:456
    127176msgid ""
    128177"The greater the number of characters of text to be generated the greater the "
    129 "cost per single call to the AI API."
    130 msgstr ""
    131 
    132 #: admin/settings-page.php:376 admin/settings-page.php:407
    133 #: helper/woocommerce.php:12
     178"cost per single call to the AI API. "
     179msgstr ""
     180
     181#: admin/settings-page.php:481
     182msgid "Yes"
     183msgstr ""
     184
     185#: admin/settings-page.php:489
     186msgid "Generate formatted text according to HTML5 semantic standards? "
     187msgstr ""
     188
     189#: admin/settings-page.php:491
     190msgid ""
     191"Well-formatted text, in addition to making it easier for users to read, "
     192"could have SEO benefits. "
     193msgstr ""
     194
     195#: admin/settings-page.php:512 admin/settings-page.php:706
     196#: admin/settings-page.php:773 admin/settings-page.php:815
     197#: admin/settings-page.php:853 helper/woocommerce.php:14
    134198msgid "Description"
    135199msgstr ""
    136200
    137 #: admin/settings-page.php:384
    138 msgid "Describe the type of products your store sells and the target users"
    139 msgstr ""
    140 
    141 #: admin/settings-page.php:386
     201#: admin/settings-page.php:522
     202msgid "Describe the type of products your store sells and the target users. "
     203msgstr ""
     204
     205#: admin/settings-page.php:524
    142206msgid ""
    143207"In the description, try to be as clear and comprehensive as possible, to "
    144 "achieve greater accuracy on the content generated."
    145 msgstr ""
    146 
    147 #: admin/settings-page.php:416
    148 msgid ""
    149 "Insert specific instructions for this tab to be incorporated into the prompt "
    150 "intended for AI"
    151 msgstr ""
    152 
    153 #: admin/settings-page.php:418
    154 msgid "Additional instructions to consider for this specific Woocommerce tab."
    155 msgstr ""
    156 
    157 #: easytab.php:44
    158 msgid ""
    159 "The \"EasyTab\" plugin requires WooCommerce to work. WooCommerce is not "
     208"achieve greater accuracy on the content generated. "
     209msgstr ""
     210
     211#: admin/settings-page.php:565 admin/settings-page.php:608
     212#: admin/settings-page.php:647
     213msgid "Taxonomies"
     214msgstr ""
     215
     216#: admin/settings-page.php:577
     217msgid "Information and instructions specific to this taxonomy. "
     218msgstr ""
     219
     220#: admin/settings-page.php:620
     221msgid "Information and specific instructions for this taxonomy. "
     222msgstr ""
     223
     224#: admin/settings-page.php:659
     225msgid "Information and specific instructions for this taxonomy"
     226msgstr ""
     227
     228#: admin/settings-page.php:682 admin/settings-page.php:876
     229msgid ""
     230"Product Meta Fields containing useful information for the selected tab. "
     231msgstr ""
     232
     233#: admin/settings-page.php:684
     234msgid ""
     235"A taxonomy, in WordPress, is a classification system used to organize "
     236"content. Taxonomies can be hierarchical, similar to a tree structure such as "
     237"\"Categories\", or non-hierarchical, such as \"Tags.\""
     238msgstr ""
     239
     240#: admin/settings-page.php:685
     241msgid ""
     242"Choose one or more taxonomies from the list if you think it would be useful "
     243"to provide IA with the information contained in it. This will be used to "
     244"improve the generation of Woocommerce Tab content for each product page. "
     245msgstr ""
     246
     247#: admin/settings-page.php:717
     248msgid ""
     249"Provide specific instructions for this tab to be incorporated into the "
     250"prompt intended for IA. "
     251msgstr ""
     252
     253#: admin/settings-page.php:719
     254msgid "Additional instructions to consider for this specific Woocommerce tab. "
     255msgstr ""
     256
     257#: admin/settings-page.php:878
     258msgid ""
     259"In WordPress, a meta field is a data element associated with a post, page "
     260"or, in the case of the WooCommerce plugin, a product. Each meta field stores "
     261"additional information related to a specific piece of information, such as "
     262"the SKU, a discounted price, dimensions, or other technical specifications "
     263"of the product. "
     264msgstr ""
     265
     266#: admin/settings-page.php:879
     267msgid ""
     268"Choose one or more meta fields from the list of meta fields found, if you "
     269"think it would be useful to provide the IA with the information contained in "
     270"them. They will be used to improve the generation of content for the "
     271"selected Woocommerce Tab, on each product page. "
     272msgstr ""
     273
     274#: easytab-pro.php:43
     275msgid ""
     276"The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not "
    160277"active, so the plugin has been disabled."
    161278msgstr ""
    162279
    163 #: helper/woocommerce.php:20
     280#: helper/woocommerce.php:22
    164281#: wc-templates-override/single-product/tabs/additional-information.php:13
    165282msgid "Additional information"
     
    172289#. Description of the plugin/theme
    173290msgid ""
    174 "EasyTab helps you optimize Woocommerce tabs with the support of artificial "
    175 "intelligence."
     291"EasyTab Pro helps you optimize Woocommerce tabs with the support of "
     292"artificial intelligence."
    176293msgstr ""
    177294
    178295#. Author of the plugin/theme
    179 msgid "rgwebdev"
     296msgid "Riccardo Guerrera"
    180297msgstr ""
    181298
  • easytab/trunk/readme.txt

    r3195878 r3202007  
     1
    12=== EasyTab ===
    23
    3 Contributors: rgwebdev
     4Contributors: rgwebdev, freemius
    45Tags: WooCommerce, AI, tabs
    56Requires at least: 6.6
    67Tested up to: 6.7
    7 Stable tag: 1.0.0
     8Stable tag: 1.0.1
    89Requires PHP: 7.2
    910License: GPLv3 or later
     
    1718
    1819The free version of EasyTab is available in the WordPress repository. For advanced features, you can find **EasyTab Pro** on [easytab.pro](https://easytab.pro).
     20
     21https://www.youtube.com/watch?v=rS05e_R8KdM
    1922
    2023### Key Features
     
    6164== Changelog ==
    6265
     66= 1.0.1 =
     67* Freemius integration.
     68* Enhancements: WooCommerce tabs capture mode bug fixed.
     69
    6370= 1.0.0 =
    6471* Initial release with AI-powered content generation for WooCommerce product tabs.
  • easytab/trunk/wc-templates-override/single-product/tabs/additional-information.php

    r3195878 r3202007  
    11<?php
    22
    3     /**
    4     * EasyTab
    5     */
     3    /**
     4    * EasyTab
     5    */
    66
    7     defined('ABSPATH') || exit;
     7    defined('ABSPATH') || exit;
     8
    89
    910    global $product;
    1011
    11     if ($product->has_weight() || $product->has_dimensions()) {
     12    if ($product->has_weight() || $product->has_dimensions()) {
     13       
     14        $tab_content = get_post_meta(get_the_ID(), 'easytab_additional_information_tab', true);
    1215
    13         $heading = apply_filters('woocommerce_product_additional_information_heading', __('Additional information', 'easytab'));
    14         $tab_content = get_post_meta(get_the_ID(), 'easytab_additional_information_tab', true);
     16        if (!empty($tab_content)) {
    1517
    16         if ($heading) {
    17             echo "<h2>" . esc_html($heading) . "</h2>";
     18            echo wp_kses_post($tab_content);
     19
     20            do_action('woocommerce_product_additional_information', $product);
     21
    1822        }
    1923
    20         if (empty($tab_content)) {
    21             do_action('woocommerce_product_additional_information', $product);
    22         } else {
    23             echo wp_kses_post($tab_content);
    24         }
    25 
    26     }
     24    }
  • easytab/trunk/wc-templates-override/single-product/tabs/description.php

    r3195878 r3202007  
    77    defined('ABSPATH') || exit;
    88
    9     global $post;
    109
    11     $tab_content = get_post_meta(get_the_ID(), 'easytab_description_tab', true);
     10    $tab_content = get_post_meta(get_the_ID(), 'easytab_description_tab', true);
     11
    1212
    1313    if (empty($tab_content)) {
    14         the_content();
    15     } else {
    16         echo esc_html($tab_content);
    17     }
     14        the_content();
     15    } else {
     16        echo wp_kses_post($tab_content);
     17    }
Note: See TracChangeset for help on using the changeset viewer.