PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 8.8.1
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v8.8.1
8.8.1 8.8.0 8.7.9 8.7.8 8.7.7 8.7.6 8.7.5 8.7.4 8.7.3 8.7.2 8.7.1 8.7.0 8.6.9 8.6.8 8.6.7 8.6.6 8.6.5 8.6.4 8.6.2 8.6.1 8.6.0 8.5.9 8.5.8 8.5.7 8.5.6 All 537 releases
← All changes | qcld-wpwbot.php +387 -52 8.6.0 → 8.8.1 View file →
@@ -3,14 +3,14 @@
3 3 * Plugin Name: AI ChatBot - WPBot
4 4 * Plugin URI: https://www.wpbot.pro/
5 5 * Description: ChatBot is a native WordPress ChatBot plugin to provide live chat support and lead generation
6 6 * Donate link: https://www.wpbot.pro/
7 - * Version: 8.6.0
7 + * Version: 8.8.1
8 8 * @author QuantumCloud
9 9 * Author: ChatBot for WordPress - WPBot
10 10 * Author URI: https://www.wpbot.pro/
11 - * Requires at least: 4.6
12 - * Tested up to: 7.0
11 + * Requires at least: 5.5
12 + * Tested up to: 7.1
13 13 * Text Domain: chatbot
14 14 * Domain Path: /languages
15 15 * License: GPL2
16 16 */
@@ -18,9 +18,8 @@
18 18
19 19
20 20 if (!defined('ABSPATH')) exit; // Exit if accessed directly.
21 21
22 -
23 22 // Abort execution if Pro version is active to prevent conflicts
24 23 if ( ! function_exists( 'is_plugin_active' ) ) {
25 24 require_once ABSPATH . 'wp-admin/includes/plugin.php';
26 25 }
@@ -48,9 +47,9 @@
48 47 }
49 48 }
50 49
51 50 if ( ! defined( 'QCLD_wpCHATBOT_VERSION' ) ) {
52 - define('QCLD_wpCHATBOT_VERSION', '8.6.0');
51 + define('QCLD_wpCHATBOT_VERSION', '8.8.1');
53 52 }
54 53 if ( ! defined( 'QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION' ) ) {
55 54 define('QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION', 2.2);
56 55 }
@@ -88,8 +87,9 @@
88 87 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openai/qcld-bot-openai.php");
89 88 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openrouter/qcld-bot-openrouter.php");
90 89 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/gemini/qcld-bot-gemini.php");
91 90 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/grok/qcld-bot-grok.php");
91 +require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/claude/qcld-bot-claude.php");
92 92 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."class-qc-free-plugin-upgrade-notice.php");
93 93 require_once("class-plugin-deactivate-feedback.php");
94 94 require_once("qc-support-promo-page/class-qc-support-promo-page.php");
95 95 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."/functions.php");
@@ -107,8 +107,13 @@
107 107 // Built-in Chat Sessions & Analytics module.
108 108 // Defers to the Pro addon automatically when it's active.
109 109 require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/chat-sessions/wpbot-chat-sessions.php' );
110 110
111 +// Load Automator addon if it exists
112 +if ( file_exists( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'addons/automator/wpbot-automator.php' ) ) {
113 + require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'addons/automator/wpbot-automator.php' );
114 +}
115 +
111 116 /**
112 117 * Main Class.
113 118 */
114 119
@@ -154,18 +159,18 @@
154 159 add_action('admin_init', array($this, 'qcld_wb_chatbot_save_options'));
155 160
156 161 }
157 162
158 - if( ( !empty($_GET['page']) && $_GET["page"] == "wpbot") || ( !empty($_GET['page']) && $_GET["page"] == "wpbot-panel")|| ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_openAi') || ( !empty($_GET['page']) && $_GET['page'] == 'simple-text-response') ){
163 + if( ( !empty($_GET['page']) && $_GET["page"] == "wpbot") || ( !empty($_GET['page']) && $_GET["page"] == "wpbot-panel")|| ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_openAi') || ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_ai_actions') || ( !empty($_GET['page']) && $_GET['page'] == 'simple-text-response') ){
159 164 // add_action( 'admin_notices', array( $this, 'promotion_notice' ) );
160 165
161 166 }
162 167
163 168 if (is_admin() && !empty($_GET["page"]) && ($_GET["page"] == "wpbot") || (!empty($_GET['page']) && $_GET['page']=='wpbot_help_page')
164 -
169 + || ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_ai_actions')
165 170 || (!empty($_GET['page']) && $_GET['page']=='wpbot_openAi')
166 171
167 - || (!empty($_GET['page']) && $_GET['page']=='wpbot-panel') || ( !empty($_GET['page']) && $_GET["page"] == "wbcs-botsessions-page") ) {
172 + || (!empty($_GET['page']) && $_GET['page']=='wpbot-panel') || ( !empty($_GET['page']) && $_GET["page"] == "wbcs-botsessions-page") || ( !empty($_GET['page']) && $_GET["page"] == "wpbot_ai_actions") ) {
168 173 add_action('admin_enqueue_scripts', array($this, 'qcld_wb_chatbot_admin_scripts'));
169 174 if( get_option('wp_chatbot_index_count')<=0 && get_option('qlcd_wp_chatbot_search_option')=='advanced'){
170 175
171 176 add_action( 'admin_notices', array( $this, 'admin_notice_reindex' ) );
@@ -184,20 +189,30 @@
184 189 if (!is_admin() && get_option('disable_wp_chatbot') != 1 && wp_chatbot_load_controlling() === true) {
185 190 add_action('wp_enqueue_scripts', array($this, 'qcld_wb_chatbot_frontend_scripts'));
186 191 }
187 192 }
193 + public function qcld_register_ai_form_cpt() {
194 + $args = array(
195 + 'public' => false,
196 + 'show_ui' => true,
197 + 'show_in_menu' => 'wpbot', // under WPBot menu
198 + 'label' => 'AI Form Entries',
199 + 'supports' => array('title', 'custom-fields')
200 + );
201 + register_post_type('wpbot_form_entry', $args);
202 + }
188 203 public function qcld_wpchatbot_init2_fnc(){
204 + $this->qcld_register_ai_form_cpt();
189 205 global $wpdb;
190 206 if( is_admin() ){
191 207
192 - $connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
193 - if($connection === false){
208 + $content = $wpdb->db_server_info();
209 + if ( empty( $content ) ) {
194 210 return;
195 211 }
196 - $content = $connection->server_info;
197 -
198 - $mysql_server_info = $wpdb->db_server_info();
199 212
213 + $mysql_server_info = $content;
214 +
200 215 // Check for the MariaDB.
201 216 $is_mariadb = false;
202 217 if ( ! empty( $mysql_server_info ) && strpos( strtolower( $mysql_server_info ), 'maria' ) !== false ) {
203 218 $is_mariadb = true;
@@ -222,9 +237,8 @@
222 237 }
223 238
224 239 }
225 240
226 - $connection->close();
227 241 }
228 242 }
229 243
230 244 public function mysql_version_notice(){
@@ -248,19 +262,30 @@
248 262 $capability = 'publish_posts';
249 263 }else{
250 264 $capability = 'manage_options';
251 265 }
252 - add_menu_page( esc_html('WPBot - ChatBot Lite'), esc_html('WPBot - ChatBot Lite'), 'manage_options','wpbot-panel', array($this, 'qcld_wb_chatbot_admin_page'),'dashicons-format-status', 6 );
266 + add_menu_page( esc_html('WPBot - ChatBot'), esc_html('WPBot - ChatBot'), 'manage_options','wpbot-panel', array($this, 'qcld_wb_chatbot_admin_page'),'dashicons-format-status', 6 );
253 267
254 - add_submenu_page( 'wpbot-panel', esc_html('Settings'), esc_html('Settings'), 'manage_options','wpbot', array($this, 'qcld_wb_chatbot_admin_page_settings') );
268 + add_submenu_page( 'wpbot-panel', esc_html('General Settings'), esc_html('General Settings'), 'manage_options','wpbot', array($this, 'qcld_wb_chatbot_admin_page_settings') );
269 + add_submenu_page( 'wpbot-panel', esc_html('AI Settings'), esc_html('AI Settings'), 'manage_options','wpbot_openAi', 'wpbot_openAi_setting_func' );
270 + add_submenu_page( 'wpbot-panel', esc_html('AI Actions'), esc_html('AI Actions'), 'manage_options','wpbot_ai_actions', 'wpbot_Ai_actions_func' );
271 +
272 + if ( class_exists( '\WPbot_Automator\Core\Plugin' ) && method_exists( '\WPbot_Automator\Core\Plugin', 'render_admin_page' ) ) {
273 + add_submenu_page( 'wpbot-panel', esc_html('Automator'), esc_html('Automator'), 'manage_options', 'wpbot-automator', array( '\WPbot_Automator\Core\Plugin', 'render_admin_page' ) );
274 + }
255 275
276 + if ( function_exists( 'qc_wpbot_cs_tabbed_wrapper' ) ) {
277 + add_submenu_page( 'wpbot-panel', esc_html('Chat Sessions'), esc_html('Chat Sessions'), $capability, 'wbcs-botsessions-page', 'qc_wpbot_cs_tabbed_wrapper' );
278 + }
279 +
280 + $hook = add_submenu_page( 'wpbot-panel', esc_html('Simple Text Responses'), esc_html('Simple Text Responses'), $capability,'simple-text-response', array($this, 'qcld_wb_chatbot_admin_str') );
281 + add_action( "load-$hook", [ $this, 'screen_option' ] );
282 +
256 283 add_submenu_page( 'wpbot-panel', esc_html('User Data'), esc_html('User Data'), 'manage_options','email-subscription', array($this, 'qcld_wb_chatbot_admin_page1') );
257 284
258 - add_submenu_page( 'wpbot-panel', esc_html('AI Settings'), esc_html('AI Settings'), 'manage_options','wpbot_openAi', 'wpbot_openAi_setting_func' );
259 285
260 - $hook = add_submenu_page( 'wpbot-panel', esc_html('Simple Text Responses'), esc_html('Simple Text Responses'), $capability,'simple-text-response', array($this, 'qcld_wb_chatbot_admin_str') );
286 + //$hook = add_submenu_page( 'wpbot-panel', esc_html('Simple Text Responses'), esc_html('Simple Text Responses'), $capability,'simple-text-response', array($this, 'qcld_wb_chatbot_admin_str') );
261 287
262 - add_action( "load-$hook", [ $this, 'screen_option' ] );
263 288
264 289 // add_submenu_page( 'wpbot-panel', esc_html('Conversational Form '), esc_html('Conversational Form'), 'manage_options','wpbots', [$this, 'qcld_wb_chatbot_admin_conversational_settings'] );
265 290
266 291 add_submenu_page( 'wpbot-panel', esc_html('Get Support'), esc_html('Get Support'), 'manage_options','wpbot_support_page', 'qcpromo_wpbot_free_support_page_callback_func' );
@@ -303,9 +328,9 @@
303 328 global $wpcommerce, $wp_scripts;
304 329 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
305 330
306 331 if (((!empty($_GET["page"])) && ($_GET["page"] == "wpbot")) || ($hook == "widgets.php") || $_GET['page']=='wpbot_help_page' || $_GET['page']=='wpbot_openAi' || $_GET['page']=='simple-text-response'
307 - || $_GET['page']=='wpbot-panel' || $_GET["page"] == "wbcs-botsessions-page" ) {
332 + || $_GET['page']=='wpbot-panel' || $_GET["page"] == "wbcs-botsessions-page" || $_GET["page"] == "wpbot_ai_actions" ) {
308 333
309 334 wp_enqueue_script('jquery');
310 335 //wp_enqueue_style('wpcommerce_admin_styles', $wpcommerce->plugin_url() . '/assets/css/admin.css');
311 336
@@ -330,9 +355,9 @@
330 355 wp_enqueue_script( 'wp-color-picker');
331 356 wp_enqueue_script( 'jquery-ui-sortable');
332 357 wp_register_script('qcld-wp-fontpicker', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/fontpicker.js', basename(__FILE__)), array(), true);
333 358 wp_enqueue_script('qcld-wp-fontpicker');
334 - wp_register_script('qcld-wp-chatbot-cbpFWTabs', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/cbpFWTabs.js', basename(__FILE__)), array(), true);
359 + wp_register_script('qcld-wp-chatbot-cbpFWTabs', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/cbpFWTabs.js', basename(__FILE__)), array(), QCLD_wpCHATBOT_VERSION, true);
335 360 wp_enqueue_script('qcld-wp-chatbot-cbpFWTabs');
336 361 wp_register_script('qcld-wp-chatbot-modernizr-custom', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/modernizr.custom.js', basename(__FILE__)), array(), true);
337 362 wp_enqueue_script('qcld-wp-chatbot-modernizr-custom');
338 363 wp_register_script('qcld-wp-chatbot-bootstrap-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/bootstrap.js', basename(__FILE__)), array('jquery'), true);
@@ -353,9 +378,9 @@
353 378 wp_register_style('qcld-wp-chatbot-timepicker-css', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/jquery.timepicker.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
354 379 wp_enqueue_style('qcld-wp-chatbot-timepicker-css');
355 380 wp_register_script('qcld-wp-chatbot-sweetalrt', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/sweetalrt.js', basename(__FILE__)), array(), true);
356 381 wp_enqueue_script('qcld-wp-chatbot-sweetalrt');
357 - wp_register_script('qcld-wp-chatbot-admin-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/qcld-wp-chatbot-admin.js', basename(__FILE__)), array('jquery', 'jquery-ui-core','jquery-ui-sortable','jquery-ui-droppable','wp-color-picker','qcld-wp-chatbot-timepicker-js'), true);
382 + wp_register_script('qcld-wp-chatbot-admin-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/qcld-wp-chatbot-admin.js', basename(__FILE__)), array('jquery', 'jquery-ui-core','jquery-ui-sortable','jquery-ui-droppable','wp-color-picker','qcld-wp-chatbot-timepicker-js'), QCLD_wpCHATBOT_VERSION, true);
358 383 wp_enqueue_script('qcld-wp-chatbot-admin-js');
359 384 wp_localize_script('qcld-wp-chatbot-admin-js', 'qcld_gemini_admin_data',
360 385 array('ajax_url' => admin_url('admin-ajax.php'),'ajax_nonce' => wp_create_nonce('wp_chatbot'),'image_path' => QCLD_wpCHATBOT_IMG_URL));
361 386 // WordPress Media library
@@ -619,8 +644,10 @@
619 644 'enable_ret_user_show' => get_option('enable_wp_chatbot_ret_user_show'),
620 645 'enable_inactive_time_show' => get_option('enable_wp_chatbot_inactive_time_show'),
621 646 'ret_inactive_user_once' => get_option('wp_chatbot_inactive_once'),
622 647 'mobile_full_screen' => '1',
648 + 'chatbot_content' => get_option( 'chatbot_content_max_height' ),
649 + 'chatbot_content_responsive' => get_option( 'chatbot_content_max_height_responsive' ),
623 650 'botpreloadingtime' => (get_option('wpbot_preloading_time')?get_option('wpbot_preloading_time'):800),
624 651 'inactive_time' => get_option('wp_chatbot_inactive_time'),
625 652 'checkout_msg' => str_replace('\\', '', get_option('wp_chatbot_checkout_msg')),
626 653 'ai_df_enable' => get_option('enable_wp_chatbot_dailogflow'),
@@ -631,8 +658,9 @@
631 658 'is_stream_enabled' => ( get_option('is_stream_enabled', '1') == '1' ? '1' : '0' ),
632 659 'qcld_openai_append_content' => get_option('qcld_openai_append_content'),
633 660 'openrouter_enabled' => (get_option('qcld_openrouter_enabled')=='1'? get_option('qcld_openrouter_enabled') : '0'),
634 661 'gemini_enabled' => (get_option('qcld_gemini_enabled')=='1'? get_option('qcld_gemini_enabled') : '0'),
662 + 'claude_enabled' => (get_option('qcld_claude_enabled')=='1'? get_option('qcld_claude_enabled') : '0'),
635 663 'grok_enabled' => (get_option('qcld_grok_enabled')=='1'? get_option('qcld_grok_enabled') : '0'),
636 664 'qcld_gemini_prepend_content' => get_option('qcld_gemini_prepend_content'),
637 665 'qcld_gemini_append_content' => get_option('qcld_gemini_append_content'),
638 666 'qcld_openrouter_append_content' => get_option('qcld_openrouter_append_content'),
@@ -651,9 +679,12 @@
651 679 'current_user_id' => $user_id,
652 680 'display_name' => esc_html( $display_name ),
653 681 'skip_wp_greetings' => get_option('skip_wp_greetings'),
654 682 'skip_greetings_and_menu' => get_option('skip_wp_greetings_donot_show_menu'),
655 - 'ask_email_wp_greetings' => get_option('ask_email_wp_greetings'),
683 + 'skip_wp_greetings_trigger_intent' => get_option('skip_wp_greetings_trigger_intent'),
684 + 'intent_for_non_logged_in_user' => get_option('qlcd_wp_chatbot_intent_for_non_logged_in_user'),
685 + 'intent_for_logged_in_user' => get_option('qlcd_wp_chatbot_intent_for_logged_in_user'),
686 + 'ask_email_wp_greetings' => get_option('enable_asking_for_email'),
656 687 'skip_chat_reactions_menu' => get_option('skip_chat_reactions_menu'),
657 688 'qlcd_wp_chatbot_like_text' => get_option('qlcd_wp_chatbot_like_text'),
658 689 'qlcd_wp_chatbot_dislike_text' => get_option('qlcd_wp_chatbot_dislike_text'),
659 690 'enable_chat_report_menu' => get_option('enable_chat_report_menu'),
@@ -659,8 +690,10 @@
659 690 'enable_chat_report_menu' => get_option('enable_chat_report_menu'),
660 691 'qlcd_wp_chatbot_report_text' => get_option('qlcd_wp_chatbot_report_text'),
661 692 'enable_chat_share_menu' => get_option('enable_chat_share_menu'),
662 693 'qlcd_wp_chatbot_share_text' => get_option('qlcd_wp_chatbot_share_text'),
694 + 'icon_video' => get_option('wp_chatbot_icon_video', ''),
695 + 'icon_video_delay' => absint(get_option('wp_chatbot_icon_video_delay', 0)),
663 696
664 697 );
665 698 $user_font = get_option('wp_chatbot_user_font') != '' ? get_option('wp_chatbot_user_font') : '';
666 699 if($user_font != '' ){
@@ -708,8 +741,18 @@
708 741 wp_enqueue_script('qcld-wp-chatbot-magnify-popup');
709 742 wp_register_script('qcld-wp-chatbot-plugin', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/qcld-wp-chatbot-plugin.js', basename(__FILE__)), array('jquery', 'qcld-wp-chatbot-jquery-cookie','qcld-wp-chatbot-magnify-popup'), QCLD_wpCHATBOT_VERSION, true);
710 743 wp_enqueue_script('qcld-wp-chatbot-plugin');
711 744
745 + $saved_ai_forms = get_option('wpbot_ai_forms', array());
746 + $ai_form_titles = array();
747 + if (is_array($saved_ai_forms)) {
748 + foreach ($saved_ai_forms as $form) {
749 + if (!isset($form['interactive']) || $form['interactive'] == 1) {
750 + $ai_form_titles[] = trim(strtolower($form['title']));
751 + }
752 + }
753 + }
754 +
712 755 $nonce = wp_create_nonce('wp_chatbot');
713 756 // Pass data to JS
714 757 wp_localize_script('qcld-wp-chatbot-plugin', 'qcld_chatbot_obj', [
715 758 'ajax_url' => admin_url('admin-ajax.php'),
@@ -714,8 +757,9 @@
714 757 wp_localize_script('qcld-wp-chatbot-plugin', 'qcld_chatbot_obj', [
715 758 'ajax_url' => admin_url('admin-ajax.php'),
716 759 'nonce' => $nonce,
717 760 'stream_endpoint' => admin_url('admin-ajax.php?action=qcld_stream_openai'),
761 + 'ai_form_titles' => $ai_form_titles,
718 762 ]);
719 763
720 764 wp_register_script('qcld-wp-chatbot-front-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/qcld-wp-chatbot-front.js', basename(__FILE__)), array('jquery', 'qcld-wp-chatbot-jquery-cookie'), QCLD_wpCHATBOT_VERSION, true);
721 765 wp_enqueue_script('qcld-wp-chatbot-front-js');
@@ -779,8 +823,11 @@
779 823 $user_msg_text_color = sanitize_hex_color( get_option('wp_chatbot_user_msg_text_color') );
780 824 $wp_chatbot_text_color = sanitize_hex_color( get_option('wp_chatbot_text_color') );
781 825 $user_msg_bg_color = sanitize_hex_color( get_option('wp_chatbot_user_msg_bg_color') );
782 826 $header_background_color = sanitize_hex_color( get_option('wp_chatbot_header_background_color') );
827 + $chatbot_content_max_height = sanitize_text_field( get_option('chatbot_content_max_height') );
828 + $chatbot_content_max_height_responsive = sanitize_text_field( get_option('chatbot_content_max_height_responsive') );
829 +
783 830
784 831 $inline_chat_custom_styles .= "
785 832 #wp-chatbot-chat-container, .wp-chatbot-product-description, .wp-chatbot-product-description p,.wp-chatbot-product-quantity label, .wp-chatbot-product-variable label {
786 833 color: ". $text_color ." !important;
@@ -872,8 +919,11 @@
872 919 font-style: ".$bot_font_family->fontStyle.";
873 920 font-size: ". get_option('wp_chatbot_font_size'). "px;
874 921 }
875 922
923 +
924 +
925 +
876 926 ";
877 927 }
878 928 if ( get_option('enable_wp_chatbot_custom_color') == 1 && ! empty($bot_font) ) {
879 929
@@ -896,10 +946,9 @@
896 946 font-style: {$font_style};
897 947 font-size: {$font_size};
898 948 }
899 949 ";
900 -
901 - wp_add_inline_style( 'qcld-wp-chatbot-common-style', $custom_colors );
950 +
902 951 }
903 952
904 953 if(get_option('wp_chatbot_custom_css')!=""){
905 954
@@ -904,8 +953,89 @@
904 953 if(get_option('wp_chatbot_custom_css')!=""){
905 954
906 955 wp_add_inline_style( 'qcld-wp-chatbot-common-style', get_option('wp_chatbot_custom_css') );
907 956 }
957 +
958 +
959 +
960 +
961 + if ( ( get_option( 'chatbot_content_max_height' ) != '' ) ) {
962 + $chatbot_h_vh = absint( get_option( 'chatbot_content_max_height' ) );
963 + if ( $chatbot_h_vh <= 0 ) {
964 + $chatbot_h_vh = 80;
965 + }
966 + if ( $chatbot_h_vh > 100 ) {
967 + $chatbot_h_vh = 100;
968 + }
969 + // Expand adds a modest bump based on admin height (never above 100vh).
970 + $chatbot_h_expanded_vh = min( 100, $chatbot_h_vh + 8 );
971 +
972 + $chatbot_h_mobile_vh = absint( get_option( 'chatbot_content_max_height_responsive' ) );
973 + if ( $chatbot_h_mobile_vh <= 0 ) {
974 + $chatbot_h_mobile_vh = 90;
975 + }
976 + if ( $chatbot_h_mobile_vh > 100 ) {
977 + $chatbot_h_mobile_vh = 100;
978 + }
979 +
980 + $custom_colors .= ' .slimScrollDiv{
981 + height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
982 + max-height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
983 + }';
984 +
985 +
986 + $custom_colors .= 'div#wp-chatbot-board-container{
987 + height: calc(' . $chatbot_h_vh . 'vh - 100px) !important;
988 + max-height: calc(' . $chatbot_h_vh . 'vh - 100px) !important;
989 + }';
990 +
991 + $custom_colors .= '.wp-chatbot-content{
992 + height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
993 + max-height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
994 + }';
995 +
996 + // Desktop expand: width toggle also grows height from admin base + bump.
997 + $custom_colors .= '
998 + div#wp-chatbot-board-container.wp-chatbot-expanded,
999 + .wp-chatbot-board-container.wp-chatbot-expanded {
1000 + height: calc(' . $chatbot_h_expanded_vh . 'vh - 100px) !important;
1001 + max-height: calc(' . $chatbot_h_expanded_vh . 'vh - 100px) !important;
1002 + }
1003 + div#wp-chatbot-board-container.wp-chatbot-expanded .slimScrollDiv,
1004 + div#wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-content,
1005 + div#wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-ball-inner,
1006 + .wp-chatbot-board-container.wp-chatbot-expanded .slimScrollDiv,
1007 + .wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-content,
1008 + .wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-ball-inner {
1009 + height: calc(' . $chatbot_h_expanded_vh . 'vh - 270px) !important;
1010 + max-height: calc(' . $chatbot_h_expanded_vh . 'vh - 270px) !important;
1011 + }
1012 + ';
1013 +
1014 +
1015 +
1016 + $custom_colors .= '
1017 + @media screen and (max-width: 480px) {
1018 + div#wp-chatbot-board-container{
1019 + height: calc(' . $chatbot_h_mobile_vh . 'vh - 0px) !important;
1020 + max-height: calc(' . $chatbot_h_mobile_vh . 'vh - 0px) !important;
1021 + }
1022 +
1023 + .slimScrollDiv{
1024 + height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1025 + max-height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1026 + }
1027 +
1028 + .wp-chatbot-content{
1029 + height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1030 + max-height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1031 + }
1032 + }
1033 + ';
1034 +
1035 +
1036 + }
1037 + wp_add_inline_style( 'qcld-wp-chatbot-common-style', $custom_colors );
908 1038 }
909 1039 public function qcld_wb_chatbot_str_replace($messages=array()){
910 1040 $allowed_html = array(
911 1041 'a' => array(
@@ -1090,12 +1220,23 @@
1090 1220 update_option('skip_wp_greetings', wp_unslash($skip_wp_greetings));
1091 1221
1092 1222 if( $skip_wp_greetings == '1' || $skip_wp_greetings_donot_show_menu == '1' ){
1093 1223 $ask_email_wp_greetings = '';
1094 - } elseif(isset( $_POST["ask_email_wp_greetings"])){
1095 - $ask_email_wp_greetings = sanitize_text_field(wp_unslash($_POST["ask_email_wp_greetings"]));
1096 - }else{ $ask_email_wp_greetings='';}
1224 + $enable_asking_for_email = '';
1225 + } else {
1226 + if (isset( $_POST["ask_email_wp_greetings"])) {
1227 + $ask_email_wp_greetings = sanitize_text_field(wp_unslash($_POST["ask_email_wp_greetings"]));
1228 + } else {
1229 + $ask_email_wp_greetings = '';
1230 + }
1231 + if (isset( $_POST["enable_asking_for_email"])) {
1232 + $enable_asking_for_email = sanitize_text_field(wp_unslash($_POST["enable_asking_for_email"]));
1233 + } else {
1234 + $enable_asking_for_email = '';
1235 + }
1236 + }
1097 1237 update_option('ask_email_wp_greetings', wp_unslash($ask_email_wp_greetings));
1238 + update_option('enable_asking_for_email', wp_unslash($enable_asking_for_email));
1098 1239 //Enable /disable wpwbot
1099 1240 if(isset( $_POST["disable_wp_chatbot"])){
1100 1241 $disable_wp_chatbot = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot"]));
1101 1242 }else{ $disable_wp_chatbot='';}
@@ -1142,9 +1283,21 @@
1142 1283 if(isset( $_POST["enable_wp_chatbot_rtl"])) {
1143 1284 $enable_wp_chatbot_rtl = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_rtl"]));
1144 1285 }else{ $enable_wp_chatbot_rtl='';}
1145 1286 update_option('enable_wp_chatbot_rtl', wp_unslash($enable_wp_chatbot_rtl));
1146 -
1287 +
1288 + if(isset( $_POST["chatbot_content_max_height"])) {
1289 + $chatbot_content_max_height = sanitize_text_field(wp_unslash($_POST["chatbot_content_max_height"]));
1290 + }else{ $chatbot_content_max_height='';}
1291 + update_option('chatbot_content_max_height', wp_unslash($chatbot_content_max_height));
1292 +
1293 +
1294 + if(isset( $_POST["chatbot_content_max_height_responsive"])) {
1295 + $chatbot_content_max_height_responsive = sanitize_text_field(wp_unslash($_POST["chatbot_content_max_height_responsive"]));
1296 + }else{ $chatbot_content_max_height_responsive='';}
1297 + update_option('chatbot_content_max_height_responsive', wp_unslash($chatbot_content_max_height_responsive));
1298 +
1299 +
1147 1300 if(isset( $_POST["show_menu_after_greetings"])) {
1148 1301 $show_menu_after_greetings = sanitize_text_field(wp_unslash($_POST["show_menu_after_greetings"]));
1149 1302 }else{ $show_menu_after_greetings='';}
1150 1303 update_option('show_menu_after_greetings', wp_unslash($show_menu_after_greetings));
@@ -1285,8 +1438,17 @@
1285 1438 update_option('wp_chatbot_icon', $wp_chatbot_icon);
1286 1439
1287 1440 $wp_chatbot_floatingiconbg_color = isset( $_POST['wp_chatbot_floatingiconbg_color'] ) ? sanitize_text_field(wp_unslash($_POST['wp_chatbot_floatingiconbg_color'])) : '#fff';
1288 1441 update_option('wp_chatbot_floatingiconbg_color', $wp_chatbot_floatingiconbg_color);
1442 +
1443 + // Custom icon video / YouTube link
1444 + $wp_chatbot_icon_youtube_url = isset( $_POST['wp_chatbot_icon_youtube_url'] ) ? esc_url_raw( $_POST['wp_chatbot_icon_youtube_url'] ) : '';
1445 + $wp_chatbot_icon_video_upload = isset( $_POST['wp_chatbot_icon_video'] ) ? esc_url_raw( $_POST['wp_chatbot_icon_video'] ) : '';
1446 + // YouTube URL takes priority; fall back to uploaded video
1447 + $wp_chatbot_icon_video = ( $wp_chatbot_icon_youtube_url !== '' ) ? $wp_chatbot_icon_youtube_url : $wp_chatbot_icon_video_upload;
1448 + update_option( 'wp_chatbot_icon_video', $wp_chatbot_icon_video );
1449 + $wp_chatbot_icon_video_delay = isset( $_POST['wp_chatbot_icon_video_delay'] ) ? absint( $_POST['wp_chatbot_icon_video_delay'] ) : 0;
1450 + update_option( 'wp_chatbot_icon_video_delay', $wp_chatbot_icon_video_delay );
1289 1451
1290 1452 // upload custom wpwbot icon path
1291 1453 $wp_chatbot_custom_icon_path = sanitize_text_field(wp_unslash($_POST['wp_chatbot_custom_icon_path']));
1292 1454 update_option('wp_chatbot_custom_icon_path', $wp_chatbot_custom_icon_path);
@@ -1323,9 +1485,9 @@
1323 1485
1324 1486 //To override style use custom css.
1325 1487 if(isset($_POST["wp_chatbot_custom_css"])){
1326 1488 $wp_chatbot_custom_css = wp_unslash($_POST["wp_chatbot_custom_css"]);
1327 - update_option('wp_chatbot_custom_css', sanitize_text_field($wp_chatbot_custom_css));
1489 + update_option('wp_chatbot_custom_css', sanitize_textarea_field($wp_chatbot_custom_css));
1328 1490 }
1329 1491
1330 1492 if (isset($_POST["qlcd_wp_chatbot_dialogflow_project_id"])) {
1331 1493 $qlcd_wp_chatbot_dialogflow_project_id = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_dialogflow_project_id"]));
@@ -2540,10 +2702,10 @@
2540 2702
2541 2703 $sqlqry = $wpdb->get_results($wpdb->prepare("select * from {$table1} where id = %d", 1)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
2542 2704 if(empty($sqlqry)){
2543 2705
2544 - $query = 'What are you?';
2545 - $response = 'I am an Automated ChatBot to answer your questions. This is a sample Simple Text Response that can be edited or deleted.';
2706 + $query = 'Sample Question ?';
2707 + $response = 'Sample Answer';
2546 2708
2547 2709 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
2548 2710 $format = array('%s','%s', '%s', '%s');
2549 2711 $wpdb->insert($table1,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, PluginCheck.Security.DirectDB.UnescapedDBParameter
@@ -2550,9 +2712,9 @@
2550 2712 }
2551 2713
2552 2714 $table = $wpdb->prefix . 'wpbot_subscription';
2553 2715 if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
2554 - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange
2716 + // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
2555 2717 $sql_sliders_Table = "
2556 2718 CREATE TABLE IF NOT EXISTS `$table` (
2557 2719 `id` int(11) NOT NULL AUTO_INCREMENT,
2558 2720 `name` varchar(256) NOT NULL,
@@ -2563,10 +2725,10 @@
2563 2725 `user_agent` text NOT NULL,
2564 2726 PRIMARY KEY (`id`)
2565 2727 ) $collate AUTO_INCREMENT=1 ";
2566 2728 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2567 - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange
2568 2729 dbDelta($sql_sliders_Table);
2730 + // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange
2569 2731 }
2570 2732
2571 2733 $url = get_site_url();
2572 2734 $url = wp_parse_url($url);
@@ -2998,12 +3160,12 @@
2998 3160 if(!get_option('qlcd_wp_chatbot_notifications')) {
2999 3161 update_option('qlcd_wp_chatbot_notifications', maybe_serialize(array('Welcome to WPBot')));
3000 3162 }
3001 3163 if(!get_option('support_query')) {
3002 - update_option('support_query', maybe_serialize(array('What is WPBot?')));
3164 + update_option('support_query', maybe_serialize(array('Sample Question?')));
3003 3165 }
3004 3166 if(!get_option('support_ans')) {
3005 - update_option('support_ans', maybe_serialize(array('WPBot is a stand alone Chat Bot with zero configuration or bot training required. This plug and play chatbot also does not require any 3rd party service integration like Facebook. This chat bot helps shoppers find the products they are looking for easily and increase store sales! WPBot is a must have plugin for trending conversational commerce or conversational shopping.')));
3167 + update_option('support_ans', maybe_serialize(array('Sample Answer')));
3006 3168 }
3007 3169 if(!get_option('qlcd_wp_chatbot_search_option')) {
3008 3170 update_option('qlcd_wp_chatbot_search_option', 'standard');
3009 3171 }
@@ -3190,9 +3352,10 @@
3190 3352 }
3191 3353 if(!get_option('enable_wp_chatbot_opening_hour')) {
3192 3354 update_option('wpwbot_hours', array());
3193 3355 }
3194 -
3356 + wpbot_free_set_content_height_defaults();
3357 +
3195 3358 if(!get_option('enable_wp_chatbot_dailogflow')) {
3196 3359 update_option('enable_wp_chatbot_dailogflow', '');
3197 3360 }
3198 3361 if(!get_option('qlcd_wp_chatbot_dialogflow_client_token')) {
@@ -3226,8 +3389,159 @@
3226 3389 * Reset Options will be insert as defualt data
3227 3390 */
3228 3391 add_action('wp_ajax_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
3229 3392 //add_action('wp_ajax_nopriv_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
3393 +
3394 +add_action('wp_ajax_qcld_save_ai_form', 'qcld_save_ai_form');
3395 +add_action('wp_ajax_nopriv_qcld_save_ai_form', 'qcld_save_ai_form');
3396 +
3397 +function qcld_save_ai_form() {
3398 + check_ajax_referer('wp_chatbot', 'nonce');
3399 + if (isset($_POST['data'])) {
3400 + $data_string = stripslashes($_POST['data']);
3401 + $json_data = json_decode($data_string, true);
3402 + if ($json_data && isset($json_data['form_title'])) {
3403 + $post_title = sanitize_text_field($json_data['form_title']) . ' - ' . current_time('mysql');
3404 + $post_id = wp_insert_post(array(
3405 + 'post_title' => $post_title,
3406 + 'post_type' => 'wpbot_form_entry',
3407 + 'post_status' => 'publish'
3408 + ));
3409 + if ($post_id && isset($json_data['data']) && is_array($json_data['data'])) {
3410 + $email_body = "<h2>" . esc_html__('New AI Action Submission', 'chatbot') . "</h2>";
3411 + $email_body .= "<p><strong>" . esc_html__('Action', 'chatbot') . ":</strong> " . sanitize_text_field($json_data['form_title']) . "</p>";
3412 + $email_body .= "<table border='1' cellpadding='10' cellspacing='0' style='border-collapse: collapse; width: 100%; max-width: 600px; font-family: sans-serif;'>";
3413 +
3414 + // Extract user's email for Reply-To (not From, to avoid SMTP rejection)
3415 + $reply_to = '';
3416 +
3417 + foreach ($json_data['data'] as $key => $value) {
3418 + update_post_meta($post_id, sanitize_text_field($key), sanitize_text_field($value));
3419 + $clean_key = ucwords(str_replace(array('-', '_'), ' ', sanitize_text_field($key)));
3420 + $email_body .= "<tr><td style='background: #f4f4f4; width: 40%;'><strong>" . esc_html($clean_key) . "</strong></td><td>" . esc_html(sanitize_text_field($value)) . "</td></tr>";
3421 +
3422 + // Extract email from value — handles plain, [bracketed], and combined answers
3423 + if (preg_match('/\[?([a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,})\]?/', $value, $email_match)) {
3424 + $candidate = sanitize_email(trim($email_match[1]));
3425 + if (is_email($candidate)) {
3426 + $reply_to = $candidate;
3427 + }
3428 + }
3429 + }
3430 + $email_body .= "</table>";
3431 +
3432 + $email_enabled = true; // Default to true if not found for backwards compatibility
3433 + $per_action_emails = '';
3434 + $saved_forms = get_option('wpbot_ai_forms', array());
3435 + $ai_form_title = strtolower( trim( sanitize_text_field( $json_data['form_title'] ) ) );
3436 + if (is_array($saved_forms)) {
3437 + foreach ($saved_forms as $form) {
3438 + if ( strtolower( trim( $form['title'] ) ) === $ai_form_title ) {
3439 + if (isset($form['email'])) {
3440 + $email_enabled = $form['email'] == 1;
3441 + }
3442 + $per_action_emails = isset($form['email_addresses']) ? trim($form['email_addresses']) : '';
3443 + break;
3444 + }
3445 + }
3446 + }
3447 +
3448 + if ($email_enabled) {
3449 + if (!empty($per_action_emails)) {
3450 + $to = array_map('trim', explode(',', $per_action_emails));
3451 + } else {
3452 + $default = get_option('qlcd_wp_chatbot_admin_email', '');
3453 + $to = !empty($default) ? array_map('trim', explode(',', $default)) : get_option('admin_email');
3454 + }
3455 + $subject = sanitize_text_field($json_data['form_title']) . " - " . esc_html__('New AI Action Submission', 'chatbot');
3456 + $headers = array('Content-Type: text/html; charset=UTF-8');
3457 + if (!empty($reply_to)) {
3458 + $headers[] = 'Reply-To: ' . $reply_to;
3459 + }
3460 + wp_mail($to, $subject, $email_body, $headers);
3461 + }
3462 +
3463 + wp_send_json_success('Saved successfully');
3464 + }
3465 + }
3466 + }
3467 + wp_send_json_error('Failed to save');
3468 +}
3469 +
3470 +add_action('wp_ajax_qcld_get_ai_form_entries', 'qcld_get_ai_form_entries');
3471 +function qcld_get_ai_form_entries() {
3472 + check_ajax_referer('wp_chatbot_ai_actions', 'nonce');
3473 + if (!current_user_can('manage_options')) {
3474 + wp_send_json_error('Unauthorized');
3475 + }
3476 + $form_title = isset($_POST['form_title']) ? sanitize_text_field($_POST['form_title']) : '';
3477 + if (empty($form_title)) {
3478 + wp_send_json_error('No title provided');
3479 + }
3480 +
3481 + global $wpdb;
3482 + $title_prefix = $form_title . ' - ';
3483 + $where_filter = function ( $where ) use ( $wpdb, $title_prefix ) {
3484 + $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_title LIKE %s", $wpdb->esc_like( $title_prefix ) . '%' );
3485 + return $where;
3486 + };
3487 + add_filter( 'posts_where', $where_filter );
3488 + $query = new WP_Query( array(
3489 + 'post_type' => 'wpbot_form_entry',
3490 + 'post_status' => 'publish',
3491 + 'posts_per_page' => -1,
3492 + ) );
3493 + remove_filter( 'posts_where', $where_filter );
3494 +
3495 + ob_start();
3496 + if ($query->have_posts()) {
3497 + echo '<table class="wp-list-table widefat fixed striped" style="width: 100%; text-align: left;">';
3498 + echo '<thead><tr><th>Entry</th><th>Data</th><th>Date</th><th>Action</th></tr></thead>';
3499 + echo '<tbody>';
3500 + while ($query->have_posts()) {
3501 + $query->the_post();
3502 + $meta = get_post_meta(get_the_ID());
3503 + echo '<tr>';
3504 + echo '<td><strong>' . esc_html( get_the_title() ) . '</strong></td>';
3505 + echo '<td>';
3506 + foreach ($meta as $key => $values) {
3507 + if (strpos($key, '_') !== 0) { // skip hidden meta
3508 + echo '<strong>' . esc_html($key) . ':</strong> ' . esc_html($values[0]) . '<br>';
3509 + }
3510 + }
3511 + echo '</td>';
3512 + echo '<td>' . esc_html( get_the_date() ) . ' ' . esc_html( get_the_time() ) . '</td>';
3513 + echo '<td><button type="button" class="button qcld-delete-ai-entry" data-id="' . esc_attr(get_the_ID()) . '" style="color: #a00; border-color: #a00;">Delete</button></td>';
3514 + echo '</tr>';
3515 + }
3516 + echo '</tbody></table>';
3517 + wp_reset_postdata();
3518 + } else {
3519 + echo '<p>No entries found for this form.</p>';
3520 + }
3521 + $html = ob_get_clean();
3522 + wp_send_json_success(array('html' => $html));
3523 +}
3524 +
3525 +add_action('wp_ajax_qcld_delete_ai_form_entry', 'qcld_delete_ai_form_entry');
3526 +function qcld_delete_ai_form_entry() {
3527 + check_ajax_referer('wp_chatbot_ai_actions', 'nonce');
3528 + if (!current_user_can('manage_options')) {
3529 + wp_send_json_error('Unauthorized');
3530 + }
3531 +
3532 + $entry_id = isset($_POST['entry_id']) ? intval($_POST['entry_id']) : 0;
3533 + if (empty($entry_id)) {
3534 + wp_send_json_error('No entry ID provided');
3535 + }
3536 +
3537 + if (get_post_type($entry_id) === 'wpbot_form_entry') {
3538 + wp_delete_post($entry_id, true);
3539 + wp_send_json_success('Entry deleted successfully');
3540 + } else {
3541 + wp_send_json_error('Invalid entry');
3542 + }
3543 +}
3230 3544 //Jarvis all option will be delete during uninstlling.
3231 3545 if( !function_exists('qcld_wb_chatboot_delete_all_options') ){
3232 3546 function qcld_wb_chatboot_delete_all_options(){
3233 3547
@@ -3475,8 +3789,22 @@
3475 3789 wp_send_json($html);
3476 3790 }
3477 3791 }
3478 3792
3793 +if( !function_exists('wpbot_free_set_content_height_defaults') ){
3794 + function wpbot_free_set_content_height_defaults() {
3795 + $chatbot_content_max_height = get_option( 'chatbot_content_max_height', false );
3796 + if ( $chatbot_content_max_height === false || $chatbot_content_max_height === '' ) {
3797 + update_option( 'chatbot_content_max_height', '80' );
3798 + }
3799 +
3800 + $chatbot_content_max_height_responsive = get_option( 'chatbot_content_max_height_responsive', false );
3801 + if ( $chatbot_content_max_height_responsive === false || $chatbot_content_max_height_responsive === '' ) {
3802 + update_option( 'chatbot_content_max_height_responsive', '90' );
3803 + }
3804 + }
3805 +}
3806 +
3479 3807 if( !function_exists('wpbot_free_qc_upgrade_completed') ){
3480 3808 function wpbot_free_qc_upgrade_completed( $upgrader_object, $options ) {
3481 3809 // The path to our plugin's main file
3482 3810 $our_plugin = plugin_basename( __FILE__ );
@@ -3485,8 +3813,9 @@
3485 3813 // Iterate through the plugins being updated and check if ours is there
3486 3814 foreach( $options['plugins'] as $plugin ) {
3487 3815 if( $plugin == $our_plugin ) {
3488 3816 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
3817 + wpbot_free_set_content_height_defaults();
3489 3818 }
3490 3819 }
3491 3820 }
3492 3821 update_option( 'qcld_openai_relevant_post', ['post','page'] );
@@ -3508,9 +3837,17 @@
3508 3837 // require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."qcld-openai-bot.php");
3509 3838
3510 3839 }
3511 3840 }
3841 +if( !function_exists('wpbot_Ai_actions_func') ){
3842 + function wpbot_Ai_actions_func (){
3512 3843
3844 + require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/admin/templates/ai-actions.php");
3845 + // require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."qcld-openai-bot.php");
3846 +
3847 +}
3848 +}
3849 +
3513 3850 /**
3514 3851 *
3515 3852 * Function to load translation files.
3516 3853 *
@@ -3524,9 +3861,9 @@
3524 3861 add_action( 'plugins_loaded', 'wp_chatbot_lang_init');
3525 3862
3526 3863 $wpbot_feedback = new Qcld_Wp_Usage_Feedback(
3527 3864 __FILE__,
3528 - '[email protected]',
3865 + '[email protected]',
3529 3866 false,
3530 3867 true
3531 3868
3532 3869 );
@@ -3538,9 +3875,9 @@
3538 3875
3539 3876 <div class="wrap qcld-main-wrapper">
3540 3877 <div class="qcld-wp-chatbot-wrap-header">
3541 3878
3542 - <div class="qcld-wp-chatbot-wrap-header-logo"><a href="#" class="qcld-wp-chatbot-wrap-site__logo"><img style="width:100%" src="<?php echo esc_url( QCLD_wpCHATBOT_IMG_URL . '/chatbot.png' ); ?>" alt="Dialogflow CX"> WPBot Control Panel </a>
3879 + <div class="qcld-wp-chatbot-wrap-header-logo"><a href="#" class="qcld-wp-chatbot-wrap-site__logo"><img src="<?php echo esc_url( QCLD_wpCHATBOT_IMG_URL . '/chatbot.png' ); ?>" alt="Dialogflow CX"> WPBot Control Panel </a>
3543 3880 <p><strong>Core Version:</strong> v<?php echo esc_html( QCLD_wpCHATBOT_VERSION ); ?></p>
3544 3881 </div>
3545 3882 <ul class="qcld-wp-chatbot-wrap-version-wrapper">
3546 3883 <li>
@@ -3579,16 +3916,16 @@
3579 3916 </div>
3580 3917 <div class="panel panel-default">
3581 3918 <div class="panel-heading" role="tab" id="headingSix">
3582 3919 <h4 class="panel-title">
3583 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="false" aria-controls="collapseSix"> <?php esc_html_e('Start Menu', 'chatbot'); ?> </a>
3920 + <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="false" aria-controls="collapseSix"> <?php esc_html_e('Action Start Menu', 'chatbot'); ?> </a>
3584 3921 </h4>
3585 3922 </div>
3586 3923 <div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix">
3587 3924 <div class="panel-body">
3588 - <?php echo esc_html_e('While using a ChatBot, users can get lost or not know how to Interact with the Bot. That is why we have a Start menu to always give the user', 'chatbot'); ?> <b><?php echo esc_html_e('options to do more', 'chatbot'); ?></b>. <?php echo esc_html_e('From ChatBot->Settings->Start Menu you can drag Available Menu Items (Intents) to the Active Menu Items area.', 'chatbot'); ?></br></br>
3589 - <?php echo esc_html_e('Besides the built-in Intents, you can also create custom Intents for your Start Menu using', 'chatbot'); ?> <b><?php echo esc_html_e('Simple Text Responses', 'chatbot'); ?></b> and <b><?php echo esc_html_e('Conversational form builder', 'chatbot'); ?></b>. <?php echo esc_html_e('You can create almost any kind of response with the combinations of the two.', 'chatbot'); ?></br></br>
3590 - <?php echo esc_html_e('We recommend enabling', 'chatbot'); ?><b><?php echo esc_html_e(' Show Start Menu After Greetings ', 'chatbot'); ?></b><?php echo esc_html_e('from ChatBot Pro->Settings->General settings.', 'chatbot'); ?>
3925 + <?php echo esc_html_e('While using a ChatBot, users can get lost or not know how to Interact with the Bot. That is why we have a Action Start Menu to always give the user', 'chatbot'); ?> <b><?php echo esc_html_e('options to do more', 'chatbot'); ?></b>. <?php echo esc_html_e('From ChatBot->Settings->Action Start Menu you can drag Available Menu Items (Intents) to the Active Menu Items area.', 'chatbot'); ?></br></br>
3926 + <?php echo esc_html_e('Besides the built-in Intents, you can also create custom Intents for your Action Start Menu using', 'chatbot'); ?> <b><?php echo esc_html_e('Simple Text Responses', 'chatbot'); ?></b> and <b><?php echo esc_html_e('Conversational form builder', 'chatbot'); ?></b>. <?php echo esc_html_e('You can create almost any kind of response with the combinations of the two.', 'chatbot'); ?></br></br>
3927 + <?php echo esc_html_e('We recommend enabling', 'chatbot'); ?><b><?php echo esc_html_e(' Show Action Start Menu After Greetings ', 'chatbot'); ?></b><?php echo esc_html_e('from ChatBot Pro->Settings->General settings.', 'chatbot'); ?>
3591 3928 </div>
3592 3929 </div>
3593 3930 </div>
3594 3931 <div class="panel panel-default">
@@ -3598,9 +3935,9 @@
3598 3935 </h4>
3599 3936 </div>
3600 3937 <div id="collapseSeven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSeven">
3601 3938 <div class="panel-body">
3602 - <?php echo esc_html_e('Head over to ChatBot Pro->Settings->General and make sure to Enable the Floating Icon. As soon as you do that, the ChatBot can start working for your users. Make sure to drag some items to the Active Menu area under the Start Menu.', 'chatbot'); ?></br></br>
3939 + <?php echo esc_html_e('Head over to ChatBot Pro->Settings->General and make sure to Enable the Floating Icon. As soon as you do that, the ChatBot can start working for your users. Make sure to drag some items to the Active Menu area under the Action Start Menu.', 'chatbot'); ?></br></br>
3603 3940 <?php echo esc_html_e('The ChatBot settings area is full of options. Do not be intimidated by that. You do not need to use all the options – just what you need. Head over to the Settings->', 'chatbot'); ?><b><?php echo esc_html_e('Icons and Themes', 'chatbot'); ?></b> <?php echo esc_html_e('for options to customize your ChatBot. You will also find options to embed the ChatBot on a page, click to chat, FAQ builder etc. under the Setting options.', 'chatbot'); ?>
3604 3941 </div>
3605 3942 </div>
3606 3943 </div>
@@ -3720,9 +4057,9 @@
3720 4057 <div class="to-icon-txt fa-4x-txt ">
3721 4058 <h3>
3722 4059 <span>// </span><?php esc_html_e('Send eMail, Call Me Back &amp; Feedback Collection', 'chatbot'); ?>
3723 4060 </h3>
3724 - <p><?php esc_html_e('Users can send a email to the site admin directly from the Chat window for customer support. The Call Me Back feature lets you get call requests from your customers which will be emailed to you. You can also use WPBot to collect Feedback from your customers regarding anything! You can disable/enable these features from the Start Menu.', 'chatbot'); ?></p>
4061 + <p><?php esc_html_e('Users can send a email to the site admin directly from the Chat window for customer support. The Call Me Back feature lets you get call requests from your customers which will be emailed to you. You can also use WPBot to collect Feedback from your customers regarding anything! You can disable/enable these features from the Action Start Menu.', 'chatbot'); ?></p>
3725 4062 </div>
3726 4063 </div>
3727 4064 <div class="to-icon-box left txt-left">
3728 4065 <div class="to-icon-txt fa-4x-txt ">
@@ -3776,14 +4113,14 @@
3776 4113 </h4>
3777 4114 </div>
3778 4115 <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
3779 4116 <div class="panel-body">
3780 - <p><?php esc_html_e('Extend the Start Menu with the', 'chatbot'); ?> <strong><?php esc_html_e('powerful Conversational Forms', 'chatbot'); ?></strong>&nbsp;<?php esc_html_e(' Addon for WPBot. It extends WPBot’s functionality and adds the ability to create', 'chatbot'); ?> <strong><?php esc_html_e('conditional conversations', 'chatbot'); ?></strong> <?php esc_html_e('and/or', 'chatbot'); ?> <strong><?php esc_html_e('forms', 'chatbot'); ?></strong> <?php esc_html_e('for the WPBot. It is a visual,', 'chatbot'); ?> <strong><?php esc_html_e('drag and drop', 'chatbot'); ?></strong><?php esc_html_e(' form builder that is easy to use and very flexible. Supports conditional logic and use of variables to build all types of forms or just', 'chatbot'); ?> <strong><?php esc_html_e('menu driven', 'chatbot'); ?></strong>
4117 + <p><?php esc_html_e('Extend the Action Start Menu with the', 'chatbot'); ?> <strong><?php esc_html_e('powerful Conversational Forms', 'chatbot'); ?></strong>&nbsp;<?php esc_html_e(' Addon for WPBot. It extends WPBot’s functionality and adds the ability to create', 'chatbot'); ?> <strong><?php esc_html_e('conditional conversations', 'chatbot'); ?></strong> <?php esc_html_e('and/or', 'chatbot'); ?> <strong><?php esc_html_e('forms', 'chatbot'); ?></strong> <?php esc_html_e('for the WPBot. It is a visual,', 'chatbot'); ?> <strong><?php esc_html_e('drag and drop', 'chatbot'); ?></strong><?php esc_html_e(' form builder that is easy to use and very flexible. Supports conditional logic and use of variables to build all types of forms or just', 'chatbot'); ?> <strong><?php esc_html_e('menu driven', 'chatbot'); ?></strong>
3781 4118 <strong><?php esc_html_e('conversations', 'chatbot'); ?> </strong><?php esc_html_e('with if else logic', 'chatbot'); ?> <strong>. </strong><?php esc_html_e('Conversations or forms can be', 'chatbot'); ?> <strong><?php esc_html_e('eMailed', 'chatbot'); ?></strong> <?php esc_html_e('to you and', 'chatbot'); ?> <strong><?php esc_html_e('saved in the database', 'chatbot'); ?></strong>.
3782 4119 </p>
3783 4120 <h4><?php esc_html_e('Conversational Form Builder Free or Pro version works with the WPBot Free or Pro versions.', 'chatbot'); ?></h4>
3784 4121 <a class="FormBuilder" href="https://wordpress.org/plugins/conversational-forms/" target="_blank"><?php esc_html_e('Download Free Version', 'chatbot'); ?></a>
3785 - <a class="FormBuilder" href="https://www.quantumcloud.com/products/conversations-and-form-builder/" target="_blank"><?php esc_html_e('Grab the Pro version', 'chatbot'); ?></a>
4122 + <a class="FormBuilder" href="https://www.quantumcloud.net/products/conversations-and-form-builder/" target="_blank"><?php esc_html_e('Grab the Pro version', 'chatbot'); ?></a>
3786 4123 <h4><?php esc_html_e('What Can You Do with it?', 'chatbot'); ?></h4>
3787 4124 <p><?php esc_html_e('Conversation Forms allows you to create a wide variety of forms, that might include:', 'chatbot'); ?></p>
3788 4125 <ul>
3789 4126 <li><?php esc_html_e('Create menu or button driven conversations', 'chatbot'); ?></li>
@@ -4044,9 +4381,9 @@
4044 4381 </h4>
4045 4382 </div>
4046 4383 <div id="faqcollapsetwelve" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqtwelve">
4047 4384 <div class="panel-body">
4048 - <?php echo esc_html_e('You can disable predefined intents FAQ, eMail, Call me from WPBot Lite > Settings page`s Start Menu Section.', 'chatbot'); ?>
4385 + <?php echo esc_html_e('You can disable predefined intents FAQ, eMail, Call me from WPBot Lite > Settings page`s Action Start Menu Section.', 'chatbot'); ?>
4049 4386 </div>
4050 4387 </div>
4051 4388 </div>
4052 4389
@@ -4144,10 +4481,10 @@
4144 4481
4145 4482 $sqlqry = $wpdb->get_results( $wpdb->prepare( "select * from {$table1} where id = %d", 1 ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
4146 4483 if(empty($sqlqry)){
4147 4484
4148 - $query = 'What are you?';
4149 - $response = 'I am an Automated ChatBot to answer your questions. This is a sample Simple Text Response that can be edited or deleted.';
4485 + $query = 'Sample Question?';
4486 + $response = 'Sample Answer';
4150 4487
4151 4488 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
4152 4489 $format = array('%s','%s', '%s', '%s');
4153 4490 $wpdb->insert($table1,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, PluginCheck.Security.DirectDB.UnescapedDBParameter
@@ -4329,6 +4666,4 @@
4329 4666 }
4330 4667 }
4331 4668 }
4332 4669 }
4333 -
4334 -