PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 7.4.4
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v7.4.4
8.8.4 8.8.3 8.8.2 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 All 540 releases
← All changes | qcld-wpwbot.php +412 -712 8.6.2 → 7.4.4 View file →
@@ -1,18 +1,18 @@
1 1 <?php
2 2 /**
3 3 * Plugin Name: AI ChatBot - WPBot
4 - * Plugin URI: https://www.wpbot.pro/
4 + * Plugin URI: https://wordpress.org/plugins/chatbot/
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.2
7 + * Version: 7.4.4
8 8 * @author QuantumCloud
9 9 * Author: ChatBot for WordPress - WPBot
10 10 * Author URI: https://www.wpbot.pro/
11 11 * Requires at least: 4.6
12 - * Tested up to: 7.0
13 - * Text Domain: chatbot
14 - * Domain Path: /languages
12 + * Tested up to: 6.8
13 + * Text Domain: wpbot
14 + * Domain Path: /lang
15 15 * License: GPL2
16 16 */
17 17
18 18
@@ -18,40 +18,31 @@
18 18
19 19
20 20 if (!defined('ABSPATH')) exit; // Exit if accessed directly.
21 21
22 +add_action( 'plugins_loaded', 'qcld_chatbot_existing_plugin_activate_check_callback' );
23 +if( !function_exists('qcld_chatbot_existing_plugin_activate_check_callback') ){
24 + function qcld_chatbot_existing_plugin_activate_check_callback(){
22 25
26 + $check_existing_plugin = get_option('qcld_chatbot_existing_plugin_activate_check');
23 27
24 -// Abort execution if Pro version is active to prevent conflicts
25 -if ( ! function_exists( 'is_plugin_active' ) ) {
26 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
27 -}
28 28
29 -$active_plugins = (array) get_option( 'active_plugins', array() );
30 -if ( is_multisite() ) {
31 - $active_plugins = array_merge( $active_plugins, array_keys( (array) get_site_option( 'active_sitewide_plugins', array() ) ) );
32 -}
33 -
34 -$current_plugin = plugin_basename( __FILE__ );
35 -
36 -foreach ( $active_plugins as $plugin ) {
37 - if ( $plugin !== $current_plugin && basename( $plugin ) === 'qcld-wpwbot.php' ) {
38 - return;
29 + if ( class_exists( 'qcld_wb_Chatbot' ) && isset($check_existing_plugin) && ($check_existing_plugin !== 'yes') ) {
30 + update_option('qcld_chatbot_existing_plugin_activate_check', 'yes');
31 + }else if ( ! class_exists( 'qcld_wb_Chatbot' ) ) {
32 + delete_option('qcld_chatbot_existing_plugin_activate_check');
33 + }
34 +
39 35 }
40 36 }
41 37
42 -// Also abort if we are currently activating the Pro plugin
43 -if ( isset($_REQUEST['action']) ) {
44 - if ( $_REQUEST['action'] == 'activate' && isset($_REQUEST['plugin']) && ( ( strpos($_REQUEST['plugin'], 'wpbot-pro-master') !== false ) || ( strpos($_REQUEST['plugin'], 'wpbot-pro-professional') !== false ) || ( strpos($_REQUEST['plugin'], 'wpbot-pro-professional') !== false ) || ( strpos($_REQUEST['plugin'], 'wpbot-pro-starter') !== false ) ) ) {
45 - return;
46 - }
47 - if ( $_REQUEST['action'] == 'activate-selected' && isset($_POST['checked']) && ( in_array('wpbot-pro-master/qcld-wpwbot.php', $_POST['checked']) || in_array('wpbot-pro-professional/qcld-wpwbot.php', $_POST['checked']) || in_array('wpbot-pro-starter/qcld-wpwbot.php', $_POST['checked']) ) ) {
48 - return;
49 - }
38 +$check_existing_plugin = get_option('qcld_chatbot_existing_plugin_activate_check');
39 +if ( isset($check_existing_plugin) && ($check_existing_plugin == 'yes') || class_exists( 'qcld_wb_Chatbot' ) ) {
40 + return;
50 41 }
51 42
52 43 if ( ! defined( 'QCLD_wpCHATBOT_VERSION' ) ) {
53 - define('QCLD_wpCHATBOT_VERSION', '8.6.2');
44 + define('QCLD_wpCHATBOT_VERSION', '7.4.4');
54 45 }
55 46 if ( ! defined( 'QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION' ) ) {
56 47 define('QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION', 2.2);
57 48 }
@@ -84,13 +75,11 @@
84 75 define('QCLD_wpCHATBOT_GC_ROOT', $wpcontentpath);
85 76 }
86 77
87 78 require_once("qcld-wpwbot-search.php");
88 -require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/class-qcld-bot-rag.php");
89 79 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openai/qcld-bot-openai.php");
90 80 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openrouter/qcld-bot-openrouter.php");
91 81 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/gemini/qcld-bot-gemini.php");
92 -require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/grok/qcld-bot-grok.php");
93 82 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."class-qc-free-plugin-upgrade-notice.php");
94 83 require_once("class-plugin-deactivate-feedback.php");
95 84 require_once("qc-support-promo-page/class-qc-support-promo-page.php");
96 85 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."/functions.php");
@@ -95,9 +84,8 @@
95 84 require_once("qc-support-promo-page/class-qc-support-promo-page.php");
96 85 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."/functions.php");
97 86 require_once('qcld_df_api.php');
98 87 require_once('includes/class-wpbot-gc-download.php');
99 -require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/class-common-function.php");
100 88 require_once('includes/class-response-list.php');
101 89 require_once('qc-rating-feature/qc-rating-class.php');
102 90 // if ( is_admin() ) {
103 91 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/parsedown.php' );
@@ -104,12 +92,8 @@
104 92 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/qcld-floating-openai-style-filter.php' );
105 93 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/qcld_openai_floating_content.php' );
106 94 // }
107 95
108 -// Built-in Chat Sessions & Analytics module.
109 -// Defers to the Pro addon automatically when it's active.
110 -require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/chat-sessions/wpbot-chat-sessions.php' );
111 -
112 96 /**
113 97 * Main Class.
114 98 */
115 99
@@ -136,9 +120,9 @@
136 120 * Construct empty on purpose
137 121 */
138 122 private function __construct()
139 123 {
140 - $this->promotion = QCLD_wpCHATBOT_IMG_URL . "/NY-26-wpbot.jpg";
124 + $this->promotion = QCLD_wpCHATBOT_IMG_URL . "/halloween25-wpbot.jpg";
141 125 }
142 126 /**
143 127 * Init behaves like, and replaces, construct
144 128 */
@@ -154,12 +138,15 @@
154 138 if ((!empty($_GET["page"])) && ($_GET["page"] == "wpbot")) {
155 139 add_action('admin_init', array($this, 'qcld_wb_chatbot_save_options'));
156 140
157 141 }
158 -
142 + add_action('admin_enqueue_scripts', function() {
143 + wp_register_style('qlcd-str-wp-chatbot-font-awesome', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/font-awesome.min.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
144 + wp_enqueue_style('qlcd-str-wp-chatbot-font-awesome');
145 + });
159 146 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') ){
160 - // add_action( 'admin_notices', array( $this, 'promotion_notice' ) );
161 -
147 +
148 + // add_action( 'admin_notices', array( $this, 'promotion_notice' ) );
162 149 }
163 150
164 151 if (is_admin() && !empty($_GET["page"]) && ($_GET["page"] == "wpbot") || (!empty($_GET['page']) && $_GET['page']=='wpbot_help_page')
165 152
@@ -244,28 +231,22 @@
244 231 __('wpwBot Pro', 'chatbot'),
245 232 'manage_wpcommerce',
246 233 $this->id,
247 234 array($this, 'qcld_wb_chatbot_admin_page'));*/
248 - if( get_option( 'qc_bot_str_allow_author_editor' ) == 1 ){
249 - $capability = 'publish_posts';
250 - }else{
251 - $capability = 'manage_options';
252 - }
253 - 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 );
235 +
236 + add_menu_page( esc_html('ChatBot WPBot Lite'), esc_html('ChatBot WPBot Lite'), 'manage_options','wpbot-panel', array($this, 'qcld_wb_chatbot_admin_page'),'dashicons-format-status', 6 );
254 237
255 238 add_submenu_page( 'wpbot-panel', esc_html('Settings'), esc_html('Settings'), 'manage_options','wpbot', array($this, 'qcld_wb_chatbot_admin_page_settings') );
256 239
257 - add_submenu_page( 'wpbot-panel', esc_html('User Data'), esc_html('User Data'), 'manage_options','email-subscription', array($this, 'qcld_wb_chatbot_admin_page1') );
240 + add_submenu_page( 'wpbot-panel', esc_html('OpenAI Settings'), esc_html('AI Settings'), 'manage_options','wpbot_openAi', 'wpbot_openAi_setting_func' );
258 241
259 - add_submenu_page( 'wpbot-panel', esc_html('AI Settings'), esc_html('AI Settings'), 'manage_options','wpbot_openAi', 'wpbot_openAi_setting_func' );
242 + $hook = add_submenu_page( 'wpbot-panel', esc_html('Simple Text Responses'), esc_html('Simple Text Responses'), 'manage_options','simple-text-response', array($this, 'qcld_wb_chatbot_admin_str') );
260 243
261 - $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') );
262 -
263 244 add_action( "load-$hook", [ $this, 'screen_option' ] );
264 245
265 246 // add_submenu_page( 'wpbot-panel', esc_html('Conversational Form '), esc_html('Conversational Form'), 'manage_options','wpbots', [$this, 'qcld_wb_chatbot_admin_conversational_settings'] );
266 247
267 - 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' );
248 + add_submenu_page( 'wpbot-panel', esc_html('Support'), esc_html('Support'), 'manage_options','wpbot_support_page', 'qcpromo_wpbot_free_support_page_callback_func' );
268 249
269 250 add_submenu_page( 'wpbot-panel', esc_html('Help and Debugging'), esc_html('Help and Debugging'), 'manage_options','wpbot_help_page', 'wpbot_help_page_callback_func' );
270 251
271 252
@@ -311,8 +292,11 @@
311 292 //wp_enqueue_style('wpcommerce_admin_styles', $wpcommerce->plugin_url() . '/assets/css/admin.css');
312 293
313 294 wp_register_style('qlcd-wp-chatbot-admin-style', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/admin-style.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
314 295 wp_enqueue_style('qlcd-wp-chatbot-admin-style');
296 +
297 + wp_register_style('qlcd-wp-chatbot-font-awesome', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/font-awesome.min.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
298 + wp_enqueue_style('qlcd-wp-chatbot-font-awesome');
315 299 wp_register_style('qlcd-wp-chatbot-tabs-style', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/wp-chatbot-tabs.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
316 300 wp_enqueue_style('qlcd-wp-chatbot-tabs-style');
317 301 wp_register_style('jquery.fontpicker.min.css', QCLD_wpCHATBOT_PLUGIN_URL . 'css/fontpicker.min.css', '', QCLD_wpCHATBOT_VERSION, 'screen');
318 302 wp_enqueue_style('jquery.fontpicker.min.css');
@@ -354,9 +338,9 @@
354 338 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');
355 339 wp_enqueue_style('qcld-wp-chatbot-timepicker-css');
356 340 wp_register_script('qcld-wp-chatbot-sweetalrt', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/sweetalrt.js', basename(__FILE__)), array(), true);
357 341 wp_enqueue_script('qcld-wp-chatbot-sweetalrt');
358 - 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);
342 + 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','wp-color-picker','qcld-wp-chatbot-timepicker-js'), '10.9.9', true);
359 343 wp_enqueue_script('qcld-wp-chatbot-admin-js');
360 344 wp_localize_script('qcld-wp-chatbot-admin-js', 'qcld_gemini_admin_data',
361 345 array('ajax_url' => admin_url('admin-ajax.php'),'ajax_nonce' => wp_create_nonce('wp_chatbot'),'image_path' => QCLD_wpCHATBOT_IMG_URL));
362 346 // WordPress Media library
@@ -372,9 +356,9 @@
372 356 public function qcld_get_formbuilder_forms(){
373 357 global $wpdb;
374 358 $forms = array();
375 359 if(class_exists('Qcformbuilder_Forms_Admin')){
376 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
360 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
377 361 if(!empty($results)){
378 362 foreach($results as $result){
379 363 $form = maybe_unserialize($result->config);
380 364 $forms[] = trim($form['name']);
@@ -386,15 +370,12 @@
386 370 }else{
387 371 return array();
388 372 }
389 373 }
390 - public function qcld_wb_chatbot_admin_page1() {
391 - require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/admin/templates/email_subscription.php';
392 - }
393 374 public function qcld_wpbot_simple_response_intent(){
394 375 global $wpdb;
395 376 $table = $wpdb->prefix.'wpbot_response';
396 - $results = $wpdb->get_results("SELECT `intent` FROM `{$table}` WHERE 1 and `intent` !=''"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
377 + $results = $wpdb->get_results("SELECT `intent` FROM `$table` WHERE 1 and `intent` !=''"); //DB Call OK, No Caching OK
397 378 $response = array();
398 379 if(!empty($results)){
399 380 foreach($results as $result){
400 381 $response[] = $result->intent;
@@ -406,9 +387,9 @@
406 387 global $wpdb;
407 388 $command = array();
408 389 if(class_exists('Qcformbuilder_Forms_Admin')){
409 390 $primary = 'primary';
410 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type = %s", $primary)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
391 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type = %s", $primary)); //DB Call OK, No Caching OK
411 392
412 393 if(!empty($results)){
413 394 foreach($results as $result){
414 395 $form = maybe_unserialize($result->config);
@@ -427,11 +408,12 @@
427 408 }
428 409 }
429 410 public function promotion_notice(){
430 411 $screen = get_current_screen();
412 + // var_dump($screen->base );
431 413 // if( isset($screen->base) && (( $screen->base == 'wpbot-lite_page_wpbot') || ( $screen->base == 'toplevel_page_wpbot-panel"'))){
432 414 ?>
433 - <div id="promotion-wpchatbot" data-dismiss-type="qcbot-feedback-notice" class="notice is-dismissible qcbot-feedback" style="background: #120976 !important">
415 + <div id="promotion-wpchatbot" data-dismiss-type="qcbot-feedback-notice" class="notice is-dismissible qcbot-feedback" style="background: #5c62b6 !important">
434 416 <div class="">
435 417
436 418 <div class="qc-review-text" >
437 419 <a href="<?php echo esc_url('https://www.wpbot.pro/pricing/'); ?>" target="_blank">
@@ -445,9 +427,9 @@
445 427 public function qcld_get_formbuilder_form_ids(){
446 428 global $wpdb;
447 429 $forms = array();
448 430 if(class_exists('Qcformbuilder_Forms_Admin')){
449 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
431 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
450 432
451 433 if(!empty($results)){
452 434 foreach($results as $result){
453 435 $form = maybe_unserialize($result->config);
@@ -481,13 +463,13 @@
481 463 $conversation_form_ids = array();
482 464 $conversation_form_names = array();
483 465
484 466 if(class_exists('Qcformbuilder_Forms_Admin')){
485 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
467 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
486 468 if(!empty($results)){
487 469
488 470 foreach($results as $result){
489 - $form = maybe_unserialize($result->config);
471 + $form = unserialize($result->config);
490 472 $conversation_form_ids[] = $form['ID'];
491 473 $conversation_form_names[] = $form['name'];
492 474 }
493 475
@@ -492,8 +474,10 @@
492 474 }
493 475
494 476 }
495 477 }
478 +
479 + // var_dump( str_replace('<', '',esc_html(get_option('qlcd_wp_chatbot_agent'))));wp_die();
496 480 $wp_chatbot_obj = array(
497 481 'wp_chatbot_position_x' => get_option('wp_chatbot_position_x'),
498 482 'wp_chatbot_position_y' => get_option('wp_chatbot_position_y'),
499 483 'disable_icon_animation' => get_option('disable_wp_chatbot_icon_animation'),
@@ -509,31 +493,31 @@
509 493 'yes' => str_replace('\\', '',get_option('qlcd_wp_chatbot_yes')),
510 494 'no' => str_replace('\\', '',get_option('qlcd_wp_chatbot_no')),
511 495 'or' => str_replace('\\', '',get_option('qlcd_wp_chatbot_or')),
512 496 'host' => str_replace('\\', '',get_option('qlcd_wp_chatbot_host')),
513 - 'agent' => str_replace(['\\','<','>'], '',esc_html(is_array(maybe_unserialize(get_option('qlcd_wp_chatbot_agent'))) ? current(maybe_unserialize(get_option('qlcd_wp_chatbot_agent'))) : get_option('qlcd_wp_chatbot_agent'))),
497 + 'agent' => str_replace(['\\','<','>'], '',esc_html(get_option('qlcd_wp_chatbot_agent'))),
514 498 'agent_image' => get_option('wp_chatbot_agent_image'),
515 - 'agent_image_path' => esc_url((!empty(get_option('wp_chatbot_custom_icon_path')) && !is_404(get_option('wp_chatbot_custom_icon_path'))) ? $this->qcld_wb_chatbot_agent_icon() : QCLD_wpCHATBOT_IMG_URL . 'icon-1.png'),
516 - 'shopper_demo_name' => str_replace('\\', '', is_array(maybe_unserialize(get_option('qlcd_wp_chatbot_shopper_demo_name'))) ? current(maybe_unserialize(get_option('qlcd_wp_chatbot_shopper_demo_name'))) : get_option('qlcd_wp_chatbot_shopper_demo_name')),
517 - 'agent_join' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_agent_join'))),
518 - 'welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_welcome'))),
519 - 'welcome_back' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_welcome_back'))),
520 - 'hi_there' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_hi_there'))),
499 + 'agent_image_path' => (!empty(get_option('wp_chatbot_custom_icon_path')) && !is_404(get_option('wp_chatbot_custom_icon_path'))) ? $this->qcld_wb_chatbot_agent_icon() : QCLD_wpCHATBOT_IMG_URL . 'icon-1.png',
500 + 'shopper_demo_name' => str_replace('\\', '',get_option('qlcd_wp_chatbot_shopper_demo_name')),
501 + 'agent_join' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_agent_join'))),
502 + 'welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome'))),
503 + 'welcome_back' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome_back'))),
504 + 'hi_there' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_hi_there'))),
521 505 'hello' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_hello'))),
522 - 'asking_name' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_asking_name'))),
523 - 'i_am' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_i_am'))),
524 - 'name_greeting' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_name_greeting'))),
525 - 'wildcard_msg' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_wildcard_msg'))),
526 - 'empty_filter_msg' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_empty_filter_msg'))),
527 - 'did_you_mean' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_did_you_mean'))),
528 - 'is_typing' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_is_typing'))),
529 - 'send_a_msg' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_send_a_msg'))),
506 + 'asking_name' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_name'))),
507 + 'i_am' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_i_am'))),
508 + 'name_greeting' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_name_greeting'))),
509 + 'wildcard_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_msg'))),
510 + 'empty_filter_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_empty_filter_msg'))),
511 + 'did_you_mean' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_did_you_mean'))),
512 + 'is_typing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_is_typing'))),
513 + 'send_a_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_send_a_msg'))),
530 514
531 - 'viewed_products' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_viewed_products'))),
515 + 'viewed_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_viewed_products'))),
532 516
533 - 'shopping_cart' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_shopping_cart'))),
534 - 'cart_updating' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_cart_updating'))),
535 - 'cart_removing' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_cart_removing'))),
517 + 'shopping_cart' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_shopping_cart'))),
518 + 'cart_updating' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_updating'))),
519 + 'cart_removing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_removing'))),
536 520 'imgurl' => QCLD_wpCHATBOT_IMG_URL,
537 521 'sys_key_help' => get_option('qlcd_wp_chatbot_sys_key_help'),
538 522 'sys_key_product' => get_option('qlcd_wp_chatbot_sys_key_product'),
539 523 'sys_key_catalog' => get_option('qlcd_wp_chatbot_sys_key_catalog'),
@@ -540,54 +524,54 @@
540 524 'sys_key_order' => get_option('qlcd_wp_chatbot_sys_key_order'),
541 525 'sys_key_support' => get_option('qlcd_wp_chatbot_sys_key_support'),
542 526 'sys_key_reset' => get_option('qlcd_wp_chatbot_sys_key_reset'),
543 527 'sys_key_email' => get_option('qlcd_wp_chatbot_sys_key_email'),
544 - 'help_welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_help_welcome'))),
545 - 'back_to_start' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_back_to_start'))),
546 - 'help_msg' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_help_msg'))),
547 - 'reset' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_reset'))),
548 - 'wildcard_product' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_wildcard_product'))),
549 - 'wildcard_catalog' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_wildcard_catalog'))),
550 - 'featured_products' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_featured_products'))),
551 - 'sale_products' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_sale_products'))),
552 - 'wildcard_order' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_wildcard_order'))),
528 + 'help_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_welcome'))),
529 + 'back_to_start' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_back_to_start'))),
530 + 'help_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_msg'))),
531 + 'reset' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_reset'))),
532 + 'wildcard_product' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_product'))),
533 + 'wildcard_catalog' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_catalog'))),
534 + 'featured_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_featured_products'))),
535 + 'sale_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_sale_products'))),
536 + 'wildcard_order' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_order'))),
553 537 'wildcard_support' => get_option('qlcd_wp_chatbot_wildcard_support'),
554 - 'product_asking' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_asking'))),
555 - 'product_suggest' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_suggest'))),
556 - 'product_infinite' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_infinite'))),
557 - 'product_success' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_success'))),
558 - 'product_fail' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_fail'))),
559 - 'support_welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_support_welcome'))),
538 + 'product_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_asking'))),
539 + 'product_suggest' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_suggest'))),
540 + 'product_infinite' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_infinite'))),
541 + 'product_success' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_success'))),
542 + 'product_fail' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_fail'))),
543 + 'support_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_welcome'))),
560 544 'support_email' => get_option('qlcd_wp_chatbot_support_email'),
561 - 'support_option_again' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_support_option_again'))),
562 - 'asking_email' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_asking_email'))),
563 - 'asking_msg' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_asking_msg'))),
564 - 'no_result' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_no_result'))),
545 + 'support_option_again' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_option_again'))),
546 + 'asking_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_email'))),
547 + 'asking_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_msg'))),
548 + 'no_result' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_no_result'))),
565 549 'support_phone' => get_option('qlcd_wp_chatbot_support_phone'),
566 - 'asking_phone' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_asking_phone'))),
567 - 'thank_for_phone' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_thank_for_phone'))),
568 - 'support_query' => ((gettype(get_option('support_query')) == 'string') ? $this->qcld_wb_chatbot_str_replace(maybe_unserialize( get_option('support_query'))) : $this->qcld_wb_chatbot_str_replace(( get_option('support_query')))),
569 - 'support_ans' => (gettype(get_option('support_ans')) == 'string') ? $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('support_ans'))) : $this->qcld_wb_chatbot_str_replace((get_option('support_ans'))),
550 + 'asking_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_phone'))),
551 + 'thank_for_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_thank_for_phone'))),
552 + 'support_query' => ((gettype(get_option('support_query')) == 'string') ? $this->qcld_wb_chatbot_str_replace(unserialize( get_option('support_query'))) : $this->qcld_wb_chatbot_str_replace(( get_option('support_query')))),
553 + 'support_ans' => (gettype(get_option('support_ans')) == 'string') ? $this->qcld_wb_chatbot_str_replace(unserialize(get_option('support_ans'))) : $this->qcld_wb_chatbot_str_replace((get_option('support_ans'))),
570 554 'notification_interval' => get_option('qlcd_wp_chatbot_notification_interval'),
571 - 'notifications' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_notifications'))),
572 - 'order_welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_welcome'))),
573 - 'order_username_asking' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_username_asking'))),
574 - 'order_username_password' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_username_password'))),
555 + 'notifications' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_notifications'))),
556 + 'order_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_welcome'))),
557 + 'order_username_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_asking'))),
558 + 'order_username_password' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_password'))),
575 559 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
576 560 'order_login' => is_user_logged_in(),
577 561 'is_chat_session_active' => qcld_wpbot_is_active_chat_history(),
578 562 'order_nonce' => wp_create_nonce("wpwbot-order-nonce"),
579 - 'order_email_support' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_email_support'))),
563 + 'order_email_support' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_email_support'))),
580 564 'email_fail' => str_replace('\\', '', get_option('qlcd_wp_chatbot_email_fail')),
581 - 'invalid_email' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_invalid_email'))),
565 + 'invalid_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_invalid_email'))),
582 566 'stop_words' => str_replace('\\', '', get_option('qlcd_wp_chatbot_stop_words')),
583 567 'currency_symbol' => '',
584 568 'enable_messenger' => get_option('enable_wp_chatbot_messenger'),
585 - 'messenger_label' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_messenger_label'))),
569 + 'messenger_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_messenger_label'))),
586 570 'fb_page_id' => get_option('qlcd_wp_chatbot_fb_page_id'),
587 571 'enable_skype' => get_option('enable_wp_chatbot_skype'),
588 572 'enable_whats' => get_option('enable_wp_chatbot_whats'),
589 - 'whats_label' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_whats_label'))),
573 + 'whats_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_whats_label'))),
590 574 'whats_num' => get_option('qlcd_wp_chatbot_whats_num'),
591 575 'ret_greet' => get_option('qlcd_wp_chatbot_ret_greet'),
592 576 'enable_exit_intent' => get_option('enable_wp_chatbot_exit_intent'),
593 577 'exit_intent_msg' => str_replace('\\', '', get_option('wp_chatbot_exit_intent_msg')),
@@ -602,9 +586,9 @@
602 586 'auto_open_once' => get_option('wp_chatbot_auto_open_once'),
603 587 'proactive_bg_color' => get_option('wp_chatbot_proactive_bg_color'),
604 588 'disable_feedback' => get_option('disable_wp_chatbot_feedback'),
605 589 'disable_faq' => get_option('disable_wp_chatbot_faq'),
606 - 'feedback_label' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_feedback_label'))),
590 + 'feedback_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_feedback_label'))),
607 591 'enable_meta_title' =>get_option('enable_wp_chatbot_meta_title'),
608 592 'meta_label' =>str_replace('\\', '', get_option('qlcd_wp_chatbot_meta_label')),
609 593 'phone_number' => get_option('qlcd_wp_chatbot_phone'),
610 594 'disable_site_search' => get_option('disable_wp_chatbot_site_search'),
@@ -609,9 +593,8 @@
609 593 'phone_number' => get_option('qlcd_wp_chatbot_phone'),
610 594 'disable_site_search' => get_option('disable_wp_chatbot_site_search'),
611 595 'search_keyword' => get_option('qlcd_wp_chatbot_asking_search_keyword'),
612 596 'ajax_nonce'=> wp_create_nonce('qcsecretbotnonceval123qc'),
613 - 'session_nonce'=> wp_create_nonce('wp_chatbot'),
614 597 'site_search' => get_option('qlcd_wp_site_search'),
615 598 'open_links_newtab' => get_option('open_links_new_window'),
616 599 'call_gen' => get_option('disable_wp_chatbot_call_gen'),
617 600 'call_sup' => get_option('disable_wp_chatbot_call_sup'),
@@ -620,9 +603,9 @@
620 603 'enable_ret_user_show' => get_option('enable_wp_chatbot_ret_user_show'),
621 604 'enable_inactive_time_show' => get_option('enable_wp_chatbot_inactive_time_show'),
622 605 'ret_inactive_user_once' => get_option('wp_chatbot_inactive_once'),
623 606 'mobile_full_screen' => '1',
624 - 'botpreloadingtime' => (get_option('wpbot_preloading_time')?get_option('wpbot_preloading_time'):800),
607 + 'botpreloadingtime' => (get_option('wpbot_preloading_time')?get_option('wpbot_preloading_time'):100),
625 608 'inactive_time' => get_option('wp_chatbot_inactive_time'),
626 609 'checkout_msg' => str_replace('\\', '', get_option('wp_chatbot_checkout_msg')),
627 610 'ai_df_enable' => get_option('enable_wp_chatbot_dailogflow'),
628 611 'ai_df_token' => get_option('qlcd_wp_chatbot_dialogflow_client_token'),
@@ -628,13 +611,11 @@
628 611 'ai_df_token' => get_option('qlcd_wp_chatbot_dialogflow_client_token'),
629 612 'df_defualt_reply' => str_replace('\\', '', get_option('qlcd_wp_chatbot_dialogflow_defualt_reply')),
630 613 'df_agent_lan' => get_option('qlcd_wp_chatbot_dialogflow_agent_language'),
631 614 'openai_enabled' => get_option('ai_enabled'),
632 - 'is_stream_enabled' => ( get_option('is_stream_enabled', '1') == '1' ? '1' : '0' ),
633 615 'qcld_openai_append_content' => get_option('qcld_openai_append_content'),
634 616 'openrouter_enabled' => (get_option('qcld_openrouter_enabled')=='1'? get_option('qcld_openrouter_enabled') : '0'),
635 617 'gemini_enabled' => (get_option('qcld_gemini_enabled')=='1'? get_option('qcld_gemini_enabled') : '0'),
636 - 'grok_enabled' => (get_option('qcld_grok_enabled')=='1'? get_option('qcld_grok_enabled') : '0'),
637 618 'qcld_gemini_prepend_content' => get_option('qcld_gemini_prepend_content'),
638 619 'qcld_gemini_append_content' => get_option('qcld_gemini_append_content'),
639 620 'qcld_openrouter_append_content' => get_option('qcld_openrouter_append_content'),
640 621 'qcld_openrouter_prepend_content' => get_option('qcld_openrouter_prepend_content'),
@@ -647,14 +628,11 @@
647 628 'form_commands' => $this->qcld_get_formbuilder_form_commands(),
648 629 'df_api_version' => (get_option('wp_chatbot_df_api')==''?'v1':get_option('wp_chatbot_df_api')),
649 630 'v2_client_url'=> esc_url(get_site_url().'/?action=qcld_dfv2_api'),
650 631 'show_menu_after_greetings'=> (get_option('show_menu_after_greetings')!=''?get_option('show_menu_after_greetings'):0),
651 - 'disable_back_to_start'=> (get_option('disable_back_to_start_menu')!=''?get_option('disable_back_to_start_menu'):0),
652 632 'current_user_id' => $user_id,
653 - 'display_name' => esc_html( $display_name ),
654 633 'skip_wp_greetings' => get_option('skip_wp_greetings'),
655 634 'skip_greetings_and_menu' => get_option('skip_wp_greetings_donot_show_menu'),
656 - 'ask_email_wp_greetings' => get_option('enable_asking_for_email'),
657 635 'skip_chat_reactions_menu' => get_option('skip_chat_reactions_menu'),
658 636 'qlcd_wp_chatbot_like_text' => get_option('qlcd_wp_chatbot_like_text'),
659 637 'qlcd_wp_chatbot_dislike_text' => get_option('qlcd_wp_chatbot_dislike_text'),
660 638 'enable_chat_report_menu' => get_option('enable_chat_report_menu'),
@@ -709,14 +687,16 @@
709 687 wp_enqueue_script('qcld-wp-chatbot-magnify-popup');
710 688 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);
711 689 wp_enqueue_script('qcld-wp-chatbot-plugin');
712 690
691 + wp_register_style('qlcd-frontend-font-awesome', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/font-awesome.min.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
692 + wp_enqueue_style('qlcd-frontend-font-awesome');
693 +
713 694 $nonce = wp_create_nonce('wp_chatbot');
714 695 // Pass data to JS
715 696 wp_localize_script('qcld-wp-chatbot-plugin', 'qcld_chatbot_obj', [
716 - 'ajax_url' => admin_url('admin-ajax.php'),
717 - 'nonce' => $nonce,
718 - 'stream_endpoint' => admin_url('admin-ajax.php?action=qcld_stream_openai'),
697 + 'ajax_url' => admin_url('admin-ajax.php'),
698 + 'nonce' => $nonce,
719 699 ]);
720 700
721 701 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);
722 702 wp_enqueue_script('qcld-wp-chatbot-front-js');
@@ -1014,15 +994,15 @@
1014 994 if (is_array($options) && count($options) > 0) {
1015 995 foreach ($options as $key => $value) {
1016 996 ?>
1017 997 <div class="row" class="wp-chatbot-lng-item">
1018 - <div class="col-xs-11">
998 + <div class="col-xs-10">
1019 999 <input type="text"
1020 1000 class="form-control qc-opt-dcs-font"
1021 1001 name="<?php echo esc_attr( $option_name ); ?>[]"
1022 1002 value="<?php echo esc_attr(str_replace('\\', '', $value)); ?>">
1023 1003 </div>
1024 - <div class="col-xs-1">
1004 + <div class="col-xs-2">
1025 1005 <button type="button" class="btn btn-danger btn-sm wp-chatbot-lng-item-remove"> <span class="glyphicon glyphicon-remove"></span> </button>
1026 1006 </div>
1027 1007 </div>
1028 1008 <?php
@@ -1028,15 +1008,15 @@
1028 1008 <?php
1029 1009 }
1030 1010 } else { ?>
1031 1011 <div class="row" class="wp-chatbot-lng-item">
1032 -<div class="col-xs-11">
1012 +<div class="col-xs-10">
1033 1013 <input type="text"
1034 1014 class="form-control qc-opt-dcs-font"
1035 1015 name="<?php echo esc_attr( $option_name ); ?>[]"
1036 1016 value="<?php echo esc_attr($option_text); ?>">
1037 1017 </div>
1038 -<div class="col-xs-1"> <span class="wp-chatbot-lng-item-remove">
1018 +<div class="col-xs-2"> <span class="wp-chatbot-lng-item-remove">
1039 1019 <?php esc_html_e('X', 'chatbot'); ?>
1040 1020 </span> </div>
1041 1021 </div>
1042 1022 <?php } ?>
@@ -1041,9 +1021,9 @@
1041 1021 </div>
1042 1022 <?php } ?>
1043 1023 </div>
1044 1024 <div class="row">
1045 - <div class="col-sm-1 col-sm-offset-11">
1025 + <div class="col-sm-2 col-sm-offset-10">
1046 1026 <button type="button" class="btn btn-success btn-sm wp-chatbot-lng-item-add"> <span class="glyphicon glyphicon-plus"></span> </button>
1047 1027 </div>
1048 1028 </div>
1049 1029 <?php
@@ -1051,169 +1031,137 @@
1051 1031
1052 1032 function qcld_wb_chatbot_save_options()
1053 1033 {
1054 1034 //global $wpcommerce;
1055 - if (isset($_POST['_wpnonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'wp_chatbot') && current_user_can('manage_options')) {
1035 + if (isset($_POST['_wpnonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'wp_chatbot')) {
1056 1036 // Check if the form is submitted or not.
1057 - $submit = sanitize_text_field(wp_unslash($_POST['submit']));
1037 + $submit = sanitize_text_field($_POST['submit']);
1058 1038 if (isset($submit)) {
1059 1039 //wpwboticon position settings.
1060 1040 if (isset($_POST["wp_chatbot_position_x"])) {
1061 - $wp_chatbot_position_x = intval(sanitize_text_field(wp_unslash($_POST["wp_chatbot_position_x"])));
1041 + $wp_chatbot_position_x = intval(sanitize_text_field($_POST["wp_chatbot_position_x"]));
1062 1042 update_option('wp_chatbot_position_x', $wp_chatbot_position_x);
1063 1043 }
1064 1044 if (isset($_POST["wp_chatbot_position_y"])) {
1065 - $wp_chatbot_position_y = intval(sanitize_text_field(wp_unslash($_POST["wp_chatbot_position_y"])));
1045 + $wp_chatbot_position_y = intval(sanitize_text_field($_POST["wp_chatbot_position_y"]));
1066 1046 update_option('wp_chatbot_position_y', $wp_chatbot_position_y);
1067 1047 }
1068 1048 //product search options
1069 1049 if(isset($_POST['qlcd_wp_chatbot_search_option'])){
1070 - $qlcd_wp_chatbot_search_option = sanitize_text_field(wp_unslash($_POST['qlcd_wp_chatbot_search_option']));
1050 + $qlcd_wp_chatbot_search_option = sanitize_text_field($_POST['qlcd_wp_chatbot_search_option']);
1071 1051 update_option('qlcd_wp_chatbot_search_option', $qlcd_wp_chatbot_search_option);
1072 1052 }
1073 - if(isset( $_POST["disable_floating_button"])){
1074 - $disable_floating_button = sanitize_text_field(wp_unslash($_POST["disable_floating_button"]));
1075 - }else{ $disable_floating_button='';}
1076 - update_option('disable_floating_button', wp_unslash($disable_floating_button));
1053 +
1077 1054
1078 - if(isset( $_POST["wpbot_enable_on_search"])){
1079 - $wpbot_enable_on_search = sanitize_text_field(wp_unslash($_POST["wpbot_enable_on_search"]));
1080 - }else{ $wpbot_enable_on_search='';}
1081 - update_option('wpbot_enable_on_search', wp_unslash($wpbot_enable_on_search));
1082 -
1083 1055 if(isset( $_POST["skip_wp_greetings_donot_show_menu"])){
1084 - $skip_wp_greetings_donot_show_menu = sanitize_text_field(wp_unslash($_POST["skip_wp_greetings_donot_show_menu"]));
1056 + $skip_wp_greetings_donot_show_menu = sanitize_text_field($_POST["skip_wp_greetings_donot_show_menu"]);
1085 1057 }else{ $skip_wp_greetings_donot_show_menu='';}
1086 1058 update_option('skip_wp_greetings_donot_show_menu', wp_unslash($skip_wp_greetings_donot_show_menu));
1087 1059
1088 1060 if(isset( $_POST["skip_wp_greetings"])){
1089 - $skip_wp_greetings = sanitize_text_field(wp_unslash($_POST["skip_wp_greetings"]));
1061 + $skip_wp_greetings = sanitize_text_field($_POST["skip_wp_greetings"]);
1090 1062 }else{ $skip_wp_greetings='';}
1091 1063 update_option('skip_wp_greetings', wp_unslash($skip_wp_greetings));
1092 -
1093 - if( $skip_wp_greetings == '1' || $skip_wp_greetings_donot_show_menu == '1' ){
1094 - $ask_email_wp_greetings = '';
1095 - $enable_asking_for_email = '';
1096 - } else {
1097 - if (isset( $_POST["ask_email_wp_greetings"])) {
1098 - $ask_email_wp_greetings = sanitize_text_field(wp_unslash($_POST["ask_email_wp_greetings"]));
1099 - } else {
1100 - $ask_email_wp_greetings = '';
1101 - }
1102 - if (isset( $_POST["enable_asking_for_email"])) {
1103 - $enable_asking_for_email = sanitize_text_field(wp_unslash($_POST["enable_asking_for_email"]));
1104 - } else {
1105 - $enable_asking_for_email = '';
1106 - }
1107 - }
1108 - update_option('ask_email_wp_greetings', wp_unslash($ask_email_wp_greetings));
1109 - update_option('enable_asking_for_email', wp_unslash($enable_asking_for_email));
1110 1064 //Enable /disable wpwbot
1111 1065 if(isset( $_POST["disable_wp_chatbot"])){
1112 - $disable_wp_chatbot = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot"]));
1066 + $disable_wp_chatbot = sanitize_text_field($_POST["disable_wp_chatbot"]);
1113 1067 }else{ $disable_wp_chatbot='';}
1114 1068 update_option('disable_wp_chatbot', wp_unslash($disable_wp_chatbot));
1115 1069
1116 1070 if(isset( $_POST["qlcd_wp_chatbot_admin_email"])){
1117 - $qlcd_wp_chatbot_admin_email = sanitize_email(wp_unslash($_POST["qlcd_wp_chatbot_admin_email"]));
1071 + $qlcd_wp_chatbot_admin_email = sanitize_email($_POST["qlcd_wp_chatbot_admin_email"]);
1118 1072 }else{ $qlcd_wp_chatbot_admin_email='';}
1119 1073 update_option('qlcd_wp_chatbot_admin_email', wp_unslash($qlcd_wp_chatbot_admin_email));
1120 1074
1121 1075
1122 1076 if(isset( $_POST["open_links_new_window"])){
1123 - $open_links_new_window = sanitize_text_field(wp_unslash($_POST["open_links_new_window"]));
1077 + $open_links_new_window = sanitize_text_field($_POST["open_links_new_window"]);
1124 1078 }else{ $open_links_new_window='';}
1125 1079 update_option('open_links_new_window', wp_unslash($open_links_new_window));
1126 1080
1127 1081
1128 1082 if(isset( $_POST["qlcd_wp_chatbot_from_email"])){
1129 - $qlcd_wp_chatbot_from_email = sanitize_email(wp_unslash($_POST["qlcd_wp_chatbot_from_email"]));
1083 + $qlcd_wp_chatbot_from_email = sanitize_email($_POST["qlcd_wp_chatbot_from_email"]);
1130 1084 }else{ $qlcd_wp_chatbot_from_email='';}
1131 1085 update_option('qlcd_wp_chatbot_from_email', wp_unslash($qlcd_wp_chatbot_from_email));
1132 1086
1133 1087 if(isset( $_POST["disable_wp_chatbot_on_mobile"])) {
1134 - $disable_wp_chatbot_on_mobile = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_on_mobile"]));
1088 + $disable_wp_chatbot_on_mobile = sanitize_text_field($_POST["disable_wp_chatbot_on_mobile"]);
1135 1089 }else{ $disable_wp_chatbot_on_mobile='';}
1136 1090 update_option('disable_wp_chatbot_on_mobile', wp_unslash($disable_wp_chatbot_on_mobile));
1137 1091 if(isset( $_POST["disable_wp_chatbot_product_search"])) {
1138 - $disable_wp_chatbot_product_search = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_product_search"]));
1092 + $disable_wp_chatbot_product_search = sanitize_text_field($_POST["disable_wp_chatbot_product_search"]);
1139 1093 }else{ $disable_wp_chatbot_product_search='';}
1140 1094 update_option('disable_wp_chatbot_product_search', wp_unslash($disable_wp_chatbot_product_search));
1141 1095 if(isset( $_POST["disable_wp_chatbot_catalog"])) {
1142 - $disable_wp_chatbot_catalog= sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_catalog"]));
1096 + $disable_wp_chatbot_catalog= sanitize_text_field($_POST["disable_wp_chatbot_catalog"]);
1143 1097 }else{ $disable_wp_chatbot_catalog='';}
1144 1098 update_option('disable_wp_chatbot_catalog', wp_unslash($disable_wp_chatbot_catalog));
1145 1099 if(isset( $_POST["disable_wp_chatbot_order_status"])) {
1146 - $disable_wp_chatbot_order_status = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_order_status"]));
1100 + $disable_wp_chatbot_order_status = sanitize_text_field($_POST["disable_wp_chatbot_order_status"]);
1147 1101 }else{ $disable_wp_chatbot_order_status='';}
1148 1102 update_option('disable_wp_chatbot_order_status', wp_unslash($disable_wp_chatbot_order_status));
1149 1103 if(isset( $_POST["disable_wp_chatbot_notification"])) {
1150 - $disable_wp_chatbot_notification = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_notification"]));
1104 + $disable_wp_chatbot_notification = sanitize_text_field($_POST["disable_wp_chatbot_notification"]);
1151 1105 }else{ $disable_wp_chatbot_notification='1';}
1152 1106 update_option('disable_wp_chatbot_notification', wp_unslash($disable_wp_chatbot_notification));
1153 1107
1154 1108 if(isset( $_POST["enable_wp_chatbot_rtl"])) {
1155 - $enable_wp_chatbot_rtl = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_rtl"]));
1109 + $enable_wp_chatbot_rtl = sanitize_text_field($_POST["enable_wp_chatbot_rtl"]);
1156 1110 }else{ $enable_wp_chatbot_rtl='';}
1157 1111 update_option('enable_wp_chatbot_rtl', wp_unslash($enable_wp_chatbot_rtl));
1158 1112
1159 1113 if(isset( $_POST["show_menu_after_greetings"])) {
1160 - $show_menu_after_greetings = sanitize_text_field(wp_unslash($_POST["show_menu_after_greetings"]));
1114 + $show_menu_after_greetings = sanitize_text_field($_POST["show_menu_after_greetings"]);
1161 1115 }else{ $show_menu_after_greetings='';}
1162 1116 update_option('show_menu_after_greetings', wp_unslash($show_menu_after_greetings));
1163 -
1164 - if(isset( $_POST["disable_back_to_start_menu"])) {
1165 - $disable_back_to_start_menu = sanitize_text_field(wp_unslash($_POST["disable_back_to_start_menu"]));
1166 - }else{ $disable_back_to_start_menu='';}
1167 - update_option('disable_back_to_start_menu', wp_unslash($disable_back_to_start_menu));
1168 -
1169 1117 if(isset( $_POST["enable_chat_session"])) {
1170 - $enable_chat_session = sanitize_text_field(wp_unslash($_POST["enable_chat_session"]));
1118 + $enable_chat_session = sanitize_text_field($_POST["enable_chat_session"]);
1171 1119 }else{ $enable_chat_session='';}
1172 1120 update_option('enable_chat_session', wp_unslash($enable_chat_session));
1173 1121
1174 1122
1175 1123 if(isset( $_POST["enable_wp_chatbot_mobile_full_screen"])) {
1176 - $enable_wp_chatbot_mobile_full_screen = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_mobile_full_screen"]));
1124 + $enable_wp_chatbot_mobile_full_screen = sanitize_text_field($_POST["enable_wp_chatbot_mobile_full_screen"]);
1177 1125 }else{ $enable_wp_chatbot_mobile_full_screen='';}
1178 1126 update_option('enable_wp_chatbot_mobile_full_screen', wp_unslash($enable_wp_chatbot_mobile_full_screen));
1179 1127
1180 1128 if(isset( $_POST["wpbot_preloading_time"])) {
1181 - $wpbot_preloading_time = sanitize_text_field(wp_unslash($_POST["wpbot_preloading_time"]));
1182 - }else{ $wpbot_preloading_time='800';}
1129 + $wpbot_preloading_time = sanitize_text_field($_POST["wpbot_preloading_time"]);
1130 + }else{ $wpbot_preloading_time='100';}
1183 1131 update_option('wpbot_preloading_time', wp_unslash($wpbot_preloading_time));
1184 1132
1185 1133 if(isset( $_POST["disable_wp_chatbot_icon_animation"])) {
1186 - $disable_wp_chatbot_icon_animation = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_icon_animation"]));
1134 + $disable_wp_chatbot_icon_animation = sanitize_text_field($_POST["disable_wp_chatbot_icon_animation"]);
1187 1135 }else{ $disable_wp_chatbot_icon_animation='';}
1188 1136 update_option('disable_wp_chatbot_icon_animation', wp_unslash($disable_wp_chatbot_icon_animation));
1189 1137 //Enable /disable Cart Item Number
1190 1138 if(isset( $_POST["disable_wp_chatbot_cart_item_number"])) {
1191 - $disable_wp_chatbot_cart_item_number = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_cart_item_number"]));
1139 + $disable_wp_chatbot_cart_item_number = sanitize_text_field($_POST["disable_wp_chatbot_cart_item_number"]);
1192 1140 }else{ $disable_wp_chatbot_cart_item_number='';}
1193 1141 update_option('disable_wp_chatbot_cart_item_number', wp_unslash($disable_wp_chatbot_cart_item_number));
1194 1142 //Enable /disable featured products button.
1195 1143 if(isset( $_POST["disable_wp_chatbot_featured_product"])) {
1196 - $disable_wp_chatbot_featured_product = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_featured_product"]));
1144 + $disable_wp_chatbot_featured_product = sanitize_text_field($_POST["disable_wp_chatbot_featured_product"]);
1197 1145 }else{ $disable_wp_chatbot_featured_product='';}
1198 1146 update_option('disable_wp_chatbot_featured_product', wp_unslash($disable_wp_chatbot_featured_product));
1199 1147 //Enable /disable sale products button
1200 1148 if(isset( $_POST["disable_wp_chatbot_sale_product"])) {
1201 - $disable_wp_chatbot_sale_product = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_sale_product"]));
1149 + $disable_wp_chatbot_sale_product = sanitize_text_field($_POST["disable_wp_chatbot_sale_product"]);
1202 1150 }else{ $disable_wp_chatbot_sale_product='';}
1203 1151 update_option('disable_wp_chatbot_sale_product', wp_unslash($disable_wp_chatbot_sale_product));
1204 1152 //Enable Product details page.
1205 1153 if(isset( $_POST["wp_chatbot_open_product_detail"])) {
1206 - $wp_chatbot_open_product_detail = sanitize_text_field(wp_unslash($_POST["wp_chatbot_open_product_detail"]));
1154 + $wp_chatbot_open_product_detail = sanitize_text_field($_POST["wp_chatbot_open_product_detail"]);
1207 1155 }else{ $wp_chatbot_open_product_detail='';}
1208 1156 update_option('wp_chatbot_open_product_detail', wp_unslash($wp_chatbot_open_product_detail));
1209 1157 //product order and order by
1210 1158 if(isset($_POST['qlcd_wp_chatbot_product_orderby'])){
1211 - $qlcd_wp_chatbot_product_orderby = sanitize_text_field(wp_unslash($_POST['qlcd_wp_chatbot_product_orderby']));
1159 + $qlcd_wp_chatbot_product_orderby = sanitize_text_field($_POST['qlcd_wp_chatbot_product_orderby']);
1212 1160 update_option('qlcd_wp_chatbot_product_orderby', sanitize_text_field($qlcd_wp_chatbot_product_orderby));
1213 1161 }
1214 1162 if(isset($_POST['qlcd_wp_chatbot_product_order'])){
1215 - $qlcd_wp_chatbot_product_order = sanitize_text_field(wp_unslash($_POST['qlcd_wp_chatbot_product_order']));
1163 + $qlcd_wp_chatbot_product_order = sanitize_text_field($_POST['qlcd_wp_chatbot_product_order']);
1216 1164 update_option('qlcd_wp_chatbot_product_order', sanitize_text_field($qlcd_wp_chatbot_product_order));
1217 1165 }
1218 1166
1219 1167
@@ -1218,53 +1166,53 @@
1218 1166
1219 1167
1220 1168 //Product per page settings.
1221 1169 if (isset($_POST["qlcd_wp_chatbot_ppp"])) {
1222 - $qlcd_wp_chatbot_ppp = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_ppp"]));
1170 + $qlcd_wp_chatbot_ppp = sanitize_text_field($_POST["qlcd_wp_chatbot_ppp"]);
1223 1171 update_option('qlcd_wp_chatbot_ppp', intval($qlcd_wp_chatbot_ppp));
1224 1172 }
1225 1173 if(isset( $_POST["wp_chatbot_exclude_stock_out_product"])) {
1226 - $wp_chatbot_exclude_stock_out_product = sanitize_text_field(wp_unslash($_POST['wp_chatbot_exclude_stock_out_product']));
1174 + $wp_chatbot_exclude_stock_out_product = sanitize_text_field($_POST['wp_chatbot_exclude_stock_out_product']);
1227 1175 }else{ $wp_chatbot_exclude_stock_out_product='';}
1228 1176 update_option('wp_chatbot_exclude_stock_out_product', wp_unslash($wp_chatbot_exclude_stock_out_product));
1229 1177 if(isset( $_POST["wp_chatbot_show_parent_category"])) {
1230 - $wp_chatbot_show_parent_category = sanitize_text_field(wp_unslash($_POST['wp_chatbot_show_parent_category']));
1178 + $wp_chatbot_show_parent_category = sanitize_text_field($_POST['wp_chatbot_show_parent_category']);
1231 1179 }else{ $wp_chatbot_show_parent_category='';}
1232 1180 update_option('wp_chatbot_show_parent_category', wp_unslash($wp_chatbot_show_parent_category));
1233 1181 if(isset( $_POST["wp_chatbot_show_sub_category"])) {
1234 - $wp_chatbot_show_sub_category = sanitize_text_field(wp_unslash($_POST['wp_chatbot_show_sub_category']));
1182 + $wp_chatbot_show_sub_category = sanitize_text_field($_POST['wp_chatbot_show_sub_category']);
1235 1183 }else{ $wp_chatbot_show_sub_category='';}
1236 1184 update_option('wp_chatbot_show_sub_category', wp_unslash($wp_chatbot_show_sub_category));
1237 1185 if (isset($_POST["qlcd_wp_chatbot_order_user"])) {
1238 - $qlcd_wp_chatbot_order_user = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_order_user"]));
1186 + $qlcd_wp_chatbot_order_user = sanitize_text_field($_POST["qlcd_wp_chatbot_order_user"]);
1239 1187 update_option('qlcd_wp_chatbot_order_user', sanitize_text_field($qlcd_wp_chatbot_order_user));
1240 1188 }
1241 1189
1242 1190 if(isset( $_POST["qc_wpbot_menu_order"]) && !empty($_POST["qc_wpbot_menu_order"])) {
1243 - $qc_wpbot_menu_order = wp_kses_post(wp_unslash($_POST["qc_wpbot_menu_order"]));
1191 + $qc_wpbot_menu_order = wp_kses_post($_POST["qc_wpbot_menu_order"]);
1244 1192 }else{ $qc_wpbot_menu_order='';}
1245 1193 update_option('qc_wpbot_menu_order', ($qc_wpbot_menu_order));
1246 1194
1247 1195 //wpwBot Load control
1248 1196 if(isset($_POST["wp_chatbot_show_home_page"])){
1249 - $wp_chatbot_show_home_page = sanitize_key((wp_unslash($_POST["wp_chatbot_show_home_page"])));
1197 + $wp_chatbot_show_home_page = sanitize_key(($_POST["wp_chatbot_show_home_page"]));
1250 1198 update_option('wp_chatbot_show_home_page', $wp_chatbot_show_home_page);
1251 1199 }
1252 1200
1253 1201
1254 1202 if(isset($_POST["wp_chatbot_show_posts"])){
1255 - $wp_chatbot_show_posts = sanitize_key((wp_unslash($_POST["wp_chatbot_show_posts"])));
1203 + $wp_chatbot_show_posts = sanitize_key(($_POST["wp_chatbot_show_posts"]));
1256 1204 update_option('wp_chatbot_show_posts', $wp_chatbot_show_posts);
1257 1205 }
1258 1206
1259 1207
1260 1208 if(isset($_POST["wp_chatbot_show_pages"])){
1261 - $wp_chatbot_show_pages = sanitize_key((wp_unslash($_POST["wp_chatbot_show_pages"])));
1209 + $wp_chatbot_show_pages = sanitize_key(($_POST["wp_chatbot_show_pages"]));
1262 1210 update_option('wp_chatbot_show_pages', $wp_chatbot_show_pages);
1263 1211 }
1264 1212
1265 1213 if(isset( $_POST["wp_chatbot_show_pages_list"])) {
1266 - $wp_chatbot_show_pages_list = wp_parse_id_list(wp_unslash($_POST["wp_chatbot_show_pages_list"]));
1214 + $wp_chatbot_show_pages_list = wp_parse_id_list($_POST["wp_chatbot_show_pages_list"]);
1267 1215 update_option('wp_chatbot_show_pages_list', maybe_serialize(sanitize_array($wp_chatbot_show_pages_list)));
1268 1216 }else{
1269 1217 $wp_chatbot_show_pages_list='';
1270 1218 update_option('wp_chatbot_show_pages_list', maybe_serialize(sanitize_array($wp_chatbot_show_pages_list)));
@@ -1269,9 +1217,9 @@
1269 1217 $wp_chatbot_show_pages_list='';
1270 1218 update_option('wp_chatbot_show_pages_list', maybe_serialize(sanitize_array($wp_chatbot_show_pages_list)));
1271 1219 }
1272 1220 if(isset( $_POST["wp_chatbot_exclude_post_list"])) {
1273 - $wp_chatbot_exclude_post_list = wp_unslash($_POST["wp_chatbot_exclude_post_list"]);
1221 + $wp_chatbot_exclude_post_list = $_POST["wp_chatbot_exclude_post_list"];
1274 1222 update_option('wp_chatbot_exclude_post_list', maybe_serialize(sanitize_array($wp_chatbot_exclude_post_list)));
1275 1223 }else{
1276 1224 $wp_chatbot_exclude_post_list='';
1277 1225 update_option('wp_chatbot_exclude_post_list', maybe_serialize(sanitize_array($wp_chatbot_exclude_post_list)));
@@ -1277,9 +1225,9 @@
1277 1225 update_option('wp_chatbot_exclude_post_list', maybe_serialize(sanitize_array($wp_chatbot_exclude_post_list)));
1278 1226 }
1279 1227
1280 1228 if(isset($_POST["wp_chatbot_show_wpcommerce"])){
1281 - $wp_chatbot_show_wpcommerce = sanitize_key((wp_unslash($_POST["wp_chatbot_show_wpcommerce"])));
1229 + $wp_chatbot_show_wpcommerce = sanitize_key(($_POST["wp_chatbot_show_wpcommerce"]));
1282 1230 update_option('wp_chatbot_show_wpcommerce', $wp_chatbot_show_wpcommerce);
1283 1231 }
1284 1232
1285 1233
@@ -1284,51 +1232,45 @@
1284 1232
1285 1233
1286 1234 //Stop Words Settings
1287 1235 if (isset($_POST["qlcd_wp_chatbot_stop_words_name"])) {
1288 - $qlcd_wp_chatbot_stop_words_name = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_stop_words_name"]));
1236 + $qlcd_wp_chatbot_stop_words_name = sanitize_text_field($_POST["qlcd_wp_chatbot_stop_words_name"]);
1289 1237 update_option('qlcd_wp_chatbot_stop_words_name', $qlcd_wp_chatbot_stop_words_name);
1290 1238 }
1291 1239 if (isset($_POST["qlcd_wp_chatbot_stop_words"])) {
1292 - $qlcd_wp_chatbot_stop_words = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_stop_words"]));
1240 + $qlcd_wp_chatbot_stop_words = sanitize_text_field($_POST["qlcd_wp_chatbot_stop_words"]);
1293 1241 update_option('qlcd_wp_chatbot_stop_words', $qlcd_wp_chatbot_stop_words);
1294 1242 }
1295 1243 //wpwbot icon settings.
1296 - $wp_chatbot_icon = isset( $_POST['wp_chatbot_icon'] ) ? sanitize_text_field(wp_unslash($_POST['wp_chatbot_icon'])) : 'icon-3.png';
1244 + $wp_chatbot_icon = isset( $_POST['wp_chatbot_icon'] ) ? sanitize_text_field($_POST['wp_chatbot_icon']) : 'icon-3.png';
1297 1245 update_option('wp_chatbot_icon', $wp_chatbot_icon);
1298 1246
1299 - $wp_chatbot_floatingiconbg_color = isset( $_POST['wp_chatbot_floatingiconbg_color'] ) ? sanitize_text_field(wp_unslash($_POST['wp_chatbot_floatingiconbg_color'])) : '#fff';
1247 + $wp_chatbot_floatingiconbg_color = isset( $_POST['wp_chatbot_floatingiconbg_color'] ) ? sanitize_text_field($_POST['wp_chatbot_floatingiconbg_color']) : '#fff';
1300 1248 update_option('wp_chatbot_floatingiconbg_color', $wp_chatbot_floatingiconbg_color);
1301 1249
1302 1250 // upload custom wpwbot icon path
1303 - $wp_chatbot_custom_icon_path = sanitize_text_field(wp_unslash($_POST['wp_chatbot_custom_icon_path']));
1251 + $wp_chatbot_custom_icon_path = sanitize_text_field($_POST['wp_chatbot_custom_icon_path']);
1304 1252 update_option('wp_chatbot_custom_icon_path', $wp_chatbot_custom_icon_path);
1305 1253 //Agent image
1306 1254 //wpwbot icon settings.
1307 - $wp_chatbot_icon = (isset($_POST['wp_chatbot_agent_image']) ? sanitize_text_field(wp_unslash($_POST['wp_chatbot_agent_image'])) : 'agent-13.png');
1255 + $wp_chatbot_icon = (isset($_POST['wp_chatbot_agent_image']) ? sanitize_text_field($_POST['wp_chatbot_agent_image']) : 'agent-13.png');
1308 1256 update_option('wp_chatbot_agent_image', $wp_chatbot_icon);
1309 1257 // upload custom wpwbot icon
1310 1258 if(isset($_POST['wp_chatbot_custom_agent_path'])){
1311 - $wp_chatbot_custom_agent_path = sanitize_text_field(wp_unslash($_POST['wp_chatbot_custom_agent_path']));
1259 + $wp_chatbot_custom_agent_path = sanitize_text_field($_POST['wp_chatbot_custom_agent_path']);
1312 1260 update_option('wp_chatbot_custom_agent_path', $wp_chatbot_custom_agent_path);
1313 1261 }
1314 1262
1315 1263 //Theming
1316 - $qcld_wb_chatbot_theme = (isset($_POST['qcld_wb_chatbot_theme']) ? sanitize_text_field(wp_unslash($_POST['qcld_wb_chatbot_theme'])) : 'template-00');
1264 + $qcld_wb_chatbot_theme = (isset($_POST['qcld_wb_chatbot_theme']) ? sanitize_text_field($_POST['qcld_wb_chatbot_theme']) : 'template-00');
1317 1265 update_option('qcld_wb_chatbot_theme', $qcld_wb_chatbot_theme);
1318 -
1319 - //Avatar Location
1320 - if(isset($_POST['qcld_chatbot_avatar_location'])) {
1321 - $qcld_chatbot_avatar_location = sanitize_text_field(wp_unslash($_POST['qcld_chatbot_avatar_location']));
1322 - update_option('qcld_chatbot_avatar_location', $qcld_chatbot_avatar_location);
1323 - }
1324 1266 //Theme custom background option
1325 1267 if(isset( $_POST["qcld_wb_chatbot_change_bg"])) {
1326 - $qcld_wb_chatbot_change_bg = sanitize_text_field(wp_unslash($_POST["qcld_wb_chatbot_change_bg"]));
1268 + $qcld_wb_chatbot_change_bg = sanitize_text_field($_POST["qcld_wb_chatbot_change_bg"]);
1327 1269 }else{$qcld_wb_chatbot_change_bg='';}
1328 1270 update_option('qcld_wb_chatbot_change_bg', $qcld_wb_chatbot_change_bg);
1329 1271 if(isset($_POST["qcld_wb_chatbot_board_bg_path"])){
1330 - $qcld_wb_chatbot_board_bg_path = sanitize_text_field(wp_unslash($_POST["qcld_wb_chatbot_board_bg_path"]));
1272 + $qcld_wb_chatbot_board_bg_path = sanitize_text_field($_POST["qcld_wb_chatbot_board_bg_path"]);
1331 1273 update_option('qcld_wb_chatbot_board_bg_path', wp_unslash($qcld_wb_chatbot_board_bg_path));
1332 1274 }
1333 1275
1334 1276
@@ -1468,10 +1410,9 @@
1468 1410 update_option('qlcd_wp_chatbot_share_text', $qlcd_wp_chatbot_share_text);
1469 1411
1470 1412 if (isset($_POST["qlcd_wp_chatbot_agent_join"])) {
1471 1413 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1472 - $qlcd_wp_chatbot_agent_join = wp_unslash($_POST["qlcd_wp_chatbot_agent_join"]);
1473 - $qlcd_wp_chatbot_agent_join = sanitize_array($qlcd_wp_chatbot_agent_join);
1414 + $qlcd_wp_chatbot_agent_join = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_agent_join"]));
1474 1415 } else {
1475 1416 $qlcd_wp_chatbot_agent_join = array();
1476 1417 }
1477 1418 update_option('qlcd_wp_chatbot_agent_join', maybe_serialize($qlcd_wp_chatbot_agent_join));
@@ -1478,10 +1419,9 @@
1478 1419
1479 1420 //Greeting.
1480 1421 if (isset($_POST["qlcd_wp_chatbot_welcome"])) {
1481 1422 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1482 - $qlcd_wp_chatbot_welcome = wp_unslash($_POST["qlcd_wp_chatbot_welcome"]);
1483 - $qlcd_wp_chatbot_welcome = sanitize_array($qlcd_wp_chatbot_welcome);
1423 + $qlcd_wp_chatbot_welcome = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_welcome"]));
1484 1424 } else {
1485 1425 $qlcd_wp_chatbot_welcome = array();
1486 1426 }
1487 1427 update_option('qlcd_wp_chatbot_welcome', maybe_serialize($qlcd_wp_chatbot_welcome));
@@ -1487,10 +1427,9 @@
1487 1427 update_option('qlcd_wp_chatbot_welcome', maybe_serialize($qlcd_wp_chatbot_welcome));
1488 1428
1489 1429 if (isset($_POST["qlcd_wp_chatbot_back_to_start"])) {
1490 1430 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1491 - $qlcd_wp_chatbot_back_to_start = wp_unslash($_POST["qlcd_wp_chatbot_back_to_start"]);
1492 - $qlcd_wp_chatbot_back_to_start = sanitize_array($qlcd_wp_chatbot_back_to_start);
1431 + $qlcd_wp_chatbot_back_to_start = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_back_to_start"]));
1493 1432 } else {
1494 1433 $qlcd_wp_chatbot_back_to_start = array();
1495 1434 }
1496 1435 update_option('qlcd_wp_chatbot_back_to_start', maybe_serialize($qlcd_wp_chatbot_back_to_start));
@@ -1496,10 +1435,9 @@
1496 1435 update_option('qlcd_wp_chatbot_back_to_start', maybe_serialize($qlcd_wp_chatbot_back_to_start));
1497 1436
1498 1437 if (isset($_POST["qlcd_wp_chatbot_hi_there"])) {
1499 1438 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1500 - $qlcd_wp_chatbot_hi_there = wp_unslash($_POST["qlcd_wp_chatbot_hi_there"]);
1501 - $qlcd_wp_chatbot_hi_there = sanitize_array($qlcd_wp_chatbot_hi_there);
1439 + $qlcd_wp_chatbot_hi_there = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_hi_there"]));
1502 1440 } else {
1503 1441 $qlcd_wp_chatbot_hi_there = array();
1504 1442 }
1505 1443 update_option('qlcd_wp_chatbot_hi_there', maybe_serialize($qlcd_wp_chatbot_hi_there));
@@ -1505,10 +1443,9 @@
1505 1443 update_option('qlcd_wp_chatbot_hi_there', maybe_serialize($qlcd_wp_chatbot_hi_there));
1506 1444
1507 1445 if (isset($_POST["qlcd_wp_chatbot_hello"])) {
1508 1446 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1509 - $qlcd_wp_chatbot_hello = wp_unslash($_POST["qlcd_wp_chatbot_hello"]);
1510 - $qlcd_wp_chatbot_hello = sanitize_array($qlcd_wp_chatbot_hello);
1447 + $qlcd_wp_chatbot_hello = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_hello"]));
1511 1448 } else {
1512 1449 $qlcd_wp_chatbot_hello = array();
1513 1450 }
1514 1451 update_option('qlcd_wp_chatbot_hello', maybe_serialize($qlcd_wp_chatbot_hello));
@@ -1514,10 +1451,9 @@
1514 1451 update_option('qlcd_wp_chatbot_hello', maybe_serialize($qlcd_wp_chatbot_hello));
1515 1452
1516 1453 if (isset($_POST["qlcd_wp_chatbot_welcome_back"])) {
1517 1454 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1518 - $qlcd_wp_chatbot_welcome_back = wp_unslash( $_POST["qlcd_wp_chatbot_welcome_back"] );
1519 - $qlcd_wp_chatbot_welcome_back = sanitize_array( $qlcd_wp_chatbot_welcome_back );
1455 + $qlcd_wp_chatbot_welcome_back = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_welcome_back"]));
1520 1456 } else {
1521 1457 $qlcd_wp_chatbot_welcome_back = array();
1522 1458 }
1523 1459 update_option('qlcd_wp_chatbot_welcome_back', maybe_serialize($qlcd_wp_chatbot_welcome_back));
@@ -1523,10 +1459,9 @@
1523 1459 update_option('qlcd_wp_chatbot_welcome_back', maybe_serialize($qlcd_wp_chatbot_welcome_back));
1524 1460
1525 1461 if (isset($_POST["qlcd_wp_chatbot_asking_name"])) {
1526 1462 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1527 - $qlcd_wp_chatbot_asking_name = wp_unslash( $_POST["qlcd_wp_chatbot_asking_name"] );
1528 - $qlcd_wp_chatbot_asking_name = sanitize_array( $qlcd_wp_chatbot_asking_name );
1463 + $qlcd_wp_chatbot_asking_name = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_asking_name"]));
1529 1464 } else {
1530 1465 $qlcd_wp_chatbot_asking_name = array();
1531 1466 }
1532 1467 update_option('qlcd_wp_chatbot_asking_name', maybe_serialize($qlcd_wp_chatbot_asking_name));
@@ -1532,10 +1467,9 @@
1532 1467 update_option('qlcd_wp_chatbot_asking_name', maybe_serialize($qlcd_wp_chatbot_asking_name));
1533 1468
1534 1469 if (isset($_POST["qlcd_wp_chatbot_name_greeting"])) {
1535 1470 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1536 - $qlcd_wp_chatbot_name_greeting = wp_unslash( $_POST["qlcd_wp_chatbot_name_greeting"] );
1537 - $qlcd_wp_chatbot_name_greeting = sanitize_array( $qlcd_wp_chatbot_name_greeting );
1471 + $qlcd_wp_chatbot_name_greeting = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_name_greeting"]));
1538 1472 } else {
1539 1473 $qlcd_wp_chatbot_name_greeting = array();
1540 1474 }
1541 1475 update_option('qlcd_wp_chatbot_name_greeting', maybe_serialize($qlcd_wp_chatbot_name_greeting));
@@ -1541,10 +1475,9 @@
1541 1475 update_option('qlcd_wp_chatbot_name_greeting', maybe_serialize($qlcd_wp_chatbot_name_greeting));
1542 1476
1543 1477 if (isset($_POST["qlcd_wp_chatbot_i_am"])) {
1544 1478 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1545 - $qlcd_wp_chatbot_i_am = wp_unslash( $_POST["qlcd_wp_chatbot_i_am"] );
1546 - $qlcd_wp_chatbot_i_am = sanitize_array( $qlcd_wp_chatbot_i_am );
1479 + $qlcd_wp_chatbot_i_am = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_i_am"]));
1547 1480 } else {
1548 1481 $qlcd_wp_chatbot_i_am = array();
1549 1482 }
1550 1483 update_option('qlcd_wp_chatbot_i_am', maybe_serialize($qlcd_wp_chatbot_i_am));
@@ -1550,10 +1483,9 @@
1550 1483 update_option('qlcd_wp_chatbot_i_am', maybe_serialize($qlcd_wp_chatbot_i_am));
1551 1484
1552 1485 if (isset($_POST["qlcd_wp_chatbot_is_typing"])) {
1553 1486 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1554 - $qlcd_wp_chatbot_is_typing = wp_unslash( $_POST["qlcd_wp_chatbot_is_typing"] );
1555 - $qlcd_wp_chatbot_is_typing = sanitize_array( $qlcd_wp_chatbot_is_typing );
1487 + $qlcd_wp_chatbot_is_typing = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_is_typing"]));
1556 1488 } else {
1557 1489 $qlcd_wp_chatbot_is_typing = array();
1558 1490 }
1559 1491 update_option('qlcd_wp_chatbot_is_typing', maybe_serialize($qlcd_wp_chatbot_is_typing));
@@ -1559,10 +1491,9 @@
1559 1491 update_option('qlcd_wp_chatbot_is_typing', maybe_serialize($qlcd_wp_chatbot_is_typing));
1560 1492
1561 1493 if (isset($_POST["qlcd_wp_chatbot_send_a_msg"])) {
1562 1494 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1563 - $qlcd_wp_chatbot_send_a_msg = wp_unslash( $_POST["qlcd_wp_chatbot_send_a_msg"] );
1564 - $qlcd_wp_chatbot_send_a_msg = sanitize_array( $qlcd_wp_chatbot_send_a_msg );
1495 + $qlcd_wp_chatbot_send_a_msg = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_send_a_msg"]));
1565 1496 } else {
1566 1497 $qlcd_wp_chatbot_send_a_msg = array();
1567 1498 }
1568 1499 update_option('qlcd_wp_chatbot_send_a_msg', maybe_serialize($qlcd_wp_chatbot_send_a_msg));
@@ -1568,10 +1499,9 @@
1568 1499 update_option('qlcd_wp_chatbot_send_a_msg', maybe_serialize($qlcd_wp_chatbot_send_a_msg));
1569 1500
1570 1501 if (isset($_POST["qlcd_wp_chatbot_choose_option"])) {
1571 1502 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1572 - $qlcd_wp_chatbot_choose_option = wp_unslash( $_POST["qlcd_wp_chatbot_choose_option"] );
1573 - $qlcd_wp_chatbot_choose_option = sanitize_array( $qlcd_wp_chatbot_choose_option );
1503 + $qlcd_wp_chatbot_choose_option = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_choose_option"]));
1574 1504 } else {
1575 1505 $qlcd_wp_chatbot_choose_option = array();
1576 1506 }
1577 1507 update_option('qlcd_wp_chatbot_choose_option', maybe_serialize($qlcd_wp_chatbot_choose_option));
@@ -1577,10 +1507,9 @@
1577 1507 update_option('qlcd_wp_chatbot_choose_option', maybe_serialize($qlcd_wp_chatbot_choose_option));
1578 1508
1579 1509 if (isset($_POST["qlcd_wp_chatbot_viewed_products"])) {
1580 1510
1581 - $qlcd_wp_chatbot_viewed_products = wp_unslash( $_POST["qlcd_wp_chatbot_viewed_products"] );
1582 - $qlcd_wp_chatbot_viewed_products = sanitize_array( $qlcd_wp_chatbot_viewed_products );
1511 + $qlcd_wp_chatbot_viewed_products = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_viewed_products"]));
1583 1512 } else {
1584 1513 $qlcd_wp_chatbot_viewed_products = array();
1585 1514 }
1586 1515 update_option('qlcd_wp_chatbot_viewed_products', maybe_serialize($qlcd_wp_chatbot_viewed_products));
@@ -1585,52 +1514,52 @@
1585 1514 }
1586 1515 update_option('qlcd_wp_chatbot_viewed_products', maybe_serialize($qlcd_wp_chatbot_viewed_products));
1587 1516
1588 1517 if(isset($_POST["qlcd_wp_chatbot_shopping_cart"])){
1589 - $qlcd_wp_chatbot_shopping_cart= esc_html((@wp_unslash($_POST["qlcd_wp_chatbot_shopping_cart"])));
1518 + $qlcd_wp_chatbot_shopping_cart= esc_html((@$_POST["qlcd_wp_chatbot_shopping_cart"]));
1590 1519 update_option('qlcd_wp_chatbot_shopping_cart', maybe_serialize(sanitize_array($qlcd_wp_chatbot_shopping_cart)));
1591 1520 }
1592 1521
1593 1522 if(isset($_POST["qlcd_wp_chatbot_add_to_cart"])){
1594 - $qlcd_wp_chatbot_add_to_cart= (@wp_unslash($_POST["qlcd_wp_chatbot_add_to_cart"]));
1523 + $qlcd_wp_chatbot_add_to_cart= (@$_POST["qlcd_wp_chatbot_add_to_cart"]);
1595 1524 update_option('qlcd_wp_chatbot_add_to_cart', maybe_serialize(sanitize_array($qlcd_wp_chatbot_add_to_cart)));
1596 1525 }
1597 1526 if(isset($_POST["qlcd_wp_chatbot_cart_link"])){
1598 - $qlcd_wp_chatbot_cart_link= @wp_unslash($_POST["qlcd_wp_chatbot_cart_link"]);
1527 + $qlcd_wp_chatbot_cart_link= @$_POST["qlcd_wp_chatbot_cart_link"];
1599 1528 update_option('qlcd_wp_chatbot_cart_link', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_link)));
1600 1529 }
1601 1530 if(isset($_POST["qlcd_wp_chatbot_checkout_link"])){
1602 - $qlcd_wp_chatbot_checkout_link= @wp_unslash($_POST["qlcd_wp_chatbot_checkout_link"]);
1531 + $qlcd_wp_chatbot_checkout_link= @$_POST["qlcd_wp_chatbot_checkout_link"];
1603 1532 update_option('qlcd_wp_chatbot_checkout_link', maybe_serialize(sanitize_array($qlcd_wp_chatbot_checkout_link)));
1604 1533 }
1605 1534 if(isset($_POST["qlcd_wp_chatbot_cart_welcome"])){
1606 - $qlcd_wp_chatbot_cart_welcome= (@wp_unslash($_POST["qlcd_wp_chatbot_cart_welcome"]));
1535 + $qlcd_wp_chatbot_cart_welcome= (@$_POST["qlcd_wp_chatbot_cart_welcome"]);
1607 1536 update_option('qlcd_wp_chatbot_cart_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_welcome)));
1608 1537 }
1609 1538 if(isset($_POST["qlcd_wp_chatbot_featured_product_welcome"])){
1610 - $qlcd_wp_chatbot_featured_product_welcome= @wp_unslash($_POST["qlcd_wp_chatbot_featured_product_welcome"]);
1539 + $qlcd_wp_chatbot_featured_product_welcome= @$_POST["qlcd_wp_chatbot_featured_product_welcome"];
1611 1540 update_option('qlcd_wp_chatbot_featured_product_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_featured_product_welcome)));
1612 1541 }
1613 1542
1614 1543 if(isset($_POST["qlcd_wp_chatbot_viewed_product_welcome"])){
1615 - $qlcd_wp_chatbot_viewed_product_welcome= @wp_unslash($_POST["qlcd_wp_chatbot_viewed_product_welcome"]);
1544 + $qlcd_wp_chatbot_viewed_product_welcome= @$_POST["qlcd_wp_chatbot_viewed_product_welcome"];
1616 1545 update_option('qlcd_wp_chatbot_viewed_product_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_viewed_product_welcome)));
1617 1546 }
1618 1547 if(isset($_POST["qlcd_wp_chatbot_latest_product_welcome"])){
1619 - $qlcd_wp_chatbot_latest_product_welcome= @wp_unslash($_POST["qlcd_wp_chatbot_latest_product_welcome"]);
1548 + $qlcd_wp_chatbot_latest_product_welcome= @$_POST["qlcd_wp_chatbot_latest_product_welcome"];
1620 1549 update_option('qlcd_wp_chatbot_latest_product_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_latest_product_welcome)));
1621 1550 }
1622 1551
1623 1552 if(isset($_POST["qlcd_wp_chatbot_cart_title"])){
1624 - $qlcd_wp_chatbot_cart_title= @wp_unslash($_POST["qlcd_wp_chatbot_cart_title"]);
1553 + $qlcd_wp_chatbot_cart_title= @$_POST["qlcd_wp_chatbot_cart_title"];
1625 1554 update_option('qlcd_wp_chatbot_cart_title', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_title)));
1626 1555 }
1627 1556 if(isset($_POST["qlcd_wp_chatbot_cart_quantity"])){
1628 - $qlcd_wp_chatbot_cart_quantity= @wp_unslash($_POST["qlcd_wp_chatbot_cart_quantity"]);
1557 + $qlcd_wp_chatbot_cart_quantity= @$_POST["qlcd_wp_chatbot_cart_quantity"];
1629 1558 update_option('qlcd_wp_chatbot_cart_quantity', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_quantity)));
1630 1559 }
1631 1560 if(isset($_POST["qlcd_wp_chatbot_cart_price"])){
1632 - $qlcd_wp_chatbot_cart_price= @wp_unslash($_POST["qlcd_wp_chatbot_cart_price"]);
1561 + $qlcd_wp_chatbot_cart_price= @$_POST["qlcd_wp_chatbot_cart_price"];
1633 1562 update_option('qlcd_wp_chatbot_cart_price', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_price)));
1634 1563 }
1635 1564 if(isset($_POST["qlcd_wp_chatbot_no_cart_items"])){
1636 1565 $qlcd_wp_chatbot_no_cart_items= wp_unslash(@$_POST["qlcd_wp_chatbot_no_cart_items"]);
@@ -1636,20 +1565,18 @@
1636 1565 $qlcd_wp_chatbot_no_cart_items= wp_unslash(@$_POST["qlcd_wp_chatbot_no_cart_items"]);
1637 1566 update_option('qlcd_wp_chatbot_no_cart_items', maybe_serialize(sanitize_array($qlcd_wp_chatbot_no_cart_items)));
1638 1567 }
1639 1568 if(isset($_POST["qlcd_wp_chatbot_cart_updating"])){
1640 - $qlcd_wp_chatbot_cart_updating= @wp_unslash($_POST["qlcd_wp_chatbot_cart_updating"]);
1569 + $qlcd_wp_chatbot_cart_updating= @$_POST["qlcd_wp_chatbot_cart_updating"];
1641 1570 update_option('qlcd_wp_chatbot_cart_updating', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_updating)));
1642 1571 }
1643 1572 if(isset($_POST["qlcd_wp_chatbot_cart_removing"])){
1644 - $qlcd_wp_chatbot_cart_removing= @wp_unslash($_POST["qlcd_wp_chatbot_cart_removing"]);
1573 + $qlcd_wp_chatbot_cart_removing= @$_POST["qlcd_wp_chatbot_cart_removing"];
1645 1574 update_option('qlcd_wp_chatbot_cart_removing', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_removing)));
1646 1575 }
1647 1576 //wpwBot wildcard settings
1648 1577 if (isset($_POST["qlcd_wp_chatbot_wildcard_msg"])) {
1649 - $qlcd_wp_chatbot_wildcard_msg = wp_unslash( $_POST["qlcd_wp_chatbot_wildcard_msg"] );
1650 - $qlcd_wp_chatbot_wildcard_msg = sanitize_array( $qlcd_wp_chatbot_wildcard_msg );
1651 -
1578 + $qlcd_wp_chatbot_wildcard_msg = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_wildcard_msg"]));
1652 1579 update_option('qlcd_wp_chatbot_wildcard_msg', maybe_serialize($qlcd_wp_chatbot_wildcard_msg));
1653 1580 } else {
1654 1581 update_option('qlcd_wp_chatbot_wildcard_msg', maybe_serialize(array()));
1655 1582 }
@@ -1654,11 +1581,9 @@
1654 1581 update_option('qlcd_wp_chatbot_wildcard_msg', maybe_serialize(array()));
1655 1582 }
1656 1583 //empty filter message repeat.
1657 1584 if (isset($_POST["qlcd_wp_chatbot_empty_filter_msg"])) {
1658 - $qlcd_wp_chatbot_empty_filter_msg = wp_unslash( $_POST["qlcd_wp_chatbot_empty_filter_msg"] );
1659 - $qlcd_wp_chatbot_empty_filter_msg = sanitize_array( $qlcd_wp_chatbot_empty_filter_msg );
1660 -
1585 + $qlcd_wp_chatbot_empty_filter_msg = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_empty_filter_msg"]));
1661 1586 update_option('qlcd_wp_chatbot_empty_filter_msg', maybe_serialize($qlcd_wp_chatbot_empty_filter_msg));
1662 1587 } else {
1663 1588 update_option('qlcd_wp_chatbot_empty_filter_msg', maybe_serialize(array()));
1664 1589 }
@@ -1663,10 +1588,9 @@
1663 1588 update_option('qlcd_wp_chatbot_empty_filter_msg', maybe_serialize(array()));
1664 1589 }
1665 1590
1666 1591 if (isset($_POST["qlcd_wp_chatbot_did_you_mean"])) {
1667 - $qlcd_wp_chatbot_did_you_mean = wp_unslash( $_POST["qlcd_wp_chatbot_did_you_mean"] );
1668 - $qlcd_wp_chatbot_did_you_mean = sanitize_array( $qlcd_wp_chatbot_did_you_mean );
1592 + $qlcd_wp_chatbot_did_you_mean = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_did_you_mean"]));
1669 1593 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize($qlcd_wp_chatbot_did_you_mean));
1670 1594 } else {
1671 1595 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array()));
1672 1596 }
@@ -1671,17 +1595,15 @@
1671 1595 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array()));
1672 1596 }
1673 1597 //help welcome and message
1674 1598 if (isset($_POST["qlcd_wp_chatbot_help_welcome"])) {
1675 - $qlcd_wp_chatbot_help_welcome = wp_unslash( $_POST["qlcd_wp_chatbot_help_welcome"] );
1676 - $qlcd_wp_chatbot_help_welcome = sanitize_array( $qlcd_wp_chatbot_help_welcome );
1599 + $qlcd_wp_chatbot_help_welcome = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_help_welcome"]));
1677 1600 update_option('qlcd_wp_chatbot_help_welcome', maybe_serialize($qlcd_wp_chatbot_help_welcome));
1678 1601 } else {
1679 1602 update_option('qlcd_wp_chatbot_help_welcome', maybe_serialize(array()));
1680 1603 }
1681 1604 if (isset($_POST["qlcd_wp_chatbot_help_msg"])) {
1682 - $qlcd_wp_chatbot_help_msg = wp_unslash( $_POST["qlcd_wp_chatbot_help_msg"] );
1683 - $qlcd_wp_chatbot_help_msg = sanitize_array( $qlcd_wp_chatbot_help_msg );
1605 + $qlcd_wp_chatbot_help_msg = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_help_msg"]));
1684 1606 update_option('qlcd_wp_chatbot_help_msg', maybe_serialize($qlcd_wp_chatbot_help_msg));
1685 1607 } else {
1686 1608 update_option('qlcd_wp_chatbot_help_msg', maybe_serialize(array()));
1687 1609 }
@@ -1686,10 +1608,9 @@
1686 1608 update_option('qlcd_wp_chatbot_help_msg', maybe_serialize(array()));
1687 1609 }
1688 1610 //To clear Conversation history.
1689 1611 if (isset($_POST["qlcd_wp_chatbot_reset"])) {
1690 - $qlcd_wp_chatbot_reset = wp_unslash( $_POST["qlcd_wp_chatbot_reset"] );
1691 - $qlcd_wp_chatbot_reset = sanitize_array( $qlcd_wp_chatbot_reset );
1612 + $qlcd_wp_chatbot_reset = sanitize_array(wp_unslash($_POST["qlcd_wp_chatbot_reset"]));
1692 1613 update_option('qlcd_wp_chatbot_reset', maybe_serialize($qlcd_wp_chatbot_reset));
1693 1614 } else {
1694 1615 update_option('qlcd_wp_chatbot_reset', maybe_serialize(array()));
1695 1616 }
@@ -1700,17 +1621,17 @@
1700 1621 } else {
1701 1622 update_option('qlcd_wp_chatbot_sys_key_help', '');
1702 1623 }
1703 1624 if(isset($_POST["qlcd_wp_chatbot_sys_key_product"])){
1704 - $qlcd_wp_chatbot_sys_key_product = esc_html((@wp_unslash($_POST["qlcd_wp_chatbot_sys_key_product"])));
1625 + $qlcd_wp_chatbot_sys_key_product = esc_html((@$_POST["qlcd_wp_chatbot_sys_key_product"]));
1705 1626 update_option('qlcd_wp_chatbot_sys_key_product', sanitize_text_field($qlcd_wp_chatbot_sys_key_product));
1706 1627 }
1707 1628 if(isset($_POST["qlcd_wp_chatbot_sys_key_catalog"])){
1708 - $qlcd_wp_chatbot_sys_key_catalog = (@wp_unslash($_POST["qlcd_wp_chatbot_sys_key_catalog"]));
1629 + $qlcd_wp_chatbot_sys_key_catalog = (@$_POST["qlcd_wp_chatbot_sys_key_catalog"]);
1709 1630 update_option('qlcd_wp_chatbot_sys_key_catalog', sanitize_text_field($qlcd_wp_chatbot_sys_key_catalog));
1710 1631 }
1711 1632 if(isset($_POST["qlcd_wp_chatbot_sys_key_order"])){
1712 - $qlcd_wp_chatbot_sys_key_order = (@wp_unslash($_POST["qlcd_wp_chatbot_sys_key_order"]));
1633 + $qlcd_wp_chatbot_sys_key_order = (@$_POST["qlcd_wp_chatbot_sys_key_order"]);
1713 1634 update_option('qlcd_wp_chatbot_sys_key_order', sanitize_text_field($qlcd_wp_chatbot_sys_key_order));
1714 1635 }
1715 1636 if (isset($_POST["qlcd_wp_chatbot_sys_key_support"])) {
1716 1637 $qlcd_wp_chatbot_sys_key_support = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_sys_key_support"]));
@@ -1730,21 +1651,21 @@
1730 1651 } else {
1731 1652 update_option('qlcd_wp_chatbot_sys_key_email', '');
1732 1653 }
1733 1654 if(isset($_POST["qlcd_wp_chatbot_wildcard_product"])){
1734 - $qlcd_wp_chatbot_wildcard_product = (@wp_unslash($_POST["qlcd_wp_chatbot_wildcard_product"]));
1655 + $qlcd_wp_chatbot_wildcard_product = (@$_POST["qlcd_wp_chatbot_wildcard_product"]);
1735 1656 update_option('qlcd_wp_chatbot_wildcard_product', maybe_serialize(sanitize_array($qlcd_wp_chatbot_wildcard_product)));
1736 1657 }
1737 1658 if(isset($_POST["qlcd_wp_chatbot_wildcard_catalog"])){
1738 - $qlcd_wp_chatbot_wildcard_catalog = (@wp_unslash($_POST["qlcd_wp_chatbot_wildcard_catalog"]));
1659 + $qlcd_wp_chatbot_wildcard_catalog = (@$_POST["qlcd_wp_chatbot_wildcard_catalog"]);
1739 1660 update_option('qlcd_wp_chatbot_wildcard_catalog', maybe_serialize(sanitize_array($qlcd_wp_chatbot_wildcard_catalog)));
1740 1661 }
1741 1662 if(isset($_POST["qlcd_wp_chatbot_featured_products"])){
1742 - $qlcd_wp_chatbot_featured_products = (@wp_unslash($_POST["qlcd_wp_chatbot_featured_products"]));
1663 + $qlcd_wp_chatbot_featured_products = (@$_POST["qlcd_wp_chatbot_featured_products"]);
1743 1664 update_option('qlcd_wp_chatbot_featured_products', maybe_serialize(sanitize_array($qlcd_wp_chatbot_featured_products)));
1744 1665 }
1745 1666 if(isset($_POST["qlcd_wp_chatbot_sale_products"])){
1746 - $qlcd_wp_chatbot_sale_products = (@wp_unslash($_POST["qlcd_wp_chatbot_sale_products"]));
1667 + $qlcd_wp_chatbot_sale_products = (@$_POST["qlcd_wp_chatbot_sale_products"]);
1747 1668 update_option('qlcd_wp_chatbot_sale_products', maybe_serialize(sanitize_array($qlcd_wp_chatbot_sale_products)));
1748 1669 }
1749 1670
1750 1671 if (isset($_POST["qlcd_wp_chatbot_wildcard_support"])) {
@@ -1761,9 +1682,9 @@
1761 1682 update_option('qlcd_wp_chatbot_wildcard_site_search', '');
1762 1683 }
1763 1684
1764 1685 if(isset($_POST["qlcd_wp_chatbot_messenger_label"])){
1765 - $qlcd_wp_chatbot_messenger_label = (@wp_unslash($_POST["qlcd_wp_chatbot_messenger_label"]));
1686 + $qlcd_wp_chatbot_messenger_label = (@$_POST["qlcd_wp_chatbot_messenger_label"]);
1766 1687 update_option('qlcd_wp_chatbot_messenger_label', maybe_serialize(sanitize_array($qlcd_wp_chatbot_messenger_label)));
1767 1688 }
1768 1689 //Products search .
1769 1690 if (isset($_POST["qlcd_wp_chatbot_product_success"])) {
@@ -1772,42 +1693,42 @@
1772 1693 $qlcd_wp_chatbot_product_success = map_deep($unslashed_data, 'sanitize_text_field');
1773 1694 update_option('qlcd_wp_chatbot_product_success', maybe_serialize($qlcd_wp_chatbot_product_success));
1774 1695 }
1775 1696 if (isset($_POST["qlcd_wp_chatbot_product_fail"])) {
1776 - $qlcd_wp_chatbot_product_fail = @wp_unslash($_POST["qlcd_wp_chatbot_product_fail"]);
1697 + $qlcd_wp_chatbot_product_fail = @$_POST["qlcd_wp_chatbot_product_fail"];
1777 1698 update_option('qlcd_wp_chatbot_product_fail', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_fail)));
1778 1699 }
1779 1700 if(isset($_POST["qlcd_wp_chatbot_product_asking"])){
1780 - $qlcd_wp_chatbot_product_asking = @wp_unslash($_POST["qlcd_wp_chatbot_product_asking"]);
1701 + $qlcd_wp_chatbot_product_asking = @$_POST["qlcd_wp_chatbot_product_asking"];
1781 1702 update_option('qlcd_wp_chatbot_product_asking', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_asking)));
1782 1703 }
1783 1704 if(isset($_POST["qlcd_wp_chatbot_product_suggest"])){
1784 - $qlcd_wp_chatbot_product_suggest = @wp_unslash($_POST["qlcd_wp_chatbot_product_suggest"]);
1705 + $qlcd_wp_chatbot_product_suggest = @$_POST["qlcd_wp_chatbot_product_suggest"];
1785 1706 update_option('qlcd_wp_chatbot_product_suggest', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_suggest)));
1786 1707 }
1787 1708 if(isset($_POST["qlcd_wp_chatbot_product_infinite"])){
1788 - $qlcd_wp_chatbot_product_infinite = @wp_unslash($_POST["qlcd_wp_chatbot_product_infinite"]);
1709 + $qlcd_wp_chatbot_product_infinite = @$_POST["qlcd_wp_chatbot_product_infinite"];
1789 1710 update_option('qlcd_wp_chatbot_product_infinite', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_infinite)));
1790 1711 }
1791 1712 if(isset($_POST["qlcd_wp_chatbot_load_more"])){
1792 - $qlcd_wp_chatbot_load_more = @wp_unslash($_POST["qlcd_wp_chatbot_load_more"]);
1713 + $qlcd_wp_chatbot_load_more = @$_POST["qlcd_wp_chatbot_load_more"];
1793 1714 update_option('qlcd_wp_chatbot_load_more', maybe_serialize(sanitize_array($qlcd_wp_chatbot_load_more)));
1794 1715 }
1795 1716 //Order
1796 1717 if(isset($_POST["qlcd_wp_chatbot_wildcard_order"])){
1797 - $qlcd_wp_chatbot_wildcard_order = @wp_unslash($_POST["qlcd_wp_chatbot_wildcard_order"]);
1718 + $qlcd_wp_chatbot_wildcard_order = @$_POST["qlcd_wp_chatbot_wildcard_order"];
1798 1719 update_option('qlcd_wp_chatbot_wildcard_order', maybe_serialize(sanitize_array($qlcd_wp_chatbot_wildcard_order)));
1799 1720 }
1800 1721 if(isset($_POST["qlcd_wp_chatbot_order_welcome"])){
1801 - $qlcd_wp_chatbot_order_welcome = @wp_unslash($_POST["qlcd_wp_chatbot_order_welcome"]);
1722 + $qlcd_wp_chatbot_order_welcome = @$_POST["qlcd_wp_chatbot_order_welcome"];
1802 1723 update_option('qlcd_wp_chatbot_order_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_welcome)));
1803 1724 }
1804 1725 if(isset($_POST["qlcd_wp_chatbot_order_username_asking"])){
1805 - $qlcd_wp_chatbot_order_username_asking = @wp_unslash($_POST["qlcd_wp_chatbot_order_username_asking"]);
1726 + $qlcd_wp_chatbot_order_username_asking = @$_POST["qlcd_wp_chatbot_order_username_asking"];
1806 1727 update_option('qlcd_wp_chatbot_order_username_asking', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_username_asking)));
1807 1728 }
1808 1729 if(isset($_POST["qlcd_wp_chatbot_order_username_not_exist"])){
1809 - $qlcd_wp_chatbot_order_username_not_exist = @wp_unslash($_POST["qlcd_wp_chatbot_order_username_not_exist"]);
1730 + $qlcd_wp_chatbot_order_username_not_exist = @$_POST["qlcd_wp_chatbot_order_username_not_exist"];
1810 1731 update_option('qlcd_wp_chatbot_order_username_not_exist', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_username_not_exist)));
1811 1732 }
1812 1733 if (isset($_POST["qlcd_wp_chatbot_order_username_thanks"])) {
1813 1734 // Unslash the input first, then sanitize deeply as text, assuming it's an array of texts or a single text.
@@ -1815,55 +1736,52 @@
1815 1736 $qlcd_wp_chatbot_order_username_thanks = map_deep($unslashed_data, 'sanitize_text_field');
1816 1737 update_option('qlcd_wp_chatbot_order_username_thanks', maybe_serialize($qlcd_wp_chatbot_order_username_thanks));
1817 1738 }
1818 1739 if(isset($_POST["qlcd_wp_chatbot_order_username_password"])){
1819 - $qlcd_wp_chatbot_order_username_password = @wp_unslash($_POST["qlcd_wp_chatbot_order_username_password"]);
1740 + $qlcd_wp_chatbot_order_username_password = @$_POST["qlcd_wp_chatbot_order_username_password"];
1820 1741 update_option('qlcd_wp_chatbot_order_username_password', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_username_password)));
1821 1742 }
1822 1743 if(isset($_POST["qlcd_wp_chatbot_order_password_incorrect"])){
1823 - $qlcd_wp_chatbot_order_password_incorrect= @wp_unslash($_POST["qlcd_wp_chatbot_order_password_incorrect"]);
1744 + $qlcd_wp_chatbot_order_password_incorrect= @$_POST["qlcd_wp_chatbot_order_password_incorrect"];
1824 1745 update_option('qlcd_wp_chatbot_order_password_incorrect', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_password_incorrect)));
1825 1746 }
1826 1747 if(isset($_POST["qlcd_wp_chatbot_order_not_found"])){
1827 - $qlcd_wp_chatbot_order_not_found= @wp_unslash($_POST["qlcd_wp_chatbot_order_not_found"]);
1748 + $qlcd_wp_chatbot_order_not_found= @$_POST["qlcd_wp_chatbot_order_not_found"];
1828 1749 update_option('qlcd_wp_chatbot_order_not_found', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_not_found)));
1829 1750 }
1830 1751 if(isset($_POST["qlcd_wp_chatbot_order_found"])){
1831 - $qlcd_wp_chatbot_order_found= @wp_unslash($_POST["qlcd_wp_chatbot_order_found"]);
1752 + $qlcd_wp_chatbot_order_found= @$_POST["qlcd_wp_chatbot_order_found"];
1832 1753 update_option('qlcd_wp_chatbot_order_found', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_found)));
1833 1754 }
1834 1755 if(isset( $_POST["qlcd_wp_chatbot_order_email_support"])){
1835 - $qlcd_wp_chatbot_order_email_support= @wp_unslash($_POST["qlcd_wp_chatbot_order_email_support"]);
1756 + $qlcd_wp_chatbot_order_email_support= @$_POST["qlcd_wp_chatbot_order_email_support"];
1836 1757 update_option('qlcd_wp_chatbot_order_email_support', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_email_support)));
1837 1758 }
1838 1759 //Support
1839 1760 if (isset($_POST["qlcd_wp_chatbot_support_welcome"])) {
1840 - $qlcd_wp_chatbot_support_welcome = wp_unslash($_POST["qlcd_wp_chatbot_support_welcome"]);
1841 - $qlcd_wp_chatbot_support_welcome = sanitize_array($qlcd_wp_chatbot_support_welcome);
1761 + $qlcd_wp_chatbot_support_welcome = sanitize_array($_POST["qlcd_wp_chatbot_support_welcome"]);
1842 1762 update_option('qlcd_wp_chatbot_support_welcome', maybe_serialize($qlcd_wp_chatbot_support_welcome));
1843 1763 }
1844 1764 if (isset($_POST["qlcd_wp_chatbot_support_email"])) {
1845 - $qlcd_wp_chatbot_support_email = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_support_email"]));
1765 + $qlcd_wp_chatbot_support_email = sanitize_text_field($_POST["qlcd_wp_chatbot_support_email"]);
1846 1766 update_option('qlcd_wp_chatbot_support_email', $qlcd_wp_chatbot_support_email);
1847 1767 }
1848 1768 if (isset($_POST["qlcd_wp_chatbot_asking_email"])) {
1849 - $qlcd_wp_chatbot_asking_email = wp_unslash($_POST["qlcd_wp_chatbot_asking_email"]);
1850 - $qlcd_wp_chatbot_asking_email = sanitize_array($qlcd_wp_chatbot_asking_email);
1769 + $qlcd_wp_chatbot_asking_email = sanitize_array($_POST["qlcd_wp_chatbot_asking_email"]);
1851 1770 update_option('qlcd_wp_chatbot_asking_email', maybe_serialize($qlcd_wp_chatbot_asking_email));
1852 1771 }
1853 1772 if (isset($_POST["qlcd_wp_chatbot_asking_msg"])) {
1854 - $qlcd_wp_chatbot_asking_msg = wp_unslash($_POST["qlcd_wp_chatbot_asking_msg"]);
1855 - $qlcd_wp_chatbot_asking_msg = sanitize_array($qlcd_wp_chatbot_asking_msg);
1773 + $qlcd_wp_chatbot_asking_msg = sanitize_array($_POST["qlcd_wp_chatbot_asking_msg"]);
1856 1774 update_option('qlcd_wp_chatbot_asking_msg', maybe_serialize($qlcd_wp_chatbot_asking_msg));
1857 1775 }
1858 1776
1859 1777 if(isset($_POST["qlcd_wp_chatbot_no_result"])){
1860 - $qlcd_wp_chatbot_no_result = @wp_unslash($_POST["qlcd_wp_chatbot_no_result"]);
1778 + $qlcd_wp_chatbot_no_result = @$_POST["qlcd_wp_chatbot_no_result"];
1861 1779 update_option('qlcd_wp_chatbot_no_result', maybe_serialize(sanitize_array($qlcd_wp_chatbot_no_result)));
1862 1780 }
1863 1781
1864 1782 if (isset($_POST["qlcd_wp_chatbot_support_option_again"])) {
1865 - $qlcd_wp_chatbot_support_option_again = wp_unslash($_POST["qlcd_wp_chatbot_support_option_again"]);
1783 + $qlcd_wp_chatbot_support_option_again = $_POST["qlcd_wp_chatbot_support_option_again"];
1866 1784 update_option('qlcd_wp_chatbot_support_option_again', maybe_serialize(sanitize_array($qlcd_wp_chatbot_support_option_again)));
1867 1785 } else {
1868 1786 update_option('qlcd_wp_chatbot_support_option_again', maybe_serialize(array()));
1869 1787 }
@@ -1868,9 +1786,9 @@
1868 1786 update_option('qlcd_wp_chatbot_support_option_again', maybe_serialize(array()));
1869 1787 }
1870 1788
1871 1789 if (isset($_POST["qlcd_wp_chatbot_invalid_email"])) {
1872 - $qlcd_wp_chatbot_invalid_email = wp_unslash($_POST["qlcd_wp_chatbot_invalid_email"]);
1790 + $qlcd_wp_chatbot_invalid_email = $_POST["qlcd_wp_chatbot_invalid_email"];
1873 1791 update_option('qlcd_wp_chatbot_invalid_email', maybe_serialize(sanitize_array($qlcd_wp_chatbot_invalid_email)));
1874 1792 } else {
1875 1793 update_option('qlcd_wp_chatbot_invalid_email', maybe_serialize(array()));
1876 1794 }
@@ -1875,9 +1793,9 @@
1875 1793 update_option('qlcd_wp_chatbot_invalid_email', maybe_serialize(array()));
1876 1794 }
1877 1795
1878 1796 if (isset($_POST["qlcd_wp_chatbot_support_phone"])) {
1879 - $qlcd_wp_chatbot_support_phone = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_support_phone"]));
1797 + $qlcd_wp_chatbot_support_phone = sanitize_text_field($_POST["qlcd_wp_chatbot_support_phone"]);
1880 1798 update_option('qlcd_wp_chatbot_support_phone', $qlcd_wp_chatbot_support_phone);
1881 1799 } else {
1882 1800 update_option('qlcd_wp_chatbot_support_phone', '');
1883 1801 }
@@ -1882,9 +1800,9 @@
1882 1800 update_option('qlcd_wp_chatbot_support_phone', '');
1883 1801 }
1884 1802
1885 1803 if (isset($_POST["qlcd_wp_chatbot_asking_phone"])) {
1886 - $qlcd_wp_chatbot_asking_phone = wp_unslash($_POST["qlcd_wp_chatbot_asking_phone"]);
1804 + $qlcd_wp_chatbot_asking_phone = $_POST["qlcd_wp_chatbot_asking_phone"];
1887 1805 update_option('qlcd_wp_chatbot_asking_phone', maybe_serialize(sanitize_array($qlcd_wp_chatbot_asking_phone)));
1888 1806 } else {
1889 1807 update_option('qlcd_wp_chatbot_asking_phone', maybe_serialize(array()));
1890 1808 }
@@ -1889,9 +1807,9 @@
1889 1807 update_option('qlcd_wp_chatbot_asking_phone', maybe_serialize(array()));
1890 1808 }
1891 1809
1892 1810 if (isset($_POST["qlcd_wp_chatbot_thank_for_phone"])) {
1893 - $qlcd_wp_chatbot_thank_for_phone = wp_unslash($_POST["qlcd_wp_chatbot_thank_for_phone"]);
1811 + $qlcd_wp_chatbot_thank_for_phone = $_POST["qlcd_wp_chatbot_thank_for_phone"];
1894 1812 update_option('qlcd_wp_chatbot_thank_for_phone', maybe_serialize(sanitize_array($qlcd_wp_chatbot_thank_for_phone)));
1895 1813 } else {
1896 1814 update_option('qlcd_wp_chatbot_thank_for_phone', maybe_serialize(array()));
1897 1815 }
@@ -1896,9 +1814,9 @@
1896 1814 update_option('qlcd_wp_chatbot_thank_for_phone', maybe_serialize(array()));
1897 1815 }
1898 1816
1899 1817 if (isset($_POST["qlcd_wp_chatbot_admin_email"])) {
1900 - $qlcd_wp_chatbot_admin_email = sanitize_email(wp_unslash($_POST["qlcd_wp_chatbot_admin_email"]));
1818 + $qlcd_wp_chatbot_admin_email = sanitize_email($_POST["qlcd_wp_chatbot_admin_email"]);
1901 1819 } else {
1902 1820 $qlcd_wp_chatbot_admin_email = '';
1903 1821 }
1904 1822
@@ -1943,9 +1861,9 @@
1943 1861 update_option('qlcd_wp_chatbot_notification_interval', $qlcd_wp_chatbot_notification_interval);
1944 1862 }
1945 1863
1946 1864 if(isset($_POST["qlcd_wp_chatbot_notifications"])){
1947 - $qlcd_wp_chatbot_notifications = @wp_unslash($_POST["qlcd_wp_chatbot_notifications"]);
1865 + $qlcd_wp_chatbot_notifications = @$_POST["qlcd_wp_chatbot_notifications"];
1948 1866 update_option('qlcd_wp_chatbot_notifications', maybe_serialize(sanitize_array($qlcd_wp_chatbot_notifications)));
1949 1867 }
1950 1868 //Support building part.
1951 1869
@@ -1957,9 +1875,9 @@
1957 1875 'br' => array(),
1958 1876 'em' => array(),
1959 1877 'strong' => array(),
1960 1878 );
1961 - $support_query = @wp_unslash($_POST["support_query"]);
1879 + $support_query = @$_POST["support_query"];
1962 1880 $clean_support_query = [];
1963 1881 if(!empty($support_query)){
1964 1882 foreach($support_query as $key => $val) {
1965 1883
@@ -1966,9 +1884,9 @@
1966 1884 $clean_support_query[wp_kses($key,$allowed_html)] = wp_kses($val,$allowed_html);
1967 1885 }
1968 1886 }
1969 1887 update_option('support_query', (maybe_serialize($clean_support_query)));
1970 - $support_ans = @wp_unslash($_POST["support_ans"]);
1888 + $support_ans = @$_POST["support_ans"];
1971 1889 $clean_support_ans = [];
1972 1890 if(!empty($support_query)){
1973 1891 foreach($support_ans as $key => $val) {
1974 1892 $clean_support_ans[wp_kses($key,$allowed_html)] = wp_kses($val,$allowed_html);
@@ -1976,241 +1894,241 @@
1976 1894 }
1977 1895 update_option('support_ans', (maybe_serialize($clean_support_ans)));
1978 1896 //Create Mobile app pages.
1979 1897 if(isset( $_POST["wp_chatbot_app_pages"])) {
1980 - $wp_chatbot_app_pages = wp_unslash($_POST["wp_chatbot_app_pages"]);
1898 + $wp_chatbot_app_pages = $_POST["wp_chatbot_app_pages"];
1981 1899 }else{ $wp_chatbot_app_pages='';}
1982 1900 update_option('wp_chatbot_app_pages', wp_unslash($wp_chatbot_app_pages));
1983 1901 //Messenger Options
1984 1902 if(isset( $_POST["enable_wp_chatbot_messenger"])) {
1985 - $enable_wp_chatbot_messenger = wp_unslash($_POST["enable_wp_chatbot_messenger"]);
1903 + $enable_wp_chatbot_messenger = $_POST["enable_wp_chatbot_messenger"];
1986 1904 }else{ $enable_wp_chatbot_messenger='';}
1987 1905 update_option('enable_wp_chatbot_messenger', wp_unslash($enable_wp_chatbot_messenger));
1988 1906 if(isset( $_POST["enable_wp_chatbot_messenger_floating_icon"])) {
1989 - $enable_wp_chatbot_messenger_floating_icon = wp_unslash($_POST["enable_wp_chatbot_messenger_floating_icon"]);
1907 + $enable_wp_chatbot_messenger_floating_icon = $_POST["enable_wp_chatbot_messenger_floating_icon"];
1990 1908 }else{ $enable_wp_chatbot_messenger_floating_icon='';}
1991 1909 update_option('enable_wp_chatbot_messenger_floating_icon', wp_unslash($enable_wp_chatbot_messenger_floating_icon));
1992 1910 if(isset($_POST["qlcd_wp_chatbot_fb_app_id"])){
1993 - $qlcd_wp_chatbot_fb_app_id = @wp_unslash($_POST["qlcd_wp_chatbot_fb_app_id"]);
1911 + $qlcd_wp_chatbot_fb_app_id = @$_POST["qlcd_wp_chatbot_fb_app_id"];
1994 1912 update_option('qlcd_wp_chatbot_fb_app_id', sanitize_text_field($qlcd_wp_chatbot_fb_app_id));
1995 1913 }
1996 1914 if(isset($_POST["qlcd_wp_chatbot_fb_page_id"])){
1997 - $qlcd_wp_chatbot_fb_page_id = @wp_unslash($_POST["qlcd_wp_chatbot_fb_page_id"]);
1915 + $qlcd_wp_chatbot_fb_page_id = @$_POST["qlcd_wp_chatbot_fb_page_id"];
1998 1916 update_option('qlcd_wp_chatbot_fb_page_id', sanitize_text_field($qlcd_wp_chatbot_fb_page_id));
1999 1917 }
2000 1918 if(isset($_POST["qlcd_wp_chatbot_fb_color"])){
2001 - $qlcd_wp_chatbot_fb_color= @wp_unslash($_POST["qlcd_wp_chatbot_fb_color"]);
1919 + $qlcd_wp_chatbot_fb_color= @$_POST["qlcd_wp_chatbot_fb_color"];
2002 1920 update_option('qlcd_wp_chatbot_fb_color', wp_unslash($qlcd_wp_chatbot_fb_color));
2003 1921 }
2004 1922 if(isset($_POST["qlcd_wp_chatbot_fb_in_msg"])){
2005 - $qlcd_wp_chatbot_fb_in_msg = @wp_unslash($_POST["qlcd_wp_chatbot_fb_in_msg"]);
1923 + $qlcd_wp_chatbot_fb_in_msg = @$_POST["qlcd_wp_chatbot_fb_in_msg"];
2006 1924 update_option('qlcd_wp_chatbot_fb_in_msg', stripslashes(sanitize_text_field($qlcd_wp_chatbot_fb_in_msg)));
2007 1925 }
2008 1926 if(isset($_POST["qlcd_wp_chatbot_fb_out_msg"])){
2009 - $qlcd_wp_chatbot_fb_out_msg = @wp_unslash($_POST["qlcd_wp_chatbot_fb_out_msg"]);
1927 + $qlcd_wp_chatbot_fb_out_msg = @$_POST["qlcd_wp_chatbot_fb_out_msg"];
2010 1928 update_option('qlcd_wp_chatbot_fb_out_msg', stripslashes(sanitize_text_field($qlcd_wp_chatbot_fb_out_msg)));
2011 1929 }
2012 1930 //Skype option
2013 1931 if(isset( $_POST["enable_wp_chatbot_skype_floating_icon"])) {
2014 - $enable_wp_chatbot_skype_floating_icon = wp_unslash($_POST["enable_wp_chatbot_skype_floating_icon"]);
1932 + $enable_wp_chatbot_skype_floating_icon = $_POST["enable_wp_chatbot_skype_floating_icon"];
2015 1933 }else{ $enable_wp_chatbot_skype_floating_icon='';}
2016 1934 update_option('enable_wp_chatbot_skype_floating_icon', sanitize_text_field($enable_wp_chatbot_skype_floating_icon));
2017 1935 if(isset( $_POST["enable_wp_chatbot_skype_id"])) {
2018 - $enable_wp_chatbot_skype_id = wp_unslash($_POST["enable_wp_chatbot_skype_id"]);
1936 + $enable_wp_chatbot_skype_id = $_POST["enable_wp_chatbot_skype_id"];
2019 1937 }else{ $enable_wp_chatbot_skype_id='';}
2020 1938 update_option('enable_wp_chatbot_skype_id', sanitize_text_field($enable_wp_chatbot_skype_id));
2021 1939 //WhatsApp
2022 1940 if(isset( $_POST["enable_wp_chatbot_whats"])) {
2023 - $enable_wp_chatbot_whats= wp_unslash($_POST["enable_wp_chatbot_whats"]);
1941 + $enable_wp_chatbot_whats= $_POST["enable_wp_chatbot_whats"];
2024 1942 }else{ $enable_wp_chatbot_whats='';}
2025 1943 update_option('enable_wp_chatbot_whats', sanitize_text_field($enable_wp_chatbot_whats));
2026 1944 if(isset($_POST["qlcd_wp_chatbot_whats_label"])){
2027 - $qlcd_wp_chatbot_whats_label = @wp_unslash($_POST["qlcd_wp_chatbot_whats_label"]);
1945 + $qlcd_wp_chatbot_whats_label = @$_POST["qlcd_wp_chatbot_whats_label"];
2028 1946 update_option('qlcd_wp_chatbot_whats_label', maybe_serialize(sanitize_array($qlcd_wp_chatbot_whats_label)));
2029 1947 }
2030 1948 if(isset( $_POST["enable_wp_chatbot_floating_whats"])) {
2031 - $enable_wp_chatbot_floating_whats= wp_unslash($_POST["enable_wp_chatbot_floating_whats"]);
1949 + $enable_wp_chatbot_floating_whats= $_POST["enable_wp_chatbot_floating_whats"];
2032 1950 }else{ $enable_wp_chatbot_floating_whats='';}
2033 1951 update_option('enable_wp_chatbot_floating_whats', sanitize_text_field($enable_wp_chatbot_floating_whats));
2034 1952 if(isset($_POST["qlcd_wp_chatbot_whats_num"])){
2035 - $qlcd_wp_chatbot_whats_num = @wp_unslash($_POST["qlcd_wp_chatbot_whats_num"]);
1953 + $qlcd_wp_chatbot_whats_num = @$_POST["qlcd_wp_chatbot_whats_num"];
2036 1954 update_option('qlcd_wp_chatbot_whats_num', sanitize_text_field($qlcd_wp_chatbot_whats_num));
2037 1955 }
2038 1956 //Viber
2039 1957 if(isset( $_POST["enable_wp_chatbot_floating_viber"])) {
2040 - $enable_wp_chatbot_floating_viber = wp_unslash($_POST["enable_wp_chatbot_floating_viber"]);
1958 + $enable_wp_chatbot_floating_viber = $_POST["enable_wp_chatbot_floating_viber"];
2041 1959 }else{ $enable_wp_chatbot_floating_viber='';}
2042 1960 update_option('enable_wp_chatbot_floating_viber', sanitize_text_field($enable_wp_chatbot_floating_viber));
2043 1961 if(isset($_POST["qlcd_wp_chatbot_viber_acc"])){
2044 - $qlcd_wp_chatbot_viber_acc = @wp_unslash($_POST["qlcd_wp_chatbot_viber_acc"]);
1962 + $qlcd_wp_chatbot_viber_acc = @$_POST["qlcd_wp_chatbot_viber_acc"];
2045 1963 update_option('qlcd_wp_chatbot_viber_acc', sanitize_text_field($qlcd_wp_chatbot_viber_acc));
2046 1964 }
2047 1965 //Others integration
2048 1966 if(isset( $_POST["enable_wp_chatbot_floating_phone"])) {
2049 - $enable_wp_chatbot_floating_phone = wp_unslash($_POST["enable_wp_chatbot_floating_phone"]);
1967 + $enable_wp_chatbot_floating_phone = $_POST["enable_wp_chatbot_floating_phone"];
2050 1968 }else{ $enable_wp_chatbot_floating_phone='';}
2051 1969 update_option('enable_wp_chatbot_floating_phone', sanitize_text_field($enable_wp_chatbot_floating_phone));
2052 1970 if(isset($_POST["qlcd_wp_chatbot_phone"])){
2053 - $qlcd_wp_chatbot_phone = @wp_unslash($_POST["qlcd_wp_chatbot_phone"]);
1971 + $qlcd_wp_chatbot_phone = @$_POST["qlcd_wp_chatbot_phone"];
2054 1972 update_option('qlcd_wp_chatbot_phone', sanitize_text_field($qlcd_wp_chatbot_phone));
2055 1973 }
2056 1974
2057 1975 if(isset( $_POST["enable_wp_chatbot_floating_link"])) {
2058 - $enable_wp_chatbot_floating_link = wp_unslash($_POST["enable_wp_chatbot_floating_link"]);
1976 + $enable_wp_chatbot_floating_link = $_POST["enable_wp_chatbot_floating_link"];
2059 1977 }else{ $enable_wp_chatbot_floating_link='';}
2060 1978 update_option('enable_wp_chatbot_floating_link', sanitize_text_field($enable_wp_chatbot_floating_link));
2061 1979 if(isset($_POST["qlcd_wp_chatbot_weblink"])){
2062 - $qlcd_wp_chatbot_weblink = @wp_unslash($_POST["qlcd_wp_chatbot_weblink"]);
1980 + $qlcd_wp_chatbot_weblink = @$_POST["qlcd_wp_chatbot_weblink"];
2063 1981 update_option('qlcd_wp_chatbot_weblink', sanitize_text_field($qlcd_wp_chatbot_weblink));
2064 1982 }
2065 1983
2066 1984 //Re Targetting.
2067 1985 if(isset($_POST["qlcd_wp_chatbot_ret_greet"])){
2068 - $qlcd_wp_chatbot_ret_greet = @wp_unslash($_POST["qlcd_wp_chatbot_ret_greet"]);
1986 + $qlcd_wp_chatbot_ret_greet = @$_POST["qlcd_wp_chatbot_ret_greet"];
2069 1987 update_option('qlcd_wp_chatbot_ret_greet', sanitize_text_field($qlcd_wp_chatbot_ret_greet));
2070 1988 }
2071 1989
2072 1990 if(isset( $_POST["enable_wp_chatbot_exit_intent"])) {
2073 - $enable_wp_chatbot_exit_intent = wp_unslash($_POST["enable_wp_chatbot_exit_intent"]);
1991 + $enable_wp_chatbot_exit_intent = $_POST["enable_wp_chatbot_exit_intent"];
2074 1992 }else{ $enable_wp_chatbot_exit_intent='';}
2075 1993 update_option('enable_wp_chatbot_exit_intent', sanitize_text_field($enable_wp_chatbot_exit_intent));
2076 1994
2077 1995 if(isset($_POST["wp_chatbot_exit_intent_msg"])){
2078 - $wp_chatbot_exit_intent_msg = @wp_unslash($_POST["wp_chatbot_exit_intent_msg"]);
1996 + $wp_chatbot_exit_intent_msg = @$_POST["wp_chatbot_exit_intent_msg"];
2079 1997 update_option('wp_chatbot_exit_intent_msg', wp_unslash($wp_chatbot_exit_intent_msg));
2080 1998 }
2081 1999
2082 2000 if(isset( $_POST["wp_chatbot_exit_intent_once"])) {
2083 - $wp_chatbot_exit_intent_once = wp_unslash($_POST["wp_chatbot_exit_intent_once"]);
2001 + $wp_chatbot_exit_intent_once = $_POST["wp_chatbot_exit_intent_once"];
2084 2002 }else{ $wp_chatbot_exit_intent_once='';}
2085 2003 update_option('wp_chatbot_exit_intent_once', sanitize_text_field($wp_chatbot_exit_intent_once));
2086 2004
2087 2005 if(isset( $_POST["enable_wp_chatbot_scroll_open"])) {
2088 - $enable_wp_chatbot_scroll_open = wp_unslash($_POST["enable_wp_chatbot_scroll_open"]);
2006 + $enable_wp_chatbot_scroll_open = $_POST["enable_wp_chatbot_scroll_open"];
2089 2007 }else{ $enable_wp_chatbot_scroll_open='';}
2090 2008 update_option('enable_wp_chatbot_scroll_open', sanitize_text_field($enable_wp_chatbot_scroll_open));
2091 2009
2092 2010 if(isset($_POST["wp_chatbot_scroll_open_msg"])){
2093 - $wp_chatbot_scroll_open_msg= @wp_unslash($_POST["wp_chatbot_scroll_open_msg"]);
2011 + $wp_chatbot_scroll_open_msg= @$_POST["wp_chatbot_scroll_open_msg"];
2094 2012 update_option('wp_chatbot_scroll_open_msg', wp_unslash($wp_chatbot_scroll_open_msg));
2095 2013 }
2096 2014
2097 2015 if(isset($_POST["wp_chatbot_scroll_percent"])){
2098 - $wp_chatbot_scroll_percent= @wp_unslash($_POST["wp_chatbot_scroll_percent"]);
2016 + $wp_chatbot_scroll_percent= @$_POST["wp_chatbot_scroll_percent"];
2099 2017 update_option('wp_chatbot_scroll_percent', wp_unslash($wp_chatbot_scroll_percent));
2100 2018 }
2101 2019
2102 2020 if(isset( $_POST["wp_chatbot_scroll_once"])) {
2103 - $wp_chatbot_scroll_once = sanitize_text_field(wp_unslash($_POST["wp_chatbot_scroll_once"]));
2021 + $wp_chatbot_scroll_once = sanitize_text_field($_POST["wp_chatbot_scroll_once"]);
2104 2022 }else{ $wp_chatbot_scroll_once='';}
2105 2023 update_option('wp_chatbot_scroll_once', $wp_chatbot_scroll_once);
2106 2024
2107 2025 if(isset( $_POST["enable_wp_chatbot_auto_open"])) {
2108 - $enable_wp_chatbot_auto_open = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_auto_open"]));
2026 + $enable_wp_chatbot_auto_open = sanitize_text_field($_POST["enable_wp_chatbot_auto_open"]);
2109 2027 }else{ $enable_wp_chatbot_auto_open='';}
2110 2028 update_option('enable_wp_chatbot_auto_open', $enable_wp_chatbot_auto_open);
2111 2029
2112 2030 if(isset( $_POST["enable_wp_chatbot_ret_sound"])) {
2113 - $enable_wp_chatbot_ret_sound = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_ret_sound"]));
2031 + $enable_wp_chatbot_ret_sound = sanitize_text_field($_POST["enable_wp_chatbot_ret_sound"]);
2114 2032 }else{ $enable_wp_chatbot_ret_sound='';}
2115 2033 update_option('enable_wp_chatbot_ret_sound', $enable_wp_chatbot_ret_sound);
2116 2034
2117 2035 if(isset( $_POST["enable_wp_chatbot_sound_initial"])) {
2118 - $enable_wp_chatbot_sound_initial = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_sound_initial"]));
2036 + $enable_wp_chatbot_sound_initial = sanitize_text_field($_POST["enable_wp_chatbot_sound_initial"]);
2119 2037 }else{ $enable_wp_chatbot_sound_initial='';}
2120 2038 update_option('enable_wp_chatbot_sound_initial', $enable_wp_chatbot_sound_initial);
2121 2039
2122 2040
2123 2041 if(isset($_POST["wp_chatbot_auto_open_msg"])){
2124 - $wp_chatbot_auto_open_msg = @wp_unslash($_POST["wp_chatbot_auto_open_msg"]);
2042 + $wp_chatbot_auto_open_msg = @$_POST["wp_chatbot_auto_open_msg"];
2125 2043 update_option('wp_chatbot_auto_open_msg', wp_unslash($wp_chatbot_auto_open_msg));
2126 2044 }
2127 2045
2128 2046 if(isset($_POST["wp_chatbot_auto_open_time"])){
2129 - $wp_chatbot_auto_open_time = @wp_unslash($_POST["wp_chatbot_auto_open_time"]);
2047 + $wp_chatbot_auto_open_time = @$_POST["wp_chatbot_auto_open_time"];
2130 2048 update_option('wp_chatbot_auto_open_time', wp_unslash($wp_chatbot_auto_open_time));
2131 2049 }
2132 2050 //to complate checkout.
2133 2051 if(isset( $_POST["enable_wp_chatbot_ret_user_show"])) {
2134 - $enable_wp_chatbot_ret_user_show = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_ret_user_show"]));
2052 + $enable_wp_chatbot_ret_user_show = sanitize_text_field($_POST["enable_wp_chatbot_ret_user_show"]);
2135 2053 }else{ $enable_wp_chatbot_ret_user_show='';}
2136 2054 update_option('enable_wp_chatbot_ret_user_show', $enable_wp_chatbot_ret_user_show);
2137 2055
2138 2056 if(isset( $_POST["enable_wp_chatbot_inactive_time_show"])) {
2139 - $enable_wp_chatbot_inactive_time_show = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_inactive_time_show"]));
2057 + $enable_wp_chatbot_inactive_time_show = sanitize_text_field($_POST["enable_wp_chatbot_inactive_time_show"]);
2140 2058 }else{ $enable_wp_chatbot_inactive_time_show='';}
2141 2059 update_option('enable_wp_chatbot_inactive_time_show', $enable_wp_chatbot_inactive_time_show);
2142 2060
2143 2061 if(isset($_POST["wp_chatbot_inactive_time"])){
2144 - $wp_chatbot_inactive_time = @wp_unslash($_POST["wp_chatbot_inactive_time"]);
2062 + $wp_chatbot_inactive_time = @$_POST["wp_chatbot_inactive_time"];
2145 2063 update_option('wp_chatbot_inactive_time', sanitize_text_field($wp_chatbot_inactive_time));
2146 2064 }
2147 2065
2148 2066 if(isset($_POST["wp_chatbot_checkout_msg"])){
2149 - $wp_chatbot_checkout_msg = @wp_unslash($_POST["wp_chatbot_checkout_msg"]);
2067 + $wp_chatbot_checkout_msg = @$_POST["wp_chatbot_checkout_msg"];
2150 2068 update_option('wp_chatbot_checkout_msg', wp_unslash($wp_chatbot_checkout_msg));
2151 2069 }
2152 2070
2153 2071 if(isset( $_POST["wp_chatbot_auto_open_once"])) {
2154 - $wp_chatbot_auto_open_once = sanitize_text_field(wp_unslash($_POST["wp_chatbot_auto_open_once"]));
2072 + $wp_chatbot_auto_open_once = sanitize_text_field($_POST["wp_chatbot_auto_open_once"]);
2155 2073 }else{ $wp_chatbot_auto_open_once='';}
2156 2074 update_option('wp_chatbot_auto_open_once', $wp_chatbot_auto_open_once);
2157 2075
2158 2076 if(isset( $_POST["wp_chatbot_inactive_once"])) {
2159 - $wp_chatbot_inactive_once = sanitize_text_field(wp_unslash($_POST["wp_chatbot_inactive_once"]));
2077 + $wp_chatbot_inactive_once = sanitize_text_field($_POST["wp_chatbot_inactive_once"]);
2160 2078 }else{ $wp_chatbot_inactive_once='';}
2161 2079 update_option('wp_chatbot_inactive_once', $wp_chatbot_inactive_once);
2162 2080
2163 2081
2164 2082 if(isset($_POST["wp_chatbot_proactive_bg_color"])){
2165 - $wp_chatbot_proactive_bg_color = @wp_unslash($_POST["wp_chatbot_proactive_bg_color"]);
2083 + $wp_chatbot_proactive_bg_color = @$_POST["wp_chatbot_proactive_bg_color"];
2166 2084 update_option('wp_chatbot_proactive_bg_color', sanitize_text_field($wp_chatbot_proactive_bg_color));
2167 2085 }
2168 2086
2169 2087 if(isset( $_POST["disable_wp_chatbot_call_gen"])) {
2170 - $disable_wp_chatbot_call_gen = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_call_gen"]));
2088 + $disable_wp_chatbot_call_gen = sanitize_text_field($_POST["disable_wp_chatbot_call_gen"]);
2171 2089 }else{ $disable_wp_chatbot_call_gen='';}
2172 2090 update_option('disable_wp_chatbot_call_gen', $disable_wp_chatbot_call_gen);
2173 2091
2174 2092 if(isset( $_POST["disable_wp_chatbot_site_search"])) {
2175 - $disable_wp_chatbot_site_search = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_site_search"]));
2093 + $disable_wp_chatbot_site_search = sanitize_text_field($_POST["disable_wp_chatbot_site_search"]);
2176 2094 update_option('enable_wp_chatbot_post_content', '');
2177 2095 }else{ $disable_wp_chatbot_site_search='';}
2178 2096 update_option('disable_wp_chatbot_site_search', $disable_wp_chatbot_site_search);
2179 2097
2180 2098 if(isset( $_POST["enable_wp_chatbot_post_content"])) {
2181 - $enable_wp_chatbot_post_content = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_post_content"]));
2099 + $enable_wp_chatbot_post_content = sanitize_text_field($_POST["enable_wp_chatbot_post_content"]);
2182 2100
2183 2101 }else{ $enable_wp_chatbot_post_content='';}
2184 2102 update_option('enable_wp_chatbot_post_content', $enable_wp_chatbot_post_content);
2185 2103
2186 2104 if(isset( $_POST["disable_wp_chatbot_call_sup"])) {
2187 - $disable_wp_chatbot_call_sup = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_call_sup"]));
2105 + $disable_wp_chatbot_call_sup = sanitize_text_field($_POST["disable_wp_chatbot_call_sup"]);
2188 2106 }else{ $disable_wp_chatbot_call_sup='';}
2189 2107 update_option('disable_wp_chatbot_call_sup', $disable_wp_chatbot_call_sup);
2190 2108
2191 2109 if(isset( $_POST["disable_wp_chatbot_feedback"])) {
2192 - $disable_wp_chatbot_feedback = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_feedback"]));
2110 + $disable_wp_chatbot_feedback = sanitize_text_field($_POST["disable_wp_chatbot_feedback"]);
2193 2111 }else{ $disable_wp_chatbot_feedback='';}
2194 2112 update_option('disable_wp_chatbot_feedback', $disable_wp_chatbot_feedback);
2195 2113
2196 2114 if(isset( $_POST["disable_wp_chatbot_faq"])) {
2197 - $disable_wp_chatbot_faq = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot_faq"]));
2115 + $disable_wp_chatbot_faq = sanitize_text_field($_POST["disable_wp_chatbot_faq"]);
2198 2116 }else{ $disable_wp_chatbot_faq='';}
2199 2117 update_option('disable_wp_chatbot_faq', $disable_wp_chatbot_faq);
2200 2118
2201 2119 if(isset($_POST["qlcd_wp_chatbot_feedback_label"])){
2202 - $qlcd_wp_chatbot_feedback_label = (@wp_unslash($_POST["qlcd_wp_chatbot_feedback_label"]));
2120 + $qlcd_wp_chatbot_feedback_label = (@$_POST["qlcd_wp_chatbot_feedback_label"]);
2203 2121 update_option('qlcd_wp_chatbot_feedback_label', maybe_serialize(sanitize_array($qlcd_wp_chatbot_feedback_label)));
2204 2122 }
2205 2123
2206 2124 if(isset( $_POST["enable_wp_chatbot_meta_title"])) {
2207 - $enable_wp_chatbot_meta_title = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_meta_title"]));
2125 + $enable_wp_chatbot_meta_title = sanitize_text_field($_POST["enable_wp_chatbot_meta_title"]);
2208 2126 }else{ $enable_wp_chatbot_meta_title='';}
2209 2127 update_option('enable_wp_chatbot_meta_title', $enable_wp_chatbot_meta_title);
2210 2128
2211 2129 if(isset($_POST["qlcd_wp_chatbot_meta_label"])){
2212 - $qlcd_wp_chatbot_meta_label = esc_html(@wp_unslash($_POST["qlcd_wp_chatbot_meta_label"]));
2130 + $qlcd_wp_chatbot_meta_label = esc_html(@$_POST["qlcd_wp_chatbot_meta_label"]);
2213 2131 update_option('qlcd_wp_chatbot_meta_label', stripslashes(sanitize_text_field($qlcd_wp_chatbot_meta_label)));
2214 2132 }
2215 2133
2216 2134 if (isset($_POST["qlcd_wp_chatbot_phone_sent"])) {
@@ -2233,24 +2151,24 @@
2233 2151 update_option('qlcd_wp_chatbot_found_result', $qlcd_wp_chatbot_found_result);
2234 2152 }
2235 2153
2236 2154 if(isset( $_POST["enable_wp_chatbot_opening_hour"])) {
2237 - $enable_wp_chatbot_opening_hour = stripslashes(sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_opening_hour"])));
2155 + $enable_wp_chatbot_opening_hour = stripslashes(sanitize_text_field($_POST["enable_wp_chatbot_opening_hour"]));
2238 2156 }else{ $enable_wp_chatbot_opening_hour='';}
2239 2157 update_option('enable_wp_chatbot_opening_hour', esc_html($enable_wp_chatbot_opening_hour));
2240 2158
2241 2159 if(isset($_POST["wpwbot_hours"])){
2242 - $wpwbot_hours= @wp_unslash($_POST["wpwbot_hours"]);
2160 + $wpwbot_hours= @$_POST["wpwbot_hours"];
2243 2161 update_option('wpwbot_hours', maybe_serialize(sanitize_array($wpwbot_hours)));
2244 2162 }
2245 2163
2246 2164 if(isset( $_POST["enable_wp_chatbot_dailogflow"])) {
2247 - $enable_wp_chatbot_dailogflow = stripslashes(sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_dailogflow"])));
2165 + $enable_wp_chatbot_dailogflow = stripslashes(sanitize_text_field($_POST["enable_wp_chatbot_dailogflow"]));
2248 2166 }else{ $enable_wp_chatbot_dailogflow='';}
2249 2167 update_option('enable_wp_chatbot_dailogflow', $enable_wp_chatbot_dailogflow);
2250 2168
2251 2169 if(isset($_POST["qlcd_wp_chatbot_dialogflow_client_token"])){
2252 - $qlcd_wp_chatbot_dialogflow_client_token= esc_html(@wp_unslash($_POST["qlcd_wp_chatbot_dialogflow_client_token"]));
2170 + $qlcd_wp_chatbot_dialogflow_client_token= esc_html(@$_POST["qlcd_wp_chatbot_dialogflow_client_token"]);
2253 2171 update_option('qlcd_wp_chatbot_dialogflow_client_token', stripslashes(sanitize_text_field($qlcd_wp_chatbot_dialogflow_client_token)));
2254 2172 }
2255 2173
2256 2174 if (isset($_POST["qlcd_wp_chatbot_dialogflow_defualt_reply"])) {
@@ -2263,99 +2181,99 @@
2263 2181 update_option('qlcd_wp_chatbot_dialogflow_agent_language', $qlcd_wp_chatbot_dialogflow_agent_language);
2264 2182 }
2265 2183 // style option save.
2266 2184 if(isset( $_POST["enable_wp_chatbot_custom_color"])) {
2267 - $enable_wp_chatbot_custom_color = esc_html(wp_unslash($_POST["enable_wp_chatbot_custom_color"]));
2185 + $enable_wp_chatbot_custom_color = esc_html($_POST["enable_wp_chatbot_custom_color"]);
2268 2186 }else{ $enable_wp_chatbot_custom_color='';}
2269 2187 update_option('enable_wp_chatbot_custom_color', stripslashes(sanitize_text_field($enable_wp_chatbot_custom_color)));
2270 2188 if (isset($_POST["wp_chatbot_text_color"])) {
2271 - $wp_chatbot_text_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_text_color"]));
2189 + $wp_chatbot_text_color = sanitize_hex_color($_POST["wp_chatbot_text_color"]);
2272 2190 update_option('wp_chatbot_text_color', $wp_chatbot_text_color);
2273 2191 }
2274 2192
2275 2193 if (isset($_POST["wp_chatbot_floatingiconbg_color"])) {
2276 - $wp_chatbot_floatingiconbg_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_floatingiconbg_color"]));
2194 + $wp_chatbot_floatingiconbg_color = sanitize_hex_color($_POST["wp_chatbot_floatingiconbg_color"]);
2277 2195 update_option('wp_chatbot_floatingiconbg_color', $wp_chatbot_floatingiconbg_color);
2278 2196 }
2279 2197
2280 2198 if (isset($_POST["wp_chatbot_link_color"])) {
2281 - $wp_chatbot_link_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_link_color"]));
2199 + $wp_chatbot_link_color = sanitize_hex_color($_POST["wp_chatbot_link_color"]);
2282 2200 update_option('wp_chatbot_link_color', $wp_chatbot_link_color);
2283 2201 }
2284 2202
2285 2203 if (isset($_POST["wp_chatbot_link_hover_color"])) {
2286 - $wp_chatbot_link_hover_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_link_hover_color"]));
2204 + $wp_chatbot_link_hover_color = sanitize_hex_color($_POST["wp_chatbot_link_hover_color"]);
2287 2205 update_option('wp_chatbot_link_hover_color', $wp_chatbot_link_hover_color);
2288 2206 }
2289 2207
2290 2208 if (isset($_POST["wp_chatbot_bot_msg_bg_color"])) {
2291 - $wp_chatbot_bot_msg_bg_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_bot_msg_bg_color"]));
2209 + $wp_chatbot_bot_msg_bg_color = sanitize_hex_color($_POST["wp_chatbot_bot_msg_bg_color"]);
2292 2210 update_option('wp_chatbot_bot_msg_bg_color', $wp_chatbot_bot_msg_bg_color);
2293 2211 }
2294 2212
2295 2213 if (isset($_POST["wp_chatbot_bot_msg_text_color"])) {
2296 - $wp_chatbot_bot_msg_text_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_bot_msg_text_color"]));
2214 + $wp_chatbot_bot_msg_text_color = sanitize_hex_color($_POST["wp_chatbot_bot_msg_text_color"]);
2297 2215 update_option('wp_chatbot_bot_msg_text_color', $wp_chatbot_bot_msg_text_color);
2298 2216 }
2299 2217
2300 2218 if (isset($_POST["wp_chatbot_user_msg_bg_color"])) {
2301 - $wp_chatbot_user_msg_bg_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_user_msg_bg_color"]));
2219 + $wp_chatbot_user_msg_bg_color = sanitize_hex_color($_POST["wp_chatbot_user_msg_bg_color"]);
2302 2220 update_option('wp_chatbot_user_msg_bg_color', $wp_chatbot_user_msg_bg_color);
2303 2221 }
2304 2222
2305 2223 if (isset($_POST["wp_chatbot_user_msg_text_color"])) {
2306 - $wp_chatbot_user_msg_text_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_user_msg_text_color"]));
2224 + $wp_chatbot_user_msg_text_color = sanitize_hex_color($_POST["wp_chatbot_user_msg_text_color"]);
2307 2225 update_option('wp_chatbot_user_msg_text_color', $wp_chatbot_user_msg_text_color);
2308 2226 }
2309 2227
2310 2228 if (isset($_POST["wp_chatbot_buttons_bg_color"])) {
2311 - $wp_chatbot_buttons_bg_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_buttons_bg_color"]));
2229 + $wp_chatbot_buttons_bg_color = sanitize_hex_color($_POST["wp_chatbot_buttons_bg_color"]);
2312 2230 update_option('wp_chatbot_buttons_bg_color', $wp_chatbot_buttons_bg_color);
2313 2231 }
2314 2232
2315 2233 if (isset($_POST["wp_chatbot_buttons_text_color"])) {
2316 - $wp_chatbot_buttons_text_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_buttons_text_color"]));
2234 + $wp_chatbot_buttons_text_color = sanitize_hex_color($_POST["wp_chatbot_buttons_text_color"]);
2317 2235 update_option('wp_chatbot_buttons_text_color', $wp_chatbot_buttons_text_color);
2318 2236 }
2319 2237
2320 2238 if (isset($_POST["wp_chatbot_buttons_bg_color_hover"])) {
2321 - $wp_chatbot_buttons_bg_color_hover = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_buttons_bg_color_hover"]));
2239 + $wp_chatbot_buttons_bg_color_hover = sanitize_hex_color($_POST["wp_chatbot_buttons_bg_color_hover"]);
2322 2240 update_option('wp_chatbot_buttons_bg_color_hover', $wp_chatbot_buttons_bg_color_hover);
2323 2241 }
2324 2242
2325 2243 if (isset($_POST["wp_chatbot_buttons_text_color_hover"])) {
2326 - $wp_chatbot_buttons_text_color_hover = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_buttons_text_color_hover"]));
2244 + $wp_chatbot_buttons_text_color_hover = sanitize_hex_color($_POST["wp_chatbot_buttons_text_color_hover"]);
2327 2245 update_option('wp_chatbot_buttons_text_color_hover', $wp_chatbot_buttons_text_color_hover);
2328 2246 }
2329 2247
2330 2248 if (isset($_POST["wp_chatbot_theme_secondary_color"])) {
2331 - $wp_chatbot_theme_secondary_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_theme_secondary_color"]));
2249 + $wp_chatbot_theme_secondary_color = sanitize_hex_color($_POST["wp_chatbot_theme_secondary_color"]);
2332 2250 update_option('wp_chatbot_theme_secondary_color', $wp_chatbot_theme_secondary_color);
2333 2251 }
2334 2252 if (isset($_POST["wp_chatbot_header_background_color"])) {
2335 - $wp_chatbot_header_background_color = sanitize_hex_color(wp_unslash($_POST["wp_chatbot_header_background_color"]));
2253 + $wp_chatbot_header_background_color = sanitize_hex_color($_POST["wp_chatbot_header_background_color"]);
2336 2254 update_option('wp_chatbot_header_background_color', $wp_chatbot_header_background_color);
2337 2255 }
2338 2256
2339 2257 if (isset($_POST["wp_chatbot_font_size"])) {
2340 - $wp_chatbot_font_size = sanitize_text_field(wp_unslash($_POST["wp_chatbot_font_size"]));
2258 + $wp_chatbot_font_size = sanitize_text_field($_POST["wp_chatbot_font_size"]);
2341 2259 // Additional validation for font size format (e.g., '14px', '1.2em') could be added here if strict adherence to CSS units is required.
2342 2260 update_option('wp_chatbot_font_size', $wp_chatbot_font_size);
2343 2261 }
2344 2262 if (isset($_POST["wp_chat_bot_font_family"])) {
2345 - $wp_chat_bot_font_family = sanitize_text_field(wp_unslash($_POST["wp_chat_bot_font_family"]));
2263 + $wp_chat_bot_font_family = sanitize_text_field($_POST["wp_chat_bot_font_family"]);
2346 2264 update_option('wp_chat_bot_font_family', $wp_chat_bot_font_family);
2347 2265 }
2348 2266 if (isset($_POST["wp_chat_user_font_family"])) {
2349 - $wp_chat_user_font_family = sanitize_text_field(wp_unslash($_POST["wp_chat_user_font_family"]));
2267 + $wp_chat_user_font_family = sanitize_text_field($_POST["wp_chat_user_font_family"]);
2350 2268 update_option('wp_chat_user_font_family', $wp_chat_user_font_family);
2351 2269 }
2352 2270 if (isset($_POST['wp_chatbot_user_font'])) {
2353 - $wp_chatbot_user_font = sanitize_text_field(wp_unslash($_POST['wp_chatbot_user_font']));
2271 + $wp_chatbot_user_font = sanitize_text_field($_POST['wp_chatbot_user_font']);
2354 2272 update_option('wp_chatbot_user_font', $wp_chatbot_user_font);
2355 2273 }
2356 2274 if (isset($_POST['wp_chatbot_bot_font'])) {
2357 - $wp_chatbot_bot_font = sanitize_text_field(wp_unslash($_POST['wp_chatbot_bot_font']));
2275 + $wp_chatbot_bot_font = sanitize_text_field($_POST['wp_chatbot_bot_font']);
2358 2276 update_option('wp_chatbot_bot_font', $wp_chatbot_bot_font);
2359 2277 }
2360 2278
2361 2279 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
@@ -2502,84 +2420,19 @@
2502 2420 ) $collate AUTO_INCREMENT=1 ENGINE=InnoDB";
2503 2421
2504 2422 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
2505 2423 dbDelta( $sql_sliders_Table1 );
2506 -
2507 -
2508 - //Bot Response Table
2509 - $table_rag_documents = $wpdb->prefix . "rag_documents";
2510 -
2511 - $charset = $wpdb->get_charset_collate();
2512 - if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_rag_documents))) != $table_rag_documents) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
2513 - // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
2514 - $sql_rag_documents = "CREATE TABLE $table_rag_documents (
2515 - id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
2516 - doc_id VARCHAR(100) DEFAULT NULL,
2517 - title VARCHAR(255) NOT NULL,
2518 - content LONGTEXT NOT NULL,
2519 - embedding LONGTEXT NOT NULL,
2520 - source_type VARCHAR(20) DEFAULT 'post',
2521 - source_url VARCHAR(255) DEFAULT NULL,
2522 - file_url TEXT DEFAULT NULL,
2523 - metadata LONGTEXT DEFAULT NULL,
2524 - status VARCHAR(50) DEFAULT 'complete',
2525 - created_at DATETIME DEFAULT CURRENT_TIMESTAMP
2526 - ) $charset;";
2527 - require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2528 - dbDelta($sql_rag_documents);
2529 - // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange
2530 - }
2531 - $table_report = $wpdb->prefix . 'wpbot_chat_report';
2532 -
2533 - if ( $wpdb->get_var( $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_report)) ) != $table_report ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
2534 - // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
2535 - $sql_report = "
2536 - CREATE TABLE `$table_report` (
2537 - `id` int(11) NOT NULL AUTO_INCREMENT,
2538 - `user_id` int(11) NOT NULL,
2539 - `conversation_id` int(11) DEFAULT NULL,
2540 - `message` longtext NOT NULL,
2541 - `feedback` varchar(20) DEFAULT NULL,
2542 - `meta_info` text DEFAULT NULL,
2543 - `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
2544 - PRIMARY KEY (`id`)
2545 - ) $charset_collate AUTO_INCREMENT=1;
2546 - ";
2547 -
2548 - require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2549 - dbDelta( $sql_report );
2550 - // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange
2551 - }
2552 2424
2553 - $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
2425 + $sqlqry = $wpdb->get_results($wpdb->prepare("select * from $table1")); //DB Call OK, No Caching OK
2554 2426 if(empty($sqlqry)){
2555 2427
2556 - $query = 'What are you?';
2557 - $response = 'I am an Automated ChatBot to answer your questions. This is a sample Simple Text Response that can be edited or deleted.';
2428 + $query = 'What Can WPBot do for you?';
2429 + $response = 'WPBot can converse fluidly with users on website and FB messenger. It can search your website, send/collect eMails, user feedback & phone numbers . You can create Custom Intents from DialogFlow with Rich Messages & Card responses!';
2558 2430
2559 2431 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
2560 2432 $format = array('%s','%s', '%s', '%s');
2561 - $wpdb->insert($table1,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, PluginCheck.Security.DirectDB.UnescapedDBParameter
2433 + $wpdb->insert($table1,$data,$format); //DB Call OK, No Caching OK
2562 2434 }
2563 -
2564 - $table = $wpdb->prefix . 'wpbot_subscription';
2565 - 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
2566 - // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
2567 - $sql_sliders_Table = "
2568 - CREATE TABLE IF NOT EXISTS `$table` (
2569 - `id` int(11) NOT NULL AUTO_INCREMENT,
2570 - `name` varchar(256) NOT NULL,
2571 - `email` varchar(256) NOT NULL,
2572 - `phone` varchar(256) NOT NULL,
2573 - `url` text NOT NULL,
2574 - `date` datetime NOT NULL,
2575 - `user_agent` text NOT NULL,
2576 - PRIMARY KEY (`id`)
2577 - ) $collate AUTO_INCREMENT=1 ";
2578 - require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2579 - dbDelta($sql_sliders_Table);
2580 - // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange
2581 - }
2582 2435
2583 2436 $url = get_site_url();
2584 2437 $url = wp_parse_url($url);
2585 2438 $domain = $url['host'];
@@ -2584,13 +2437,14 @@
2584 2437 $url = wp_parse_url($url);
2585 2438 $domain = $url['host'];
2586 2439 //$admin_email = "admin@" . $domain;
2587 2440 $admin_email = get_option('admin_email');
2441 +
2588 2442 if(!get_option('wp_chatbot_position_x')) {
2589 - update_option('wp_chatbot_position_x', 30);
2443 + update_option('wp_chatbot_position_x', 50);
2590 2444 }
2591 2445 if(!get_option('wp_chatbot_position_y')) {
2592 - update_option('wp_chatbot_position_y', 30);
2446 + update_option('wp_chatbot_position_y', 50);
2593 2447 }
2594 2448 if(!get_option('disable_wp_chatbot')) {
2595 2449 update_option('disable_wp_chatbot', '');
2596 2450 }
@@ -2617,14 +2471,8 @@
2617 2471 }
2618 2472 if(!get_option('show_menu_after_greetings')) {
2619 2473 update_option('show_menu_after_greetings', 1);
2620 2474 }
2621 - if(!get_option('disable_back_to_start_menu')) {
2622 - update_option('disable_back_to_start_menu', '');
2623 - }
2624 - if(!get_option('disable_floating_button')) {
2625 - update_option('disable_floating_button', '');
2626 - }
2627 2475 if(!get_option('enable_chat_session')) {
2628 2476 update_option('enable_chat_session', '');
2629 2477 }
2630 2478
@@ -2631,9 +2479,9 @@
2631 2479 if(!get_option('enable_wp_chatbot_mobile_full_screen')) {
2632 2480 update_option('enable_wp_chatbot_mobile_full_screen', 1);
2633 2481 }
2634 2482 if(!get_option('wpbot_preloading_time')) {
2635 - update_option('wpbot_preloading_time', '800');
2483 + update_option('wpbot_preloading_time', '0.5');
2636 2484 }
2637 2485
2638 2486 if(!get_option('disable_wp_chatbot_notification')) {
2639 2487 update_option('disable_wp_chatbot_notification', '1');
@@ -2671,19 +2519,11 @@
2671 2519 if(!get_option('wp_chatbot_show_home_page')) {
2672 2520 update_option('wp_chatbot_show_home_page', 'on');
2673 2521 }
2674 2522 if(!get_option('qc_wpbot_menu_order')) {
2675 - $site_search_label = get_option('qlcd_wp_chatbot_wildcard_site_search') != '' ? get_option('qlcd_wp_chatbot_wildcard_site_search') : 'Site Search';
2676 - $support_email_label = get_option('qlcd_wp_chatbot_support_email') != '' ? get_option('qlcd_wp_chatbot_support_email') : 'Send us Email.';
2677 - $support_phone_label = get_option('qlcd_wp_chatbot_support_phone') != '' ? get_option('qlcd_wp_chatbot_support_phone') : 'Leave your number. We will call you back!';
2678 - $default_menu = '<span class="qcld-chatbot-wildcard qc_draggable_item qcld-chatbot-site-search" data-wildcart="site_search">' . esc_attr($site_search_label) . '</span>';
2679 - $default_menu .= '<span class="qcld-chatbot-suggest-email qc_draggable_item">' . esc_attr($support_email_label) . '</span>';
2680 - $default_menu .= '<span class="qcld-chatbot-suggest-phone qc_draggable_item">' . esc_attr($support_phone_label) . '</span>';
2681 - update_option('qc_wpbot_menu_order', $default_menu);
2523 + update_option('qc_wpbot_menu_order', '');
2682 2524 }
2683 - if(!get_option('qcld_chatbot_avatar_location')) {
2684 - update_option('qcld_chatbot_avatar_location', 'side');
2685 - }
2525 +
2686 2526 if(!get_option('wp_chatbot_show_posts')) {
2687 2527 update_option('wp_chatbot_show_posts', 'on');
2688 2528 }
2689 2529 if(!get_option('wp_chatbot_show_pages')){
@@ -3010,12 +2850,12 @@
3010 2850 if(!get_option('qlcd_wp_chatbot_notifications')) {
3011 2851 update_option('qlcd_wp_chatbot_notifications', maybe_serialize(array('Welcome to WPBot')));
3012 2852 }
3013 2853 if(!get_option('support_query')) {
3014 - update_option('support_query', maybe_serialize(array('What are you?')));
2854 + update_option('support_query', maybe_serialize(array('What is WPBot?')));
3015 2855 }
3016 2856 if(!get_option('support_ans')) {
3017 - update_option('support_ans', maybe_serialize(array('I am an Automated ChatBot to answer your questions. This is a sample Simple Text Response that can be edited or deleted.')));
2857 + 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.')));
3018 2858 }
3019 2859 if(!get_option('qlcd_wp_chatbot_search_option')) {
3020 2860 update_option('qlcd_wp_chatbot_search_option', 'standard');
3021 2861 }
@@ -3254,11 +3094,8 @@
3254 3094 delete_option('disable_wp_chatbot_icon_animation');
3255 3095 delete_option('disable_wp_chatbot_on_mobile');
3256 3096 delete_option('qlcd_wp_chatbot_admin_email');
3257 3097 delete_option('qlcd_wp_chatbot_from_email');
3258 -
3259 - delete_option('disable_back_to_start_menu');
3260 - delete_option('disable_floating_button');
3261 3098
3262 3099 delete_option('disable_wp_chatbot_product_search');
3263 3100 delete_option('disable_wp_chatbot_catalog');
3264 3101 delete_option('disable_wp_chatbot_order_status');
@@ -3479,9 +3316,8 @@
3479 3316 delete_option('wp_chat_user_font_family');
3480 3317 delete_option('wp_chat_bot_font_family');
3481 3318 delete_option('wp_chatbot_bot_font');
3482 3319 delete_option('wp_chatbot_user_font');
3483 - delete_option('qcld_chatbot_avatar_location');
3484 3320 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
3485 3321 qcld_wb_chatboot_defualt_options();
3486 3322 $html='Reset all options to default successfully.';
3487 3323 wp_send_json($html);
@@ -3548,20 +3384,17 @@
3548 3384
3549 3385
3550 3386
3551 3387 <div class="wrap qcld-main-wrapper">
3552 -<div class="qcld-wp-chatbot-wrap-header">
3553 -
3554 - <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>
3555 - <p><strong>Core Version:</strong> v<?php echo esc_html( QCLD_wpCHATBOT_VERSION ); ?></p>
3556 - </div>
3557 - <ul class="qcld-wp-chatbot-wrap-version-wrapper">
3558 - <li>
3559 - <a class="wpchatbot-Upgrade" href="https://www.wpbot.pro/" target="_blank">Upgrade To Pro</a>
3560 -
3561 - </li>
3562 - </ul>
3563 -</div>
3388 + <div class="qcld-wp-chatbot-wrap-header">
3389 + <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>
3390 + <p><strong>Core Version:</strong> v<?php echo QCLD_wpCHATBOT_VERSION; ?></p>
3391 + <ul class="qcld-wp-chatbot-wrap-version-wrapper">
3392 + <li>
3393 + <a class="wpchatbot-Upgrade" href="https://www.wpbot.pro/" target="_blank">Upgrade To Pro</a>
3394 + </li>
3395 + </ul>
3396 + </div>
3564 3397 <div class="qcld-wrap swpm-admin-menu-wrap">
3565 3398 <div class="nav-tab-wrapper sld_nav_container wppt_nav_container qcld_help_wppt_nav_container">
3566 3399 <a class="nav-tab sld_click_handle nav-tab-active" href="#general_int"><span class="wpwbot-admin-tab-icon "> <i class="fa fa-rocket"></i> </span><?php echo esc_html('Getting Started'); ?></a>
3567 3400 <a class="nav-tab sld_click_handle " href="#general_wp_nutshell"><span class="wpwbot-admin-tab-icon "> <i class="fa fa-hourglass-start"></i> </span><?php echo esc_html('WPBot – In a Nutshell'); ?></a>
@@ -3877,194 +3710,79 @@
3877 3710 <h3><?php esc_html_e('Note', 'chatbot'); ?></h3>
3878 3711 <p><?php esc_html_e('You could use &lt;br&gt; tag in Language Center & Dialogflow Responses for line break.', 'chatbot'); ?></p>
3879 3712 </div>
3880 3713 </div>
3881 -
3882 -
3883 -
3884 -
3885 -
3886 -
3887 -
3888 - <div class="panel panel-default">
3889 - <div class="panel-heading" role="tab" id="faqone">
3890 - <h4 class="panel-title">
3891 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapseOne" aria-expanded="false" aria-controls="faqcollapseOne"> <?php esc_html_e('Problem: I changed language and/or some settings but do not see the changes.', 'chatbot'); ?> </a>
3892 - </h4>
3893 - </div>
3894 - <div id="faqcollapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqone">
3895 - <div class="panel-body">
3896 - <?php echo esc_html_e('WPBot saves a lot of information in the browser`s local storage. After making any language or settings change you must clear browser cache and cookies both and reload the page for testing. An easier alternative is to always launch a new browser window in Incognito mode (Ctrl+Shift+N in chrome) and test there. Also, you need to purge cache plugin and CDN caching if you have any.', 'chatbot'); ?>
3897 - </div>
3898 - </div>
3899 - </div>
3900 -
3901 -
3902 -
3903 -
3904 - <div class="panel panel-default">
3905 - <div class="panel-heading" role="tab" id="faqtwo">
3906 - <h4 class="panel-title">
3907 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapsetwo" aria-expanded="false" aria-controls="faqcollapsetwo"> <?php esc_html_e('Problem: I cannot connect to the DialogFlow', 'chatbot'); ?> </a>
3908 - </h4>
3909 - </div>
3910 - <div id="faqcollapsetwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqtwo">
3911 - <div class="panel-body">
3912 - <?php echo esc_html_e('To Debug: ', 'chatbot'); ?><br>
3913 - <?php echo esc_html_e(' 1. Make sure that you have created the Google Project and the Service account as an Owner', 'chatbot'); ?><br>
3914 - <?php echo esc_html_e('2. Make sure that you have connected to the correct Dialogflow agent', 'chatbot'); ?><br>
3915 - <?php echo esc_html_e('3. Follow the steps in this tutorial correctly: https://www.wpbot.pro/dialogflow-integration', 'chatbot'); ?><br>
3916 - <?php echo esc_html_e('4. Make sure that the Google Client Package is Installed on Your Website. 5. For DialogFlow agent region, try choosing any region other than the EU region which has known issues. 6. Make sure to download and import the sample DialogFlow agent to your agent 7. Test the ChatBot in the browser Incognito mode', 'chatbot'); ?>
3917 - </div>
3918 - </div>
3919 - </div>
3920 -
3921 -
3922 - <div class="panel panel-default">
3923 - <div class="panel-heading" role="tab" id="faqthree">
3924 - <h4 class="panel-title">
3925 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapsethree" aria-expanded="false" aria-controls="faqcollapsethree"> <?php esc_html_e('Problem: I am not getting emails from the ChatBot
3926 -', 'chatbot'); ?> </a>
3927 - </h4>
3928 - </div>
3929 - <div id="faqcollapsethree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqthree">
3930 - <div class="panel-body">
3931 - <?php echo esc_html_e('The WPBot ChatBot uses the WordPress` default email function. If you are not getting emails from the ChatBot`s email feature, it is likely that no emails are getting through from your WordPress site or they are ending up in the Spam box. Try using an SMTP mailer plugin. Also, try changing the to and from email addresses in the ChatBot`s general settings area.', 'chatbot'); ?>
3932 - </div>
3933 - </div>
3934 - </div>
3935 -
3936 - <div class="panel panel-default">
3937 - <div class="panel-heading" role="tab" id="faqfour">
3938 - <h4 class="panel-title">
3939 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapsefour" aria-expanded="false" aria-controls="faqcollapsefour"> <?php esc_html_e('Problem: Simple text responses are not working or getting an error
3940 -', 'chatbot'); ?> </a>
3941 - </h4>
3942 - </div>
3943 - <div id="faqcollapsefour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqfour">
3944 - <div class="panel-body">
3945 - <?php echo esc_html_e('WPBot requires mysql version 5.6+ for the simple text responses to work. If your server has a version below that, you might see some PHP error or the Simple Text Responses will not work at all. Please request your hosting support to update the mysql version on your server.', 'chatbot'); ?>
3946 - </div>
3947 - </div>
3948 - </div>
3949 -
3950 -
3951 - <div class="panel panel-default">
3952 - <div class="panel-heading" role="tab" id="faqfive">
3953 - <h4 class="panel-title">
3954 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapsefive" aria-expanded="false" aria-controls="faqcollapsefive"> <?php esc_html_e('Problem: I changed language or some other settings but do not see them when testing', 'chatbot'); ?> </a>
3955 - </h4>
3956 - </div>
3957 - <div id="faqcollapsefive" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqfive">
3958 - <div class="panel-body">
3959 - <?php echo esc_html_e('Please clear the browser cache and <strong>cookies</strong> to see any change you have made. Alternatively, you can open a fresh browser window in incognito mode (Ctrl+Shift+N in chrome) to test your changes. Also, you may need to purge any cache plugin and CDN caching.', 'chatbot'); ?>
3960 - </div>
3961 - </div>
3962 - </div>
3963 -
3964 -
3965 -
3966 - <div class="panel panel-default">
3967 - <div class="panel-heading" role="tab" id="faqsix">
3968 - <h4 class="panel-title">
3969 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapsesix" aria-expanded="false" aria-controls="faqcollapsesix"> <?php esc_html_e('Problem: The ChatBot is NOT working in the front end.', 'chatbot'); ?> </a>
3970 - </h4>
3971 - </div>
3972 - <div id="faqcollapsesix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqsix">
3973 - <div class="panel-body">
3974 - <?php echo esc_html_e('The most common reason for this is if the theme is coded incorrectly and jQuery is loaded from external source. jQuery is included with WordPress core and according to WordPress standard, jQuery must be included using wp_enqueue_script. https://developer.wordpress.org/reference/functions/wp_enqueue_script/ .', 'chatbot'); ?><br> <?php echo esc_html_e('Please make sure if that is the case in your theme.', 'chatbot'); ?><br>
3975 - <?php echo esc_html_e('Also go to Simple Text Responses and press the Re-Index button.', 'chatbot'); ?><br>
3976 - <?php echo esc_html_e(' After that try purging any cache and test the chatbot in Incognito mode', 'chatbot'); ?><br>
3977 - <?php echo esc_html_e('Please contact us if you need [further help] https://www.wpbot.pro/free-support/). We take all user feedback sriously.', 'chatbot'); ?>
3978 - </div>
3979 - </div>
3980 - </div>
3981 -
3982 -
3983 - <div class="panel panel-default">
3984 - <div class="panel-heading" role="tab" id="faqseven">
3985 - <h4 class="panel-title">
3986 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapseseven" aria-expanded="false" aria-controls="faqcollapseseven"> <?php esc_html_e('Problem: The ChatBot is stuck on typing or loading', 'chatbot'); ?> </a>
3987 - </h4>
3988 - </div>
3989 - <div id="faqcollapseseven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqseven">
3990 - <div class="panel-body">
3991 - <?php echo esc_html_e('This usually happens if you enabled DialogFlow but did not complete the set up. Please make sure that you have carefully followed all the steps for DialogFlow integration in the Settings->DialogFlow section.', 'chatbot'); ?><br>
3992 - <?php echo esc_html_e('This can also happen if there is any empty language fields or Simple Text Responses database needs updating because of mysql version changes. Try saving both the Language Center and Simple Text Responses and test again.', 'chatbot'); ?><br>
3993 - <?php echo esc_html_e('Also go to Simple Text Responses and press the Re-Index button.', 'chatbot'); ?><br>
3994 - <?php echo esc_html_e('After that remember to test in a browser Incognito mode to avoid cache and cookies.', 'chatbot'); ?>
3995 - </div>
3996 - </div>
3997 - </div>
3998 -
3999 - <div class="panel panel-default">
4000 - <div class="panel-heading" role="tab" id="faqeight">
4001 - <h4 class="panel-title">
4002 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapseeight" aria-expanded="false" aria-controls="faqcollapseeight"> <?php esc_html_e('Problem: How do I add new conversations to the ChatBot?', 'chatbot'); ?> </a>
4003 - </h4>
4004 - </div>
4005 - <div id="faqcollapseeight" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqeight">
4006 - <div class="panel-body">
4007 - <?php echo esc_html_e('Please check the plugin`s Help Section for details on this', 'chatbot'); ?>
4008 - </div>
4009 - </div>
4010 - </div>
4011 -
4012 - <div class="panel panel-default">
4013 - <div class="panel-heading" role="tab" id="faqnine">
4014 - <h4 class="panel-title">
4015 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapsenine" aria-expanded="false" aria-controls="faqcollapsenine"> <?php esc_html_e('Problem: How do I add Line Breaks?', 'chatbot'); ?> </a>
4016 - </h4>
4017 - </div>
4018 - <div id="faqcollapsenine" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqnine">
4019 - <div class="panel-body">
4020 - <?php echo esc_html_e('Please use the <br> tag for line breaks.', 'chatbot'); ?>
4021 - </div>
4022 - </div>
4023 - </div>
4024 -
4025 - <div class="panel panel-default">
4026 - <div class="panel-heading" role="tab" id="faqten">
4027 - <h4 class="panel-title">
4028 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapseten" aria-expanded="false" aria-controls="faqcollapseten"> <?php esc_html_e('Problem: Are HTML tags supported?', 'chatbot'); ?> </a>
4029 - </h4>
4030 - </div>
4031 - <div id="faqcollapseten" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqten">
4032 - <div class="panel-body">
4033 - <?php echo esc_html_e('Yes, common HTML tags link link href, strong, br etc. are supported.', 'chatbot'); ?>
4034 - </div>
4035 - </div>
4036 - </div>
4037 -
4038 - <div class="panel panel-default">
4039 - <div class="panel-heading" role="tab" id="faqeleven">
4040 - <h4 class="panel-title">
4041 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapseeleven" aria-expanded="false" aria-controls="faqcollapseeleven"> <?php esc_html_e('Problem: I want to add images, GIFs, Videos', 'chatbot'); ?> </a>
4042 - </h4>
4043 - </div>
4044 - <div id="faqcollapseeleven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqeleven">
4045 - <div class="panel-body">
4046 - <?php echo esc_html_e('Images, GIFs and Youtube Videos are supprted in the pro version. Pro version also includes a handy giphy floating search feature for easy embed in the language center.', 'chatbot'); ?>
4047 - </div>
4048 - </div>
4049 - </div>
4050 -
4051 -
4052 - <div class="panel panel-default">
4053 - <div class="panel-heading" role="tab" id="faqtwelve">
4054 - <h4 class="panel-title">
4055 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#faqcollapsetwelve" aria-expanded="false" aria-controls="faqcollapsetwelve"> <?php esc_html_e('How to disable Predefined Intent?', 'chatbot'); ?> </a>
4056 - </h4>
4057 - </div>
4058 - <div id="faqcollapsetwelve" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqtwelve">
4059 - <div class="panel-body">
4060 - <?php echo esc_html_e('You can disable predefined intents FAQ, eMail, Call me from WPBot Lite > Settings page`s Start Menu Section.', 'chatbot'); ?>
4061 - </div>
4062 - </div>
4063 - </div>
4064 -
4065 -
4066 -
3714 + <div class="content form-container qcbot_help_secion">
3715 + <h3><?php esc_html_e('Problem: I changed language and/or some settings but do not see the changes.', 'chatbot'); ?></h3>
3716 + <p><?php esc_html_e('WPBot saves a lot of information in the browser`s local storage. After making any language or settings change you must clear browser cache and cookies both and reload the page for testing. An easier alternative is to always launch a new browser window in Incognito mode (Ctrl+Shift+N in chrome) and test there. Also, you need to purge cache plugin and CDN caching if you have any.', 'chatbot'); ?></p>
3717 + </div>
3718 + <div class="content form-container qcbot_help_secion">
3719 + <h3><?php esc_html_e('Problem: I cannot connect to the DialogFlow', 'chatbot'); ?></h3>
3720 + <p><?php esc_html_e('To Debug: 1. Make sure that you have created the Google Project and the Service account as an Owner', 'chatbot'); ?><br>
3721 + <?php esc_html_e('2. Make sure that you have connected to the correct Dialogflow agent', 'chatbot'); ?><br>
3722 + <?php esc_html_e('3. Follow the steps in this tutorial correctly:', 'chatbot'); ?> <a href="https://www.wpbot.pro/dialogflow-integration" target="_blank">https://www.wpbot.pro/dialogflow-integration</a><br>
3723 + <?php esc_html_e(' 4. Make sure that the Google Client Package is Installed on Your Website.<br>
3724 + 5. For DialogFlow agent region, try choosing any region other than the EU region which has known issues.<br>
3725 + 6. Make sure to download and import the sample DialogFlow agent to your agent<br>
3726 + 7. Test the ChatBot in the browser Incognito mode', 'chatbot'); ?>
3727 + </p>
3728 + </div>
3729 + <div class="content form-container qcbot_help_secion" >
3730 + <h3><?php esc_html_e('Problem: I am not getting emails from the ChatBot', 'chatbot'); ?></h3>
3731 + <p>
3732 + <?php esc_html_e('The WPBot ChatBot uses the WordPress` default email function. If you are not getting emails from the ChatBot`s email feature, it is likely that no emails are getting through from your WordPress site or they are ending up in the Spam box. Try using an SMTP mailer plugin. Also, try changing the to and from email addresses in the ChatBot`s general settings area.', 'chatbot'); ?>
3733 + </p>
3734 + </div>
3735 + <div class="content form-container qcbot_help_secion" >
3736 + <h3><?php esc_html_e('Problem: Simple text responses are not working or getting an error', 'chatbot'); ?></h3>
3737 + <p>
3738 + <?php esc_html_e('WPBot requires mysql version 5.6+ for the simple text responses to work. If your server has a version below that, you might see some PHP error or the Simple Text Responses will not work at all. Please request your hosting support to update the mysql version on your server.', 'chatbot'); ?>
3739 + </p>
3740 + </div>
3741 + <div class="content form-container qcbot_help_secion">
3742 + <h3><?php esc_html_e('Problem: I changed language or some other settings but do not see them when testing', 'chatbot'); ?></h3>
3743 + <p>
3744 + <?php esc_html_e('Please clear the browser cache and <strong>cookies</strong> to see any change you have made. Alternatively, you can open a fresh browser window in incognito mode (Ctrl+Shift+N in chrome) to test your changes. Also, you may need to purge any cache plugin and CDN caching.', 'chatbot'); ?>
3745 + </p>
3746 + </div>
3747 + <div class="content form-container qcbot_help_secion">
3748 + <h3><?php esc_html_e('Problem: The ChatBot is NOT working in the front end.', 'chatbot'); ?></h3>
3749 + <p>
3750 + <?php esc_html_e('The most common reason for this is if the theme is coded incorrectly and jQuery is loaded from external source. jQuery is included with WordPress core and according to WordPress standard, jQuery must be included using wp_enqueue_script.', 'chatbot'); ?> <a href="https://developer.wordpress.org/reference/functions/wp_enqueue_script/" target="_blank">https://developer.wordpress.org/reference/functions/wp_enqueue_script/</a> <?php esc_html_e('. Please make sure if that is the case in your theme.', 'chatbot'); ?><br>
3751 + <?php esc_html_e(' Also go to Simple Text Responses and press the Re-Index button.', 'chatbot'); ?></br>
3752 + <?php esc_html_e(' After that try purging any cache and test the chatbot in Incognito mode', 'chatbot'); ?><br>
3753 + <?php esc_html_e(' Please contact us if you need [further help]', 'chatbot'); ?>(<a href="https://www.wpbot.pro/free-support/" target="_blank">https://www.wpbot.pro/free-support/</a>). <?php esc_html_e('We take all user feedback sriously.', 'chatbot'); ?>
3754 + </p>
3755 + </div>
3756 + <div class="content form-container qcbot_help_secion">
3757 + <h3><?php esc_html_e('Problem: The ChatBot is stuck on typing or loading', 'chatbot'); ?></h3>
3758 + <p>
3759 + <?php esc_html_e('This usually happens if you enabled DialogFlow but did not complete the set up. Please make sure that you have carefully followed all the steps for DialogFlow integration in the Settings->DialogFlow section.', 'chatbot'); ?><br>
3760 + <?php esc_html_e('This can also happen if there is any empty language fields or Simple Text Responses database needs updating because of mysql version changes. Try saving both the Language Center and Simple Text Responses and test again.', 'chatbot'); ?><br>
3761 + <?php esc_html_e('Also go to Simple Text Responses and press the Re-Index button.', 'chatbot'); ?></br>
3762 + <?php esc_html_e('After that remember to test in a browser Incognito mode to avoid cache and cookies.', 'chatbot'); ?>
3763 + </p>
3764 + </div>
3765 + <div class="content form-container qcbot_help_secion">
3766 + <h3><?php esc_html_e('Problem: How do I add new conversations to the ChatBot?', 'chatbot'); ?></h3>
3767 + <p><?php esc_html_e('Please check the plugin`s Help Section for details on this', 'chatbot'); ?></p>
3768 + </div>
3769 + <div class="content form-container qcbot_help_secion" >
3770 + <h3><?php esc_html_e('Problem: How do I add Line Breaks?', 'chatbot'); ?></h3>
3771 + <p><?php esc_html_e('Please use the &lt;br&gt; tag for line breaks.', 'chatbot'); ?></p>
3772 + </div>
3773 + <div class="content form-container qcbot_help_secion">
3774 + <h3><?php esc_html_e('Problem: Are HTML tags supported?', 'chatbot'); ?> </h3>
3775 + <p><?php esc_html_e('Yes, common HTML tags link link href, strong, br etc. are supported.', 'chatbot'); ?></p>
3776 + </div>
3777 + <div class="content form-container qcbot_help_secion">
3778 + <h3><?php esc_html_e('Problem: I want to add images, GIFs, Videos', 'chatbot'); ?></h3>
3779 + <p><?php esc_html_e('Images, GIFs and Youtube Videos are supprted in the pro version. Pro version also includes a handy giphy floating search feature for easy embed in the language center.', 'chatbot'); ?></p>
3780 + </div>
3781 + <div class="content form-container qcbot_help_secion">
3782 + <h3><?php esc_html_e('How to disable Predefined Intent?', 'chatbot'); ?></h3>
3783 + <p><?php esc_html_e('You can disable predefined intents FAQ, eMail, Call me from WPBot Lite > Settings page`s Start Menu Section.', 'chatbot'); ?></p>
3784 + </div>
4067 3785 </div>
4068 3786 </div>
4069 3787 </div>
4070 3788 </div>
@@ -4152,18 +3870,18 @@
4152 3870
4153 3871 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
4154 3872 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array('Did you mean?')));
4155 3873 }
4156 -
4157 - $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
3874 +
3875 + $sqlqry = $wpdb->get_results($wpdb->prepare("select * from $table1")); //DB Call OK, No Caching OK
4158 3876 if(empty($sqlqry)){
4159 3877
4160 - $query = 'What are you?';
4161 - $response = 'I am an Automated ChatBot to answer your questions. This is a sample Simple Text Response that can be edited or deleted.';
3878 + $query = 'What Can WPBot do for you?';
3879 + $response = 'WPBot can converse fluidly with users on website and FB messenger. It can search your website, send/collect eMails, user feedback & phone numbers . You can create Custom Intents from DialogFlow with Rich Messages & Card responses!';
4162 3880
4163 3881 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
4164 3882 $format = array('%s','%s', '%s', '%s');
4165 - $wpdb->insert($table1,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, PluginCheck.Security.DirectDB.UnescapedDBParameter
3883 + $wpdb->insert($table1,$data,$format); //DB Call OK, No Caching OK
4166 3884 }
4167 3885
4168 3886 update_option('qc_wpb_simple_response_db_upgrade_free2', 'done');
4169 3887
@@ -4205,15 +3923,15 @@
4205 3923 $table = $wpdb->prefix.'wpbot_response';
4206 3924 $data = array('query' => $query, 'keyword' => $keyword, 'response'=> $response, 'intent'=> $intent, 'category'=> $category);
4207 3925 $format = array('%s','%s', '%s', '%s', '%s');
4208 3926
4209 - if(isset($_POST['qc_bot_str_id']) && wp_unslash($_POST['qc_bot_str_id'])!=''){
4210 - $id = sanitize_text_field(wp_unslash($_POST['qc_bot_str_id']));
3927 + if(isset($_POST['qc_bot_str_id']) && $_POST['qc_bot_str_id']!=''){
3928 + $id = sanitize_text_field($_POST['qc_bot_str_id']);
4211 3929 $where = array('id'=>$id);
4212 3930 $whereformat = array('%d');
4213 - $wpdb->update( $table, $data, $where, $format, $whereformat ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
3931 + $wpdb->update( $table, $data, $where, $format, $whereformat ); //DB Call OK, No Caching OK
4214 3932 }else{
4215 - $wpdb->insert($table,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
3933 + $wpdb->insert($table,$data,$format); //DB Call OK, No Caching OK
4216 3934 }
4217 3935
4218 3936 qcld_mysql_remove_existing_indexes();
4219 3937
@@ -4219,9 +3937,9 @@
4219 3937
4220 3938 // phpcs:ignore
4221 3939 $wpdb->query("ALTER TABLE $table ADD FULLTEXT(`query`, `keyword`, `response`)");
4222 3940
4223 - wp_safe_redirect(admin_url('admin.php?page=simple-text-response'));exit;
3941 + wp_redirect(admin_url('admin.php?page=simple-text-response'));exit;
4224 3942
4225 3943 }
4226 3944 $table = $wpdb->prefix.'wpbot_response';
4227 3945
@@ -4234,51 +3952,33 @@
4234 3952
4235 3953 add_action('admin_notices', 'general_admin_notice_str' );
4236 3954
4237 3955 }
4238 - if(isset($_POST['qc_bot_str_weight']) && wp_unslash($_POST['qc_bot_str_weight'])!=''){
4239 - $weight = sanitize_text_field(wp_unslash($_POST['qc_bot_str_weight']));
3956 + if(isset($_POST['qc_bot_str_weight']) && $_POST['qc_bot_str_weight']!=''){
3957 + $weight = sanitize_text_field($_POST['qc_bot_str_weight']);
4240 3958 update_option('qc_bot_str_weight', $weight);
4241 3959 }
4242 - if(isset($_POST['qc_bot_str_remove_stopwords']) && wp_unslash($_POST['qc_bot_str_remove_stopwords'])!=''){
3960 + if(isset($_POST['qc_bot_str_remove_stopwords']) && $_POST['qc_bot_str_remove_stopwords']!=''){
4243 3961
4244 - $stopwords = sanitize_text_field(wp_unslash($_POST['qc_bot_str_remove_stopwords']));
3962 + $stopwords = sanitize_text_field($_POST['qc_bot_str_remove_stopwords']);
4245 3963 update_option('qc_bot_str_remove_stopwords', '1');
4246 3964 }
4247 - if ( isset($_POST['qc_bot_str_allow_author_editor']) && wp_unslash($_POST['qc_bot_str_allow_author_editor']) != '' ) {
4248 - $qc_bot_str_allow_author_editor = sanitize_text_field(wp_unslash($_POST['qc_bot_str_allow_author_editor']));
4249 - update_option( 'qc_bot_str_allow_author_editor', $qc_bot_str_allow_author_editor );
4250 - } else {
4251 - delete_option( 'qc_bot_str_allow_author_editor' );
4252 - }
4253 3965 if(isset($_POST['qc_bot_str_fields']) && !empty($_POST['qc_bot_str_fields'])){
4254 3966 $table = $wpdb->prefix.'wpbot_response';
4255 - $fields = rest_sanitize_array(wp_unslash($_POST['qc_bot_str_fields']));
4256 -
4257 - $allowed_fields = array('query', 'keyword', 'response');
4258 - $valid_fields = array();
4259 - if(is_array($fields)){
4260 - foreach($fields as $field){
4261 - if(in_array($field, $allowed_fields)){
4262 - $valid_fields[] = $field;
4263 - }
4264 - }
4265 - }
4266 - $fields = $valid_fields;
4267 -
3967 + $fields = rest_sanitize_array($_POST['qc_bot_str_fields']);
4268 3968 update_option('qc_bot_str_fields', $fields);
4269 3969 qcld_mysql_remove_existing_indexes();
4270 3970
4271 3971 if($fields && !empty($fields)){
4272 - $safe_fields = array_map(function($f) { return '`' . $f . '`'; }, $fields);
3972 +
4273 3973 // phpcs:ignore
4274 - $wpdb->query("ALTER TABLE $table ADD FULLTEXT(".implode(', ', $safe_fields).")");
3974 + $wpdb->query("ALTER TABLE $table ADD FULLTEXT(".implode(', ', $fields).")");
4275 3975
4276 3976 }
4277 3977 }
4278 3978
4279 3979 if(!get_option('wpbot_preloading_time')) {
4280 - update_option('wpbot_preloading_time', '800');
3980 + update_option('wpbot_preloading_time', '0.5');
4281 3981 }
4282 3982 }
4283 3983 }
4284 3984 }
@@ -4296,9 +3996,9 @@
4296 3996 if( !function_exists('qcld_wpbot_simple_response_intent') ){
4297 3997 function qcld_wpbot_simple_response_intent(){
4298 3998 global $wpdb;
4299 3999 $table = $wpdb->prefix.'wpbot_response';
4300 - $results = $wpdb->get_results("SELECT `intent` FROM `{$table}` WHERE 1 and `intent` !=''"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
4000 + $results = $wpdb->get_results("SELECT `intent` FROM `$table` WHERE 1 and `intent` !=''"); //DB Call OK, No Caching OK
4301 4001 $response = array();
4302 4002 if(!empty($results)){
4303 4003 foreach($results as $result){
4304 4004 $response[] = $result->intent;
@@ -4311,9 +4011,9 @@
4311 4011 function qcld_mysql_remove_existing_indexes(){
4312 4012 global $wpdb;
4313 4013 $table = $wpdb->prefix.'wpbot_response';
4314 4014
4315 - $results = $wpdb->get_results("SHOW INDEX FROM {$table}"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
4015 + $results = $wpdb->get_results("SHOW INDEX FROM $table"); //DB Call OK, No Caching OK
4316 4016 $indexes = array();
4317 4017 foreach($results as $result){
4318 4018
4319 4019