Changeset 3202007
- Timestamp:
- 12/04/2024 12:03:57 AM (16 months ago)
- Location:
- easytab/trunk
- Files:
-
- 18 edited
-
admin/debug-log.php (modified) (4 diffs)
-
admin/meta-box.php (modified) (1 diff)
-
admin/settings-page.php (modified) (7 diffs)
-
assets/css/easytab.css (modified) (4 diffs)
-
assets/js/easytab.js (modified) (4 diffs)
-
easytab.php (modified) (1 diff)
-
helper/admin.php (modified) (1 diff)
-
helper/woocommerce.php (modified) (1 diff)
-
includes/ai-connection/chat-gpt/connect.php (modified) (1 diff)
-
includes/prompt.php (modified) (1 diff)
-
languages/easytab-en_US.mo (modified) (previous)
-
languages/easytab-en_US.po (modified) (6 diffs)
-
languages/easytab-it_IT.mo (modified) (previous)
-
languages/easytab-it_IT.po (modified) (8 diffs)
-
languages/easytab.pot (modified) (7 diffs)
-
readme.txt (modified) (3 diffs)
-
wc-templates-override/single-product/tabs/additional-information.php (modified) (1 diff)
-
wc-templates-override/single-product/tabs/description.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
easytab/trunk/admin/debug-log.php
r3195878 r3202007 1 1 <?php 2 2 3 defined('ABSPATH') || exit;3 defined('ABSPATH') || exit; 4 4 5 5 function easytab_dl_page() { … … 7 7 add_submenu_page( 8 8 'easytab', 9 __('Activity Log', 'easytab'),10 __('Activity Log', 'easytab'),9 __('Activity Log', EASYTAB_DOMAIN), 10 __('Activity Log', EASYTAB_DOMAIN), 11 11 'manage_options', 12 12 'easytab_debug_log', … … 18 18 add_action('admin_menu', 'easytab_dl_page'); 19 19 20 21 20 function easytab_debug_log_page() { 22 21 … … 25 24 ?> 26 25 26 <img class="easytab-logo" src="<?php echo EASYTAB_URL . 'assets/img/easytab-logo.png' ?>" style="margin-left: -18px;"> 27 27 28 <h2>Debug Log</h2> 28 29 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> 30 31 31 32 <?php -
easytab/trunk/admin/meta-box.php
r3195878 r3202007 1 1 <?php 2 2 3 defined('ABSPATH') || exit; 3 defined( 'ABSPATH' ) || exit; 4 function easytab_add_metabox() { 5 add_meta_box( 6 'easytab_product_tabs', 7 'EasyTab', 8 'easytab_product_tabs_metabox', 9 'product', 10 'normal' 11 ); 12 } 4 13 14 add_action( 'add_meta_boxes', 'easytab_add_metabox' ); 15 function 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 } 5 56 6 function easytab_add_metabox() { 57 function 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 } 7 77 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); 78 add_action( 79 'save_post_product', 80 'easytab_product_tabs_save_metabox', 81 20, 82 3 83 ); -
easytab/trunk/admin/settings-page.php
r3195878 r3202007 1 1 <?php 2 2 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 3 defined( 'ABSPATH' ) || exit; 4 function 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 16 add_action( 'admin_menu', 'easytab_options_page' ); 17 function easytab_option_page() { 18 if ( !current_user_can( 'manage_options' ) ) { 19 return; 20 } 21 ?> 22 31 23 <div id="easytab-pro-banner"> 32 24 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> 37 35 38 36 <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> 40 42 <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> 45 58 </ul> 46 59 </div> … … 48 61 </div> 49 62 63 <?php 64 ?> 65 50 66 <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> 52 70 <form action="options.php" method="post" id="easytab-ai-prompt"> 53 71 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 ?> 78 91 79 92 <div class="wc-tabs" style="margin-top: 50px;"> 80 93 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 ?> 98 115 99 116 </div> 100 117 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 ?> 116 139 117 140 </div> 118 141 119 <?php 120 121 $default_open = false; 122 123 } 124 125 ?> 142 <?php 143 $default_open = false; 144 } 145 ?> 126 146 127 147 </div> 128 148 129 <?php 130 131 } 132 133 submit_button(__('Save Settings', 'easytab')); 134 135 ?> 149 <?php 150 } 151 submit_button( __( 'Save Settings', EASYTAB_DOMAIN ) ); 152 ?> 136 153 137 154 </form> 138 155 </div> 139 156 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 160 function 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 ); 171 201 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 ); 193 239 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 ) 200 252 ); 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 242 253 } 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 257 add_action( 'admin_init', 'easytab_settings_init' ); 258 function easytab_ai_field_cb( $args ) { 259 $ai = $args['ai']; 260 $options = get_option( 'easytab_settings' ); 261 ?> 259 262 260 263 <div> 261 264 262 265 <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 ?> 267 284 </select> 268 285 … … 272 289 273 290 <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> 275 294 <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> 277 301 </div> 278 302 </details> 279 303 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 307 function 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 } 293 313 ?> 294 314 … … 296 316 297 317 <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 ?> 302 336 </select> 303 337 … … 307 341 308 342 <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> 310 346 <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> 312 350 </div> 313 351 </details> 314 352 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 356 function 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 ?>"> 327 363 328 364 <input 329 365 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 ?>" 333 375 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 ?>"> 335 379 336 380 </div> … … 339 383 340 384 <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> 342 388 <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> 345 409 </div> 346 410 </details> 347 411 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 415 function 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 456 function 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> 371 480 372 481 <br> 373 482 374 483 <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> 407 487 <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> 409 491 </div> 410 492 </details> 411 493 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 497 function 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 ?>"> 424 504 425 505 <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 ?>" 428 514 class="not-require" 429 placeholder="<?php esc_html_e('Description', 'easytab'); ?>" 515 placeholder="<?php 516 esc_html_e( 'Description', EASYTAB_DOMAIN ); 517 ?>" 430 518 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> 432 522 433 523 </div> … … 436 526 437 527 <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> 439 531 <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> 441 535 </div> 442 536 </details> 443 537 444 <?php 445 446 } 538 <?php 539 } -
easytab/trunk/assets/css/easytab.css
r3195878 r3202007 1 form#easytab- ai-prompt details {1 form#easytab-pro-ai-prompt details { 2 2 width: 50%; 3 3 cursor: pointer; 4 4 } 5 5 6 form#easytab- ai-prompt details summary {6 form#easytab-pro-ai-prompt details summary { 7 7 display: flex; 8 8 flex-direction: row; … … 11 11 } 12 12 13 form#easytab- ai-prompt details div.info {13 form#easytab-pro-ai-prompt details div.info { 14 14 display: flex; 15 15 flex-direction: column; … … 25 25 } 26 26 27 form#easytab- ai-prompt details summary::before {27 form#easytab-pro-ai-prompt details summary::before { 28 28 content: ""; 29 29 display: block; … … 35 35 height: 15px; 36 36 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;77 37 } 78 38 -
easytab/trunk/assets/js/easytab.js
r3195878 r3202007 5 5 const convalidateForm = (e, form, aiSelected = null, wcTabSelected = null) => { 6 6 e.preventDefault(); 7 if (( typeofform === null) || (typeof form === 'undefined')) return;7 if ((form === null) || (typeof form === 'undefined')) return; 8 8 let isValid = true; 9 9 const inputsGrp1 = form.querySelectorAll('form > table select'); … … 46 46 } 47 47 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 here58 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 field68 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 82 48 const form = document.getElementById('easytab-ai-prompt'); 83 49 … … 104 70 } 105 71 106 if (document.querySelector('select#ai-select') .length > 0) {72 if (document.querySelector('select#ai-select')?.length > 0) { 107 73 let form = document.querySelector('form'); 108 74 aiSelected = document.querySelector('select#ai-select').value; … … 133 99 } 134 100 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 143 101 document.querySelectorAll('form select, form input, form textarea').forEach((input) => { 144 102 input.addEventListener('change', (e) => { -
easytab/trunk/easytab.php
r3195878 r3202007 1 1 <?php 2 2 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 */ 16 defined( 'ABSPATH' ) || exit; 17 /**/ 18 if ( 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; 40 47 } 41 48 49 // Init Freemius. 50 add_action( 'plugins_loaded', 'easytab_fs' ); 51 // Signal that SDK was initiated. 52 do_action( 'easytab_fs_loaded' ); 42 53 } 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 /**/ 56 if ( !function_exists( 'is_plugin_active' ) ) { 57 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 58 } 59 $easytab_plugin_basename = plugin_basename( __FILE__ ); 60 if ( $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 } 54 89 } 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 } 91 if ( $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 } ); 95 119 } 96 97 120 } 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 } 122 if ( !defined( 'EASYTAB_VERSION' ) ) { 123 define( 'EASYTAB_VERSION', '1.0.1' ); 124 } 125 if ( !defined( 'EASYTAB_FILE' ) ) { 126 define( 'EASYTAB_FILE', __FILE__ ); 127 } 128 if ( !defined( 'EASYTAB_PATH' ) ) { 129 define( 'EASYTAB_PATH', plugin_dir_path( __FILE__ ) ); 130 } 131 if ( !defined( 'EASYTAB_URL' ) ) { 132 define( 'EASYTAB_URL', plugin_dir_url( __FILE__ ) ); 133 } 134 if ( !defined( 'EASYTAB_DOMAIN' ) ) { 135 define( 'EASYTAB_DOMAIN', 'easytab' ); 136 } 137 if ( file_exists( EASYTAB_PATH . 'init.php' ) ) { 138 require_once EASYTAB_PATH . 'init.php'; 139 } -
easytab/trunk/helper/admin.php
r3195878 r3202007 1 1 <?php 2 2 3 defined('ABSPATH') || exit; 3 defined( 'ABSPATH' ) || exit; 4 function 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 } 4 17 18 function 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 } 5 33 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 } 34 function 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 1 1 <?php 2 2 3 defined('ABSPATH') || exit; 3 defined( 'ABSPATH' ) || exit; 4 add_filter( 'woocommerce_product_tabs', 'easytab_helper_get_woo_default_product_tabs' ); 5 function 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 } 4 24 5 function easytab_helper_get_woo_default_product_tabs() { 25 function 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 } 6 33 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'); 34 add_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 1 1 <?php 2 2 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 } 3 defined( 'ABSPATH' ) || exit; 4 function 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 1 1 <?php 2 2 3 defined('ABSPATH') || exit; 3 defined( 'ABSPATH' ) || exit; 4 function 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 } 4 75 76 add_action( 'wp', 'easytab_generate_tab_content', 1 ); 77 function 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 } 5 93 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); 94 function 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 2 2 msgid "" 3 3 msgstr "" 4 "Project-Id-Version: EasyTab \n"5 "POT-Creation-Date: 2024-11-1 0 00:09+0100\n"6 "PO-Revision-Date: 2024-11-1 0 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" 7 7 "Last-Translator: \n" 8 8 "Language-Team: \n" 9 "Language: en \n"9 "Language: en_US\n" 10 10 "MIME-Version: 1.0\n" 11 11 "Content-Type: text/plain; charset=UTF-8\n" … … 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 16 "X-Poedit-WPHeader: easytab .php\n"16 "X-Poedit-WPHeader: easytab-pro.php\n" 17 17 "X-Poedit-SourceCharset: UTF-8\n" 18 18 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" … … 27 27 msgstr "Activity Log" 28 28 29 #: admin/meta-box.php: 3429 #: admin/meta-box.php:44 30 30 msgid "Remove the text to regenerate the content!" 31 31 msgstr "Remove the text to regenerate the content!" … … 33 33 #. Plugin Name of the plugin/theme 34 34 #: admin/settings-page.php:6 admin/settings-page.php:7 35 msgid "EasyTab "36 msgstr "EasyTab "37 38 #: admin/settings-page.php:11 135 msgid "EasyTab Pro" 36 msgstr "EasyTab Pro" 37 38 #: admin/settings-page.php:118 39 39 msgid "Save Settings" 40 40 msgstr "Save Settings" 41 41 42 #: admin/settings-page.php:13543 msgid "Prompt Configuration Wizard for AI"44 msgstr "Prompt Configuration Wizard for AI"45 46 42 #: admin/settings-page.php:142 43 msgid "AI Prompt Wizard" 44 msgstr "AI Prompt Wizard" 45 46 #: admin/settings-page.php:149 47 47 msgid "Select AI" 48 48 msgstr "Select AI" 49 49 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 51 msgid "Select language" 52 msgstr "Select language" 53 54 #: admin/settings-page.php:171 56 55 msgid "Generating the prompt for " 57 56 msgstr "Generating the prompt for " 58 57 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 59 msgid "Provide the API KEY" 60 msgstr "Provide the API KEY" 61 62 #: admin/settings-page.php:187 63 msgid "AI Model Selection" 64 msgstr "AI Model Selection" 65 66 #: admin/settings-page.php:196 67 msgid "Max. characters number" 68 msgstr "Max. characters number" 69 70 #: admin/settings-page.php:205 68 71 msgid "Shop Description" 69 72 msgstr "Shop Description" 70 73 71 #: admin/settings-page.php:204 74 #: admin/settings-page.php:214 75 msgid "HTML5 Output?" 76 msgstr "HTML5 Output?" 77 78 #: admin/settings-page.php:223 79 msgid "Taxonomies Selection" 80 msgstr "Taxonomies Selection" 81 82 #: admin/settings-page.php:236 72 83 msgid "Specific information for the Woocommerce Tab " 73 84 msgstr "Specific information for the Woocommerce Tab " 74 85 75 #: admin/settings-page.php:2 1186 #: admin/settings-page.php:243 76 87 msgid "Additional Instructions" 77 88 msgstr "Additional Instructions" 78 89 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 92 msgid "Product Meta Fields" 93 msgstr "Product Meta Fields" 94 95 #: admin/settings-page.php:279 80 96 msgid "AI available" 81 97 msgstr "AI available" 82 98 83 #: admin/settings-page.php:2 5284 msgid " Select an AI"85 msgstr " Select an AI"86 87 #: admin/settings-page.php:2 5499 #: admin/settings-page.php:292 100 msgid "Choose your AI. " 101 msgstr "Choose your AI. " 102 103 #: admin/settings-page.php:294 88 104 msgid "" 89 105 "Chat-GPT is a chat bot based on artificial intelligence and machine " … … 95 111 "user. " 96 112 97 #: admin/settings-page.php:289 113 #: admin/settings-page.php:295 114 msgid "" 115 "Claude is a conversational AI assistant developed by Anthropic, which " 116 "leverages advanced natural language processing and deep learning techniques. " 117 msgstr "" 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 122 msgid "Languages" 123 msgstr "Languages" 124 125 #: admin/settings-page.php:330 126 msgid "Select a language. " 127 msgstr "Select a language. " 128 129 #: admin/settings-page.php:332 98 130 msgid "The content will be generated by the AI in the selected language. " 99 131 msgstr "The content will be generated by the AI in the selected language. " 100 132 101 #: admin/settings-page.php:3 12133 #: admin/settings-page.php:355 102 134 msgid "AI API KEY" 103 135 msgstr "AI API KEY" 104 136 105 #: admin/settings-page.php:3 19106 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:3 21110 msgid "" 111 "An API K eyis a unique code used to authenticate and authorize access to a "137 #: admin/settings-page.php:362 138 msgid "Enter the API KEY for the chosen AI. " 139 msgstr "Enter the API KEY for the chosen AI. " 140 141 #: admin/settings-page.php:364 142 msgid "" 143 "An API KEY is a unique code used to authenticate and authorize access to a " 112 144 "software API. It functions as a \"password\" that allows one to connect to " 113 145 "the chosen service and interact with the AI model, ensuring that only " 114 146 "authorized users can send requests and receive responses. " 115 147 msgstr "" 116 "An API K eyis 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 " 117 149 "software API. It functions as a \"password\" that allows one to connect to " 118 150 "the chosen service and interact with the AI model, ensuring that only " 119 151 "authorized users can send requests and receive responses. " 120 152 121 #: admin/settings-page.php:3 22153 #: admin/settings-page.php:366 122 154 msgid "To generate an API Key " 123 155 msgstr "To generate an API Key " 124 156 125 #: admin/settings-page.php:3 22157 #: admin/settings-page.php:372 admin/settings-page.php:420 126 158 msgid "click here!" 127 159 msgstr "click here!" 128 160 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 162 msgid "Models" 163 msgstr "Models" 164 165 #: admin/settings-page.php:410 166 msgid "Select one of the available AI Models. " 167 msgstr "Select one of the available AI Models. " 168 169 #: admin/settings-page.php:412 170 msgid "" 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. " 174 msgstr "" 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 180 msgid "If you want to learn more " 181 msgstr "If you want to learn more " 182 183 #: admin/settings-page.php:454 184 msgid "Set the length of the content to be generated. " 185 msgstr "Set the length of the content to be generated. " 186 187 #: admin/settings-page.php:456 134 188 msgid "" 135 189 "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. " 137 191 msgstr "" 138 192 "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 196 msgid "Yes" 197 msgstr "Yes" 198 199 #: admin/settings-page.php:489 200 msgid "Generate formatted text according to HTML5 semantic standards? " 201 msgstr "Generate formatted text according to HTML5 semantic standards? " 202 203 #: admin/settings-page.php:491 204 msgid "" 205 "Well-formatted text, in addition to making it easier for users to read, " 206 "could have SEO benefits. " 207 msgstr "" 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 143 214 msgid "Description" 144 215 msgstr "Description" 145 216 146 #: admin/settings-page.php: 384147 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: 386217 #: admin/settings-page.php:522 218 msgid "Describe the type of products your store sells and the target users. " 219 msgstr "Describe the type of products your store sells and the target users. " 220 221 #: admin/settings-page.php:524 151 222 msgid "" 152 223 "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. " 154 225 msgstr "" 155 226 "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 231 msgid "Taxonomies" 232 msgstr "Taxonomies" 233 234 #: admin/settings-page.php:577 235 msgid "Information and instructions specific to this taxonomy. " 236 msgstr "Information and instructions specific to this taxonomy. " 237 238 #: admin/settings-page.php:620 239 msgid "Information and specific instructions for this taxonomy. " 240 msgstr "Information and specific instructions for this taxonomy. " 241 242 #: admin/settings-page.php:659 243 msgid "Information and specific instructions for this taxonomy" 244 msgstr "Information and specific instructions for this taxonomy" 245 246 #: admin/settings-page.php:682 admin/settings-page.php:876 247 msgid "" 248 "Product Meta Fields containing useful information for the selected tab. " 249 msgstr "" 250 "Product Meta Fields containing useful information for the selected tab. " 251 252 #: admin/settings-page.php:684 253 msgid "" 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.\"" 257 msgstr "" 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 263 msgid "" 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. " 267 msgstr "" 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 273 msgid "" 274 "Provide specific instructions for this tab to be incorporated into the " 275 "prompt intended for IA. " 276 msgstr "" 277 "Provide specific instructions for this tab to be incorporated into the " 278 "prompt intended for IA. " 279 280 #: admin/settings-page.php:719 281 msgid "Additional instructions to consider for this specific Woocommerce tab. " 282 msgstr "" 283 "Additional instructions to consider for this specific Woocommerce tab. " 284 285 #: admin/settings-page.php:878 286 msgid "" 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. " 292 msgstr "" 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 300 msgid "" 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. " 305 msgstr "" 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 312 msgid "" 313 "The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not " 173 314 "active, so the plugin has been disabled." 174 315 msgstr "" 175 "The \"EasyTab \" plugin requires WooCommerce to work. WooCommerce is not "316 "The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not " 176 317 "active, so the plugin has been disabled." 177 318 178 #: helper/woocommerce.php:2 0319 #: helper/woocommerce.php:22 179 320 #: wc-templates-override/single-product/tabs/additional-information.php:13 180 321 msgid "Additional information" … … 187 328 #. Description of the plugin/theme 188 329 msgid "" 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." 332 msgstr "" 333 "EasyTab Pro helps you optimize Woocommerce tabs with the support of " 334 "artificial intelligence." 194 335 195 336 #. Author of the plugin/theme 196 msgid " rgwebdev"197 msgstr " rgwebdev"337 msgid "Riccardo Guerrera" 338 msgstr "Riccardo Guerrera" 198 339 199 340 #. Author URI of the plugin/theme -
easytab/trunk/languages/easytab-it_IT.po
r3195878 r3202007 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: EasyTab \n"4 "POT-Creation-Date: 2024-11-1 0 00:09+0100\n"5 "PO-Revision-Date: 2024-11-1 0 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" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 13 13 "X-Poedit-Basepath: ..\n" 14 14 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 15 "X-Poedit-WPHeader: easytab .php\n"15 "X-Poedit-WPHeader: easytab-pro.php\n" 16 16 "X-Poedit-SourceCharset: UTF-8\n" 17 17 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" … … 26 26 msgstr "Log Attività" 27 27 28 #: admin/meta-box.php: 3428 #: admin/meta-box.php:44 29 29 msgid "Remove the text to regenerate the content!" 30 30 msgstr "Rimuovi il testo per rigenerare il contenuto!" … … 32 32 #. Plugin Name of the plugin/theme 33 33 #: admin/settings-page.php:6 admin/settings-page.php:7 34 msgid "EasyTab "35 msgstr "EasyTab "36 37 #: admin/settings-page.php:11 134 msgid "EasyTab Pro" 35 msgstr "EasyTab Pro" 36 37 #: admin/settings-page.php:118 38 38 msgid "Save Settings" 39 39 msgstr "Salva Impostazioni" 40 40 41 #: admin/settings-page.php:13542 msgid "Prompt Configuration Wizard for AI"43 msgstr "Configurazione guidata prompt per l'intelligenza artificiale"44 45 41 #: admin/settings-page.php:142 42 msgid "AI Prompt Wizard" 43 msgstr "Procedura guidata di prompt AI" 44 45 #: admin/settings-page.php:149 46 46 msgid "Select AI" 47 47 msgstr "Seleziona AI" 48 48 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 50 msgid "Select language" 51 msgstr "Seleziona la lingua" 52 53 #: admin/settings-page.php:171 55 54 msgid "Generating the prompt for " 56 55 msgstr "Generazione del prompt per " 57 56 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 58 msgid "Provide the API KEY" 59 msgstr "Fornisci la CHIAVE API" 60 61 #: admin/settings-page.php:187 62 msgid "AI Model Selection" 63 msgstr "Selezione del modello AI" 64 65 #: admin/settings-page.php:196 66 msgid "Max. characters number" 64 67 msgstr "Numero massimo di caratteri" 65 68 66 #: admin/settings-page.php: 19169 #: admin/settings-page.php:205 67 70 msgid "Shop Description" 68 71 msgstr "Descrizione negozio" 69 72 70 #: admin/settings-page.php:204 73 #: admin/settings-page.php:214 74 msgid "HTML5 Output?" 75 msgstr "Output in HTML5?" 76 77 #: admin/settings-page.php:223 78 msgid "Taxonomies Selection" 79 msgstr "Selezione delle tassonomie" 80 81 #: admin/settings-page.php:236 71 82 msgid "Specific information for the Woocommerce Tab " 72 83 msgstr "Informazioni specifiche per la tab Woocommerce " 73 84 74 #: admin/settings-page.php:2 1185 #: admin/settings-page.php:243 75 86 msgid "Additional Instructions" 76 87 msgstr "Istruzioni aggiuntive" 77 88 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 91 msgid "Product Meta Fields" 92 msgstr "Campi info prodotto" 93 94 #: admin/settings-page.php:279 79 95 msgid "AI available" 80 96 msgstr "AI disponibile" 81 97 82 #: admin/settings-page.php:2 5283 msgid " Select an AI"84 msgstr "S eleziona un'intelligenza artificiale"85 86 #: admin/settings-page.php:2 5498 #: admin/settings-page.php:292 99 msgid "Choose your AI. " 100 msgstr "Scegli la tua intelligenza artificiale. " 101 102 #: admin/settings-page.php:294 87 103 msgid "" 88 104 "Chat-GPT is a chat bot based on artificial intelligence and machine " … … 94 110 "conversazione con un utente umano. " 95 111 96 #: admin/settings-page.php:289 112 #: admin/settings-page.php:295 113 msgid "" 114 "Claude is a conversational AI assistant developed by Anthropic, which " 115 "leverages advanced natural language processing and deep learning techniques. " 116 msgstr "" 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 122 msgid "Languages" 123 msgstr "Lingue" 124 125 #: admin/settings-page.php:330 126 msgid "Select a language. " 127 msgstr "Seleziona una lingua. " 128 129 #: admin/settings-page.php:332 97 130 msgid "The content will be generated by the AI in the selected language. " 98 131 msgstr "" … … 100 133 "selezionata. " 101 134 102 #: admin/settings-page.php:3 12135 #: admin/settings-page.php:355 103 136 msgid "AI API KEY" 104 137 msgstr "CHIAVE API AI" 105 138 106 #: admin/settings-page.php:3 19107 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:3 21111 msgid "" 112 "An API K eyis a unique code used to authenticate and authorize access to a "139 #: admin/settings-page.php:362 140 msgid "Enter the API KEY for the chosen AI. " 141 msgstr "Inserisci la CHIAVE API per l'IA scelta. " 142 143 #: admin/settings-page.php:364 144 msgid "" 145 "An API KEY is a unique code used to authenticate and authorize access to a " 113 146 "software API. It functions as a \"password\" that allows one to connect to " 114 147 "the chosen service and interact with the AI model, ensuring that only " 115 148 "authorized users can send requests and receive responses. " 116 149 msgstr "" 117 "Una chiave APIè un codice univoco utilizzato per autenticare e autorizzare "150 "Una API KEY è un codice univoco utilizzato per autenticare e autorizzare " 118 151 "l'accesso a un'API software. Funziona come una \"password\" che consente di " 119 152 "connettersi al servizio scelto e interagire con il modello di intelligenza " … … 121 154 "richieste e ricevere risposte. " 122 155 123 #: admin/settings-page.php:3 22156 #: admin/settings-page.php:366 124 157 msgid "To generate an API Key " 125 158 msgstr "Per generare una chiave API " 126 159 127 #: admin/settings-page.php:3 22160 #: admin/settings-page.php:372 admin/settings-page.php:420 128 161 msgid "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 162 msgstr "clicca qui!" 163 164 #: admin/settings-page.php:399 165 msgid "Models" 166 msgstr "Modelli" 167 168 #: admin/settings-page.php:410 169 msgid "Select one of the available AI Models. " 170 msgstr "Seleziona uno dei modelli di intelligenza artificiale disponibili. " 171 172 #: admin/settings-page.php:412 173 msgid "" 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. " 177 msgstr "" 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 183 msgid "If you want to learn more " 184 msgstr "Se vuoi saperne di più " 185 186 #: admin/settings-page.php:454 187 msgid "Set the length of the content to be generated. " 188 msgstr "Imposta la lunghezza del contenuto da generare. " 189 190 #: admin/settings-page.php:456 136 191 msgid "" 137 192 "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. " 139 194 msgstr "" 140 195 "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 199 msgid "Yes" 200 msgstr "Sì" 201 202 #: admin/settings-page.php:489 203 msgid "Generate formatted text according to HTML5 semantic standards? " 204 msgstr "Generare testo formattato secondo gli standard semantici HTML5? " 205 206 #: admin/settings-page.php:491 207 msgid "" 208 "Well-formatted text, in addition to making it easier for users to read, " 209 "could have SEO benefits. " 210 msgstr "" 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 145 217 msgid "Description" 146 218 msgstr "Descrizione" 147 219 148 #: admin/settings-page.php: 384149 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: 386220 #: admin/settings-page.php:522 221 msgid "Describe the type of products your store sells and the target users. " 222 msgstr "" 223 "Descrivi il tipo di prodotti venduti dal tuo negozio e gli utenti target. " 224 225 #: admin/settings-page.php:524 154 226 msgid "" 155 227 "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. " 157 229 msgstr "" 158 230 "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 235 msgid "Taxonomies" 236 msgstr "Tassonomie" 237 238 #: admin/settings-page.php:577 239 msgid "Information and instructions specific to this taxonomy. " 240 msgstr "Informazioni e istruzioni specifiche per questa tassonomia. " 241 242 #: admin/settings-page.php:620 243 msgid "Information and specific instructions for this taxonomy. " 244 msgstr "Informazioni e istruzioni specifiche per questa tassonomia. " 245 246 #: admin/settings-page.php:659 247 msgid "Information and specific instructions for this taxonomy" 248 msgstr "Informazioni e istruzioni specifiche per questa tassonomia" 249 250 #: admin/settings-page.php:682 admin/settings-page.php:876 251 msgid "" 252 "Product Meta Fields containing useful information for the selected tab. " 253 msgstr "" 254 "Meta Campi Prodotto contenenti informazioni utili per la scheda selezionata. " 255 256 #: admin/settings-page.php:684 257 msgid "" 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 msgstr "" 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 268 msgid "" 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. " 272 msgstr "" 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 279 msgid "" 280 "Provide specific instructions for this tab to be incorporated into the " 281 "prompt intended for IA. " 282 msgstr "" 283 "Fornire istruzioni specifiche per questa scheda da incorporare nel prompt " 284 "destinato a IA. " 285 286 #: admin/settings-page.php:719 287 msgid "Additional instructions to consider for this specific Woocommerce tab. " 288 msgstr "" 289 "Ulteriori istruzioni da considerare per questa specifica tab Woocommerce. " 290 291 #: admin/settings-page.php:878 292 msgid "" 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 msgstr "" 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 306 msgid "" 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. " 311 msgstr "" 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 318 msgid "" 319 "The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not " 177 320 "active, so the plugin has been disabled." 178 321 msgstr "" 179 "Il plugin \"EasyTab \" richiede WooCommerce per funzionare. WooCommerce non è"180 " attivo, quindi il plugin è stato disabilitato."181 182 #: helper/woocommerce.php:2 0322 "Il plugin \"EasyTab Pro\" richiede WooCommerce per funzionare. WooCommerce " 323 "non è attivo, quindi il plugin è stato disabilitato." 324 325 #: helper/woocommerce.php:22 183 326 #: wc-templates-override/single-product/tabs/additional-information.php:13 184 327 msgid "Additional information" … … 191 334 #. Description of the plugin/theme 192 335 msgid "" 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." 338 msgstr "" 339 "EasyTab Pro ti aiuta a ottimizzare le schede Woocommerce con il supporto " 197 340 "dell'intelligenza artificiale." 198 341 199 342 #. Author of the plugin/theme 200 msgid " rgwebdev"201 msgstr " rgwebdev"343 msgid "Riccardo Guerrera" 344 msgstr "Riccardo Guerrera" 202 345 203 346 #. Author URI of the plugin/theme -
easytab/trunk/languages/easytab.pot
r3195878 r3202007 2 2 msgid "" 3 3 msgstr "" 4 "Project-Id-Version: EasyTab \n"5 "POT-Creation-Date: 2024-11-1 0 00:09+0100\n"6 "PO-Revision-Date: 2024-11-1 0 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" 7 7 "Last-Translator: \n" 8 8 "Language-Team: \n" … … 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 16 "X-Poedit-WPHeader: easytab .php\n"16 "X-Poedit-WPHeader: easytab-pro.php\n" 17 17 "X-Poedit-SourceCharset: UTF-8\n" 18 18 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" … … 27 27 msgstr "" 28 28 29 #: admin/meta-box.php: 3429 #: admin/meta-box.php:44 30 30 msgid "Remove the text to regenerate the content!" 31 31 msgstr "" … … 33 33 #. Plugin Name of the plugin/theme 34 34 #: admin/settings-page.php:6 admin/settings-page.php:7 35 msgid "EasyTab "36 msgstr "" 37 38 #: admin/settings-page.php:11 135 msgid "EasyTab Pro" 36 msgstr "" 37 38 #: admin/settings-page.php:118 39 39 msgid "Save Settings" 40 40 msgstr "" 41 41 42 #: admin/settings-page.php:13543 msgid "Prompt Configuration Wizard for AI"44 msgstr ""45 46 42 #: admin/settings-page.php:142 43 msgid "AI Prompt Wizard" 44 msgstr "" 45 46 #: admin/settings-page.php:149 47 47 msgid "Select AI" 48 48 msgstr "" 49 49 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 51 msgid "Select language" 52 msgstr "" 53 54 #: admin/settings-page.php:171 56 55 msgid "Generating the prompt for " 57 56 msgstr "" 58 57 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 59 msgid "Provide the API KEY" 60 msgstr "" 61 62 #: admin/settings-page.php:187 63 msgid "AI Model Selection" 64 msgstr "" 65 66 #: admin/settings-page.php:196 67 msgid "Max. characters number" 68 msgstr "" 69 70 #: admin/settings-page.php:205 68 71 msgid "Shop Description" 69 72 msgstr "" 70 73 71 #: admin/settings-page.php:204 74 #: admin/settings-page.php:214 75 msgid "HTML5 Output?" 76 msgstr "" 77 78 #: admin/settings-page.php:223 79 msgid "Taxonomies Selection" 80 msgstr "" 81 82 #: admin/settings-page.php:236 72 83 msgid "Specific information for the Woocommerce Tab " 73 84 msgstr "" 74 85 75 #: admin/settings-page.php:2 1186 #: admin/settings-page.php:243 76 87 msgid "Additional Instructions" 77 88 msgstr "" 78 89 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 92 msgid "Product Meta Fields" 93 msgstr "" 94 95 #: admin/settings-page.php:279 80 96 msgid "AI available" 81 97 msgstr "" 82 98 83 #: admin/settings-page.php:2 5284 msgid " Select an AI"85 msgstr "" 86 87 #: admin/settings-page.php:2 5499 #: admin/settings-page.php:292 100 msgid "Choose your AI. " 101 msgstr "" 102 103 #: admin/settings-page.php:294 88 104 msgid "" 89 105 "Chat-GPT is a chat bot based on artificial intelligence and machine " … … 92 108 msgstr "" 93 109 94 #: admin/settings-page.php:289 110 #: admin/settings-page.php:295 111 msgid "" 112 "Claude is a conversational AI assistant developed by Anthropic, which " 113 "leverages advanced natural language processing and deep learning techniques. " 114 msgstr "" 115 116 #: admin/settings-page.php:317 117 msgid "Languages" 118 msgstr "" 119 120 #: admin/settings-page.php:330 121 msgid "Select a language. " 122 msgstr "" 123 124 #: admin/settings-page.php:332 95 125 msgid "The content will be generated by the AI in the selected language. " 96 126 msgstr "" 97 127 98 #: admin/settings-page.php:3 12128 #: admin/settings-page.php:355 99 129 msgid "AI API KEY" 100 130 msgstr "" 101 131 102 #: admin/settings-page.php:3 19103 msgid "Enter the API key for the chosen AI"104 msgstr "" 105 106 #: admin/settings-page.php:3 21107 msgid "" 108 "An API K eyis a unique code used to authenticate and authorize access to a "132 #: admin/settings-page.php:362 133 msgid "Enter the API KEY for the chosen AI. " 134 msgstr "" 135 136 #: admin/settings-page.php:364 137 msgid "" 138 "An API KEY is a unique code used to authenticate and authorize access to a " 109 139 "software API. It functions as a \"password\" that allows one to connect to " 110 140 "the chosen service and interact with the AI model, ensuring that only " … … 112 142 msgstr "" 113 143 114 #: admin/settings-page.php:3 22144 #: admin/settings-page.php:366 115 145 msgid "To generate an API Key " 116 146 msgstr "" 117 147 118 #: admin/settings-page.php:3 22148 #: admin/settings-page.php:372 admin/settings-page.php:420 119 149 msgid "click here!" 120 150 msgstr "" 121 151 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 153 msgid "Models" 154 msgstr "" 155 156 #: admin/settings-page.php:410 157 msgid "Select one of the available AI Models. " 158 msgstr "" 159 160 #: admin/settings-page.php:412 161 msgid "" 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. " 165 msgstr "" 166 167 #: admin/settings-page.php:414 168 msgid "If you want to learn more " 169 msgstr "" 170 171 #: admin/settings-page.php:454 172 msgid "Set the length of the content to be generated. " 173 msgstr "" 174 175 #: admin/settings-page.php:456 127 176 msgid "" 128 177 "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. " 179 msgstr "" 180 181 #: admin/settings-page.php:481 182 msgid "Yes" 183 msgstr "" 184 185 #: admin/settings-page.php:489 186 msgid "Generate formatted text according to HTML5 semantic standards? " 187 msgstr "" 188 189 #: admin/settings-page.php:491 190 msgid "" 191 "Well-formatted text, in addition to making it easier for users to read, " 192 "could have SEO benefits. " 193 msgstr "" 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 134 198 msgid "Description" 135 199 msgstr "" 136 200 137 #: admin/settings-page.php: 384138 msgid "Describe the type of products your store sells and the target users "139 msgstr "" 140 141 #: admin/settings-page.php: 386201 #: admin/settings-page.php:522 202 msgid "Describe the type of products your store sells and the target users. " 203 msgstr "" 204 205 #: admin/settings-page.php:524 142 206 msgid "" 143 207 "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. " 209 msgstr "" 210 211 #: admin/settings-page.php:565 admin/settings-page.php:608 212 #: admin/settings-page.php:647 213 msgid "Taxonomies" 214 msgstr "" 215 216 #: admin/settings-page.php:577 217 msgid "Information and instructions specific to this taxonomy. " 218 msgstr "" 219 220 #: admin/settings-page.php:620 221 msgid "Information and specific instructions for this taxonomy. " 222 msgstr "" 223 224 #: admin/settings-page.php:659 225 msgid "Information and specific instructions for this taxonomy" 226 msgstr "" 227 228 #: admin/settings-page.php:682 admin/settings-page.php:876 229 msgid "" 230 "Product Meta Fields containing useful information for the selected tab. " 231 msgstr "" 232 233 #: admin/settings-page.php:684 234 msgid "" 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.\"" 238 msgstr "" 239 240 #: admin/settings-page.php:685 241 msgid "" 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. " 245 msgstr "" 246 247 #: admin/settings-page.php:717 248 msgid "" 249 "Provide specific instructions for this tab to be incorporated into the " 250 "prompt intended for IA. " 251 msgstr "" 252 253 #: admin/settings-page.php:719 254 msgid "Additional instructions to consider for this specific Woocommerce tab. " 255 msgstr "" 256 257 #: admin/settings-page.php:878 258 msgid "" 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. " 264 msgstr "" 265 266 #: admin/settings-page.php:879 267 msgid "" 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. " 272 msgstr "" 273 274 #: easytab-pro.php:43 275 msgid "" 276 "The \"EasyTab Pro\" plugin requires WooCommerce to work. WooCommerce is not " 160 277 "active, so the plugin has been disabled." 161 278 msgstr "" 162 279 163 #: helper/woocommerce.php:2 0280 #: helper/woocommerce.php:22 164 281 #: wc-templates-override/single-product/tabs/additional-information.php:13 165 282 msgid "Additional information" … … 172 289 #. Description of the plugin/theme 173 290 msgid "" 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." 176 293 msgstr "" 177 294 178 295 #. Author of the plugin/theme 179 msgid " rgwebdev"296 msgid "Riccardo Guerrera" 180 297 msgstr "" 181 298 -
easytab/trunk/readme.txt
r3195878 r3202007 1 1 2 === EasyTab === 2 3 3 Contributors: rgwebdev 4 Contributors: rgwebdev, freemius 4 5 Tags: WooCommerce, AI, tabs 5 6 Requires at least: 6.6 6 7 Tested up to: 6.7 7 Stable tag: 1.0. 08 Stable tag: 1.0.1 8 9 Requires PHP: 7.2 9 10 License: GPLv3 or later … … 17 18 18 19 The 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 21 https://www.youtube.com/watch?v=rS05e_R8KdM 19 22 20 23 ### Key Features … … 61 64 == Changelog == 62 65 66 = 1.0.1 = 67 * Freemius integration. 68 * Enhancements: WooCommerce tabs capture mode bug fixed. 69 63 70 = 1.0.0 = 64 71 * Initial release with AI-powered content generation for WooCommerce product tabs. -
easytab/trunk/wc-templates-override/single-product/tabs/additional-information.php
r3195878 r3202007 1 1 <?php 2 2 3 /**4 * EasyTab5 */3 /** 4 * EasyTab 5 */ 6 6 7 defined('ABSPATH') || exit; 7 defined('ABSPATH') || exit; 8 8 9 9 10 global $product; 10 11 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); 12 15 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)) { 15 17 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 18 22 } 19 23 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 7 7 defined('ABSPATH') || exit; 8 8 9 global $post;10 9 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 12 12 13 13 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.