PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 7.6.3
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v7.6.3
8.7.8 8.7.7 8.7.6 8.7.5 8.7.4 8.7.3 8.7.2 8.7.1 8.7.0 8.6.9 8.6.8 8.6.7 8.6.6 8.6.5 8.6.4 8.6.2 8.6.1 8.6.0 8.5.9 8.5.8 8.5.7 8.5.6 8.5.5 8.5.4 8.5.3 All 534 releases
chatbot / qcld-wpwbot.php

qcld-wpwbot.php in WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services 7.6.3, at qcld-wpwbot.php

4,058 lines 245.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: AI ChatBot - WPBot
4 * Plugin URI: https://wordpress.org/plugins/chatbot/
5 * Description: ChatBot is a native WordPress ChatBot plugin to provide live chat support and lead generation
6 * Donate link: https://www.wpbot.pro/
7 * Version: 7.6.3
8 * @author QuantumCloud
9 * Author: ChatBot for WordPress - WPBot
10 * Author URI: https://www.wpbot.pro/
11 * Requires at least: 4.6
12 * Tested up to: 6.9
13 * Text Domain: wpbot
14 * Domain Path: /lang
15 * License: GPL2
16 */
17
18
19
20 if (!defined('ABSPATH')) exit; // Exit if accessed directly.
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(){
25
26 $check_existing_plugin = get_option('qcld_chatbot_existing_plugin_activate_check');
27
28
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
35 }
36 }
37
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;
41 }
42
43 if ( ! defined( 'QCLD_wpCHATBOT_VERSION' ) ) {
44 define('QCLD_wpCHATBOT_VERSION', '7.6.3');
45 }
46 if ( ! defined( 'QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION' ) ) {
47 define('QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION', 2.2);
48 }
49 if ( ! defined( 'QCLD_wpCHATBOT_PLUGIN_DIR_PATH' ) ) {
50 define('QCLD_wpCHATBOT_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
51 }
52 if ( ! defined( 'QCLD_wpCHATBOT_PLUGIN_URL' ) ) {
53 define('QCLD_wpCHATBOT_PLUGIN_URL', plugin_dir_url(__FILE__));
54 }
55 if ( ! defined( 'QCLD_wpCHATBOT_IMG_URL' ) ) {
56 define('QCLD_wpCHATBOT_IMG_URL', QCLD_wpCHATBOT_PLUGIN_URL . "images/");
57 }
58 if ( ! defined( 'QCLD_wpCHATBOT_IMG_ABSOLUTE_PATH' ) ) {
59 define('QCLD_wpCHATBOT_IMG_ABSOLUTE_PATH', plugin_dir_path(__FILE__) . "images");
60 }
61 if ( ! defined( 'QCLD_wpCHATBOT_INDEX_TABLE' ) ) {
62 define('QCLD_wpCHATBOT_INDEX_TABLE', 'wpwbot_index');
63 }
64
65
66
67 //define('QCLD_wpCHATBOT_CACHE_TABLE', 'wpwbot_cache');
68
69 if ( ! defined( 'QCLD_wpCHATBOT_GC_DIRNAME' ) ) {
70 $gcdirpath = __DIR__.'/../../wpbot-dfv2-client';
71 define('QCLD_wpCHATBOT_GC_DIRNAME', $gcdirpath);
72 }
73 if ( ! defined( 'QCLD_wpCHATBOT_GC_ROOT' ) ) {
74 $wpcontentpath = __DIR__.'/../../';
75 define('QCLD_wpCHATBOT_GC_ROOT', $wpcontentpath);
76 }
77
78 require_once("qcld-wpwbot-search.php");
79 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openai/qcld-bot-openai.php");
80 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openrouter/qcld-bot-openrouter.php");
81 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/gemini/qcld-bot-gemini.php");
82 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."class-qc-free-plugin-upgrade-notice.php");
83 require_once("class-plugin-deactivate-feedback.php");
84 require_once("qc-support-promo-page/class-qc-support-promo-page.php");
85 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."/functions.php");
86 require_once('qcld_df_api.php');
87 require_once('includes/class-wpbot-gc-download.php');
88 require_once('includes/class-response-list.php');
89 require_once('qc-rating-feature/qc-rating-class.php');
90 // if ( is_admin() ) {
91 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/parsedown.php' );
92 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/qcld-floating-openai-style-filter.php' );
93 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/qcld_openai_floating_content.php' );
94 // }
95
96 /**
97 * Main Class.
98 */
99
100 class qcld_wb_Chatbot_free
101 {
102 private $id = 'wpbot';
103 private static $instance;
104 public $mysql_version = '';
105 public $promotion;
106 public $response_list;
107
108 /**
109 * Get Instance creates a singleton class that's cached to stop duplicate instances
110 */
111 public static function qcld_wb_chatbot_get_instance()
112 {
113 if (!self::$instance) {
114 self::$instance = new self();
115 self::$instance->qcld_wb_chatbot_init();
116 }
117 return self::$instance;
118 }
119 /**
120 * Construct empty on purpose
121 */
122 private function __construct()
123 {
124 $this->promotion = QCLD_wpCHATBOT_IMG_URL . "/NY-26-wpbot.jpg";
125 }
126 /**
127 * Init behaves like, and replaces, construct
128 */
129 public function qcld_wb_chatbot_init()
130 {
131 // Check if wpCommerce is active, and is required wpCommerce version.
132 /*if (!class_exists('wpCommerce') || version_compare(get_option('wpcommerce_db_version'), QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION, '<')) {
133 add_action('admin_notices', array($this, 'wpcommerce_inactive_notice_for_wp_chatbot'));
134 return;
135 }*/
136 add_action('admin_menu', array($this, 'qcld_wb_chatbot_admin_menu'));
137
138 if ((!empty($_GET["page"])) && ($_GET["page"] == "wpbot")) {
139 add_action('admin_init', array($this, 'qcld_wb_chatbot_save_options'));
140
141 }
142
143 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') ){
144 add_action( 'admin_notices', array( $this, 'promotion_notice' ) );
145 }
146
147 if (is_admin() && !empty($_GET["page"]) && ($_GET["page"] == "wpbot") || (!empty($_GET['page']) && $_GET['page']=='wpbot_help_page')
148
149 || (!empty($_GET['page']) && $_GET['page']=='wpbot_openAi')
150
151 || (!empty($_GET['page']) && $_GET['page']=='wpbot-panel') || ( !empty($_GET['page']) && $_GET["page"] == "wbcs-botsessions-page") ) {
152 add_action('admin_enqueue_scripts', array($this, 'qcld_wb_chatbot_admin_scripts'));
153 if( get_option('wp_chatbot_index_count')<=0 && get_option('qlcd_wp_chatbot_search_option')=='advanced'){
154
155 add_action( 'admin_notices', array( $this, 'admin_notice_reindex' ) );
156 }
157 }
158 //loading frontend scripts
159 add_action('wp', array($this, 'qcld_wpchatbot_init_fnc'));
160 add_action('init', array($this, 'qcld_wpchatbot_init2_fnc'));
161
162
163 }
164
165
166
167 public function qcld_wpchatbot_init_fnc(){
168 if (!is_admin() && get_option('disable_wp_chatbot') != 1 && wp_chatbot_load_controlling() === true) {
169 add_action('wp_enqueue_scripts', array($this, 'qcld_wb_chatbot_frontend_scripts'));
170 }
171 }
172 public function qcld_wpchatbot_init2_fnc(){
173 global $wpdb;
174 if( is_admin() ){
175
176 $connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
177 if($connection === false){
178 return;
179 }
180 $content = $connection->server_info;
181
182 $mysql_server_info = $wpdb->db_server_info();
183
184 // Check for the MariaDB.
185 $is_mariadb = false;
186 if ( ! empty( $mysql_server_info ) && strpos( strtolower( $mysql_server_info ), 'maria' ) !== false ) {
187 $is_mariadb = true;
188 }
189
190 preg_match_all('/\d+\.\d+/', $content, $matches);
191
192 if( !empty( $matches ) && isset( $matches[0] ) && !empty( $matches[0] ) && is_array( $matches[0] ) && ! $is_mariadb ){
193 $versions = $matches[0];
194 $notice = true;
195 foreach( $versions as $version ){
196 if (version_compare($version, '5.5', '>')) {
197 $this->mysql_version = $version;
198 $notice = false;
199 }else{
200 $this->mysql_version = $version;
201 }
202 }
203
204 if( $notice ){
205 add_action('admin_notices', array($this, 'mysql_version_notice') );
206 }
207
208 }
209
210 $connection->close();
211 }
212 }
213
214 public function mysql_version_notice(){
215 $class="notice notice-error is-dismissible qc-notice-error";
216 $message = "Your server's MySQL version is **".$this->mysql_version."**. MySQL version 5.6+ is required for Simple Text Responses to work. Please contact your hosting support to upgrade the MySQL to the latest version.";
217 printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
218 }
219
220 /**
221 * Add a submenu item to the wpCommerce menu
222 */
223 public function qcld_wb_chatbot_admin_menu()
224 {
225 /* add_submenu_page('wpcommerce',
226 __('wpwBot Pro', 'chatbot'),
227 __('wpwBot Pro', 'chatbot'),
228 'manage_wpcommerce',
229 $this->id,
230 array($this, 'qcld_wb_chatbot_admin_page'));*/
231
232 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 );
233
234 add_submenu_page( 'wpbot-panel', esc_html('Settings'), esc_html('Settings'), 'manage_options','wpbot', array($this, 'qcld_wb_chatbot_admin_page_settings') );
235
236 add_submenu_page( 'wpbot-panel', esc_html('OpenAI Settings'), esc_html('AI Settings'), 'manage_options','wpbot_openAi', 'wpbot_openAi_setting_func' );
237
238 $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') );
239
240 add_action( "load-$hook", [ $this, 'screen_option' ] );
241
242 // add_submenu_page( 'wpbot-panel', esc_html('Conversational Form '), esc_html('Conversational Form'), 'manage_options','wpbots', [$this, 'qcld_wb_chatbot_admin_conversational_settings'] );
243
244 add_submenu_page( 'wpbot-panel', esc_html('Support'), esc_html('Support'), 'manage_options','wpbot_support_page', 'qcpromo_wpbot_free_support_page_callback_func' );
245
246 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' );
247
248
249 }
250
251 function screen_option(){
252 if( isset($_POST['wp_screen_options']) && !empty($_POST['wp_screen_options'])){
253 $per_page_str = (int)$_POST['wp_screen_options']["value"];
254
255 }else{
256 $per_page_str = 20;
257 }
258 $option = 'per_page';
259 $args = [
260 'label' => 'Response',
261 'default' => $per_page_str,
262 'option' => 'responses_per_page'
263 ];
264
265 $this->response_list = new Response_list();
266 }
267
268 public function qcld_wb_chatbot_admin_str(){
269
270 require_once("includes/simple_text_response.php");
271
272 }
273
274
275
276 /**
277 * Include admin scripts
278 */
279 public function qcld_wb_chatbot_admin_scripts($hook)
280 {
281 global $wpcommerce, $wp_scripts;
282 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
283
284 if (((!empty($_GET["page"])) && ($_GET["page"] == "wpbot")) || ($hook == "widgets.php") || $_GET['page']=='wpbot_help_page' || $_GET['page']=='wpbot_openAi' || $_GET['page']=='simple-text-response'
285 || $_GET['page']=='wpbot-panel' || $_GET["page"] == "wbcs-botsessions-page" ) {
286
287 wp_enqueue_script('jquery');
288 //wp_enqueue_style('wpcommerce_admin_styles', $wpcommerce->plugin_url() . '/assets/css/admin.css');
289
290 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');
291 wp_enqueue_style('qlcd-wp-chatbot-admin-style');
292 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');
293 wp_enqueue_style('qlcd-wp-chatbot-tabs-style');
294 wp_register_style('jquery.fontpicker.min.css', QCLD_wpCHATBOT_PLUGIN_URL . 'css/fontpicker.min.css', '', QCLD_wpCHATBOT_VERSION, 'screen');
295 wp_enqueue_style('jquery.fontpicker.min.css');
296
297
298 //wp_register_style('qlcd-openai-bootstap', plugins_url(basename(plugin_dir_path(__FILE__)) . '/openai/css/openai-admin-style.css', basename(__FILE__)), array(), true);
299 //wp_enqueue_style('qlcd-openai-bootstap');
300
301
302
303 wp_enqueue_script('jquery');
304 wp_enqueue_script( 'jquery-ui-draggable' );
305 wp_enqueue_script( 'jquery-ui-droppable' );
306 wp_enqueue_script('jquery-ui-core');
307 wp_enqueue_style( 'wp-color-picker');
308 wp_enqueue_script( 'wp-color-picker');
309 wp_enqueue_script( 'jquery-ui-sortable');
310 wp_register_script('qcld-wp-fontpicker', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/fontpicker.js', basename(__FILE__)), array(), true);
311 wp_enqueue_script('qcld-wp-fontpicker');
312 wp_register_script('qcld-wp-chatbot-cbpFWTabs', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/cbpFWTabs.js', basename(__FILE__)), array(), true);
313 wp_enqueue_script('qcld-wp-chatbot-cbpFWTabs');
314 wp_register_script('qcld-wp-chatbot-modernizr-custom', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/modernizr.custom.js', basename(__FILE__)), array(), true);
315 wp_enqueue_script('qcld-wp-chatbot-modernizr-custom');
316 wp_register_script('qcld-wp-chatbot-bootstrap-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/bootstrap.js', basename(__FILE__)), array('jquery'), true);
317 wp_enqueue_script('qcld-wp-chatbot-bootstrap-js');
318
319 // wp_register_script('qcld-wp-openai-setting-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/openai_settings.js', basename(__FILE__)), array('jquery'), true);
320 // wp_enqueue_script('qcld-wp-openai-setting-js');
321
322 wp_localize_script( 'qcld-wp-openai-setting-js', 'openai_ajax', array(
323 'url' => admin_url( 'admin-ajax.php' ),
324 ) );
325
326 wp_register_style('qcld-wp-chatbot-bootstrap-css', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/bootstrap.min.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
327 wp_enqueue_style('qcld-wp-chatbot-bootstrap-css');
328 //jquery time picker
329 wp_register_script('qcld-wp-chatbot-timepicker-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/jquery.timepicker.js', basename(__FILE__)), array('jquery'), true);
330 wp_enqueue_script('qcld-wp-chatbot-timepicker-js');
331 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');
332 wp_enqueue_style('qcld-wp-chatbot-timepicker-css');
333 wp_register_script('qcld-wp-chatbot-sweetalrt', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/sweetalrt.js', basename(__FILE__)), array(), true);
334 wp_enqueue_script('qcld-wp-chatbot-sweetalrt');
335 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);
336 wp_enqueue_script('qcld-wp-chatbot-admin-js');
337 wp_localize_script('qcld-wp-chatbot-admin-js', 'qcld_gemini_admin_data',
338 array('ajax_url' => admin_url('admin-ajax.php'),'ajax_nonce' => wp_create_nonce('wp_chatbot'),'image_path' => QCLD_wpCHATBOT_IMG_URL));
339 // WordPress Media library
340 wp_enqueue_media();
341
342
343
344 }
345
346 }
347
348
349 public function qcld_get_formbuilder_forms(){
350 global $wpdb;
351 $forms = array();
352 if(class_exists('Qcformbuilder_Forms_Admin')){
353 $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
354 if(!empty($results)){
355 foreach($results as $result){
356 $form = maybe_unserialize($result->config);
357 $forms[] = trim($form['name']);
358 }
359 return $forms;
360 }else{
361 return array();
362 }
363 }else{
364 return array();
365 }
366 }
367 public function qcld_wpbot_simple_response_intent(){
368 global $wpdb;
369 $table = $wpdb->prefix.'wpbot_response';
370 $results = $wpdb->get_results("SELECT `intent` FROM `$table` WHERE 1 and `intent` !=''"); //DB Call OK, No Caching OK
371 $response = array();
372 if(!empty($results)){
373 foreach($results as $result){
374 $response[] = $result->intent;
375 }
376 }
377 return $response;
378 }
379 public function qcld_get_formbuilder_form_commands(){
380 global $wpdb;
381 $command = array();
382 if(class_exists('Qcformbuilder_Forms_Admin')){
383 $primary = 'primary';
384 $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type = %s", $primary)); //DB Call OK, No Caching OK
385
386 if(!empty($results)){
387 foreach($results as $result){
388 $form = maybe_unserialize($result->config);
389
390 if(isset($form['command'])){
391 $command[] = array_map('trim', explode(',', strtolower($form['command'])));
392 }
393
394 }
395 return $command;
396 }else{
397 return array();
398 }
399 }else{
400 return array();
401 }
402 }
403 public function promotion_notice(){
404 $screen = get_current_screen();
405 // var_dump($screen->base );
406 // if( isset($screen->base) && (( $screen->base == 'wpbot-lite_page_wpbot') || ( $screen->base == 'toplevel_page_wpbot-panel"'))){
407 ?>
408 <div id="promotion-wpchatbot" data-dismiss-type="qcbot-feedback-notice" class="notice is-dismissible qcbot-feedback" style="background: #120976 !important">
409 <div class="">
410
411 <div class="qc-review-text" >
412 <a href="<?php echo esc_url('https://www.wpbot.pro/pricing/'); ?>" target="_blank">
413 <img src="<?php echo esc_url($this->promotion); ?>" alt="promotion" style="position: flex !important;"></a>
414 </div>
415 </div>
416 </div>
417 <?php
418 // }
419 }
420 public function qcld_get_formbuilder_form_ids(){
421 global $wpdb;
422 $forms = array();
423 if(class_exists('Qcformbuilder_Forms_Admin')){
424 $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
425
426 if(!empty($results)){
427 foreach($results as $result){
428 $form = maybe_unserialize($result->config);
429 $forms[] = trim($form['ID']);
430 }
431 return $forms;
432 }else{
433 return array();
434 }
435 }else{
436 return array();
437 }
438 }
439
440 public function qcld_wb_chatbot_frontend_scripts()
441 {
442 global $wpcommerce, $wp_scripts, $wpdb, $current_user;
443
444 $display_name = '';
445 $display_email = '';
446 $user_image = get_option('wp_custom_client_icon');
447 $user_id = 0;
448 $user_image = get_option('wp_custom_client_icon');
449 if ( is_user_logged_in() ) {
450 $display_name = $current_user->display_name;
451 $display_email = $current_user->user_email;
452 $user_image = esc_url( get_avatar_url( $current_user->ID ) );
453 $user_id = $current_user->ID;
454 }
455
456 $conversation_form_ids = array();
457 $conversation_form_names = array();
458
459 if(class_exists('Qcformbuilder_Forms_Admin')){
460 $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
461 if(!empty($results)){
462
463 foreach($results as $result){
464 $form = unserialize($result->config);
465 $conversation_form_ids[] = $form['ID'];
466 $conversation_form_names[] = $form['name'];
467 }
468
469 }
470 }
471
472 // var_dump( str_replace('<', '',esc_html(get_option('qlcd_wp_chatbot_agent'))));wp_die();
473 $wp_chatbot_obj = array(
474 'wp_chatbot_position_x' => get_option('wp_chatbot_position_x'),
475 'wp_chatbot_position_y' => get_option('wp_chatbot_position_y'),
476 'disable_icon_animation' => get_option('disable_wp_chatbot_icon_animation'),
477 'disable_featured_product' => get_option('disable_wp_chatbot_featured_product'),
478 'disable_product_search' => get_option('disable_wp_chatbot_product_search'),
479 'disable_catalog' => get_option('disable_wp_chatbot_catalog'),
480 'disable_order_status' => get_option('disable_wp_chatbot_order_status'),
481 'disable_sale_product' => get_option('disable_wp_chatbot_sale_product'),
482 'open_product_detail' => get_option('wp_chatbot_open_product_detail'),
483 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
484 'ajax_url' => admin_url('admin-ajax.php'),
485 'image_path' => QCLD_wpCHATBOT_IMG_URL,
486 'yes' => str_replace('\\', '',get_option('qlcd_wp_chatbot_yes')),
487 'no' => str_replace('\\', '',get_option('qlcd_wp_chatbot_no')),
488 'or' => str_replace('\\', '',get_option('qlcd_wp_chatbot_or')),
489 'host' => str_replace('\\', '',get_option('qlcd_wp_chatbot_host')),
490 'agent' => str_replace(['\\','<','>'], '',esc_html(get_option('qlcd_wp_chatbot_agent'))),
491 'agent_image' => get_option('wp_chatbot_agent_image'),
492 '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',
493 'shopper_demo_name' => str_replace('\\', '',get_option('qlcd_wp_chatbot_shopper_demo_name')),
494 'agent_join' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_agent_join'))),
495 'welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome'))),
496 'welcome_back' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome_back'))),
497 'hi_there' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_hi_there'))),
498 'hello' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_hello'))),
499 'asking_name' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_name'))),
500 'i_am' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_i_am'))),
501 'name_greeting' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_name_greeting'))),
502 'wildcard_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_msg'))),
503 'empty_filter_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_empty_filter_msg'))),
504 'did_you_mean' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_did_you_mean'))),
505 'is_typing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_is_typing'))),
506 'send_a_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_send_a_msg'))),
507
508 'viewed_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_viewed_products'))),
509
510 'shopping_cart' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_shopping_cart'))),
511 'cart_updating' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_updating'))),
512 'cart_removing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_removing'))),
513 'imgurl' => QCLD_wpCHATBOT_IMG_URL,
514 'sys_key_help' => get_option('qlcd_wp_chatbot_sys_key_help'),
515 'sys_key_product' => get_option('qlcd_wp_chatbot_sys_key_product'),
516 'sys_key_catalog' => get_option('qlcd_wp_chatbot_sys_key_catalog'),
517 'sys_key_order' => get_option('qlcd_wp_chatbot_sys_key_order'),
518 'sys_key_support' => get_option('qlcd_wp_chatbot_sys_key_support'),
519 'sys_key_reset' => get_option('qlcd_wp_chatbot_sys_key_reset'),
520 'sys_key_email' => get_option('qlcd_wp_chatbot_sys_key_email'),
521 'help_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_welcome'))),
522 'back_to_start' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_back_to_start'))),
523 'help_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_msg'))),
524 'reset' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_reset'))),
525 'wildcard_product' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_product'))),
526 'wildcard_catalog' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_catalog'))),
527 'featured_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_featured_products'))),
528 'sale_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_sale_products'))),
529 'wildcard_order' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_order'))),
530 'wildcard_support' => get_option('qlcd_wp_chatbot_wildcard_support'),
531 'product_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_asking'))),
532 'product_suggest' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_suggest'))),
533 'product_infinite' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_infinite'))),
534 'product_success' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_success'))),
535 'product_fail' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_fail'))),
536 'support_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_welcome'))),
537 'support_email' => get_option('qlcd_wp_chatbot_support_email'),
538 'support_option_again' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_option_again'))),
539 'asking_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_email'))),
540 'asking_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_msg'))),
541 'no_result' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_no_result'))),
542 'support_phone' => get_option('qlcd_wp_chatbot_support_phone'),
543 'asking_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_phone'))),
544 'thank_for_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_thank_for_phone'))),
545 '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')))),
546 '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'))),
547 'notification_interval' => get_option('qlcd_wp_chatbot_notification_interval'),
548 'notifications' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_notifications'))),
549 'order_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_welcome'))),
550 'order_username_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_asking'))),
551 'order_username_password' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_password'))),
552 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
553 'order_login' => is_user_logged_in(),
554 'is_chat_session_active' => qcld_wpbot_is_active_chat_history(),
555 'order_nonce' => wp_create_nonce("wpwbot-order-nonce"),
556 'order_email_support' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_email_support'))),
557 'email_fail' => str_replace('\\', '', get_option('qlcd_wp_chatbot_email_fail')),
558 'invalid_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_invalid_email'))),
559 'stop_words' => str_replace('\\', '', get_option('qlcd_wp_chatbot_stop_words')),
560 'currency_symbol' => '',
561 'enable_messenger' => get_option('enable_wp_chatbot_messenger'),
562 'messenger_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_messenger_label'))),
563 'fb_page_id' => get_option('qlcd_wp_chatbot_fb_page_id'),
564 'enable_skype' => get_option('enable_wp_chatbot_skype'),
565 'enable_whats' => get_option('enable_wp_chatbot_whats'),
566 'whats_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_whats_label'))),
567 'whats_num' => get_option('qlcd_wp_chatbot_whats_num'),
568 'ret_greet' => get_option('qlcd_wp_chatbot_ret_greet'),
569 'enable_exit_intent' => get_option('enable_wp_chatbot_exit_intent'),
570 'exit_intent_msg' => str_replace('\\', '', get_option('wp_chatbot_exit_intent_msg')),
571 'exit_intent_once' => get_option('wp_chatbot_exit_intent_once'),
572 'enable_scroll_open' => get_option('enable_wp_chatbot_scroll_open'),
573 'scroll_open_msg' => str_replace('\\', '', get_option('wp_chatbot_scroll_open_msg')),
574 'scroll_open_percent' => get_option('wp_chatbot_scroll_percent'),
575 'scroll_open_once' => get_option('wp_chatbot_scroll_once'),
576 'enable_auto_open' => get_option('enable_wp_chatbot_auto_open'),
577 'auto_open_msg' => str_replace('\\', '', get_option('wp_chatbot_auto_open_msg')),
578 'auto_open_time' => get_option('wp_chatbot_auto_open_time'),
579 'auto_open_once' => get_option('wp_chatbot_auto_open_once'),
580 'proactive_bg_color' => get_option('wp_chatbot_proactive_bg_color'),
581 'disable_feedback' => get_option('disable_wp_chatbot_feedback'),
582 'disable_faq' => get_option('disable_wp_chatbot_faq'),
583 'feedback_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_feedback_label'))),
584 'enable_meta_title' =>get_option('enable_wp_chatbot_meta_title'),
585 'meta_label' =>str_replace('\\', '', get_option('qlcd_wp_chatbot_meta_label')),
586 'phone_number' => get_option('qlcd_wp_chatbot_phone'),
587 'disable_site_search' => get_option('disable_wp_chatbot_site_search'),
588 'search_keyword' => get_option('qlcd_wp_chatbot_asking_search_keyword'),
589 'ajax_nonce'=> wp_create_nonce('qcsecretbotnonceval123qc'),
590 'site_search' => get_option('qlcd_wp_site_search'),
591 'open_links_newtab' => get_option('open_links_new_window'),
592 'call_gen' => get_option('disable_wp_chatbot_call_gen'),
593 'call_sup' => get_option('disable_wp_chatbot_call_sup'),
594 'enable_ret_sound' => get_option('enable_wp_chatbot_ret_sound'),
595 'found_result_message' => get_option('qlcd_wp_chatbot_found_result'),
596 'enable_ret_user_show' => get_option('enable_wp_chatbot_ret_user_show'),
597 'enable_inactive_time_show' => get_option('enable_wp_chatbot_inactive_time_show'),
598 'ret_inactive_user_once' => get_option('wp_chatbot_inactive_once'),
599 'mobile_full_screen' => '1',
600 'botpreloadingtime' => (get_option('wpbot_preloading_time')?get_option('wpbot_preloading_time'):100),
601 'inactive_time' => get_option('wp_chatbot_inactive_time'),
602 'checkout_msg' => str_replace('\\', '', get_option('wp_chatbot_checkout_msg')),
603 'ai_df_enable' => get_option('enable_wp_chatbot_dailogflow'),
604 'ai_df_token' => get_option('qlcd_wp_chatbot_dialogflow_client_token'),
605 'df_defualt_reply' => str_replace('\\', '', get_option('qlcd_wp_chatbot_dialogflow_defualt_reply')),
606 'df_agent_lan' => get_option('qlcd_wp_chatbot_dialogflow_agent_language'),
607 'openai_enabled' => get_option('ai_enabled'),
608 'qcld_openai_append_content' => get_option('qcld_openai_append_content'),
609 'openrouter_enabled' => (get_option('qcld_openrouter_enabled')=='1'? get_option('qcld_openrouter_enabled') : '0'),
610 'gemini_enabled' => (get_option('qcld_gemini_enabled')=='1'? get_option('qcld_gemini_enabled') : '0'),
611 'qcld_gemini_prepend_content' => get_option('qcld_gemini_prepend_content'),
612 'qcld_gemini_append_content' => get_option('qcld_gemini_append_content'),
613 'qcld_openrouter_append_content' => get_option('qcld_openrouter_append_content'),
614 'qcld_openrouter_prepend_content' => get_option('qcld_openrouter_prepend_content'),
615 'start_menu' => wp_unslash(get_option('qc_wpbot_menu_order')),
616 'conversation_form_ids' => $conversation_form_ids,
617 'conversation_form_names' => $conversation_form_names,
618 'simple_response_intent' => $this->qcld_wpbot_simple_response_intent(),
619 'forms' => $this->qcld_get_formbuilder_forms(),
620 'form_ids' =>$this->qcld_get_formbuilder_form_ids(),
621 'form_commands' => $this->qcld_get_formbuilder_form_commands(),
622 'df_api_version' => (get_option('wp_chatbot_df_api')==''?'v1':get_option('wp_chatbot_df_api')),
623 'v2_client_url'=> esc_url(get_site_url().'/?action=qcld_dfv2_api'),
624 'show_menu_after_greetings'=> (get_option('show_menu_after_greetings')!=''?get_option('show_menu_after_greetings'):0),
625 'current_user_id' => $user_id,
626 'skip_wp_greetings' => get_option('skip_wp_greetings'),
627 'skip_greetings_and_menu' => get_option('skip_wp_greetings_donot_show_menu'),
628 'skip_chat_reactions_menu' => get_option('skip_chat_reactions_menu'),
629 'qlcd_wp_chatbot_like_text' => get_option('qlcd_wp_chatbot_like_text'),
630 'qlcd_wp_chatbot_dislike_text' => get_option('qlcd_wp_chatbot_dislike_text'),
631 'enable_chat_report_menu' => get_option('enable_chat_report_menu'),
632 'qlcd_wp_chatbot_report_text' => get_option('qlcd_wp_chatbot_report_text'),
633 'enable_chat_share_menu' => get_option('enable_chat_share_menu'),
634 'qlcd_wp_chatbot_share_text' => get_option('qlcd_wp_chatbot_share_text'),
635
636 );
637 $user_font = get_option('wp_chatbot_user_font') != '' ? get_option('wp_chatbot_user_font') : '';
638 if($user_font != '' ){
639 $parts = explode(':', $user_font);
640 // Create an object
641 $user_font_family = new stdClass();
642 // Assign values
643 $user_font_family->fontfamily = $parts[0];
644 $user_font_family->fontWeight = isset($parts[1]) ? $parts[1] : '400'; // default weight
645 $user_font_family->fontStyle = 'normal';
646 if(get_option('enable_wp_chatbot_custom_color')==1){
647 $user_enqueue_font = 'https://fonts.googleapis.com/css2?family='. $user_font_family->fontfamily;
648 wp_enqueue_style( 'qcld-chatbot-user-google-fonts', $user_enqueue_font, false );
649 wp_enqueue_style( 'qcld-chatbot-user-google-fonts');
650 }
651 }
652
653 $bot_font = get_option('wp_chatbot_bot_font') != '' ? get_option('wp_chatbot_bot_font') : '';
654 if($bot_font != '' ){
655 $parts = explode(':', $bot_font);
656 // Create an object
657 $bot_font_family = new stdClass();
658 // Assign values
659 $bot_font_family->fontFamily = $parts[0];
660 $bot_font_family->fontWeight = isset($parts[1]) ? $parts[1] : '400'; // default weight
661 $bot_font_family->fontStyle = 'normal';
662
663
664
665 if(get_option('enable_wp_chatbot_custom_color')==1){
666 $bot_enqueue_font = 'https://fonts.googleapis.com/css2?family='.$bot_font_family->fontFamily;
667 wp_enqueue_style( 'qcld-chatbot-bot-google-fonts', $bot_enqueue_font, false );
668 wp_enqueue_style( 'qcld-chatbot-bot-google-fonts');
669 }
670 }
671
672
673
674 wp_enqueue_style( 'dashicons' );
675 wp_register_script('qcld-wp-chatbot-slimscroll-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/jquery.slimscroll.min.js', basename(__FILE__)), array('jquery'), QCLD_wpCHATBOT_VERSION, true);
676 wp_enqueue_script('qcld-wp-chatbot-slimscroll-js');
677 wp_register_script('qcld-wp-chatbot-jquery-cookie', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/jquery.cookie.js', basename(__FILE__)), array('jquery'), QCLD_wpCHATBOT_VERSION, true);
678 wp_enqueue_script('qcld-wp-chatbot-jquery-cookie');
679 wp_register_script('qcld-wp-chatbot-magnify-popup', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/jquery.magnific-popup.min.js', basename(__FILE__)), array('jquery'), QCLD_wpCHATBOT_VERSION, true);
680 wp_enqueue_script('qcld-wp-chatbot-magnify-popup');
681 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);
682 wp_enqueue_script('qcld-wp-chatbot-plugin');
683
684 $nonce = wp_create_nonce('wp_chatbot');
685 // Pass data to JS
686 wp_localize_script('qcld-wp-chatbot-plugin', 'qcld_chatbot_obj', [
687 'ajax_url' => admin_url('admin-ajax.php'),
688 'nonce' => $nonce,
689 ]);
690
691 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);
692 wp_enqueue_script('qcld-wp-chatbot-front-js');
693 wp_localize_script('qcld-wp-chatbot-front-js', 'wp_chatbot_obj', $wp_chatbot_obj);
694 //wp_register_script('qcld-wp-chatbot-frontend', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/qcld-wp-chatbot-frontend.js', basename(__FILE__)), array('jquery','qcld-wp-chatbot-jquery-cookie'), QCLD_wpCHATBOT_VERSION, true);
695 //wp_enqueue_script('qcld-wp-chatbot-frontend');
696 //wp_localize_script('qcld-wp-chatbot-frontend', 'wp_chatbot_obj', $wp_chatbot_obj);
697 wp_localize_script('qcld-wp-chatbot-frontend', 'wp_chatbot_obj', $wp_chatbot_obj);
698
699 if ( ! function_exists( 'wp_register_style' ) || ! function_exists( 'wp_enqueue_style' ) || ! function_exists( 'plugins_url' ) || ! function_exists( 'plugin_dir_path' ) || ! function_exists( 'get_option' ) || ! function_exists( 'sanitize_hex_color' ) || ! function_exists( 'wp_add_inline_style' ) ) {
700 // Return early if critical WordPress functions are not available.
701 // This indicates the code needs to be hooked into an appropriate action.
702 return;
703 }
704
705 wp_register_style('qcld-wp-chatbot-common-style', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/common-style.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
706 wp_enqueue_style('qcld-wp-chatbot-common-style');
707
708 $floating_icon_bg_color = get_option('wp_chatbot_floatingiconbg_color');
709 $floating_icon_bg_color = sanitize_hex_color($floating_icon_bg_color); // ensures it's a valid hex color like #ffffff
710
711 if ( ! empty($floating_icon_bg_color) ) {
712 $inline_floating_icon_styles = "
713 .wp-chatbot-ball {
714 background: {$floating_icon_bg_color} !important;
715 }
716 .wp-chatbot-ball:hover,
717 .wp-chatbot-ball:focus {
718 background: {$floating_icon_bg_color} !important;
719 }";
720
721 wp_add_inline_style( 'qcld-wp-chatbot-common-style', $inline_floating_icon_styles );
722 }
723
724 wp_register_style('qcld-wp-chatbot-magnific-popup', plugins_url(basename(plugin_dir_path(__FILE__)) . '/css/magnific-popup.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
725 wp_enqueue_style('qcld-wp-chatbot-magnific-popup');
726
727 $qcld_wb_chatbot_theme = get_option('qcld_wb_chatbot_theme');
728 /* if (file_exists(QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/templates/' . $qcld_wb_chatbot_theme . '/style.css')) {
729 wp_register_style('qcld-wp-chatbot-style', plugins_url(basename(plugin_dir_path(__FILE__)) . '/templates/' . $qcld_wb_chatbot_theme . '/style.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
730 wp_enqueue_style('qcld-wp-chatbot-style');
731 }*/
732 //Loading shortcode style
733 if (file_exists(QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/templates/' . $qcld_wb_chatbot_theme . '/shortcode.css')) {
734 wp_register_style('qcld-wp-chatbot-shortcode-style', plugins_url(basename(plugin_dir_path(__FILE__)) . '/templates/' . $qcld_wb_chatbot_theme . '/shortcode.css', basename(__FILE__)), '', QCLD_wpCHATBOT_VERSION, 'screen');
735 wp_enqueue_style('qcld-wp-chatbot-shortcode-style');
736 }
737
738 $inline_chat_custom_styles = ''; // Initialize a new variable for general chat custom styles.
739 if(get_option('enable_wp_chatbot_custom_color')==1){
740 // Sanitize all color options before using them in CSS to prevent invalid values.
741 $text_color = sanitize_hex_color( get_option('wp_chatbot_text_color') );
742 $link_color = sanitize_hex_color( get_option('wp_chatbot_link_color') );
743 $link_hover_color = sanitize_hex_color( get_option('wp_chatbot_link_hover_color') );
744 $bot_msg_text_color = sanitize_hex_color( get_option('wp_chatbot_bot_msg_text_color') );
745 $bot_msg_bg_color = sanitize_hex_color( get_option('wp_chatbot_bot_msg_bg_color') );
746 $buttons_text_color = sanitize_hex_color( get_option('wp_chatbot_buttons_text_color') );
747 $buttons_bg_color = sanitize_hex_color( get_option('wp_chatbot_buttons_bg_color') );
748 $buttons_text_color_hover = sanitize_hex_color( get_option('wp_chatbot_buttons_text_color_hover') );
749 $buttons_bg_color_hover = sanitize_hex_color( get_option('wp_chatbot_buttons_bg_color_hover') );
750 $user_msg_text_color = sanitize_hex_color( get_option('wp_chatbot_user_msg_text_color') );
751 $wp_chatbot_text_color = sanitize_hex_color( get_option('wp_chatbot_text_color') );
752 $user_msg_bg_color = sanitize_hex_color( get_option('wp_chatbot_user_msg_bg_color') );
753 $header_background_color = sanitize_hex_color( get_option('wp_chatbot_header_background_color') );
754
755 $inline_chat_custom_styles .= "
756 #wp-chatbot-chat-container, .wp-chatbot-product-description, .wp-chatbot-product-description p,.wp-chatbot-product-quantity label, .wp-chatbot-product-variable label {
757 color: ". $text_color ." !important;
758 }
759 #wp-chatbot-chat-container a {
760 color: ". $link_color ." !important;
761 }
762
763 #wp-chatbot-chat-container a p{
764 color: ". $link_color ." !important;
765 }
766 #wp-chatbot-chat-container a p span{
767 color: ". $link_color ." !important;
768 }
769 #wp-chatbot-chat-container a:hover {
770 color: ". $link_hover_color ." !important;
771 }
772
773 ul.wp-chatbot-messages-container > li.wp-chatbot-msg .wp-chatbot-paragraph,
774 .wp-chatbot-agent-profile .wp-chatbot-bubble {
775 color: ". $bot_msg_text_color ." !important;
776 background-color: ". $bot_msg_bg_color ." !important;
777 word-break: break-word;
778 }
779 span.qcld-chatbot-product-category, span.qcld-chatbot-support-items, span.qcld-chatbot-wildcard, span.qcld-chatbot-suggest-email, span.qcld-chatbot-reset-btn, #woo-chatbot-loadmore, .wp-chatbot-shortcode-template-container span.qcld-chatbot-product-category, .wp-chatbot-shortcode-template-container span.qcld-chatbot-support-items, .wp-chatbot-shortcode-template-container span.qcld-chatbot-wildcard, .wp-chatbot-shortcode-template-container span.wp-chatbot-card-button, .wp-chatbot-shortcode-template-container span.qcld-chatbot-suggest-email, span.qcld-chatbot-suggest-phone, .wp-chatbot-shortcode-template-container span.qcld-chatbot-reset-btn, .wp-chatbot-shortcode-template-container #wp-chatbot-loadmore, .wp-chatbot-ball-cart-items, .wpbd_subscription, .qcld-chatbot-site-search, .qcld_subscribe_confirm, .qcld-chat-common, .qcld-chatbot-custom-intent {
780 color: ". $buttons_text_color ." !important;
781 background-color: ". $buttons_bg_color ." !important;
782 background-image: none !important;
783 }
784
785 span.qcld-chatbot-product-category:hover, span.qcld-chatbot-support-items:hover, span.qcld-chatbot-wildcard:hover, span.qcld-chatbot-suggest-email:hover, span.qcld-chatbot-reset-btn:hover, #woo-chatbot-loadmore:hover, .wp-chatbot-shortcode-template-container:hover span.qcld-chatbot-product-category:hover, .wp-chatbot-shortcode-template-container:hover span.qcld-chatbot-support-items:hover, .wp-chatbot-shortcode-template-container:hover span.qcld-chatbot-wildcard:hover, .wp-chatbot-shortcode-template-container:hover span.wp-chatbot-card-button:hover, .wp-chatbot-shortcode-template-container:hover span.qcld-chatbot-suggest-email:hover, span.qcld-chatbot-suggest-phone:hover, .wp-chatbot-shortcode-template-container:hover span.qcld-chatbot-reset-btn:hover, .wp-chatbot-shortcode-template-container:hover #wp-chatbot-loadmore:hover, .wp-chatbot-ball-cart-items:hover, .wpbd_subscription:hover, .qcld-chatbot-site-search:hover, .qcld_subscribe_confirm:hover, .qcld-chat-common:hover, .qcld-chatbot-custom-intent:hover {
786 color: ". $buttons_text_color_hover ." !important;
787 background-color: ". $buttons_bg_color_hover ." !important;
788 background-image: none !important;
789 }
790
791 li.wp-chat-user-msg .wp-chatbot-paragraph {
792 color: ". $user_msg_text_color ." !important;
793 background: ". $user_msg_bg_color ." !important;
794 }
795
796 ul.wp-chatbot-messages-container li:first-child.wp-chatbot-msg .wp-chatbot-paragraph {
797 color: ". $wp_chatbot_text_color ." !important;
798 }
799
800 ul.wp-chatbot-messages-container > li.wp-chatbot-msg > .wp-chatbot-paragraph:before,
801 .wp-chatbot-bubble:before {
802 border-right: 10px solid ". $bot_msg_bg_color ." !important;
803
804 }
805 ul.wp-chatbot-messages-container > li.wp-chat-user-msg > .wp-chatbot-paragraph:before {
806 border-left: 10px solid ". $user_msg_bg_color ." !important;
807 }
808 #wp-chatbot-chat-container .wp-chatbot-header{
809 background: ". $header_background_color ." !important;
810 }
811 .wp-chatbot-container ul.wp-chatbot-messages-container > li.wp-chatbot-msg .chat-container, .wp-chatbot-container .wp-chatbot-agent-profile .wp-chatbot-bubble {
812 color: ". $bot_msg_text_color ." !important;
813 background: ". $bot_msg_bg_color ." !important;
814 }
815 ";
816 // Apply the accumulated general chat custom styles.
817 // This ensures these styles are added if the custom color option is enabled.
818 wp_add_inline_style( 'qcld-wp-chatbot-common-style', $inline_chat_custom_styles );
819 }
820 $custom_colors ="";
821 if((get_option('enable_wp_chatbot_custom_color')==1) && $user_font != ''){
822 $custom_colors .="
823
824
825 #wp-chatbot-messages-container > li.wp-chatbot-msg > .wp-chatbot-paragraph,
826 #wp-chatbot-messages-container > li.wp-chatbot-msg > span{
827 font-family: ".$bot_font_family->fontFamily.";
828 font-weight: ".$bot_font_family->fontWeight.";
829 font-style: ".$bot_font_family->fontStyle.";
830 font-size: ". get_option('wp_chatbot_font_size'). "px;
831 }
832
833 ul.wp-chatbot-messages-container > li.wp-chatbot-msg .wp-chatbot-paragraph, .wp-chatbot-agent-profile .wp-chatbot-bubble {
834 font-family: ".$bot_font_family->fontFamily.";
835 font-weight: ".$bot_font_family->fontWeight.";
836 font-style: ".$bot_font_family->fontStyle.";
837 font-size: ". get_option('wp_chatbot_font_size'). "px;
838 }
839
840 ul#wp-chatbot-messages-container .wp-chatbot-textanimation span {
841 font-family: ".$bot_font_family->fontFamily.";
842 font-weight: ".$bot_font_family->fontWeight.";
843 font-style: ".$bot_font_family->fontStyle.";
844 font-size: ". get_option('wp_chatbot_font_size'). "px;
845 }
846
847 ";
848 }
849 if ( get_option('enable_wp_chatbot_custom_color') == 1 && ! empty($bot_font) ) {
850
851 // Sanitize each CSS-related value
852 $font_family = isset( $user_font_family->fontfamily ) ? esc_attr( $user_font_family->fontfamily ) : 'inherit';
853 $font_weight = isset( $user_font_family->fontWeight ) ? esc_attr( $user_font_family->fontWeight ) : 'normal';
854 $font_style = isset( $user_font_family->fontStyle ) ? esc_attr( $user_font_family->fontStyle ) : 'normal';
855 $font_size = get_option( 'wp_chatbot_font_size' );
856 $font_size = esc_attr( trim( $font_size ) );
857
858 // Optional: ensure font size includes units.
859 if ( ! preg_match( '/(px|em|rem|%)$/', $font_size ) ) {
860 $font_size .= 'px'; // fallback to px if unit missing.
861 }
862
863 $custom_colors .= "
864 #wp-chatbot-messages-container > li.wp-chat-user-msg > .wp-chatbot-paragraph {
865 font-family: {$font_family};
866 font-weight: {$font_weight};
867 font-style: {$font_style};
868 font-size: {$font_size};
869 }
870 ";
871
872 wp_add_inline_style( 'qcld-wp-chatbot-common-style', $custom_colors );
873 }
874
875 if(get_option('wp_chatbot_custom_css')!=""){
876
877 wp_add_inline_style( 'qcld-wp-chatbot-common-style', get_option('wp_chatbot_custom_css') );
878 }
879 }
880 public function qcld_wb_chatbot_str_replace($messages=array()){
881 $allowed_html = array(
882 'a' => array(
883 'href' => array(),
884 'title' => array()
885 ),
886 'div' => array(
887 'class' => array()
888 ),
889 'span' => array(
890 'class' => array()
891 ),
892 'img' => array(
893 'src' => array()
894 ),
895 'h3' => array(),
896 'h4' => array(),
897 'h5' => array(),
898 'h6' => array(),
899 'b' => array(),
900 'br' => array(),
901 'em' => array(),
902 'ul' => array(),
903 'li' => array(),
904 'strong' => array(),
905 );
906 $refined_mesgses=array();
907 if(!empty($messages) && is_array($messages)){
908 foreach ($messages as $message){
909 $from = array('&lt;', '&gt;');
910 $to = array('<', '>');
911 if(!is_array($message)){
912 $message = str_replace($from, $to, $message);
913 $msg = wp_kses( ($message), $allowed_html);
914 $refined_msg=str_replace('\\', '', $msg);
915 array_push($refined_mesgses,$refined_msg);
916 }
917 }
918 }else{
919 $from = array('&lt;', '&gt;');
920 $to = array('<', '>');
921
922 $message = str_replace($from, $to, $messages);
923 if(!empty($messages )){
924 $msg = wp_kses( $messages, $allowed_html);
925 }else{
926 $msg = '';
927 }
928 $refined_msg=str_replace('\\', '', $msg);
929 array_push($refined_mesgses,$refined_msg);
930
931 }
932 return $refined_mesgses;
933
934 }
935 //getting exact agent icon path
936 public function qcld_wb_chatbot_agent_icon(){
937
938 if(get_option('wp_chatbot_custom_agent_path')!="" && get_option('wp_chatbot_agent_image')=="custom-agent.png" ){
939 $wp_chatbot_custom_icon_path=get_option('wp_chatbot_custom_agent_path');
940 }
941 else if(get_option('wp_chatbot_custom_agent_path')!="" && get_option('wp_chatbot_agent_image')!="custom-agent.png"){
942 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.get_option('wp_chatbot_agent_image');
943 }
944 else
945 {
946 if(get_option('wp_chatbot_agent_image')!=''){
947 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.get_option('wp_chatbot_agent_image');
948 }else{
949 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.'custom-agent.png';
950 }
951
952 }
953
954 return $wp_chatbot_custom_icon_path;
955 }
956 /**
957 * Render the admin page
958 */
959
960 public function qcld_wb_chatbot_admin_page()
961 {
962 global $wpcommerce;
963 $action = 'admin.php?page=wpbot-panel';
964 require_once("admin_ui2.php");
965 }
966
967 public function qcld_wb_chatbot_admin_page_settings()
968 {
969 global $wpcommerce;
970 $action = 'admin.php?page=wpbot';
971
972 require_once("admin_ui.php");
973 }
974
975 public function qcld_wb_chatbot_dynamic_multi_option($options, $option_name, $option_text)
976 {
977 ?>
978
979 <h4 class="qc-opt-title">
980 <?php echo esc_html($option_text); ?>
981 </h4>
982 <div class="wp-chatbot-lng-items">
983 <?php
984 if (is_array($options) && count($options) > 0) {
985 foreach ($options as $key => $value) {
986 ?>
987 <div class="row" class="wp-chatbot-lng-item">
988 <div class="col-xs-10">
989 <input type="text"
990 class="form-control qc-opt-dcs-font"
991 name="<?php echo esc_attr( $option_name ); ?>[]"
992 value="<?php echo esc_attr(str_replace('\\', '', $value)); ?>">
993 </div>
994 <div class="col-xs-2">
995 <button type="button" class="btn btn-danger btn-sm wp-chatbot-lng-item-remove"> <span class="glyphicon glyphicon-remove"></span> </button>
996 </div>
997 </div>
998 <?php
999 }
1000 } else { ?>
1001 <div class="row" class="wp-chatbot-lng-item">
1002 <div class="col-xs-10">
1003 <input type="text"
1004 class="form-control qc-opt-dcs-font"
1005 name="<?php echo esc_attr( $option_name ); ?>[]"
1006 value="<?php echo esc_attr($option_text); ?>">
1007 </div>
1008 <div class="col-xs-2"> <span class="wp-chatbot-lng-item-remove">
1009 <?php esc_html_e('X', 'chatbot'); ?>
1010 </span> </div>
1011 </div>
1012 <?php } ?>
1013 </div>
1014 <div class="row">
1015 <div class="col-sm-2 col-sm-offset-10">
1016 <button type="button" class="btn btn-success btn-sm wp-chatbot-lng-item-add"> <span class="glyphicon glyphicon-plus"></span> </button>
1017 </div>
1018 </div>
1019 <?php
1020 }
1021
1022 function qcld_wb_chatbot_save_options()
1023 {
1024 //global $wpcommerce;
1025 if (isset($_POST['_wpnonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'wp_chatbot')) {
1026 // Check if the form is submitted or not.
1027 $submit = sanitize_text_field($_POST['submit']);
1028 if (isset($submit)) {
1029 //wpwboticon position settings.
1030 if (isset($_POST["wp_chatbot_position_x"])) {
1031 $wp_chatbot_position_x = intval(sanitize_text_field($_POST["wp_chatbot_position_x"]));
1032 update_option('wp_chatbot_position_x', $wp_chatbot_position_x);
1033 }
1034 if (isset($_POST["wp_chatbot_position_y"])) {
1035 $wp_chatbot_position_y = intval(sanitize_text_field($_POST["wp_chatbot_position_y"]));
1036 update_option('wp_chatbot_position_y', $wp_chatbot_position_y);
1037 }
1038 //product search options
1039 if(isset($_POST['qlcd_wp_chatbot_search_option'])){
1040 $qlcd_wp_chatbot_search_option = sanitize_text_field($_POST['qlcd_wp_chatbot_search_option']);
1041 update_option('qlcd_wp_chatbot_search_option', $qlcd_wp_chatbot_search_option);
1042 }
1043
1044
1045 if(isset( $_POST["skip_wp_greetings_donot_show_menu"])){
1046 $skip_wp_greetings_donot_show_menu = sanitize_text_field($_POST["skip_wp_greetings_donot_show_menu"]);
1047 }else{ $skip_wp_greetings_donot_show_menu='';}
1048 update_option('skip_wp_greetings_donot_show_menu', wp_unslash($skip_wp_greetings_donot_show_menu));
1049
1050 if(isset( $_POST["skip_wp_greetings"])){
1051 $skip_wp_greetings = sanitize_text_field($_POST["skip_wp_greetings"]);
1052 }else{ $skip_wp_greetings='';}
1053 update_option('skip_wp_greetings', wp_unslash($skip_wp_greetings));
1054 //Enable /disable wpwbot
1055 if(isset( $_POST["disable_wp_chatbot"])){
1056 $disable_wp_chatbot = sanitize_text_field($_POST["disable_wp_chatbot"]);
1057 }else{ $disable_wp_chatbot='';}
1058 update_option('disable_wp_chatbot', wp_unslash($disable_wp_chatbot));
1059
1060 if(isset( $_POST["qlcd_wp_chatbot_admin_email"])){
1061 $qlcd_wp_chatbot_admin_email = sanitize_email($_POST["qlcd_wp_chatbot_admin_email"]);
1062 }else{ $qlcd_wp_chatbot_admin_email='';}
1063 update_option('qlcd_wp_chatbot_admin_email', wp_unslash($qlcd_wp_chatbot_admin_email));
1064
1065
1066 if(isset( $_POST["open_links_new_window"])){
1067 $open_links_new_window = sanitize_text_field($_POST["open_links_new_window"]);
1068 }else{ $open_links_new_window='';}
1069 update_option('open_links_new_window', wp_unslash($open_links_new_window));
1070
1071
1072 if(isset( $_POST["qlcd_wp_chatbot_from_email"])){
1073 $qlcd_wp_chatbot_from_email = sanitize_email($_POST["qlcd_wp_chatbot_from_email"]);
1074 }else{ $qlcd_wp_chatbot_from_email='';}
1075 update_option('qlcd_wp_chatbot_from_email', wp_unslash($qlcd_wp_chatbot_from_email));
1076
1077 if(isset( $_POST["disable_wp_chatbot_on_mobile"])) {
1078 $disable_wp_chatbot_on_mobile = sanitize_text_field($_POST["disable_wp_chatbot_on_mobile"]);
1079 }else{ $disable_wp_chatbot_on_mobile='';}
1080 update_option('disable_wp_chatbot_on_mobile', wp_unslash($disable_wp_chatbot_on_mobile));
1081 if(isset( $_POST["disable_wp_chatbot_product_search"])) {
1082 $disable_wp_chatbot_product_search = sanitize_text_field($_POST["disable_wp_chatbot_product_search"]);
1083 }else{ $disable_wp_chatbot_product_search='';}
1084 update_option('disable_wp_chatbot_product_search', wp_unslash($disable_wp_chatbot_product_search));
1085 if(isset( $_POST["disable_wp_chatbot_catalog"])) {
1086 $disable_wp_chatbot_catalog= sanitize_text_field($_POST["disable_wp_chatbot_catalog"]);
1087 }else{ $disable_wp_chatbot_catalog='';}
1088 update_option('disable_wp_chatbot_catalog', wp_unslash($disable_wp_chatbot_catalog));
1089 if(isset( $_POST["disable_wp_chatbot_order_status"])) {
1090 $disable_wp_chatbot_order_status = sanitize_text_field($_POST["disable_wp_chatbot_order_status"]);
1091 }else{ $disable_wp_chatbot_order_status='';}
1092 update_option('disable_wp_chatbot_order_status', wp_unslash($disable_wp_chatbot_order_status));
1093 if(isset( $_POST["disable_wp_chatbot_notification"])) {
1094 $disable_wp_chatbot_notification = sanitize_text_field($_POST["disable_wp_chatbot_notification"]);
1095 }else{ $disable_wp_chatbot_notification='1';}
1096 update_option('disable_wp_chatbot_notification', wp_unslash($disable_wp_chatbot_notification));
1097
1098 if(isset( $_POST["enable_wp_chatbot_rtl"])) {
1099 $enable_wp_chatbot_rtl = sanitize_text_field($_POST["enable_wp_chatbot_rtl"]);
1100 }else{ $enable_wp_chatbot_rtl='';}
1101 update_option('enable_wp_chatbot_rtl', wp_unslash($enable_wp_chatbot_rtl));
1102
1103 if(isset( $_POST["show_menu_after_greetings"])) {
1104 $show_menu_after_greetings = sanitize_text_field($_POST["show_menu_after_greetings"]);
1105 }else{ $show_menu_after_greetings='';}
1106 update_option('show_menu_after_greetings', wp_unslash($show_menu_after_greetings));
1107 if(isset( $_POST["enable_chat_session"])) {
1108 $enable_chat_session = sanitize_text_field($_POST["enable_chat_session"]);
1109 }else{ $enable_chat_session='';}
1110 update_option('enable_chat_session', wp_unslash($enable_chat_session));
1111
1112
1113 if(isset( $_POST["enable_wp_chatbot_mobile_full_screen"])) {
1114 $enable_wp_chatbot_mobile_full_screen = sanitize_text_field($_POST["enable_wp_chatbot_mobile_full_screen"]);
1115 }else{ $enable_wp_chatbot_mobile_full_screen='';}
1116 update_option('enable_wp_chatbot_mobile_full_screen', wp_unslash($enable_wp_chatbot_mobile_full_screen));
1117
1118 if(isset( $_POST["wpbot_preloading_time"])) {
1119 $wpbot_preloading_time = sanitize_text_field($_POST["wpbot_preloading_time"]);
1120 }else{ $wpbot_preloading_time='100';}
1121 update_option('wpbot_preloading_time', wp_unslash($wpbot_preloading_time));
1122
1123 if(isset( $_POST["disable_wp_chatbot_icon_animation"])) {
1124 $disable_wp_chatbot_icon_animation = sanitize_text_field($_POST["disable_wp_chatbot_icon_animation"]);
1125 }else{ $disable_wp_chatbot_icon_animation='';}
1126 update_option('disable_wp_chatbot_icon_animation', wp_unslash($disable_wp_chatbot_icon_animation));
1127 //Enable /disable Cart Item Number
1128 if(isset( $_POST["disable_wp_chatbot_cart_item_number"])) {
1129 $disable_wp_chatbot_cart_item_number = sanitize_text_field($_POST["disable_wp_chatbot_cart_item_number"]);
1130 }else{ $disable_wp_chatbot_cart_item_number='';}
1131 update_option('disable_wp_chatbot_cart_item_number', wp_unslash($disable_wp_chatbot_cart_item_number));
1132 //Enable /disable featured products button.
1133 if(isset( $_POST["disable_wp_chatbot_featured_product"])) {
1134 $disable_wp_chatbot_featured_product = sanitize_text_field($_POST["disable_wp_chatbot_featured_product"]);
1135 }else{ $disable_wp_chatbot_featured_product='';}
1136 update_option('disable_wp_chatbot_featured_product', wp_unslash($disable_wp_chatbot_featured_product));
1137 //Enable /disable sale products button
1138 if(isset( $_POST["disable_wp_chatbot_sale_product"])) {
1139 $disable_wp_chatbot_sale_product = sanitize_text_field($_POST["disable_wp_chatbot_sale_product"]);
1140 }else{ $disable_wp_chatbot_sale_product='';}
1141 update_option('disable_wp_chatbot_sale_product', wp_unslash($disable_wp_chatbot_sale_product));
1142 //Enable Product details page.
1143 if(isset( $_POST["wp_chatbot_open_product_detail"])) {
1144 $wp_chatbot_open_product_detail = sanitize_text_field($_POST["wp_chatbot_open_product_detail"]);
1145 }else{ $wp_chatbot_open_product_detail='';}
1146 update_option('wp_chatbot_open_product_detail', wp_unslash($wp_chatbot_open_product_detail));
1147 //product order and order by
1148 if(isset($_POST['qlcd_wp_chatbot_product_orderby'])){
1149 $qlcd_wp_chatbot_product_orderby = sanitize_text_field($_POST['qlcd_wp_chatbot_product_orderby']);
1150 update_option('qlcd_wp_chatbot_product_orderby', sanitize_text_field($qlcd_wp_chatbot_product_orderby));
1151 }
1152 if(isset($_POST['qlcd_wp_chatbot_product_order'])){
1153 $qlcd_wp_chatbot_product_order = sanitize_text_field($_POST['qlcd_wp_chatbot_product_order']);
1154 update_option('qlcd_wp_chatbot_product_order', sanitize_text_field($qlcd_wp_chatbot_product_order));
1155 }
1156
1157
1158 //Product per page settings.
1159 if (isset($_POST["qlcd_wp_chatbot_ppp"])) {
1160 $qlcd_wp_chatbot_ppp = sanitize_text_field($_POST["qlcd_wp_chatbot_ppp"]);
1161 update_option('qlcd_wp_chatbot_ppp', intval($qlcd_wp_chatbot_ppp));
1162 }
1163 if(isset( $_POST["wp_chatbot_exclude_stock_out_product"])) {
1164 $wp_chatbot_exclude_stock_out_product = sanitize_text_field($_POST['wp_chatbot_exclude_stock_out_product']);
1165 }else{ $wp_chatbot_exclude_stock_out_product='';}
1166 update_option('wp_chatbot_exclude_stock_out_product', wp_unslash($wp_chatbot_exclude_stock_out_product));
1167 if(isset( $_POST["wp_chatbot_show_parent_category"])) {
1168 $wp_chatbot_show_parent_category = sanitize_text_field($_POST['wp_chatbot_show_parent_category']);
1169 }else{ $wp_chatbot_show_parent_category='';}
1170 update_option('wp_chatbot_show_parent_category', wp_unslash($wp_chatbot_show_parent_category));
1171 if(isset( $_POST["wp_chatbot_show_sub_category"])) {
1172 $wp_chatbot_show_sub_category = sanitize_text_field($_POST['wp_chatbot_show_sub_category']);
1173 }else{ $wp_chatbot_show_sub_category='';}
1174 update_option('wp_chatbot_show_sub_category', wp_unslash($wp_chatbot_show_sub_category));
1175 if (isset($_POST["qlcd_wp_chatbot_order_user"])) {
1176 $qlcd_wp_chatbot_order_user = sanitize_text_field($_POST["qlcd_wp_chatbot_order_user"]);
1177 update_option('qlcd_wp_chatbot_order_user', sanitize_text_field($qlcd_wp_chatbot_order_user));
1178 }
1179
1180 if(isset( $_POST["qc_wpbot_menu_order"]) && !empty($_POST["qc_wpbot_menu_order"])) {
1181 $qc_wpbot_menu_order = wp_kses_post($_POST["qc_wpbot_menu_order"]);
1182 }else{ $qc_wpbot_menu_order='';}
1183 update_option('qc_wpbot_menu_order', ($qc_wpbot_menu_order));
1184
1185 //wpwBot Load control
1186 if(isset($_POST["wp_chatbot_show_home_page"])){
1187 $wp_chatbot_show_home_page = sanitize_key(($_POST["wp_chatbot_show_home_page"]));
1188 update_option('wp_chatbot_show_home_page', $wp_chatbot_show_home_page);
1189 }
1190
1191
1192 if(isset($_POST["wp_chatbot_show_posts"])){
1193 $wp_chatbot_show_posts = sanitize_key(($_POST["wp_chatbot_show_posts"]));
1194 update_option('wp_chatbot_show_posts', $wp_chatbot_show_posts);
1195 }
1196
1197
1198 if(isset($_POST["wp_chatbot_show_pages"])){
1199 $wp_chatbot_show_pages = sanitize_key(($_POST["wp_chatbot_show_pages"]));
1200 update_option('wp_chatbot_show_pages', $wp_chatbot_show_pages);
1201 }
1202
1203 if(isset( $_POST["wp_chatbot_show_pages_list"])) {
1204 $wp_chatbot_show_pages_list = wp_parse_id_list($_POST["wp_chatbot_show_pages_list"]);
1205 update_option('wp_chatbot_show_pages_list', maybe_serialize(sanitize_array($wp_chatbot_show_pages_list)));
1206 }else{
1207 $wp_chatbot_show_pages_list='';
1208 update_option('wp_chatbot_show_pages_list', maybe_serialize(sanitize_array($wp_chatbot_show_pages_list)));
1209 }
1210 if(isset( $_POST["wp_chatbot_exclude_post_list"])) {
1211 $wp_chatbot_exclude_post_list = $_POST["wp_chatbot_exclude_post_list"];
1212 update_option('wp_chatbot_exclude_post_list', maybe_serialize(sanitize_array($wp_chatbot_exclude_post_list)));
1213 }else{
1214 $wp_chatbot_exclude_post_list='';
1215 update_option('wp_chatbot_exclude_post_list', maybe_serialize(sanitize_array($wp_chatbot_exclude_post_list)));
1216 }
1217
1218 if(isset($_POST["wp_chatbot_show_wpcommerce"])){
1219 $wp_chatbot_show_wpcommerce = sanitize_key(($_POST["wp_chatbot_show_wpcommerce"]));
1220 update_option('wp_chatbot_show_wpcommerce', $wp_chatbot_show_wpcommerce);
1221 }
1222
1223
1224 //Stop Words Settings
1225 if (isset($_POST["qlcd_wp_chatbot_stop_words_name"])) {
1226 $qlcd_wp_chatbot_stop_words_name = sanitize_text_field($_POST["qlcd_wp_chatbot_stop_words_name"]);
1227 update_option('qlcd_wp_chatbot_stop_words_name', $qlcd_wp_chatbot_stop_words_name);
1228 }
1229 if (isset($_POST["qlcd_wp_chatbot_stop_words"])) {
1230 $qlcd_wp_chatbot_stop_words = sanitize_text_field($_POST["qlcd_wp_chatbot_stop_words"]);
1231 update_option('qlcd_wp_chatbot_stop_words', $qlcd_wp_chatbot_stop_words);
1232 }
1233 //wpwbot icon settings.
1234 $wp_chatbot_icon = isset( $_POST['wp_chatbot_icon'] ) ? sanitize_text_field($_POST['wp_chatbot_icon']) : 'icon-3.png';
1235 update_option('wp_chatbot_icon', $wp_chatbot_icon);
1236
1237 $wp_chatbot_floatingiconbg_color = isset( $_POST['wp_chatbot_floatingiconbg_color'] ) ? sanitize_text_field($_POST['wp_chatbot_floatingiconbg_color']) : '#fff';
1238 update_option('wp_chatbot_floatingiconbg_color', $wp_chatbot_floatingiconbg_color);
1239
1240 // upload custom wpwbot icon path
1241 $wp_chatbot_custom_icon_path = sanitize_text_field($_POST['wp_chatbot_custom_icon_path']);
1242 update_option('wp_chatbot_custom_icon_path', $wp_chatbot_custom_icon_path);
1243 //Agent image
1244 //wpwbot icon settings.
1245 $wp_chatbot_icon = (isset($_POST['wp_chatbot_agent_image']) ? sanitize_text_field($_POST['wp_chatbot_agent_image']) : 'agent-13.png');
1246 update_option('wp_chatbot_agent_image', $wp_chatbot_icon);
1247 // upload custom wpwbot icon
1248 if(isset($_POST['wp_chatbot_custom_agent_path'])){
1249 $wp_chatbot_custom_agent_path = sanitize_text_field($_POST['wp_chatbot_custom_agent_path']);
1250 update_option('wp_chatbot_custom_agent_path', $wp_chatbot_custom_agent_path);
1251 }
1252
1253 //Theming
1254 $qcld_wb_chatbot_theme = (isset($_POST['qcld_wb_chatbot_theme']) ? sanitize_text_field($_POST['qcld_wb_chatbot_theme']) : 'template-00');
1255 update_option('qcld_wb_chatbot_theme', $qcld_wb_chatbot_theme);
1256 //Theme custom background option
1257 if(isset( $_POST["qcld_wb_chatbot_change_bg"])) {
1258 $qcld_wb_chatbot_change_bg = sanitize_text_field($_POST["qcld_wb_chatbot_change_bg"]);
1259 }else{$qcld_wb_chatbot_change_bg='';}
1260 update_option('qcld_wb_chatbot_change_bg', $qcld_wb_chatbot_change_bg);
1261 if(isset($_POST["qcld_wb_chatbot_board_bg_path"])){
1262 $qcld_wb_chatbot_board_bg_path = sanitize_text_field($_POST["qcld_wb_chatbot_board_bg_path"]);
1263 update_option('qcld_wb_chatbot_board_bg_path', wp_unslash($qcld_wb_chatbot_board_bg_path));
1264 }
1265
1266
1267
1268 //To override style use custom css.
1269 if(isset($_POST["wp_chatbot_custom_css"])){
1270 $wp_chatbot_custom_css = wp_unslash($_POST["wp_chatbot_custom_css"]);
1271 update_option('wp_chatbot_custom_css', sanitize_text_field($wp_chatbot_custom_css));
1272 }
1273
1274 if (isset($_POST["qlcd_wp_chatbot_dialogflow_project_id"])) {
1275 $qlcd_wp_chatbot_dialogflow_project_id = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_dialogflow_project_id"]));
1276 } else {
1277 $qlcd_wp_chatbot_dialogflow_project_id = '';
1278 }
1279 update_option('qlcd_wp_chatbot_dialogflow_project_id', $qlcd_wp_chatbot_dialogflow_project_id);
1280
1281 if (isset($_POST["wp_chatbot_df_api"])) {
1282 $wp_chatbot_df_api = sanitize_text_field(wp_unslash($_POST["wp_chatbot_df_api"]));
1283 } else {
1284 $wp_chatbot_df_api = '';
1285 }
1286 update_option('wp_chatbot_df_api', $wp_chatbot_df_api);
1287
1288 if (isset($_POST["qlcd_wp_chatbot_dialogflow_project_key"])) {
1289 $qlcd_wp_chatbot_dialogflow_project_key = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_dialogflow_project_key"]));
1290 } else {
1291 $qlcd_wp_chatbot_dialogflow_project_key = '';
1292 }
1293 update_option('qlcd_wp_chatbot_dialogflow_project_key', $qlcd_wp_chatbot_dialogflow_project_key);
1294
1295 /****Language center settings. ****/
1296 //identity
1297 if (isset($_POST["qlcd_wp_chatbot_host"])) {
1298 $qlcd_wp_chatbot_host = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_host"]));
1299 } else {
1300 $qlcd_wp_chatbot_host = '';
1301 }
1302 update_option('qlcd_wp_chatbot_host', $qlcd_wp_chatbot_host);
1303
1304 if (isset($_POST["qlcd_wp_chatbot_agent"])) {
1305 $qlcd_wp_chatbot_agent = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_agent"]));
1306 } else {
1307 $qlcd_wp_chatbot_agent = '';
1308 }
1309 update_option('qlcd_wp_chatbot_agent', $qlcd_wp_chatbot_agent);
1310
1311 if (isset($_POST["qlcd_wp_chatbot_shopper_demo_name"])) {
1312 $qlcd_wp_chatbot_shopper_demo_name = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_shopper_demo_name"]));
1313 } else {
1314 $qlcd_wp_chatbot_shopper_demo_name = '';
1315 }
1316 update_option('qlcd_wp_chatbot_shopper_demo_name', $qlcd_wp_chatbot_shopper_demo_name);
1317
1318 if (isset($_POST["qlcd_wp_chatbot_yes"])) {
1319 $qlcd_wp_chatbot_yes = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_yes"]));
1320 } else {
1321 $qlcd_wp_chatbot_yes = '';
1322 }
1323 update_option('qlcd_wp_chatbot_yes', $qlcd_wp_chatbot_yes);
1324
1325 if (isset($_POST["qlcd_wp_chatbot_no"])) {
1326 $qlcd_wp_chatbot_no = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_no"]));
1327 } else {
1328 $qlcd_wp_chatbot_no = '';
1329 }
1330 update_option('qlcd_wp_chatbot_no', $qlcd_wp_chatbot_no);
1331
1332 if (isset($_POST["qlcd_wp_chatbot_or"])) {
1333 $qlcd_wp_chatbot_or = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_or"]));
1334 } else {
1335 $qlcd_wp_chatbot_or = '';
1336 }
1337 update_option('qlcd_wp_chatbot_or', $qlcd_wp_chatbot_or);
1338
1339 if (isset($_POST["qlcd_wp_chatbot_sorry"])) {
1340 $qlcd_wp_chatbot_sorry = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_sorry"]));
1341 } else {
1342 $qlcd_wp_chatbot_sorry = '';
1343 }
1344 update_option('qlcd_wp_chatbot_sorry', $qlcd_wp_chatbot_sorry);
1345
1346 if (isset($_POST["skip_chat_reactions_menu"])) {
1347 $skip_chat_reactions_menu = sanitize_text_field(wp_unslash($_POST["skip_chat_reactions_menu"]));
1348 } else {
1349 $skip_chat_reactions_menu = '';
1350 }
1351 update_option('skip_chat_reactions_menu', $skip_chat_reactions_menu);
1352
1353 if (isset($_POST["qlcd_wp_chatbot_report_text"])) {
1354 $qlcd_wp_chatbot_report_text = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_report_text"]));
1355 } else {
1356 $qlcd_wp_chatbot_report_text = '';
1357 }
1358 update_option('qlcd_wp_chatbot_report_text', $qlcd_wp_chatbot_report_text);
1359
1360 if (isset($_POST["qlcd_wp_chatbot_report_text"])) {
1361 $qlcd_wp_chatbot_report_text = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_report_text"]));
1362 } else {
1363 $qlcd_wp_chatbot_report_text = '';
1364 }
1365 update_option('qlcd_wp_chatbot_report_text', $qlcd_wp_chatbot_report_text);
1366
1367 if (isset($_POST["enable_chat_report_menu"])) {
1368 $enable_chat_report_menu = sanitize_text_field(wp_unslash($_POST["enable_chat_report_menu"]));
1369 } else {
1370 $enable_chat_report_menu = '';
1371 }
1372 update_option('enable_chat_report_menu', $enable_chat_report_menu);
1373
1374 if (isset($_POST["qlcd_wp_chatbot_like_text"])) {
1375 $qlcd_wp_chatbot_like_text = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_like_text"]));
1376 } else {
1377 $qlcd_wp_chatbot_like_text = '';
1378 }
1379 update_option('qlcd_wp_chatbot_like_text', $qlcd_wp_chatbot_like_text);
1380
1381 if (isset($_POST["qlcd_wp_chatbot_dislike_text"])) {
1382 $qlcd_wp_chatbot_dislike_text = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_dislike_text"]));
1383 } else {
1384 $qlcd_wp_chatbot_dislike_text = '';
1385 }
1386 update_option('qlcd_wp_chatbot_dislike_text', $qlcd_wp_chatbot_dislike_text);
1387
1388 if (isset($_POST["enable_chat_share_menu"])) {
1389 $enable_chat_share_menu = sanitize_text_field(wp_unslash($_POST["enable_chat_share_menu"]));
1390 } else {
1391 $enable_chat_share_menu = '';
1392 }
1393 update_option('enable_chat_share_menu', $enable_chat_share_menu);
1394
1395 if (isset($_POST["qlcd_wp_chatbot_share_text"])) {
1396 $qlcd_wp_chatbot_share_text = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_share_text"]));
1397 } else {
1398 $qlcd_wp_chatbot_share_text = '';
1399 }
1400 update_option('qlcd_wp_chatbot_share_text', $qlcd_wp_chatbot_share_text);
1401
1402 if (isset($_POST["qlcd_wp_chatbot_agent_join"])) {
1403 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1404 $qlcd_wp_chatbot_agent_join = wp_unslash($_POST["qlcd_wp_chatbot_agent_join"]);
1405 $qlcd_wp_chatbot_agent_join = sanitize_array($qlcd_wp_chatbot_agent_join);
1406 } else {
1407 $qlcd_wp_chatbot_agent_join = array();
1408 }
1409 update_option('qlcd_wp_chatbot_agent_join', maybe_serialize($qlcd_wp_chatbot_agent_join));
1410
1411 //Greeting.
1412 if (isset($_POST["qlcd_wp_chatbot_welcome"])) {
1413 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1414 $qlcd_wp_chatbot_welcome = wp_unslash($_POST["qlcd_wp_chatbot_welcome"]);
1415 $qlcd_wp_chatbot_welcome = sanitize_array($qlcd_wp_chatbot_welcome);
1416 } else {
1417 $qlcd_wp_chatbot_welcome = array();
1418 }
1419 update_option('qlcd_wp_chatbot_welcome', maybe_serialize($qlcd_wp_chatbot_welcome));
1420
1421 if (isset($_POST["qlcd_wp_chatbot_back_to_start"])) {
1422 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1423 $qlcd_wp_chatbot_back_to_start = wp_unslash($_POST["qlcd_wp_chatbot_back_to_start"]);
1424 $qlcd_wp_chatbot_back_to_start = sanitize_array($qlcd_wp_chatbot_back_to_start);
1425 } else {
1426 $qlcd_wp_chatbot_back_to_start = array();
1427 }
1428 update_option('qlcd_wp_chatbot_back_to_start', maybe_serialize($qlcd_wp_chatbot_back_to_start));
1429
1430 if (isset($_POST["qlcd_wp_chatbot_hi_there"])) {
1431 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1432 $qlcd_wp_chatbot_hi_there = wp_unslash($_POST["qlcd_wp_chatbot_hi_there"]);
1433 $qlcd_wp_chatbot_hi_there = sanitize_array($qlcd_wp_chatbot_hi_there);
1434 } else {
1435 $qlcd_wp_chatbot_hi_there = array();
1436 }
1437 update_option('qlcd_wp_chatbot_hi_there', maybe_serialize($qlcd_wp_chatbot_hi_there));
1438
1439 if (isset($_POST["qlcd_wp_chatbot_hello"])) {
1440 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1441 $qlcd_wp_chatbot_hello = wp_unslash($_POST["qlcd_wp_chatbot_hello"]);
1442 $qlcd_wp_chatbot_hello = sanitize_array($qlcd_wp_chatbot_hello);
1443 } else {
1444 $qlcd_wp_chatbot_hello = array();
1445 }
1446 update_option('qlcd_wp_chatbot_hello', maybe_serialize($qlcd_wp_chatbot_hello));
1447
1448 if (isset($_POST["qlcd_wp_chatbot_welcome_back"])) {
1449 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1450 $qlcd_wp_chatbot_welcome_back = wp_unslash( $_POST["qlcd_wp_chatbot_welcome_back"] );
1451 $qlcd_wp_chatbot_welcome_back = sanitize_array( $qlcd_wp_chatbot_welcome_back );
1452 } else {
1453 $qlcd_wp_chatbot_welcome_back = array();
1454 }
1455 update_option('qlcd_wp_chatbot_welcome_back', maybe_serialize($qlcd_wp_chatbot_welcome_back));
1456
1457 if (isset($_POST["qlcd_wp_chatbot_asking_name"])) {
1458 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1459 $qlcd_wp_chatbot_asking_name = wp_unslash( $_POST["qlcd_wp_chatbot_asking_name"] );
1460 $qlcd_wp_chatbot_asking_name = sanitize_array( $qlcd_wp_chatbot_asking_name );
1461 } else {
1462 $qlcd_wp_chatbot_asking_name = array();
1463 }
1464 update_option('qlcd_wp_chatbot_asking_name', maybe_serialize($qlcd_wp_chatbot_asking_name));
1465
1466 if (isset($_POST["qlcd_wp_chatbot_name_greeting"])) {
1467 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1468 $qlcd_wp_chatbot_name_greeting = wp_unslash( $_POST["qlcd_wp_chatbot_name_greeting"] );
1469 $qlcd_wp_chatbot_name_greeting = sanitize_array( $qlcd_wp_chatbot_name_greeting );
1470 } else {
1471 $qlcd_wp_chatbot_name_greeting = array();
1472 }
1473 update_option('qlcd_wp_chatbot_name_greeting', maybe_serialize($qlcd_wp_chatbot_name_greeting));
1474
1475 if (isset($_POST["qlcd_wp_chatbot_i_am"])) {
1476 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1477 $qlcd_wp_chatbot_i_am = wp_unslash( $_POST["qlcd_wp_chatbot_i_am"] );
1478 $qlcd_wp_chatbot_i_am = sanitize_array( $qlcd_wp_chatbot_i_am );
1479 } else {
1480 $qlcd_wp_chatbot_i_am = array();
1481 }
1482 update_option('qlcd_wp_chatbot_i_am', maybe_serialize($qlcd_wp_chatbot_i_am));
1483
1484 if (isset($_POST["qlcd_wp_chatbot_is_typing"])) {
1485 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1486 $qlcd_wp_chatbot_is_typing = wp_unslash( $_POST["qlcd_wp_chatbot_is_typing"] );
1487 $qlcd_wp_chatbot_is_typing = sanitize_array( $qlcd_wp_chatbot_is_typing );
1488 } else {
1489 $qlcd_wp_chatbot_is_typing = array();
1490 }
1491 update_option('qlcd_wp_chatbot_is_typing', maybe_serialize($qlcd_wp_chatbot_is_typing));
1492
1493 if (isset($_POST["qlcd_wp_chatbot_send_a_msg"])) {
1494 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1495 $qlcd_wp_chatbot_send_a_msg = wp_unslash( $_POST["qlcd_wp_chatbot_send_a_msg"] );
1496 $qlcd_wp_chatbot_send_a_msg = sanitize_array( $qlcd_wp_chatbot_send_a_msg );
1497 } else {
1498 $qlcd_wp_chatbot_send_a_msg = array();
1499 }
1500 update_option('qlcd_wp_chatbot_send_a_msg', maybe_serialize($qlcd_wp_chatbot_send_a_msg));
1501
1502 if (isset($_POST["qlcd_wp_chatbot_choose_option"])) {
1503 // Assuming 'sanitize_array' is a custom function that properly sanitizes each element of the array.
1504 $qlcd_wp_chatbot_choose_option = wp_unslash( $_POST["qlcd_wp_chatbot_choose_option"] );
1505 $qlcd_wp_chatbot_choose_option = sanitize_array( $qlcd_wp_chatbot_choose_option );
1506 } else {
1507 $qlcd_wp_chatbot_choose_option = array();
1508 }
1509 update_option('qlcd_wp_chatbot_choose_option', maybe_serialize($qlcd_wp_chatbot_choose_option));
1510
1511 if (isset($_POST["qlcd_wp_chatbot_viewed_products"])) {
1512
1513 $qlcd_wp_chatbot_viewed_products = wp_unslash( $_POST["qlcd_wp_chatbot_viewed_products"] );
1514 $qlcd_wp_chatbot_viewed_products = sanitize_array( $qlcd_wp_chatbot_viewed_products );
1515 } else {
1516 $qlcd_wp_chatbot_viewed_products = array();
1517 }
1518 update_option('qlcd_wp_chatbot_viewed_products', maybe_serialize($qlcd_wp_chatbot_viewed_products));
1519
1520 if(isset($_POST["qlcd_wp_chatbot_shopping_cart"])){
1521 $qlcd_wp_chatbot_shopping_cart= esc_html((@$_POST["qlcd_wp_chatbot_shopping_cart"]));
1522 update_option('qlcd_wp_chatbot_shopping_cart', maybe_serialize(sanitize_array($qlcd_wp_chatbot_shopping_cart)));
1523 }
1524
1525 if(isset($_POST["qlcd_wp_chatbot_add_to_cart"])){
1526 $qlcd_wp_chatbot_add_to_cart= (@$_POST["qlcd_wp_chatbot_add_to_cart"]);
1527 update_option('qlcd_wp_chatbot_add_to_cart', maybe_serialize(sanitize_array($qlcd_wp_chatbot_add_to_cart)));
1528 }
1529 if(isset($_POST["qlcd_wp_chatbot_cart_link"])){
1530 $qlcd_wp_chatbot_cart_link= @$_POST["qlcd_wp_chatbot_cart_link"];
1531 update_option('qlcd_wp_chatbot_cart_link', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_link)));
1532 }
1533 if(isset($_POST["qlcd_wp_chatbot_checkout_link"])){
1534 $qlcd_wp_chatbot_checkout_link= @$_POST["qlcd_wp_chatbot_checkout_link"];
1535 update_option('qlcd_wp_chatbot_checkout_link', maybe_serialize(sanitize_array($qlcd_wp_chatbot_checkout_link)));
1536 }
1537 if(isset($_POST["qlcd_wp_chatbot_cart_welcome"])){
1538 $qlcd_wp_chatbot_cart_welcome= (@$_POST["qlcd_wp_chatbot_cart_welcome"]);
1539 update_option('qlcd_wp_chatbot_cart_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_welcome)));
1540 }
1541 if(isset($_POST["qlcd_wp_chatbot_featured_product_welcome"])){
1542 $qlcd_wp_chatbot_featured_product_welcome= @$_POST["qlcd_wp_chatbot_featured_product_welcome"];
1543 update_option('qlcd_wp_chatbot_featured_product_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_featured_product_welcome)));
1544 }
1545
1546 if(isset($_POST["qlcd_wp_chatbot_viewed_product_welcome"])){
1547 $qlcd_wp_chatbot_viewed_product_welcome= @$_POST["qlcd_wp_chatbot_viewed_product_welcome"];
1548 update_option('qlcd_wp_chatbot_viewed_product_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_viewed_product_welcome)));
1549 }
1550 if(isset($_POST["qlcd_wp_chatbot_latest_product_welcome"])){
1551 $qlcd_wp_chatbot_latest_product_welcome= @$_POST["qlcd_wp_chatbot_latest_product_welcome"];
1552 update_option('qlcd_wp_chatbot_latest_product_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_latest_product_welcome)));
1553 }
1554
1555 if(isset($_POST["qlcd_wp_chatbot_cart_title"])){
1556 $qlcd_wp_chatbot_cart_title= @$_POST["qlcd_wp_chatbot_cart_title"];
1557 update_option('qlcd_wp_chatbot_cart_title', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_title)));
1558 }
1559 if(isset($_POST["qlcd_wp_chatbot_cart_quantity"])){
1560 $qlcd_wp_chatbot_cart_quantity= @$_POST["qlcd_wp_chatbot_cart_quantity"];
1561 update_option('qlcd_wp_chatbot_cart_quantity', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_quantity)));
1562 }
1563 if(isset($_POST["qlcd_wp_chatbot_cart_price"])){
1564 $qlcd_wp_chatbot_cart_price= @$_POST["qlcd_wp_chatbot_cart_price"];
1565 update_option('qlcd_wp_chatbot_cart_price', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_price)));
1566 }
1567 if(isset($_POST["qlcd_wp_chatbot_no_cart_items"])){
1568 $qlcd_wp_chatbot_no_cart_items= wp_unslash(@$_POST["qlcd_wp_chatbot_no_cart_items"]);
1569 update_option('qlcd_wp_chatbot_no_cart_items', maybe_serialize(sanitize_array($qlcd_wp_chatbot_no_cart_items)));
1570 }
1571 if(isset($_POST["qlcd_wp_chatbot_cart_updating"])){
1572 $qlcd_wp_chatbot_cart_updating= @$_POST["qlcd_wp_chatbot_cart_updating"];
1573 update_option('qlcd_wp_chatbot_cart_updating', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_updating)));
1574 }
1575 if(isset($_POST["qlcd_wp_chatbot_cart_removing"])){
1576 $qlcd_wp_chatbot_cart_removing= @$_POST["qlcd_wp_chatbot_cart_removing"];
1577 update_option('qlcd_wp_chatbot_cart_removing', maybe_serialize(sanitize_array($qlcd_wp_chatbot_cart_removing)));
1578 }
1579 //wpwBot wildcard settings
1580 if (isset($_POST["qlcd_wp_chatbot_wildcard_msg"])) {
1581 $qlcd_wp_chatbot_wildcard_msg = wp_unslash( $_POST["qlcd_wp_chatbot_wildcard_msg"] );
1582 $qlcd_wp_chatbot_wildcard_msg = sanitize_array( $qlcd_wp_chatbot_wildcard_msg );
1583
1584 update_option('qlcd_wp_chatbot_wildcard_msg', maybe_serialize($qlcd_wp_chatbot_wildcard_msg));
1585 } else {
1586 update_option('qlcd_wp_chatbot_wildcard_msg', maybe_serialize(array()));
1587 }
1588 //empty filter message repeat.
1589 if (isset($_POST["qlcd_wp_chatbot_empty_filter_msg"])) {
1590 $qlcd_wp_chatbot_empty_filter_msg = wp_unslash( $_POST["qlcd_wp_chatbot_empty_filter_msg"] );
1591 $qlcd_wp_chatbot_empty_filter_msg = sanitize_array( $qlcd_wp_chatbot_empty_filter_msg );
1592
1593 update_option('qlcd_wp_chatbot_empty_filter_msg', maybe_serialize($qlcd_wp_chatbot_empty_filter_msg));
1594 } else {
1595 update_option('qlcd_wp_chatbot_empty_filter_msg', maybe_serialize(array()));
1596 }
1597
1598 if (isset($_POST["qlcd_wp_chatbot_did_you_mean"])) {
1599 $qlcd_wp_chatbot_did_you_mean = wp_unslash( $_POST["qlcd_wp_chatbot_did_you_mean"] );
1600 $qlcd_wp_chatbot_did_you_mean = sanitize_array( $qlcd_wp_chatbot_did_you_mean );
1601 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize($qlcd_wp_chatbot_did_you_mean));
1602 } else {
1603 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array()));
1604 }
1605 //help welcome and message
1606 if (isset($_POST["qlcd_wp_chatbot_help_welcome"])) {
1607 $qlcd_wp_chatbot_help_welcome = wp_unslash( $_POST["qlcd_wp_chatbot_help_welcome"] );
1608 $qlcd_wp_chatbot_help_welcome = sanitize_array( $qlcd_wp_chatbot_help_welcome );
1609 update_option('qlcd_wp_chatbot_help_welcome', maybe_serialize($qlcd_wp_chatbot_help_welcome));
1610 } else {
1611 update_option('qlcd_wp_chatbot_help_welcome', maybe_serialize(array()));
1612 }
1613 if (isset($_POST["qlcd_wp_chatbot_help_msg"])) {
1614 $qlcd_wp_chatbot_help_msg = wp_unslash( $_POST["qlcd_wp_chatbot_help_msg"] );
1615 $qlcd_wp_chatbot_help_msg = sanitize_array( $qlcd_wp_chatbot_help_msg );
1616 update_option('qlcd_wp_chatbot_help_msg', maybe_serialize($qlcd_wp_chatbot_help_msg));
1617 } else {
1618 update_option('qlcd_wp_chatbot_help_msg', maybe_serialize(array()));
1619 }
1620 //To clear Conversation history.
1621 if (isset($_POST["qlcd_wp_chatbot_reset"])) {
1622 $qlcd_wp_chatbot_reset = wp_unslash( $_POST["qlcd_wp_chatbot_reset"] );
1623 $qlcd_wp_chatbot_reset = sanitize_array( $qlcd_wp_chatbot_reset );
1624 update_option('qlcd_wp_chatbot_reset', maybe_serialize($qlcd_wp_chatbot_reset));
1625 } else {
1626 update_option('qlcd_wp_chatbot_reset', maybe_serialize(array()));
1627 }
1628 //systems keyword.
1629 if (isset($_POST["qlcd_wp_chatbot_sys_key_help"])) {
1630 $qlcd_wp_chatbot_sys_key_help = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_sys_key_help"]));
1631 update_option('qlcd_wp_chatbot_sys_key_help', $qlcd_wp_chatbot_sys_key_help);
1632 } else {
1633 update_option('qlcd_wp_chatbot_sys_key_help', '');
1634 }
1635 if(isset($_POST["qlcd_wp_chatbot_sys_key_product"])){
1636 $qlcd_wp_chatbot_sys_key_product = esc_html((@$_POST["qlcd_wp_chatbot_sys_key_product"]));
1637 update_option('qlcd_wp_chatbot_sys_key_product', sanitize_text_field($qlcd_wp_chatbot_sys_key_product));
1638 }
1639 if(isset($_POST["qlcd_wp_chatbot_sys_key_catalog"])){
1640 $qlcd_wp_chatbot_sys_key_catalog = (@$_POST["qlcd_wp_chatbot_sys_key_catalog"]);
1641 update_option('qlcd_wp_chatbot_sys_key_catalog', sanitize_text_field($qlcd_wp_chatbot_sys_key_catalog));
1642 }
1643 if(isset($_POST["qlcd_wp_chatbot_sys_key_order"])){
1644 $qlcd_wp_chatbot_sys_key_order = (@$_POST["qlcd_wp_chatbot_sys_key_order"]);
1645 update_option('qlcd_wp_chatbot_sys_key_order', sanitize_text_field($qlcd_wp_chatbot_sys_key_order));
1646 }
1647 if (isset($_POST["qlcd_wp_chatbot_sys_key_support"])) {
1648 $qlcd_wp_chatbot_sys_key_support = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_sys_key_support"]));
1649 update_option('qlcd_wp_chatbot_sys_key_support', $qlcd_wp_chatbot_sys_key_support);
1650 } else {
1651 update_option('qlcd_wp_chatbot_sys_key_support', '');
1652 }
1653 if (isset($_POST["qlcd_wp_chatbot_sys_key_reset"])) {
1654 $qlcd_wp_chatbot_sys_key_reset = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_sys_key_reset"]));
1655 update_option('qlcd_wp_chatbot_sys_key_reset', $qlcd_wp_chatbot_sys_key_reset);
1656 } else {
1657 update_option('qlcd_wp_chatbot_sys_key_reset', '');
1658 }
1659 if (isset($_POST["qlcd_wp_chatbot_sys_key_email"])) {
1660 $qlcd_wp_chatbot_sys_key_email = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_sys_key_email"]));
1661 update_option('qlcd_wp_chatbot_sys_key_email', $qlcd_wp_chatbot_sys_key_email);
1662 } else {
1663 update_option('qlcd_wp_chatbot_sys_key_email', '');
1664 }
1665 if(isset($_POST["qlcd_wp_chatbot_wildcard_product"])){
1666 $qlcd_wp_chatbot_wildcard_product = (@$_POST["qlcd_wp_chatbot_wildcard_product"]);
1667 update_option('qlcd_wp_chatbot_wildcard_product', maybe_serialize(sanitize_array($qlcd_wp_chatbot_wildcard_product)));
1668 }
1669 if(isset($_POST["qlcd_wp_chatbot_wildcard_catalog"])){
1670 $qlcd_wp_chatbot_wildcard_catalog = (@$_POST["qlcd_wp_chatbot_wildcard_catalog"]);
1671 update_option('qlcd_wp_chatbot_wildcard_catalog', maybe_serialize(sanitize_array($qlcd_wp_chatbot_wildcard_catalog)));
1672 }
1673 if(isset($_POST["qlcd_wp_chatbot_featured_products"])){
1674 $qlcd_wp_chatbot_featured_products = (@$_POST["qlcd_wp_chatbot_featured_products"]);
1675 update_option('qlcd_wp_chatbot_featured_products', maybe_serialize(sanitize_array($qlcd_wp_chatbot_featured_products)));
1676 }
1677 if(isset($_POST["qlcd_wp_chatbot_sale_products"])){
1678 $qlcd_wp_chatbot_sale_products = (@$_POST["qlcd_wp_chatbot_sale_products"]);
1679 update_option('qlcd_wp_chatbot_sale_products', maybe_serialize(sanitize_array($qlcd_wp_chatbot_sale_products)));
1680 }
1681
1682 if (isset($_POST["qlcd_wp_chatbot_wildcard_support"])) {
1683 $qlcd_wp_chatbot_wildcard_support = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_wildcard_support"]));
1684 update_option('qlcd_wp_chatbot_wildcard_support', $qlcd_wp_chatbot_wildcard_support);
1685 } else {
1686 update_option('qlcd_wp_chatbot_wildcard_support', '');
1687 }
1688
1689 if (isset($_POST["qlcd_wp_chatbot_wildcard_site_search"])) {
1690 $qlcd_wp_chatbot_wildcard_site_search = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_wildcard_site_search"]));
1691 update_option('qlcd_wp_chatbot_wildcard_site_search', $qlcd_wp_chatbot_wildcard_site_search);
1692 } else {
1693 update_option('qlcd_wp_chatbot_wildcard_site_search', '');
1694 }
1695
1696 if(isset($_POST["qlcd_wp_chatbot_messenger_label"])){
1697 $qlcd_wp_chatbot_messenger_label = (@$_POST["qlcd_wp_chatbot_messenger_label"]);
1698 update_option('qlcd_wp_chatbot_messenger_label', maybe_serialize(sanitize_array($qlcd_wp_chatbot_messenger_label)));
1699 }
1700 //Products search .
1701 if (isset($_POST["qlcd_wp_chatbot_product_success"])) {
1702 // Unslash the input first, then sanitize deeply as text, assuming it's an array of texts or a single text.
1703 $unslashed_data = wp_unslash($_POST["qlcd_wp_chatbot_product_success"]);
1704 $qlcd_wp_chatbot_product_success = map_deep($unslashed_data, 'sanitize_text_field');
1705 update_option('qlcd_wp_chatbot_product_success', maybe_serialize($qlcd_wp_chatbot_product_success));
1706 }
1707 if (isset($_POST["qlcd_wp_chatbot_product_fail"])) {
1708 $qlcd_wp_chatbot_product_fail = @$_POST["qlcd_wp_chatbot_product_fail"];
1709 update_option('qlcd_wp_chatbot_product_fail', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_fail)));
1710 }
1711 if(isset($_POST["qlcd_wp_chatbot_product_asking"])){
1712 $qlcd_wp_chatbot_product_asking = @$_POST["qlcd_wp_chatbot_product_asking"];
1713 update_option('qlcd_wp_chatbot_product_asking', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_asking)));
1714 }
1715 if(isset($_POST["qlcd_wp_chatbot_product_suggest"])){
1716 $qlcd_wp_chatbot_product_suggest = @$_POST["qlcd_wp_chatbot_product_suggest"];
1717 update_option('qlcd_wp_chatbot_product_suggest', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_suggest)));
1718 }
1719 if(isset($_POST["qlcd_wp_chatbot_product_infinite"])){
1720 $qlcd_wp_chatbot_product_infinite = @$_POST["qlcd_wp_chatbot_product_infinite"];
1721 update_option('qlcd_wp_chatbot_product_infinite', maybe_serialize(sanitize_array($qlcd_wp_chatbot_product_infinite)));
1722 }
1723 if(isset($_POST["qlcd_wp_chatbot_load_more"])){
1724 $qlcd_wp_chatbot_load_more = @$_POST["qlcd_wp_chatbot_load_more"];
1725 update_option('qlcd_wp_chatbot_load_more', maybe_serialize(sanitize_array($qlcd_wp_chatbot_load_more)));
1726 }
1727 //Order
1728 if(isset($_POST["qlcd_wp_chatbot_wildcard_order"])){
1729 $qlcd_wp_chatbot_wildcard_order = @$_POST["qlcd_wp_chatbot_wildcard_order"];
1730 update_option('qlcd_wp_chatbot_wildcard_order', maybe_serialize(sanitize_array($qlcd_wp_chatbot_wildcard_order)));
1731 }
1732 if(isset($_POST["qlcd_wp_chatbot_order_welcome"])){
1733 $qlcd_wp_chatbot_order_welcome = @$_POST["qlcd_wp_chatbot_order_welcome"];
1734 update_option('qlcd_wp_chatbot_order_welcome', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_welcome)));
1735 }
1736 if(isset($_POST["qlcd_wp_chatbot_order_username_asking"])){
1737 $qlcd_wp_chatbot_order_username_asking = @$_POST["qlcd_wp_chatbot_order_username_asking"];
1738 update_option('qlcd_wp_chatbot_order_username_asking', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_username_asking)));
1739 }
1740 if(isset($_POST["qlcd_wp_chatbot_order_username_not_exist"])){
1741 $qlcd_wp_chatbot_order_username_not_exist = @$_POST["qlcd_wp_chatbot_order_username_not_exist"];
1742 update_option('qlcd_wp_chatbot_order_username_not_exist', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_username_not_exist)));
1743 }
1744 if (isset($_POST["qlcd_wp_chatbot_order_username_thanks"])) {
1745 // Unslash the input first, then sanitize deeply as text, assuming it's an array of texts or a single text.
1746 $unslashed_data = wp_unslash($_POST["qlcd_wp_chatbot_order_username_thanks"]);
1747 $qlcd_wp_chatbot_order_username_thanks = map_deep($unslashed_data, 'sanitize_text_field');
1748 update_option('qlcd_wp_chatbot_order_username_thanks', maybe_serialize($qlcd_wp_chatbot_order_username_thanks));
1749 }
1750 if(isset($_POST["qlcd_wp_chatbot_order_username_password"])){
1751 $qlcd_wp_chatbot_order_username_password = @$_POST["qlcd_wp_chatbot_order_username_password"];
1752 update_option('qlcd_wp_chatbot_order_username_password', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_username_password)));
1753 }
1754 if(isset($_POST["qlcd_wp_chatbot_order_password_incorrect"])){
1755 $qlcd_wp_chatbot_order_password_incorrect= @$_POST["qlcd_wp_chatbot_order_password_incorrect"];
1756 update_option('qlcd_wp_chatbot_order_password_incorrect', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_password_incorrect)));
1757 }
1758 if(isset($_POST["qlcd_wp_chatbot_order_not_found"])){
1759 $qlcd_wp_chatbot_order_not_found= @$_POST["qlcd_wp_chatbot_order_not_found"];
1760 update_option('qlcd_wp_chatbot_order_not_found', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_not_found)));
1761 }
1762 if(isset($_POST["qlcd_wp_chatbot_order_found"])){
1763 $qlcd_wp_chatbot_order_found= @$_POST["qlcd_wp_chatbot_order_found"];
1764 update_option('qlcd_wp_chatbot_order_found', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_found)));
1765 }
1766 if(isset( $_POST["qlcd_wp_chatbot_order_email_support"])){
1767 $qlcd_wp_chatbot_order_email_support= @$_POST["qlcd_wp_chatbot_order_email_support"];
1768 update_option('qlcd_wp_chatbot_order_email_support', maybe_serialize(sanitize_array($qlcd_wp_chatbot_order_email_support)));
1769 }
1770 //Support
1771 if (isset($_POST["qlcd_wp_chatbot_support_welcome"])) {
1772 $qlcd_wp_chatbot_support_welcome = sanitize_array($_POST["qlcd_wp_chatbot_support_welcome"]);
1773 update_option('qlcd_wp_chatbot_support_welcome', maybe_serialize($qlcd_wp_chatbot_support_welcome));
1774 }
1775 if (isset($_POST["qlcd_wp_chatbot_support_email"])) {
1776 $qlcd_wp_chatbot_support_email = sanitize_text_field($_POST["qlcd_wp_chatbot_support_email"]);
1777 update_option('qlcd_wp_chatbot_support_email', $qlcd_wp_chatbot_support_email);
1778 }
1779 if (isset($_POST["qlcd_wp_chatbot_asking_email"])) {
1780 $qlcd_wp_chatbot_asking_email = sanitize_array($_POST["qlcd_wp_chatbot_asking_email"]);
1781 update_option('qlcd_wp_chatbot_asking_email', maybe_serialize($qlcd_wp_chatbot_asking_email));
1782 }
1783 if (isset($_POST["qlcd_wp_chatbot_asking_msg"])) {
1784 $qlcd_wp_chatbot_asking_msg = sanitize_array($_POST["qlcd_wp_chatbot_asking_msg"]);
1785 update_option('qlcd_wp_chatbot_asking_msg', maybe_serialize($qlcd_wp_chatbot_asking_msg));
1786 }
1787
1788 if(isset($_POST["qlcd_wp_chatbot_no_result"])){
1789 $qlcd_wp_chatbot_no_result = @$_POST["qlcd_wp_chatbot_no_result"];
1790 update_option('qlcd_wp_chatbot_no_result', maybe_serialize(sanitize_array($qlcd_wp_chatbot_no_result)));
1791 }
1792
1793 if (isset($_POST["qlcd_wp_chatbot_support_option_again"])) {
1794 $qlcd_wp_chatbot_support_option_again = $_POST["qlcd_wp_chatbot_support_option_again"];
1795 update_option('qlcd_wp_chatbot_support_option_again', maybe_serialize(sanitize_array($qlcd_wp_chatbot_support_option_again)));
1796 } else {
1797 update_option('qlcd_wp_chatbot_support_option_again', maybe_serialize(array()));
1798 }
1799
1800 if (isset($_POST["qlcd_wp_chatbot_invalid_email"])) {
1801 $qlcd_wp_chatbot_invalid_email = $_POST["qlcd_wp_chatbot_invalid_email"];
1802 update_option('qlcd_wp_chatbot_invalid_email', maybe_serialize(sanitize_array($qlcd_wp_chatbot_invalid_email)));
1803 } else {
1804 update_option('qlcd_wp_chatbot_invalid_email', maybe_serialize(array()));
1805 }
1806
1807 if (isset($_POST["qlcd_wp_chatbot_support_phone"])) {
1808 $qlcd_wp_chatbot_support_phone = sanitize_text_field($_POST["qlcd_wp_chatbot_support_phone"]);
1809 update_option('qlcd_wp_chatbot_support_phone', $qlcd_wp_chatbot_support_phone);
1810 } else {
1811 update_option('qlcd_wp_chatbot_support_phone', '');
1812 }
1813
1814 if (isset($_POST["qlcd_wp_chatbot_asking_phone"])) {
1815 $qlcd_wp_chatbot_asking_phone = $_POST["qlcd_wp_chatbot_asking_phone"];
1816 update_option('qlcd_wp_chatbot_asking_phone', maybe_serialize(sanitize_array($qlcd_wp_chatbot_asking_phone)));
1817 } else {
1818 update_option('qlcd_wp_chatbot_asking_phone', maybe_serialize(array()));
1819 }
1820
1821 if (isset($_POST["qlcd_wp_chatbot_thank_for_phone"])) {
1822 $qlcd_wp_chatbot_thank_for_phone = $_POST["qlcd_wp_chatbot_thank_for_phone"];
1823 update_option('qlcd_wp_chatbot_thank_for_phone', maybe_serialize(sanitize_array($qlcd_wp_chatbot_thank_for_phone)));
1824 } else {
1825 update_option('qlcd_wp_chatbot_thank_for_phone', maybe_serialize(array()));
1826 }
1827
1828 if (isset($_POST["qlcd_wp_chatbot_admin_email"])) {
1829 $qlcd_wp_chatbot_admin_email = sanitize_email($_POST["qlcd_wp_chatbot_admin_email"]);
1830 } else {
1831 $qlcd_wp_chatbot_admin_email = '';
1832 }
1833
1834 update_option('qlcd_wp_chatbot_admin_email', $qlcd_wp_chatbot_admin_email);
1835
1836 // Sanitize early for qlcd_wp_chatbot_email_sub
1837 $qlcd_wp_chatbot_email_sub = '';
1838 if (isset($_POST["qlcd_wp_chatbot_email_sub"])) {
1839 $qlcd_wp_chatbot_email_sub = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_email_sub"]));
1840 }
1841 update_option('qlcd_wp_chatbot_email_sub', $qlcd_wp_chatbot_email_sub);
1842
1843 // Sanitize early for qlcd_wp_site_search, only update if set
1844 if (isset($_POST["qlcd_wp_site_search"])) {
1845 $qlcd_wp_site_search = sanitize_text_field(wp_unslash($_POST["qlcd_wp_site_search"]));
1846 update_option('qlcd_wp_site_search', $qlcd_wp_site_search);
1847 }
1848
1849 // Sanitize early for qlcd_wp_chatbot_email_sent
1850 $qlcd_wp_chatbot_email_sent = '';
1851 if (isset($_POST["qlcd_wp_chatbot_email_sent"])) {
1852 $qlcd_wp_chatbot_email_sent = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_email_sent"]));
1853 }
1854 update_option('qlcd_wp_chatbot_email_sent', $qlcd_wp_chatbot_email_sent);
1855
1856 // Sanitize early for qlcd_wp_chatbot_email_fail
1857 $qlcd_wp_chatbot_email_fail = '';
1858 if (isset($_POST["qlcd_wp_chatbot_email_fail"])) {
1859 $qlcd_wp_chatbot_email_fail = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_email_fail"]));
1860 }
1861 update_option('qlcd_wp_chatbot_email_fail', $qlcd_wp_chatbot_email_fail);
1862
1863 // Sanitize early for qlcd_wp_chatbot_relevant_post_link_openai
1864 $qlcd_wp_chatbot_relevant_post_link_openai = '';
1865 if (isset($_POST["qlcd_wp_chatbot_relevant_post_link_openai"])) {
1866 $qlcd_wp_chatbot_relevant_post_link_openai = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_relevant_post_link_openai"]));
1867 }
1868 update_option('qlcd_wp_chatbot_relevant_post_link_openai', $qlcd_wp_chatbot_relevant_post_link_openai);
1869 //Notifications messages building.
1870 if (isset($_POST["qlcd_wp_chatbot_notification_interval"])) {
1871 $qlcd_wp_chatbot_notification_interval = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_notification_interval"]));
1872 update_option('qlcd_wp_chatbot_notification_interval', $qlcd_wp_chatbot_notification_interval);
1873 }
1874
1875 if(isset($_POST["qlcd_wp_chatbot_notifications"])){
1876 $qlcd_wp_chatbot_notifications = @$_POST["qlcd_wp_chatbot_notifications"];
1877 update_option('qlcd_wp_chatbot_notifications', maybe_serialize(sanitize_array($qlcd_wp_chatbot_notifications)));
1878 }
1879 //Support building part.
1880
1881 $allowed_html = array(
1882 'a' => array(
1883 'href' => array(),
1884 'title' => array()
1885 ),
1886 'br' => array(),
1887 'em' => array(),
1888 'strong' => array(),
1889 );
1890 $support_query = @$_POST["support_query"];
1891 $clean_support_query = [];
1892 if(!empty($support_query)){
1893 foreach($support_query as $key => $val) {
1894
1895 $clean_support_query[wp_kses($key,$allowed_html)] = wp_kses($val,$allowed_html);
1896 }
1897 }
1898 update_option('support_query', (maybe_serialize($clean_support_query)));
1899 $support_ans = @$_POST["support_ans"];
1900 $clean_support_ans = [];
1901 if(!empty($support_query)){
1902 foreach($support_ans as $key => $val) {
1903 $clean_support_ans[wp_kses($key,$allowed_html)] = wp_kses($val,$allowed_html);
1904 }
1905 }
1906 update_option('support_ans', (maybe_serialize($clean_support_ans)));
1907 //Create Mobile app pages.
1908 if(isset( $_POST["wp_chatbot_app_pages"])) {
1909 $wp_chatbot_app_pages = $_POST["wp_chatbot_app_pages"];
1910 }else{ $wp_chatbot_app_pages='';}
1911 update_option('wp_chatbot_app_pages', wp_unslash($wp_chatbot_app_pages));
1912 //Messenger Options
1913 if(isset( $_POST["enable_wp_chatbot_messenger"])) {
1914 $enable_wp_chatbot_messenger = $_POST["enable_wp_chatbot_messenger"];
1915 }else{ $enable_wp_chatbot_messenger='';}
1916 update_option('enable_wp_chatbot_messenger', wp_unslash($enable_wp_chatbot_messenger));
1917 if(isset( $_POST["enable_wp_chatbot_messenger_floating_icon"])) {
1918 $enable_wp_chatbot_messenger_floating_icon = $_POST["enable_wp_chatbot_messenger_floating_icon"];
1919 }else{ $enable_wp_chatbot_messenger_floating_icon='';}
1920 update_option('enable_wp_chatbot_messenger_floating_icon', wp_unslash($enable_wp_chatbot_messenger_floating_icon));
1921 if(isset($_POST["qlcd_wp_chatbot_fb_app_id"])){
1922 $qlcd_wp_chatbot_fb_app_id = @$_POST["qlcd_wp_chatbot_fb_app_id"];
1923 update_option('qlcd_wp_chatbot_fb_app_id', sanitize_text_field($qlcd_wp_chatbot_fb_app_id));
1924 }
1925 if(isset($_POST["qlcd_wp_chatbot_fb_page_id"])){
1926 $qlcd_wp_chatbot_fb_page_id = @$_POST["qlcd_wp_chatbot_fb_page_id"];
1927 update_option('qlcd_wp_chatbot_fb_page_id', sanitize_text_field($qlcd_wp_chatbot_fb_page_id));
1928 }
1929 if(isset($_POST["qlcd_wp_chatbot_fb_color"])){
1930 $qlcd_wp_chatbot_fb_color= @$_POST["qlcd_wp_chatbot_fb_color"];
1931 update_option('qlcd_wp_chatbot_fb_color', wp_unslash($qlcd_wp_chatbot_fb_color));
1932 }
1933 if(isset($_POST["qlcd_wp_chatbot_fb_in_msg"])){
1934 $qlcd_wp_chatbot_fb_in_msg = @$_POST["qlcd_wp_chatbot_fb_in_msg"];
1935 update_option('qlcd_wp_chatbot_fb_in_msg', stripslashes(sanitize_text_field($qlcd_wp_chatbot_fb_in_msg)));
1936 }
1937 if(isset($_POST["qlcd_wp_chatbot_fb_out_msg"])){
1938 $qlcd_wp_chatbot_fb_out_msg = @$_POST["qlcd_wp_chatbot_fb_out_msg"];
1939 update_option('qlcd_wp_chatbot_fb_out_msg', stripslashes(sanitize_text_field($qlcd_wp_chatbot_fb_out_msg)));
1940 }
1941 //Skype option
1942 if(isset( $_POST["enable_wp_chatbot_skype_floating_icon"])) {
1943 $enable_wp_chatbot_skype_floating_icon = $_POST["enable_wp_chatbot_skype_floating_icon"];
1944 }else{ $enable_wp_chatbot_skype_floating_icon='';}
1945 update_option('enable_wp_chatbot_skype_floating_icon', sanitize_text_field($enable_wp_chatbot_skype_floating_icon));
1946 if(isset( $_POST["enable_wp_chatbot_skype_id"])) {
1947 $enable_wp_chatbot_skype_id = $_POST["enable_wp_chatbot_skype_id"];
1948 }else{ $enable_wp_chatbot_skype_id='';}
1949 update_option('enable_wp_chatbot_skype_id', sanitize_text_field($enable_wp_chatbot_skype_id));
1950 //WhatsApp
1951 if(isset( $_POST["enable_wp_chatbot_whats"])) {
1952 $enable_wp_chatbot_whats= $_POST["enable_wp_chatbot_whats"];
1953 }else{ $enable_wp_chatbot_whats='';}
1954 update_option('enable_wp_chatbot_whats', sanitize_text_field($enable_wp_chatbot_whats));
1955 if(isset($_POST["qlcd_wp_chatbot_whats_label"])){
1956 $qlcd_wp_chatbot_whats_label = @$_POST["qlcd_wp_chatbot_whats_label"];
1957 update_option('qlcd_wp_chatbot_whats_label', maybe_serialize(sanitize_array($qlcd_wp_chatbot_whats_label)));
1958 }
1959 if(isset( $_POST["enable_wp_chatbot_floating_whats"])) {
1960 $enable_wp_chatbot_floating_whats= $_POST["enable_wp_chatbot_floating_whats"];
1961 }else{ $enable_wp_chatbot_floating_whats='';}
1962 update_option('enable_wp_chatbot_floating_whats', sanitize_text_field($enable_wp_chatbot_floating_whats));
1963 if(isset($_POST["qlcd_wp_chatbot_whats_num"])){
1964 $qlcd_wp_chatbot_whats_num = @$_POST["qlcd_wp_chatbot_whats_num"];
1965 update_option('qlcd_wp_chatbot_whats_num', sanitize_text_field($qlcd_wp_chatbot_whats_num));
1966 }
1967 //Viber
1968 if(isset( $_POST["enable_wp_chatbot_floating_viber"])) {
1969 $enable_wp_chatbot_floating_viber = $_POST["enable_wp_chatbot_floating_viber"];
1970 }else{ $enable_wp_chatbot_floating_viber='';}
1971 update_option('enable_wp_chatbot_floating_viber', sanitize_text_field($enable_wp_chatbot_floating_viber));
1972 if(isset($_POST["qlcd_wp_chatbot_viber_acc"])){
1973 $qlcd_wp_chatbot_viber_acc = @$_POST["qlcd_wp_chatbot_viber_acc"];
1974 update_option('qlcd_wp_chatbot_viber_acc', sanitize_text_field($qlcd_wp_chatbot_viber_acc));
1975 }
1976 //Others integration
1977 if(isset( $_POST["enable_wp_chatbot_floating_phone"])) {
1978 $enable_wp_chatbot_floating_phone = $_POST["enable_wp_chatbot_floating_phone"];
1979 }else{ $enable_wp_chatbot_floating_phone='';}
1980 update_option('enable_wp_chatbot_floating_phone', sanitize_text_field($enable_wp_chatbot_floating_phone));
1981 if(isset($_POST["qlcd_wp_chatbot_phone"])){
1982 $qlcd_wp_chatbot_phone = @$_POST["qlcd_wp_chatbot_phone"];
1983 update_option('qlcd_wp_chatbot_phone', sanitize_text_field($qlcd_wp_chatbot_phone));
1984 }
1985
1986 if(isset( $_POST["enable_wp_chatbot_floating_link"])) {
1987 $enable_wp_chatbot_floating_link = $_POST["enable_wp_chatbot_floating_link"];
1988 }else{ $enable_wp_chatbot_floating_link='';}
1989 update_option('enable_wp_chatbot_floating_link', sanitize_text_field($enable_wp_chatbot_floating_link));
1990 if(isset($_POST["qlcd_wp_chatbot_weblink"])){
1991 $qlcd_wp_chatbot_weblink = @$_POST["qlcd_wp_chatbot_weblink"];
1992 update_option('qlcd_wp_chatbot_weblink', sanitize_text_field($qlcd_wp_chatbot_weblink));
1993 }
1994
1995 //Re Targetting.
1996 if(isset($_POST["qlcd_wp_chatbot_ret_greet"])){
1997 $qlcd_wp_chatbot_ret_greet = @$_POST["qlcd_wp_chatbot_ret_greet"];
1998 update_option('qlcd_wp_chatbot_ret_greet', sanitize_text_field($qlcd_wp_chatbot_ret_greet));
1999 }
2000
2001 if(isset( $_POST["enable_wp_chatbot_exit_intent"])) {
2002 $enable_wp_chatbot_exit_intent = $_POST["enable_wp_chatbot_exit_intent"];
2003 }else{ $enable_wp_chatbot_exit_intent='';}
2004 update_option('enable_wp_chatbot_exit_intent', sanitize_text_field($enable_wp_chatbot_exit_intent));
2005
2006 if(isset($_POST["wp_chatbot_exit_intent_msg"])){
2007 $wp_chatbot_exit_intent_msg = @$_POST["wp_chatbot_exit_intent_msg"];
2008 update_option('wp_chatbot_exit_intent_msg', wp_unslash($wp_chatbot_exit_intent_msg));
2009 }
2010
2011 if(isset( $_POST["wp_chatbot_exit_intent_once"])) {
2012 $wp_chatbot_exit_intent_once = $_POST["wp_chatbot_exit_intent_once"];
2013 }else{ $wp_chatbot_exit_intent_once='';}
2014 update_option('wp_chatbot_exit_intent_once', sanitize_text_field($wp_chatbot_exit_intent_once));
2015
2016 if(isset( $_POST["enable_wp_chatbot_scroll_open"])) {
2017 $enable_wp_chatbot_scroll_open = $_POST["enable_wp_chatbot_scroll_open"];
2018 }else{ $enable_wp_chatbot_scroll_open='';}
2019 update_option('enable_wp_chatbot_scroll_open', sanitize_text_field($enable_wp_chatbot_scroll_open));
2020
2021 if(isset($_POST["wp_chatbot_scroll_open_msg"])){
2022 $wp_chatbot_scroll_open_msg= @$_POST["wp_chatbot_scroll_open_msg"];
2023 update_option('wp_chatbot_scroll_open_msg', wp_unslash($wp_chatbot_scroll_open_msg));
2024 }
2025
2026 if(isset($_POST["wp_chatbot_scroll_percent"])){
2027 $wp_chatbot_scroll_percent= @$_POST["wp_chatbot_scroll_percent"];
2028 update_option('wp_chatbot_scroll_percent', wp_unslash($wp_chatbot_scroll_percent));
2029 }
2030
2031 if(isset( $_POST["wp_chatbot_scroll_once"])) {
2032 $wp_chatbot_scroll_once = sanitize_text_field($_POST["wp_chatbot_scroll_once"]);
2033 }else{ $wp_chatbot_scroll_once='';}
2034 update_option('wp_chatbot_scroll_once', $wp_chatbot_scroll_once);
2035
2036 if(isset( $_POST["enable_wp_chatbot_auto_open"])) {
2037 $enable_wp_chatbot_auto_open = sanitize_text_field($_POST["enable_wp_chatbot_auto_open"]);
2038 }else{ $enable_wp_chatbot_auto_open='';}
2039 update_option('enable_wp_chatbot_auto_open', $enable_wp_chatbot_auto_open);
2040
2041 if(isset( $_POST["enable_wp_chatbot_ret_sound"])) {
2042 $enable_wp_chatbot_ret_sound = sanitize_text_field($_POST["enable_wp_chatbot_ret_sound"]);
2043 }else{ $enable_wp_chatbot_ret_sound='';}
2044 update_option('enable_wp_chatbot_ret_sound', $enable_wp_chatbot_ret_sound);
2045
2046 if(isset( $_POST["enable_wp_chatbot_sound_initial"])) {
2047 $enable_wp_chatbot_sound_initial = sanitize_text_field($_POST["enable_wp_chatbot_sound_initial"]);
2048 }else{ $enable_wp_chatbot_sound_initial='';}
2049 update_option('enable_wp_chatbot_sound_initial', $enable_wp_chatbot_sound_initial);
2050
2051
2052 if(isset($_POST["wp_chatbot_auto_open_msg"])){
2053 $wp_chatbot_auto_open_msg = @$_POST["wp_chatbot_auto_open_msg"];
2054 update_option('wp_chatbot_auto_open_msg', wp_unslash($wp_chatbot_auto_open_msg));
2055 }
2056
2057 if(isset($_POST["wp_chatbot_auto_open_time"])){
2058 $wp_chatbot_auto_open_time = @$_POST["wp_chatbot_auto_open_time"];
2059 update_option('wp_chatbot_auto_open_time', wp_unslash($wp_chatbot_auto_open_time));
2060 }
2061 //to complate checkout.
2062 if(isset( $_POST["enable_wp_chatbot_ret_user_show"])) {
2063 $enable_wp_chatbot_ret_user_show = sanitize_text_field($_POST["enable_wp_chatbot_ret_user_show"]);
2064 }else{ $enable_wp_chatbot_ret_user_show='';}
2065 update_option('enable_wp_chatbot_ret_user_show', $enable_wp_chatbot_ret_user_show);
2066
2067 if(isset( $_POST["enable_wp_chatbot_inactive_time_show"])) {
2068 $enable_wp_chatbot_inactive_time_show = sanitize_text_field($_POST["enable_wp_chatbot_inactive_time_show"]);
2069 }else{ $enable_wp_chatbot_inactive_time_show='';}
2070 update_option('enable_wp_chatbot_inactive_time_show', $enable_wp_chatbot_inactive_time_show);
2071
2072 if(isset($_POST["wp_chatbot_inactive_time"])){
2073 $wp_chatbot_inactive_time = @$_POST["wp_chatbot_inactive_time"];
2074 update_option('wp_chatbot_inactive_time', sanitize_text_field($wp_chatbot_inactive_time));
2075 }
2076
2077 if(isset($_POST["wp_chatbot_checkout_msg"])){
2078 $wp_chatbot_checkout_msg = @$_POST["wp_chatbot_checkout_msg"];
2079 update_option('wp_chatbot_checkout_msg', wp_unslash($wp_chatbot_checkout_msg));
2080 }
2081
2082 if(isset( $_POST["wp_chatbot_auto_open_once"])) {
2083 $wp_chatbot_auto_open_once = sanitize_text_field($_POST["wp_chatbot_auto_open_once"]);
2084 }else{ $wp_chatbot_auto_open_once='';}
2085 update_option('wp_chatbot_auto_open_once', $wp_chatbot_auto_open_once);
2086
2087 if(isset( $_POST["wp_chatbot_inactive_once"])) {
2088 $wp_chatbot_inactive_once = sanitize_text_field($_POST["wp_chatbot_inactive_once"]);
2089 }else{ $wp_chatbot_inactive_once='';}
2090 update_option('wp_chatbot_inactive_once', $wp_chatbot_inactive_once);
2091
2092
2093 if(isset($_POST["wp_chatbot_proactive_bg_color"])){
2094 $wp_chatbot_proactive_bg_color = @$_POST["wp_chatbot_proactive_bg_color"];
2095 update_option('wp_chatbot_proactive_bg_color', sanitize_text_field($wp_chatbot_proactive_bg_color));
2096 }
2097
2098 if(isset( $_POST["disable_wp_chatbot_call_gen"])) {
2099 $disable_wp_chatbot_call_gen = sanitize_text_field($_POST["disable_wp_chatbot_call_gen"]);
2100 }else{ $disable_wp_chatbot_call_gen='';}
2101 update_option('disable_wp_chatbot_call_gen', $disable_wp_chatbot_call_gen);
2102
2103 if(isset( $_POST["disable_wp_chatbot_site_search"])) {
2104 $disable_wp_chatbot_site_search = sanitize_text_field($_POST["disable_wp_chatbot_site_search"]);
2105 update_option('enable_wp_chatbot_post_content', '');
2106 }else{ $disable_wp_chatbot_site_search='';}
2107 update_option('disable_wp_chatbot_site_search', $disable_wp_chatbot_site_search);
2108
2109 if(isset( $_POST["enable_wp_chatbot_post_content"])) {
2110 $enable_wp_chatbot_post_content = sanitize_text_field($_POST["enable_wp_chatbot_post_content"]);
2111
2112 }else{ $enable_wp_chatbot_post_content='';}
2113 update_option('enable_wp_chatbot_post_content', $enable_wp_chatbot_post_content);
2114
2115 if(isset( $_POST["disable_wp_chatbot_call_sup"])) {
2116 $disable_wp_chatbot_call_sup = sanitize_text_field($_POST["disable_wp_chatbot_call_sup"]);
2117 }else{ $disable_wp_chatbot_call_sup='';}
2118 update_option('disable_wp_chatbot_call_sup', $disable_wp_chatbot_call_sup);
2119
2120 if(isset( $_POST["disable_wp_chatbot_feedback"])) {
2121 $disable_wp_chatbot_feedback = sanitize_text_field($_POST["disable_wp_chatbot_feedback"]);
2122 }else{ $disable_wp_chatbot_feedback='';}
2123 update_option('disable_wp_chatbot_feedback', $disable_wp_chatbot_feedback);
2124
2125 if(isset( $_POST["disable_wp_chatbot_faq"])) {
2126 $disable_wp_chatbot_faq = sanitize_text_field($_POST["disable_wp_chatbot_faq"]);
2127 }else{ $disable_wp_chatbot_faq='';}
2128 update_option('disable_wp_chatbot_faq', $disable_wp_chatbot_faq);
2129
2130 if(isset($_POST["qlcd_wp_chatbot_feedback_label"])){
2131 $qlcd_wp_chatbot_feedback_label = (@$_POST["qlcd_wp_chatbot_feedback_label"]);
2132 update_option('qlcd_wp_chatbot_feedback_label', maybe_serialize(sanitize_array($qlcd_wp_chatbot_feedback_label)));
2133 }
2134
2135 if(isset( $_POST["enable_wp_chatbot_meta_title"])) {
2136 $enable_wp_chatbot_meta_title = sanitize_text_field($_POST["enable_wp_chatbot_meta_title"]);
2137 }else{ $enable_wp_chatbot_meta_title='';}
2138 update_option('enable_wp_chatbot_meta_title', $enable_wp_chatbot_meta_title);
2139
2140 if(isset($_POST["qlcd_wp_chatbot_meta_label"])){
2141 $qlcd_wp_chatbot_meta_label = esc_html(@$_POST["qlcd_wp_chatbot_meta_label"]);
2142 update_option('qlcd_wp_chatbot_meta_label', stripslashes(sanitize_text_field($qlcd_wp_chatbot_meta_label)));
2143 }
2144
2145 if (isset($_POST["qlcd_wp_chatbot_phone_sent"])) {
2146 $qlcd_wp_chatbot_phone_sent = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_phone_sent"]));
2147 update_option('qlcd_wp_chatbot_phone_sent', $qlcd_wp_chatbot_phone_sent);
2148 }
2149
2150 if (isset($_POST["qlcd_wp_chatbot_phone_fail"])) {
2151 $qlcd_wp_chatbot_phone_fail = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_phone_fail"]));
2152 update_option('qlcd_wp_chatbot_phone_fail', $qlcd_wp_chatbot_phone_fail);
2153 }
2154
2155 if (isset($_POST["qlcd_wp_chatbot_asking_search_keyword"])) {
2156 $qlcd_wp_chatbot_asking_search_keyword = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_asking_search_keyword"]));
2157 update_option('qlcd_wp_chatbot_asking_search_keyword', $qlcd_wp_chatbot_asking_search_keyword);
2158 }
2159
2160 if (isset($_POST["qlcd_wp_chatbot_found_result"])) {
2161 $qlcd_wp_chatbot_found_result = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_found_result"]));
2162 update_option('qlcd_wp_chatbot_found_result', $qlcd_wp_chatbot_found_result);
2163 }
2164
2165 if(isset( $_POST["enable_wp_chatbot_opening_hour"])) {
2166 $enable_wp_chatbot_opening_hour = stripslashes(sanitize_text_field($_POST["enable_wp_chatbot_opening_hour"]));
2167 }else{ $enable_wp_chatbot_opening_hour='';}
2168 update_option('enable_wp_chatbot_opening_hour', esc_html($enable_wp_chatbot_opening_hour));
2169
2170 if(isset($_POST["wpwbot_hours"])){
2171 $wpwbot_hours= @$_POST["wpwbot_hours"];
2172 update_option('wpwbot_hours', maybe_serialize(sanitize_array($wpwbot_hours)));
2173 }
2174
2175 if(isset( $_POST["enable_wp_chatbot_dailogflow"])) {
2176 $enable_wp_chatbot_dailogflow = stripslashes(sanitize_text_field($_POST["enable_wp_chatbot_dailogflow"]));
2177 }else{ $enable_wp_chatbot_dailogflow='';}
2178 update_option('enable_wp_chatbot_dailogflow', $enable_wp_chatbot_dailogflow);
2179
2180 if(isset($_POST["qlcd_wp_chatbot_dialogflow_client_token"])){
2181 $qlcd_wp_chatbot_dialogflow_client_token= esc_html(@$_POST["qlcd_wp_chatbot_dialogflow_client_token"]);
2182 update_option('qlcd_wp_chatbot_dialogflow_client_token', stripslashes(sanitize_text_field($qlcd_wp_chatbot_dialogflow_client_token)));
2183 }
2184
2185 if (isset($_POST["qlcd_wp_chatbot_dialogflow_defualt_reply"])) {
2186 $qlcd_wp_chatbot_dialogflow_defualt_reply = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_dialogflow_defualt_reply"]));
2187 update_option('qlcd_wp_chatbot_dialogflow_defualt_reply', $qlcd_wp_chatbot_dialogflow_defualt_reply);
2188 }
2189
2190 if (isset($_POST["qlcd_wp_chatbot_dialogflow_agent_language"])) {
2191 $qlcd_wp_chatbot_dialogflow_agent_language = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_dialogflow_agent_language"]));
2192 update_option('qlcd_wp_chatbot_dialogflow_agent_language', $qlcd_wp_chatbot_dialogflow_agent_language);
2193 }
2194 // style option save.
2195 if(isset( $_POST["enable_wp_chatbot_custom_color"])) {
2196 $enable_wp_chatbot_custom_color = esc_html($_POST["enable_wp_chatbot_custom_color"]);
2197 }else{ $enable_wp_chatbot_custom_color='';}
2198 update_option('enable_wp_chatbot_custom_color', stripslashes(sanitize_text_field($enable_wp_chatbot_custom_color)));
2199 if (isset($_POST["wp_chatbot_text_color"])) {
2200 $wp_chatbot_text_color = sanitize_hex_color($_POST["wp_chatbot_text_color"]);
2201 update_option('wp_chatbot_text_color', $wp_chatbot_text_color);
2202 }
2203
2204 if (isset($_POST["wp_chatbot_floatingiconbg_color"])) {
2205 $wp_chatbot_floatingiconbg_color = sanitize_hex_color($_POST["wp_chatbot_floatingiconbg_color"]);
2206 update_option('wp_chatbot_floatingiconbg_color', $wp_chatbot_floatingiconbg_color);
2207 }
2208
2209 if (isset($_POST["wp_chatbot_link_color"])) {
2210 $wp_chatbot_link_color = sanitize_hex_color($_POST["wp_chatbot_link_color"]);
2211 update_option('wp_chatbot_link_color', $wp_chatbot_link_color);
2212 }
2213
2214 if (isset($_POST["wp_chatbot_link_hover_color"])) {
2215 $wp_chatbot_link_hover_color = sanitize_hex_color($_POST["wp_chatbot_link_hover_color"]);
2216 update_option('wp_chatbot_link_hover_color', $wp_chatbot_link_hover_color);
2217 }
2218
2219 if (isset($_POST["wp_chatbot_bot_msg_bg_color"])) {
2220 $wp_chatbot_bot_msg_bg_color = sanitize_hex_color($_POST["wp_chatbot_bot_msg_bg_color"]);
2221 update_option('wp_chatbot_bot_msg_bg_color', $wp_chatbot_bot_msg_bg_color);
2222 }
2223
2224 if (isset($_POST["wp_chatbot_bot_msg_text_color"])) {
2225 $wp_chatbot_bot_msg_text_color = sanitize_hex_color($_POST["wp_chatbot_bot_msg_text_color"]);
2226 update_option('wp_chatbot_bot_msg_text_color', $wp_chatbot_bot_msg_text_color);
2227 }
2228
2229 if (isset($_POST["wp_chatbot_user_msg_bg_color"])) {
2230 $wp_chatbot_user_msg_bg_color = sanitize_hex_color($_POST["wp_chatbot_user_msg_bg_color"]);
2231 update_option('wp_chatbot_user_msg_bg_color', $wp_chatbot_user_msg_bg_color);
2232 }
2233
2234 if (isset($_POST["wp_chatbot_user_msg_text_color"])) {
2235 $wp_chatbot_user_msg_text_color = sanitize_hex_color($_POST["wp_chatbot_user_msg_text_color"]);
2236 update_option('wp_chatbot_user_msg_text_color', $wp_chatbot_user_msg_text_color);
2237 }
2238
2239 if (isset($_POST["wp_chatbot_buttons_bg_color"])) {
2240 $wp_chatbot_buttons_bg_color = sanitize_hex_color($_POST["wp_chatbot_buttons_bg_color"]);
2241 update_option('wp_chatbot_buttons_bg_color', $wp_chatbot_buttons_bg_color);
2242 }
2243
2244 if (isset($_POST["wp_chatbot_buttons_text_color"])) {
2245 $wp_chatbot_buttons_text_color = sanitize_hex_color($_POST["wp_chatbot_buttons_text_color"]);
2246 update_option('wp_chatbot_buttons_text_color', $wp_chatbot_buttons_text_color);
2247 }
2248
2249 if (isset($_POST["wp_chatbot_buttons_bg_color_hover"])) {
2250 $wp_chatbot_buttons_bg_color_hover = sanitize_hex_color($_POST["wp_chatbot_buttons_bg_color_hover"]);
2251 update_option('wp_chatbot_buttons_bg_color_hover', $wp_chatbot_buttons_bg_color_hover);
2252 }
2253
2254 if (isset($_POST["wp_chatbot_buttons_text_color_hover"])) {
2255 $wp_chatbot_buttons_text_color_hover = sanitize_hex_color($_POST["wp_chatbot_buttons_text_color_hover"]);
2256 update_option('wp_chatbot_buttons_text_color_hover', $wp_chatbot_buttons_text_color_hover);
2257 }
2258
2259 if (isset($_POST["wp_chatbot_theme_secondary_color"])) {
2260 $wp_chatbot_theme_secondary_color = sanitize_hex_color($_POST["wp_chatbot_theme_secondary_color"]);
2261 update_option('wp_chatbot_theme_secondary_color', $wp_chatbot_theme_secondary_color);
2262 }
2263 if (isset($_POST["wp_chatbot_header_background_color"])) {
2264 $wp_chatbot_header_background_color = sanitize_hex_color($_POST["wp_chatbot_header_background_color"]);
2265 update_option('wp_chatbot_header_background_color', $wp_chatbot_header_background_color);
2266 }
2267
2268 if (isset($_POST["wp_chatbot_font_size"])) {
2269 $wp_chatbot_font_size = sanitize_text_field($_POST["wp_chatbot_font_size"]);
2270 // Additional validation for font size format (e.g., '14px', '1.2em') could be added here if strict adherence to CSS units is required.
2271 update_option('wp_chatbot_font_size', $wp_chatbot_font_size);
2272 }
2273 if (isset($_POST["wp_chat_bot_font_family"])) {
2274 $wp_chat_bot_font_family = sanitize_text_field($_POST["wp_chat_bot_font_family"]);
2275 update_option('wp_chat_bot_font_family', $wp_chat_bot_font_family);
2276 }
2277 if (isset($_POST["wp_chat_user_font_family"])) {
2278 $wp_chat_user_font_family = sanitize_text_field($_POST["wp_chat_user_font_family"]);
2279 update_option('wp_chat_user_font_family', $wp_chat_user_font_family);
2280 }
2281 if (isset($_POST['wp_chatbot_user_font'])) {
2282 $wp_chatbot_user_font = sanitize_text_field($_POST['wp_chatbot_user_font']);
2283 update_option('wp_chatbot_user_font', $wp_chatbot_user_font);
2284 }
2285 if (isset($_POST['wp_chatbot_bot_font'])) {
2286 $wp_chatbot_bot_font = sanitize_text_field($_POST['wp_chatbot_bot_font']);
2287 update_option('wp_chatbot_bot_font', $wp_chatbot_bot_font);
2288 }
2289
2290 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
2291
2292 wp_enqueue_script( 'wp_chatbot_bot-front-js', plugins_url(basename(plugin_dir_path(__FILE__))) . '/js/sweetalrt.js', array('jquery'), '', true);
2293 $script = "
2294 console.log('sdaas');
2295 function callsweetalert(){
2296 Swal.fire({
2297 title: 'Your settings are saved.',
2298 html: '<p style=font-size:14px>Please clear your browser <b>cache</b> and <b>cookies</b> both and reload the front end before testing. Alternatively, you can launch a new browser window in <b>Incognito</b>/Private mode (Ctrl+Shift+N in chrome) to test.</p>',
2299 width: 450,
2300 icon: 'success',
2301 confirmButtonText: 'Got it',
2302 confirmButtonWidth: 100,
2303 confirmButtonClass: 'btn btn-lg',
2304 }).then((result) => {
2305 // location.reload();
2306 })
2307 }
2308 callsweetalert();
2309 ";
2310
2311 wp_add_inline_script( 'wp_chatbot_bot-front-js', $script );
2312 }
2313 }
2314 }
2315 /**
2316 * Display Notifications on specific criteria.
2317 *
2318 * @since 2.14
2319 */
2320 public static function wpcommerce_inactive_notice_for_wp_chatbot()
2321 {
2322 if (current_user_can('activate_plugins')) :
2323 if (!class_exists('wpCommerce')) :
2324 deactivate_plugins(plugin_basename(__FILE__));
2325 ?>
2326 <div id="message" class="error">
2327 <p>
2328 <?php
2329 printf(
2330 '%s WPBot for wpCommerce REQUIRES wpCommerce%s %swpCommerce%s must be active for WPBot to work. Please install & activate wpCommerce.',
2331 '<strong>',
2332 '</strong><br>',
2333 '<a href="http://wordpress.org/extend/plugins/wpcommerce/" target="_blank" >',
2334 '</a>'
2335 );
2336 ?>
2337 </p>
2338 </div>
2339 <?php
2340 elseif (version_compare(get_option('wpcommerce_db_version'), QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION, '<')) :
2341 ?>
2342 <div id="message" class="error">
2343 <!--<p style="float: right; color: #9A9A9A; font-size: 13px; font-style: italic;">For more information <a href="http://cxthemes.com/plugins/update-notice.html" target="_blank" style="color: inheret;">click here</a></p>-->
2344 <p>
2345 <?php
2346 printf(
2347 '%WPBot for wpCommerce is inactive%s This version of WpBot requires wpCommerce %s or newer. For more information about our wpCommerce version support %sclick here%s.',
2348 '<strong>',
2349 '</strong><br>',
2350 esc_html( QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION )
2351 );
2352 ?>
2353 </p>
2354 <div style="clear:both;"></div>
2355 </div>
2356 <?php
2357 endif;
2358 endif;
2359 }
2360 /**
2361 * Admin notice for table reindex
2362 */
2363 public function admin_notice_reindex() { ?>
2364 <div class="updated notice is-dismissible">
2365 <p><?php
2366 // translators: %s: A link to the Re-Index Products page.
2367 printf( esc_html__( 'WPBot Pro : To Enable Title, Content, Excerpt, Categories, Tag and SKU Search Re-Index Products is required. %s', 'chatbot' ),'<a class="button button-secondary" href="'.esc_url( admin_url( 'admin.php?page=wpbot') ).'">'.esc_html__( 'Re-Index Products', 'chatbot' ).'</a>'); ?></p>
2368 </div>
2369 <?php }
2370 }
2371 /**
2372 * Instantiate plugin.
2373 *
2374 */
2375 if (!function_exists('qcld_wb_chatboot_plugin_init')) {
2376 function qcld_wb_chatboot_plugin_init()
2377 {
2378 global $qcld_wb_chatbot;
2379 $qcld_wb_chatbot = qcld_wb_Chatbot_free::qcld_wb_chatbot_get_instance();
2380 }
2381 }
2382 add_action('plugins_loaded', 'qcld_wb_chatboot_plugin_init');
2383 /*
2384 * Initial Options will be insert as defualt data
2385 */
2386 register_activation_hook(__FILE__, 'qcld_wb_chatboot_defualt_options');
2387 if( !function_exists('qcld_wb_chatboot_defualt_options') ){
2388 function qcld_wb_chatboot_defualt_options(){
2389
2390 global $wpdb;
2391 $collate = '';
2392
2393 if ( $wpdb->has_cap( 'collation' ) ) {
2394
2395 if ( ! empty( $wpdb->charset ) ) {
2396
2397 $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
2398 }
2399 if ( ! empty( $wpdb->collate ) ) {
2400
2401 $collate .= " COLLATE $wpdb->collate";
2402
2403 }
2404 }
2405
2406 //Bot User Table
2407 $table1 = $wpdb->prefix.'wpbot_sessions';
2408 $sql_sliders_Table1 = "
2409 CREATE TABLE IF NOT EXISTS `$table1` (
2410 `id` int(11) NOT NULL AUTO_INCREMENT,
2411 `session` int(11) NOT NULL,
2412 PRIMARY KEY (`id`)
2413 ) $collate AUTO_INCREMENT=1 ";
2414
2415 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
2416 dbDelta( $sql_sliders_Table1 );
2417
2418 //Bot Response Table
2419 $table1 = $wpdb->prefix.'wpbot_response';
2420 $sql_sliders_Table1 = "
2421 CREATE TABLE IF NOT EXISTS `$table1` (
2422 `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
2423 `query` TEXT NOT NULL,
2424 `keyword` TEXT NOT NULL,
2425 `response` TEXT NOT NULL,
2426 `category` varchar(256) NOT NULL,
2427 `intent` varchar(256) NOT NULL,
2428 `custom` varchar(256) NOT NULL,
2429 `lang` varchar(25) NULL,
2430 FULLTEXT(`query`, `keyword`, `response`)
2431 ) $collate AUTO_INCREMENT=1 ENGINE=InnoDB";
2432
2433 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
2434 dbDelta( $sql_sliders_Table1 );
2435
2436 $sqlqry = $wpdb->get_results($wpdb->prepare("select * from $table1 where id = %d", 1)); //DB Call OK, No Caching OK
2437 if(empty($sqlqry)){
2438
2439 $query = 'What Can WPBot do for you?';
2440 $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!';
2441
2442 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
2443 $format = array('%s','%s', '%s', '%s');
2444 $wpdb->insert($table1,$data,$format); //DB Call OK, No Caching OK
2445 }
2446
2447 $url = get_site_url();
2448 $url = wp_parse_url($url);
2449 $domain = $url['host'];
2450 //$admin_email = "admin@" . $domain;
2451 $admin_email = get_option('admin_email');
2452
2453 if(!get_option('wp_chatbot_position_x')) {
2454 update_option('wp_chatbot_position_x', 50);
2455 }
2456 if(!get_option('wp_chatbot_position_y')) {
2457 update_option('wp_chatbot_position_y', 50);
2458 }
2459 if(!get_option('disable_wp_chatbot')) {
2460 update_option('disable_wp_chatbot', '');
2461 }
2462 if(!get_option('disable_wp_chatbot_icon_animation')) {
2463 update_option('disable_wp_chatbot_icon_animation', '');
2464 }
2465 if(!get_option('disable_wp_chatbot_on_mobile')) {
2466 update_option('disable_wp_chatbot_on_mobile', '');
2467 }
2468 if(!get_option('qlcd_wp_chatbot_admin_email')) {
2469 update_option('qlcd_wp_chatbot_admin_email', get_option('admin_email'));
2470 }
2471 if(!get_option('disable_wp_chatbot_product_search')) {
2472 update_option('disable_wp_chatbot_product_search', '');
2473 }
2474 if(!get_option('disable_wp_chatbot_catalog')) {
2475 update_option('disable_wp_chatbot_catalog', '');
2476 }
2477 if(!get_option('disable_wp_chatbot_order_status')) {
2478 update_option('disable_wp_chatbot_order_status', '');
2479 }
2480 if(!get_option('enable_wp_chatbot_rtl')) {
2481 update_option('enable_wp_chatbot_rtl', '');
2482 }
2483 if(!get_option('show_menu_after_greetings')) {
2484 update_option('show_menu_after_greetings', 1);
2485 }
2486 if(!get_option('enable_chat_session')) {
2487 update_option('enable_chat_session', '');
2488 }
2489
2490 if(!get_option('enable_wp_chatbot_mobile_full_screen')) {
2491 update_option('enable_wp_chatbot_mobile_full_screen', 1);
2492 }
2493 if(!get_option('wpbot_preloading_time')) {
2494 update_option('wpbot_preloading_time', '0.5');
2495 }
2496
2497 if(!get_option('disable_wp_chatbot_notification')) {
2498 update_option('disable_wp_chatbot_notification', '1');
2499 }
2500 if(!get_option('disable_wp_chatbot_cart_item_number')) {
2501 update_option('disable_wp_chatbot_cart_item_number', '');
2502 }
2503 if(!get_option('disable_wp_chatbot_featured_product')) {
2504 update_option('disable_wp_chatbot_featured_product', '');
2505 }
2506 if(!get_option('disable_wp_chatbot_sale_product')) {
2507 update_option('disable_wp_chatbot_sale_product', '');
2508 }
2509 if(!get_option('wp_chatbot_open_product_detail')) {
2510 update_option('wp_chatbot_open_product_detail', '');
2511 }
2512 if(!get_option('qlcd_wp_chatbot_product_orderby')) {
2513 update_option('qlcd_wp_chatbot_product_orderby', sanitize_text_field('title'));
2514 }
2515 if(!get_option('qlcd_wp_chatbot_product_order')) {
2516 update_option('qlcd_wp_chatbot_product_order', sanitize_text_field('ASC'));
2517 }
2518 if(!get_option('qlcd_wp_chatbot_ppp')) {
2519 update_option('qlcd_wp_chatbot_ppp', intval(6));
2520 }
2521 if(!get_option('wp_chatbot_exclude_stock_out_product')) {
2522 update_option('wp_chatbot_exclude_stock_out_product', '');
2523 }
2524 if(!get_option('wp_chatbot_show_sub_category')) {
2525 update_option('wp_chatbot_show_sub_category', '');
2526 }
2527 if(!get_option('wp_chatbot_vertical_custom')){
2528 update_option('wp_chatbot_vertical_custom', 'Go To');
2529 }
2530 if(!get_option('wp_chatbot_show_home_page')) {
2531 update_option('wp_chatbot_show_home_page', 'on');
2532 }
2533 if(!get_option('qc_wpbot_menu_order')) {
2534 update_option('qc_wpbot_menu_order', '');
2535 }
2536
2537 if(!get_option('wp_chatbot_show_posts')) {
2538 update_option('wp_chatbot_show_posts', 'on');
2539 }
2540 if(!get_option('wp_chatbot_show_pages')){
2541 update_option('wp_chatbot_show_pages', 'on');
2542 }
2543 if(!get_option('wp_chatbot_show_pages_list')) {
2544 update_option('wp_chatbot_show_pages_list', maybe_serialize(array()));
2545 }
2546 if(!get_option('wp_chatbot_exclude_post_list')) {
2547 update_option('wp_chatbot_exclude_post_list', maybe_serialize(array()));
2548 }
2549
2550 if(!get_option('wp_chatbot_show_wpcommerce')) {
2551 update_option('wp_chatbot_show_wpcommerce', 'on');
2552 }
2553 if(!get_option('qlcd_wp_chatbot_stop_words_name')) {
2554 update_option('qlcd_wp_chatbot_stop_words_name', 'english');
2555 }
2556 if(!get_option('qlcd_wp_chatbot_stop_words')) {
2557 update_option('qlcd_wp_chatbot_stop_words', "a,able,about,above,abst,accordance,according,accordingly,across,act,actually,added,adj,affected,affecting,affects,after,afterwards,again,against,ah,all,almost,alone,along,already,also,although,always,am,among,amongst,an,and,announce,another,any,anybody,anyhow,anymore,anyone,anything,anyway,anyways,anywhere,apparently,approximately,are,aren,arent,arise,around,as,aside,ask,asking,at,auth,available,away,awfully,b,back,be,became,because,become,becomes,becoming,been,before,beforehand,begin,beginning,beginnings,begins,behind,being,believe,below,beside,besides,between,beyond,biol,both,brief,briefly,but,by,c,ca,came,can,cannot,can't,cause,causes,certain,certainly,co,com,come,comes,contain,containing,contains,could,couldnt,d,date,did,didn't,different,do,does,doesn't,doing,done,don't,down,downwards,due,during,e,each,ed,edu,effect,eg,eight,eighty,either,else,elsewhere,end,ending,enough,especially,et,et-al,etc,even,ever,every,everybody,everyone,everything,everywhere,ex,except,f,far,few,ff,fifth,first,five,fix,followed,following,follows,for,former,formerly,forth,found,four,from,further,furthermore,g,gave,get,gets,getting,give,given,gives,giving,go,goes,gone,got,gotten,h,had,happens,hardly,has,hasn't,have,haven't,having,he,hed,hence,her,here,hereafter,hereby,herein,heres,hereupon,hers,herself,hes,hi,hid,him,himself,his,hither,home,how,howbeit,however,hundred,i,id,ie,if,i'll,im,immediate,immediately,importance,important,in,inc,indeed,index,information,instead,into,invention,inward,is,isn't,it,itd,it'll,its,itself,i've,j,just,k,keep,keeps,kept,kg,km,know,known,knows,l,largely,last,lately,later,latter,latterly,least,less,lest,let,lets,like,liked,likely,line,little,'ll,look,looking,looks,ltd,m,made,mainly,make,makes,many,may,maybe,me,mean,means,meantime,meanwhile,merely,mg,might,million,miss,ml,more,moreover,most,mostly,mr,mrs,much,mug,must,my,myself,n,na,name,namely,nay,nd,near,nearly,necessarily,necessary,need,needs,neither,never,nevertheless,new,next,nine,ninety,no,nobody,non,none,nonetheless,noone,nor,normally,nos,not,noted,nothing,now,nowhere,o,obtain,obtained,obviously,of,off,often,oh,ok,okay,old,omitted,on,once,one,ones,only,onto,or,ord,other,others,otherwise,ought,our,ours,ourselves,out,outside,over,overall,owing,own,p,page,pages,part,particular,particularly,past,per,perhaps,placed,please,plus,poorly,possible,possibly,potentially,pp,predominantly,present,previously,primarily,probably,promptly,proud,provides,put,q,que,quickly,quite,qv,r,ran,rather,rd,re,readily,really,recent,recently,ref,refs,regarding,regardless,regards,related,relatively,research,respectively,resulted,resulting,results,right,run,s,said,same,saw,say,saying,says,sec,section,see,seeing,seem,seemed,seeming,seems,seen,self,selves,sent,seven,several,shall,she,shed,she'll,shes,should,shouldn't,show,showed,shown,showns,shows,significant,significantly,similar,similarly,since,six,slightly,so,some,somebody,somehow,someone,somethan,something,sometime,sometimes,somewhat,somewhere,soon,sorry,specifically,specified,specify,specifying,still,stop,strongly,sub,substantially,successfully,such,sufficiently,suggest,sup,sure,t,take,taken,taking,tell,tends,th,than,thank,thanks,thanx,that,that'll,thats,that've,the,their,theirs,them,themselves,then,thence,there,thereafter,thereby,thered,therefore,therein,there'll,thereof,therere,theres,thereto,thereupon,there've,these,they,theyd,they'll,theyre,they've,think,this,those,thou,though,thoughh,thousand,throug,through,throughout,thru,thus,til,tip,to,together,too,took,toward,towards,tried,tries,truly,try,trying,ts,twice,two,u,un,under,unfortunately,unless,unlike,unlikely,until,unto,up,upon,ups,us,use,used,useful,usefully,usefulness,uses,using,usually,v,value,various,'ve,very,via,viz,vol,vols,vs,w,want,wants,was,wasnt,way,we,wed,welcome,we'll,went,were,werent,we've,what,whatever,what'll,whats,when,whence,whenever,where,whereafter,whereas,whereby,wherein,wheres,whereupon,wherever,whether,which,while,whim,whither,who,whod,whoever,whole,who'll,whom,whomever,whos,whose,why,widely,willing,wish,with,within,without,wont,words,world,would,wouldnt,www,x,y,yes,yet,you,youd,you'll,your,youre,yours,yourself,yourselves,you've,z,zero");
2558 }
2559 if(!get_option('qlcd_wp_chatbot_order_user')) {
2560 update_option('qlcd_wp_chatbot_order_user', sanitize_text_field('login'));
2561 }
2562 if(!get_option('wp_chatbot_custom_agent_path')) {
2563 update_option('wp_chatbot_custom_agent_path', '');
2564 }
2565 if(!get_option('wp_chatbot_custom_icon_path')) {
2566 update_option('wp_chatbot_custom_icon_path', '');
2567 }
2568
2569 if(!get_option('wp_chatbot_icon')) {
2570 update_option('wp_chatbot_icon', sanitize_text_field('icon-13.png'));
2571 }
2572 if(!get_option('wp_chatbot_floatingiconbg_color')) {
2573 update_option('wp_chatbot_floatingiconbg_color', '#fff');
2574 }
2575 if(!get_option('wp_chatbot_agent_image')){
2576 update_option('wp_chatbot_agent_image',sanitize_text_field('agent-0.png'));
2577 }
2578 if(!get_option('qcld_wb_chatbot_theme')) {
2579 update_option('qcld_wb_chatbot_theme', sanitize_text_field('template-00'));
2580 }
2581 if(!get_option('qcld_wb_chatbot_change_bg')) {
2582 update_option('qcld_wb_chatbot_change_bg', '');
2583 }
2584 if(!get_option('wp_chatbot_custom_css')) {
2585 update_option('wp_chatbot_custom_css', '');
2586 }
2587 if(!get_option('qlcd_wp_chatbot_host')) {
2588 update_option('qlcd_wp_chatbot_host', stripslashes(sanitize_text_field('Our Website')));
2589 }
2590 if(!get_option('qlcd_wp_chatbot_agent')) {
2591 update_option('qlcd_wp_chatbot_agent', stripslashes(sanitize_text_field('Carrie')));
2592 }
2593 if(!get_option('qlcd_wp_chatbot_host')) {
2594 update_option('qlcd_wp_chatbot_host', stripslashes(sanitize_text_field('Our Website')));
2595 }
2596 if(!get_option('qlcd_wp_chatbot_shopper_demo_name')) {
2597 update_option('qlcd_wp_chatbot_shopper_demo_name', stripslashes(sanitize_text_field('Amigo')));
2598 }
2599 if(!get_option('qlcd_wp_chatbot_yes')) {
2600 update_option('qlcd_wp_chatbot_yes', stripslashes(sanitize_text_field('YES')));
2601 }
2602 if(!get_option('qlcd_wp_chatbot_no')) {
2603 update_option('qlcd_wp_chatbot_no', stripslashes(sanitize_text_field('NO')));
2604 }
2605 if(!get_option('qlcd_wp_chatbot_or')) {
2606 update_option('qlcd_wp_chatbot_or', stripslashes(sanitize_text_field('OR')));
2607 }
2608 if(!get_option('qlcd_wp_chatbot_sorry')) {
2609 update_option('qlcd_wp_chatbot_sorry', stripslashes(sanitize_text_field('Sorry')));
2610 }
2611
2612 if(!get_option('qlcd_wp_chatbot_dialogflow_project_id')) {
2613 update_option('qlcd_wp_chatbot_dialogflow_project_id', '');
2614 }
2615 if(!get_option('wp_chatbot_df_api')) {
2616 update_option('wp_chatbot_df_api', 'v1');
2617 }
2618
2619
2620 if(!get_option('qlcd_wp_chatbot_dialogflow_project_key')) {
2621 update_option('qlcd_wp_chatbot_dialogflow_project_key', '');
2622 }
2623
2624 if(!get_option('qlcd_wp_chatbot_agent_join')) {
2625 update_option('qlcd_wp_chatbot_agent_join', maybe_serialize(array('has joined the conversation')));
2626 }
2627 if(!get_option('qlcd_wp_chatbot_welcome')) {
2628 update_option('qlcd_wp_chatbot_welcome', maybe_serialize(array('Welcome to', 'Glad to have you at')));
2629 }
2630 if(!get_option('qlcd_wp_chatbot_back_to_start')) {
2631 update_option('qlcd_wp_chatbot_back_to_start', maybe_serialize(array('Back to Start')));
2632 }
2633 if(!get_option('qlcd_wp_chatbot_hi_there')) {
2634 update_option('qlcd_wp_chatbot_hi_there', maybe_serialize(array('Hi There!')));
2635 }
2636 if(!get_option('qlcd_wp_chatbot_hello')) {
2637 update_option('qlcd_wp_chatbot_hello', maybe_serialize(array('Hi There!')));
2638 }
2639 if(!get_option('qlcd_wp_chatbot_welcome_back')) {
2640 update_option('qlcd_wp_chatbot_welcome_back', maybe_serialize(array('Welcome back', 'Good to see your again')));
2641 }
2642 if(!get_option('qlcd_wp_chatbot_asking_name')) {
2643 update_option('qlcd_wp_chatbot_asking_name', maybe_serialize(array('May I know your name?', 'What should I call you?')));
2644 }
2645 if(!get_option('qlcd_wp_chatbot_name_greeting')) {
2646 update_option('qlcd_wp_chatbot_name_greeting', maybe_serialize(array('Nice to meet you')));
2647 }
2648 if(!get_option('qlcd_wp_chatbot_i_am')) {
2649 update_option('qlcd_wp_chatbot_i_am', maybe_serialize(array('I am', 'This is')));
2650 }
2651 if(!get_option('qlcd_wp_chatbot_is_typing')) {
2652 update_option('qlcd_wp_chatbot_is_typing', maybe_serialize(array('is typing...')));
2653 }
2654 if(!get_option('qlcd_wp_chatbot_send_a_msg')) {
2655 update_option('qlcd_wp_chatbot_send_a_msg', maybe_serialize(array('Send a message.')));
2656 }
2657 if(!get_option('qlcd_wp_chatbot_choose_option')) {
2658 update_option('qlcd_wp_chatbot_choose_option', maybe_serialize(array('Choose an option.')));
2659 }
2660 if(!get_option('qlcd_wp_chatbot_viewed_products')) {
2661 update_option('qlcd_wp_chatbot_viewed_products', maybe_serialize(array('Recently viewed products')));
2662 }
2663 if(!get_option('qlcd_wp_chatbot_add_to_cart')) {
2664 update_option('qlcd_wp_chatbot_add_to_cart', maybe_serialize(array('Add to Cart')));
2665 }
2666 if(!get_option('qlcd_wp_chatbot_cart_link')) {
2667 update_option('qlcd_wp_chatbot_cart_link', maybe_serialize(array('Cart')));
2668 }
2669 if(!get_option('qlcd_wp_chatbot_checkout_link')) {
2670 update_option('qlcd_wp_chatbot_checkout_link', maybe_serialize(array('Checkout')));
2671 }
2672 if(!get_option('qlcd_wp_chatbot_featured_product_welcome')) {
2673 update_option('qlcd_wp_chatbot_featured_product_welcome', maybe_serialize(array('I have found following featured products')));
2674 }
2675 if(!get_option('qlcd_wp_chatbot_viewed_product_welcome')) {
2676 update_option('qlcd_wp_chatbot_viewed_product_welcome', maybe_serialize(array('I have found following recently viewed products')));
2677 }
2678 if(!get_option('qlcd_wp_chatbot_latest_product_welcome')) {
2679 update_option('qlcd_wp_chatbot_latest_product_welcome', maybe_serialize(array('I have found following latest products')));
2680 }
2681 if(!get_option('qlcd_wp_chatbot_cart_welcome')) {
2682 update_option('qlcd_wp_chatbot_cart_welcome', maybe_serialize(array('I have found following items from Shopping Cart.')));
2683 }
2684 if(!get_option('qlcd_wp_chatbot_cart_title')) {
2685 update_option('qlcd_wp_chatbot_cart_title', maybe_serialize(array('Title')));
2686 }
2687 if(!get_option('qlcd_wp_chatbot_cart_quantity')) {
2688 update_option('qlcd_wp_chatbot_cart_quantity', maybe_serialize(array('Qty')));
2689 }
2690 if(!get_option('qlcd_wp_chatbot_cart_price')) {
2691 update_option('qlcd_wp_chatbot_cart_price', maybe_serialize(array('Price')));
2692 }
2693 if(!get_option('qlcd_wp_chatbot_no_cart_items')) {
2694 update_option('qlcd_wp_chatbot_no_cart_items', maybe_serialize(array('No items in the cart')));
2695 }
2696 if(!get_option('qlcd_wp_chatbot_cart_updating')) {
2697 update_option('qlcd_wp_chatbot_cart_updating', maybe_serialize(array('Updating cart items ...')));
2698 }
2699 if(!get_option('qlcd_wp_chatbot_cart_removing')) {
2700 update_option('qlcd_wp_chatbot_cart_removing', maybe_serialize(array('Removing cart items ...')));
2701 }
2702 if(!get_option('qlcd_wp_chatbot_wildcard_msg')) {
2703 update_option('qlcd_wp_chatbot_wildcard_msg', maybe_serialize(array('I am here to find what you need. What are you looking for?')));
2704 }
2705 if(!get_option('qlcd_wp_chatbot_empty_filter_msg')) {
2706 update_option('qlcd_wp_chatbot_empty_filter_msg', maybe_serialize(array('Sorry, I did not understand you.')));
2707 }
2708 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
2709 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array('Did you mean?')));
2710 }
2711 if(!get_option('qlcd_wp_chatbot_sys_key_help')) {
2712 update_option('qlcd_wp_chatbot_sys_key_help', 'start');
2713 }
2714 if(!get_option('qlcd_wp_chatbot_sys_key_product')) {
2715 update_option('qlcd_wp_chatbot_sys_key_product', 'product');
2716 }
2717 if(!get_option('qlcd_wp_chatbot_sys_key_catalog')) {
2718 update_option('qlcd_wp_chatbot_sys_key_catalog', 'catalog');
2719 }
2720 if(!get_option('qlcd_wp_chatbot_sys_key_order')) {
2721 update_option('qlcd_wp_chatbot_sys_key_order', 'order');
2722 }
2723 if(!get_option('qlcd_wp_chatbot_sys_key_support')) {
2724 update_option('qlcd_wp_chatbot_sys_key_support', 'faq');
2725 }
2726 if(!get_option('qlcd_wp_chatbot_sys_key_reset')) {
2727 update_option('qlcd_wp_chatbot_sys_key_reset', 'reset');
2728 }
2729 if(!get_option('qlcd_wp_chatbot_sys_key_email')) {
2730 update_option('qlcd_wp_chatbot_sys_key_email', 'email');
2731 }
2732 if(!get_option('qlcd_wp_chatbot_help_welcome')) {
2733 update_option('qlcd_wp_chatbot_help_welcome', maybe_serialize(array('Welcome to Help Section.')));
2734 }
2735 if(!get_option('qlcd_wp_chatbot_help_msg')) {
2736 update_option('qlcd_wp_chatbot_help_msg', maybe_serialize(array('<b>Type and Hit Enter</b><br><ul><li> <b>start</b> to Get back to the main menu. </li><li> <b>faq</b> for FAQ. </li><li> <b>email </b> to send eMail </li><li> <b>reset</b> to restart the chat</li></ul>')));
2737 }
2738 if(!get_option('qlcd_wp_chatbot_reset')) {
2739 update_option('qlcd_wp_chatbot_reset', maybe_serialize(array('Do you want to clear our chat history and start over?')));
2740 }
2741 if(!get_option('qlcd_wp_chatbot_wildcard_product')) {
2742 update_option('qlcd_wp_chatbot_wildcard_product', maybe_serialize(array('Product Search')));
2743 }
2744 if(!get_option('qlcd_wp_chatbot_wildcard_catalog')) {
2745 update_option('qlcd_wp_chatbot_wildcard_catalog', maybe_serialize(array('Catalog')));
2746 }
2747 if(!get_option('qlcd_wp_chatbot_featured_products')) {
2748 update_option('qlcd_wp_chatbot_featured_products', maybe_serialize(array('Featured Products')));
2749 }
2750 if(!get_option('qlcd_wp_chatbot_sale_products')) {
2751 update_option('qlcd_wp_chatbot_sale_products', maybe_serialize(array('Products on Sale')));
2752 }
2753 if(!get_option('qlcd_wp_chatbot_wildcard_support')) {
2754 update_option('qlcd_wp_chatbot_wildcard_support', 'FAQ');
2755 }
2756 if(!get_option('qlcd_wp_chatbot_wildcard_site_search')) {
2757 update_option('qlcd_wp_chatbot_wildcard_site_search', 'Site Search');
2758 }
2759 if(!get_option('qlcd_wp_chatbot_messenger_label')) {
2760 update_option('qlcd_wp_chatbot_messenger_label', maybe_serialize(array('Chat with Us on Facebook Messenger')));
2761 }
2762 if(!get_option('qlcd_wp_chatbot_product_success')) {
2763 update_option('qlcd_wp_chatbot_product_success', maybe_serialize(array('Great! We have these products for', 'Found these products for')));
2764 }
2765 if(!get_option('qlcd_wp_chatbot_product_fail')) {
2766 update_option('qlcd_wp_chatbot_product_fail', maybe_serialize(array('Sorry, I found nothing')));
2767 }
2768 if(!get_option('qlcd_wp_chatbot_product_asking')) {
2769 update_option('qlcd_wp_chatbot_product_asking', maybe_serialize(array('What are you shopping for?')));
2770 }
2771 if(!get_option('qlcd_wp_chatbot_product_suggest')) {
2772 update_option('qlcd_wp_chatbot_product_suggest', maybe_serialize(array('You can browse our extensive catalog. Just pick a category from below:')));
2773 }
2774 if(!get_option('qlcd_wp_chatbot_product_infinite')) {
2775 update_option('qlcd_wp_chatbot_product_infinite', maybe_serialize(array('Too many choices? Let\'s try another search term', 'I may have something else for you. Why not search again?')));
2776 }
2777 if(!get_option('qlcd_wp_chatbot_load_more')) {
2778 update_option('qlcd_wp_chatbot_load_more', maybe_serialize(array('Load More')));
2779 }
2780 if(!get_option('qlcd_wp_chatbot_wildcard_order')) {
2781 update_option('qlcd_wp_chatbot_wildcard_order', maybe_serialize(array('Order Status')));
2782 }
2783 if(!get_option('qlcd_wp_chatbot_order_welcome')) {
2784 update_option('qlcd_wp_chatbot_order_welcome', maybe_serialize(array('Welcome to Order status section!')));
2785 }
2786 if(!get_option('qlcd_wp_chatbot_order_username_asking')) {
2787 update_option('qlcd_wp_chatbot_order_username_asking', maybe_serialize(array('Please type your username?')));
2788 }
2789 if(!get_option('qlcd_wp_chatbot_order_username_password')) {
2790 update_option('qlcd_wp_chatbot_order_username_password', maybe_serialize(array('Please type your password')));
2791 }
2792 if(!get_option('qlcd_wp_chatbot_order_username_not_exist')) {
2793 update_option('qlcd_wp_chatbot_order_username_not_exist', maybe_serialize(array('This username does not exist.')));
2794 }
2795 if(!get_option('qlcd_wp_chatbot_order_username_thanks')) {
2796 update_option('qlcd_wp_chatbot_order_username_thanks', maybe_serialize(array('Thank you for the username')));
2797 }
2798 if(!get_option('qlcd_wp_chatbot_order_password_incorrect')) {
2799 update_option('qlcd_wp_chatbot_order_password_incorrect', maybe_serialize(array('Sorry Password is not correct!')));
2800 }
2801 if(!get_option('qlcd_wp_chatbot_asking_email')) {
2802 update_option('qlcd_wp_chatbot_asking_email', maybe_serialize(array('Please provide your email address')));
2803 }
2804 if(!get_option('qlcd_wp_chatbot_order_not_found')) {
2805 update_option('qlcd_wp_chatbot_order_not_found', maybe_serialize(array('I did not find any order by you')));
2806 }
2807 if(!get_option('qlcd_wp_chatbot_order_found')) {
2808 update_option('qlcd_wp_chatbot_order_found', maybe_serialize(array('I have found the following orders')));
2809 }
2810 if(!get_option('qlcd_wp_chatbot_order_email_support')) {
2811 update_option('qlcd_wp_chatbot_order_email_support', maybe_serialize(array('Email our support center about your order.')));
2812 }
2813 if(!get_option('qlcd_wp_chatbot_support_welcome')) {
2814 update_option('qlcd_wp_chatbot_support_welcome', maybe_serialize(array('Welcome to FAQ Section')));
2815 }
2816 if(!get_option('qlcd_wp_chatbot_support_email')) {
2817 update_option('qlcd_wp_chatbot_support_email', 'Send us Email.');
2818 }
2819 if(!get_option('qlcd_wp_chatbot_asking_msg')) {
2820 update_option('qlcd_wp_chatbot_asking_msg', maybe_serialize(array('Thank you for email address. Please write your message now.')));
2821 }
2822 if(!get_option('qlcd_wp_chatbot_no_result')) {
2823 update_option('qlcd_wp_chatbot_no_result', maybe_serialize(array('Sorry, No result found!')));
2824 }
2825 if(!get_option('qlcd_wp_chatbot_invalid_email')) {
2826 update_option('qlcd_wp_chatbot_invalid_email', maybe_serialize(array('Sorry, Email address is not valid! Please provide a valid email.')));
2827 }
2828 if(!get_option('qlcd_wp_chatbot_support_phone')) {
2829 update_option('qlcd_wp_chatbot_support_phone', 'Leave your number. We will call you back!');
2830 }
2831 if(!get_option('qlcd_wp_chatbot_asking_phone')) {
2832 update_option('qlcd_wp_chatbot_asking_phone', maybe_serialize(array('Please provide your Phone number')));
2833 }
2834 if(!get_option('qlcd_wp_chatbot_thank_for_phone')) {
2835 update_option('qlcd_wp_chatbot_thank_for_phone', maybe_serialize(array('Thank you for Phone number')));
2836 }
2837 if(!get_option('qlcd_wp_chatbot_support_option_again')) {
2838 update_option('qlcd_wp_chatbot_support_option_again', maybe_serialize(array('You may choose option from below.')));
2839 }
2840 if(!get_option('qlcd_wp_chatbot_admin_email')) {
2841 update_option('qlcd_wp_chatbot_admin_email', $admin_email);
2842 }
2843 if(!get_option('qlcd_wp_chatbot_email_sub')) {
2844 update_option('qlcd_wp_chatbot_email_sub', sanitize_text_field('WPBot Support Mail'));
2845 }
2846 if(!get_option('qlcd_wp_site_search')) {
2847 update_option('qlcd_wp_site_search', sanitize_text_field('Site Search'));
2848 }
2849 if(!get_option('qlcd_wp_chatbot_email_sent')) {
2850 update_option('qlcd_wp_chatbot_email_sent', sanitize_text_field('Your email was sent successfully.Thanks!'));
2851 }
2852 if(!get_option('qlcd_wp_chatbot_email_fail')) {
2853 update_option('qlcd_wp_chatbot_email_fail', sanitize_text_field('Sorry! I could not send your mail! Please contact the webmaster.'));
2854 }
2855 if(!get_option('qlcd_wp_chatbot_relevant_post_link_openai')) {
2856 update_option('qlcd_wp_chatbot_relevant_post_link_openai', sanitize_text_field('Check the relevant pages for more details and up to date information:'));
2857 }
2858 if(!get_option('qlcd_wp_chatbot_notification_interval')) {
2859 update_option('qlcd_wp_chatbot_notification_interval', sanitize_text_field(5));
2860 }
2861 if(!get_option('qlcd_wp_chatbot_notifications')) {
2862 update_option('qlcd_wp_chatbot_notifications', maybe_serialize(array('Welcome to WPBot')));
2863 }
2864 if(!get_option('support_query')) {
2865 update_option('support_query', maybe_serialize(array('What is WPBot?')));
2866 }
2867 if(!get_option('support_ans')) {
2868 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.')));
2869 }
2870 if(!get_option('qlcd_wp_chatbot_search_option')) {
2871 update_option('qlcd_wp_chatbot_search_option', 'standard');
2872 }
2873 if(!get_option('wp_chatbot_index_count')) {
2874 update_option('wp_chatbot_index_count', 0);
2875 }
2876 if(!get_option('wp_chatbot_app_pages')) {
2877 update_option('wp_chatbot_app_pages', 0);
2878 }
2879 //messenger options.
2880 if(!get_option('enable_wp_chatbot_messenger')) {
2881 update_option('enable_wp_chatbot_messenger', '');
2882 }
2883 if(!get_option('enable_wp_chatbot_messenger_floating_icon')) {
2884 update_option('enable_wp_chatbot_messenger_floating_icon', '');
2885 }
2886 if(!get_option('qlcd_wp_chatbot_fb_app_id')) {
2887 update_option('qlcd_wp_chatbot_fb_app_id', '');
2888 }
2889 if(!get_option('qlcd_wp_chatbot_fb_page_id')) {
2890 update_option('qlcd_wp_chatbot_fb_page_id', '');
2891 }
2892 if(!get_option('qlcd_wp_chatbot_fb_color')) {
2893 update_option('qlcd_wp_chatbot_fb_color', '#0084ff');
2894 }
2895 if(!get_option('qlcd_wp_chatbot_fb_in_msg')) {
2896 update_option('qlcd_wp_chatbot_fb_in_msg', 'Welcome to WPBot!');
2897 }
2898 if(!get_option('qlcd_wp_chatbot_fb_out_msg')) {
2899 update_option('qlcd_wp_chatbot_fb_out_msg', 'You are not logged in');
2900 }
2901 //Skype option
2902 if(!get_option('enable_wp_chatbot_skype_floating_icon')) {
2903 update_option('enable_wp_chatbot_skype_floating_icon', '');
2904 }
2905 if(!get_option('enable_wp_chatbot_skype_id')) {
2906 update_option('enable_wp_chatbot_skype_id', '');
2907 }
2908 //Whats App
2909 if(!get_option('enable_wp_chatbot_whats')) {
2910 update_option('enable_wp_chatbot_whats', '');
2911 }
2912 if(!get_option('qlcd_wp_chatbot_whats_label')) {
2913 update_option('qlcd_wp_chatbot_whats_label', maybe_serialize(array('Chat with Us on WhatsApp')));
2914 }
2915 if(!get_option('enable_wp_chatbot_floating_whats')) {
2916 update_option('enable_wp_chatbot_floating_whats', '');
2917 }
2918 if(!get_option('qlcd_wp_chatbot_whats_num')) {
2919 update_option('qlcd_wp_chatbot_whats_num', '');
2920 }
2921 //Viber
2922 if(!get_option('enable_wp_chatbot_floating_viber')) {
2923 update_option('enable_wp_chatbot_floating_viber', '');
2924 }
2925 if(!get_option('qlcd_wp_chatbot_viber_acc')) {
2926 update_option('qlcd_wp_chatbot_viber_acc', '');
2927 }
2928 //Integration others
2929 if(!get_option('enable_wp_chatbot_floating_phone')) {
2930 update_option('enable_wp_chatbot_floating_phone', '');
2931 }
2932 if(!get_option('qlcd_wp_chatbot_phone')) {
2933 update_option('qlcd_wp_chatbot_phone', '');
2934 }
2935 if(!get_option('enable_wp_chatbot_floating_link')) {
2936 update_option('enable_wp_chatbot_floating_link', '');
2937 }
2938
2939 if(!get_option('qlcd_wp_chatbot_weblink')) {
2940 update_option('qlcd_wp_chatbot_weblink', '');
2941 }
2942 //Re-Tagetting
2943 if(!get_option('qlcd_wp_chatbot_ret_greet')) {
2944 update_option('qlcd_wp_chatbot_ret_greet', 'Hello');
2945 }
2946 if(!get_option('enable_wp_chatbot_exit_intent')) {
2947 update_option('enable_wp_chatbot_exit_intent', '');
2948 }
2949 if(!get_option('wp_chatbot_exit_intent_msg')) {
2950 update_option('wp_chatbot_exit_intent_msg', 'WAIT, WE HAVE A SPECIAL OFFER FOR YOU! Get Your 50% Discount Now. Use Coupon Code QC50 during checkout.');
2951 }
2952 if(!get_option('wp_chatbot_exit_intent_once')) {
2953 update_option('wp_chatbot_exit_intent_once', '');
2954 }
2955
2956 if(!get_option('enable_wp_chatbot_scroll_open')) {
2957 update_option('enable_wp_chatbot_scroll_open', '');
2958 }
2959 if(!get_option('wp_chatbot_scroll_open_msg')) {
2960 update_option('wp_chatbot_scroll_open_msg', 'WE HAVE A VERY SPECIAL OFFER FOR YOU! Get Your 50% Discount Now. Use Coupon Code QC50 during checkout.');
2961 }
2962 if(!get_option('wp_chatbot_scroll_percent')) {
2963 update_option('wp_chatbot_scroll_percent', 50);
2964 }
2965 if(!get_option('wp_chatbot_scroll_once')) {
2966 update_option('wp_chatbot_scroll_once', '');
2967 }
2968
2969 if(!get_option('enable_wp_chatbot_auto_open')) {
2970 update_option('enable_wp_chatbot_auto_open', '');
2971 }
2972
2973 if(!get_option('enable_wp_chatbot_ret_sound')) {
2974 update_option('enable_wp_chatbot_ret_sound', '');
2975 }
2976 if(!get_option('enable_wp_chatbot_sound_initial')) {
2977 update_option('enable_wp_chatbot_sound_initial', '');
2978 }
2979
2980
2981 if(!get_option('wp_chatbot_auto_open_msg')) {
2982 update_option('wp_chatbot_auto_open_msg', 'A SPECIAL OFFER FOR YOU! Get Your 50% Discount Now. Use Coupon Code QC50 during checkout.');
2983 }
2984 if(!get_option('wp_chatbot_auto_open_time')) {
2985 update_option('wp_chatbot_auto_open_time', 10);
2986 }
2987 if(!get_option('wp_chatbot_auto_open_once')) {
2988 update_option('wp_chatbot_auto_open_once', '');
2989 }
2990 if(!get_option('wp_chatbot_inactive_once')) {
2991 update_option('wp_chatbot_inactive_once', '');
2992 }
2993
2994 //To complete checkout.
2995 if(!get_option('enable_wp_chatbot_ret_user_show')) {
2996 update_option('enable_wp_chatbot_ret_user_show', '');
2997 }
2998 if(!get_option('wp_chatbot_auto_open_msg')) {
2999 update_option('wp_chatbot_checkout_msg', 'You have products in shopping cart, please complete your order.');
3000 }
3001 if(!get_option('wp_chatbot_inactive_time')) {
3002 update_option('wp_chatbot_inactive_time', 300);
3003 }
3004 if(!get_option('enable_wp_chatbot_inactive_time_show')) {
3005 update_option('enable_wp_chatbot_inactive_time_show', '');
3006 }
3007
3008 if(!get_option('wp_chatbot_proactive_bg_color')) {
3009 update_option('wp_chatbot_proactive_bg_color', '#ffffff');
3010 }
3011 if(!get_option('disable_wp_chatbot_feedback')) {
3012 update_option('disable_wp_chatbot_feedback','');
3013 }
3014 if(!get_option('disable_wp_chatbot_faq')) {
3015 update_option('disable_wp_chatbot_faq','');
3016 }
3017 if(!get_option('qlcd_wp_chatbot_feedback_label')) {
3018 update_option('qlcd_wp_chatbot_feedback_label',maybe_serialize(array('Send Feedback')));
3019 }
3020
3021 if(!get_option('enable_wp_chatbot_meta_title')) {
3022 update_option('enable_wp_chatbot_meta_title','');
3023 }
3024 if(!get_option('qlcd_wp_chatbot_meta_label')) {
3025 update_option('qlcd_wp_chatbot_meta_label','*New Messages');
3026 }
3027
3028 if(!get_option('disable_wp_chatbot_call_gen')) {
3029 update_option('disable_wp_chatbot_call_gen', '');
3030 }
3031
3032 if(!get_option('disable_wp_chatbot_site_search')) {
3033 update_option('disable_wp_chatbot_site_search', '');
3034 }
3035 if(!get_option('disable_wp_chatbot_call_sup')) {
3036 update_option('disable_wp_chatbot_call_sup', '');
3037 }
3038
3039 if(!get_option('qlcd_wp_chatbot_phone_sent')) {
3040 update_option('qlcd_wp_chatbot_phone_sent', 'Thanks for your phone number. We will call you ASAP!');
3041 }
3042 if(!get_option('qlcd_wp_chatbot_phone_fail')) {
3043 update_option('qlcd_wp_chatbot_phone_fail', 'Sorry! I could not collect your phone number!');
3044 }
3045 if(!get_option('qlcd_wp_chatbot_asking_search_keyword')){
3046 update_option('qlcd_wp_chatbot_asking_search_keyword', 'Please enter your keyword for searching');
3047 }
3048 if(!get_option('qlcd_wp_chatbot_found_result')){
3049 update_option('qlcd_wp_chatbot_found_result', 'We have found these results');
3050 }
3051 if(!get_option('enable_wp_chatbot_opening_hour')) {
3052 update_option('enable_wp_chatbot_opening_hour', '');
3053 }
3054 if(!get_option('enable_wp_chatbot_opening_hour')) {
3055 update_option('wpwbot_hours', array());
3056 }
3057
3058 if(!get_option('enable_wp_chatbot_dailogflow')) {
3059 update_option('enable_wp_chatbot_dailogflow', '');
3060 }
3061 if(!get_option('qlcd_wp_chatbot_dialogflow_client_token')) {
3062 update_option('qlcd_wp_chatbot_dialogflow_client_token', '');
3063 }
3064 if(!get_option('qlcd_wp_chatbot_dialogflow_defualt_reply')) {
3065 update_option('qlcd_wp_chatbot_dialogflow_defualt_reply', 'Sorry, I did not understand you. You may browse');
3066 }
3067 if(!get_option('openai_max_tokens')) {
3068 update_option('openai_max_tokens', '200');
3069 }
3070 if(!get_option('qcld_openai_suffix')) {
3071 update_option('qcld_openai_suffix', 'qcld');
3072 }
3073 if(!get_option('qlcd_wp_chatbot_dialogflow_agent_language')) {
3074 update_option('qlcd_wp_chatbot_dialogflow_agent_language', 'en');
3075 }
3076 if(!get_option('enable_wp_chatbot_post_content')) {
3077 update_option('enable_wp_chatbot_post_content', '1');
3078 }
3079 if(!get_option('openai_engines')) {
3080 update_option('openai_engines', 'gpt-4o');
3081 }
3082 // if(!get_option('skip_wp_greetings')) {
3083 update_option('skip_wp_greetings', '');
3084 //}
3085 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
3086 }
3087 }
3088 /*
3089 * Reset Options will be insert as defualt data
3090 */
3091 add_action('wp_ajax_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
3092 //add_action('wp_ajax_nopriv_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
3093 //Jarvis all option will be delete during uninstlling.
3094 if( !function_exists('qcld_wb_chatboot_delete_all_options') ){
3095 function qcld_wb_chatboot_delete_all_options(){
3096
3097 if ( ! current_user_can( 'manage_options' ) ) {
3098 wp_die( 'Unauthorized access' );
3099 }
3100
3101 if ( ! isset( $_POST['wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wpnonce'] ) ), 'wp_chatbot' ) ) {
3102 wp_die( 'No cheating' );
3103 }
3104 delete_option('disable_wp_chatbot');
3105 delete_option('disable_wp_chatbot_icon_animation');
3106 delete_option('disable_wp_chatbot_on_mobile');
3107 delete_option('qlcd_wp_chatbot_admin_email');
3108 delete_option('qlcd_wp_chatbot_from_email');
3109
3110 delete_option('disable_wp_chatbot_product_search');
3111 delete_option('disable_wp_chatbot_catalog');
3112 delete_option('disable_wp_chatbot_order_status');
3113 delete_option('disable_wp_chatbot_notification');
3114 delete_option('enable_wp_chatbot_rtl');
3115 delete_option('show_menu_after_greetings');
3116 delete_option('enable_chat_session');
3117
3118 delete_option('enable_wp_chatbot_mobile_full_screen');
3119 delete_option('wpbot_preloading_time');
3120 delete_option('disable_wp_chatbot_cart_item_number');
3121 delete_option('disable_wp_chatbot_featured_product');
3122 delete_option('disable_wp_chatbot_sale_product');
3123 delete_option('wp_chatbot_open_product_detail');
3124 delete_option('qlcd_wp_chatbot_product_orderby');
3125 delete_option('qlcd_wp_chatbot_product_order');
3126 delete_option('qlcd_wp_chatbot_ppp');
3127 delete_option('wp_chatbot_show_parent_category');
3128 delete_option('wp_chatbot_show_sub_category');
3129 delete_option('wp_chatbot_exclude_stock_out_product');
3130 delete_option('wp_chatbot_show_home_page');
3131 delete_option('qc_wpbot_menu_order');
3132
3133 delete_option('wp_chatbot_show_posts');
3134 delete_option('wp_chatbot_show_pages');
3135 delete_option('wp_chatbot_show_pages_list');
3136 delete_option('wp_chatbot_exclude_post_list');
3137 delete_option('wp_chatbot_show_wpcommerce');
3138 delete_option('qlcd_wp_chatbot_stop_words_name');
3139 delete_option('qlcd_wp_chatbot_stop_words');
3140 delete_option('qlcd_wp_chatbot_order_user');
3141 delete_option('wp_chatbot_icon');
3142 delete_option('wp_chatbot_floatingiconbg_color');
3143 delete_option('wp_chatbot_agent_image');
3144 delete_option('qcld_wb_chatbot_theme');
3145 delete_option('qcld_wb_chatbot_change_bg');
3146 delete_option('wp_chatbot_custom_css');
3147 delete_option('qlcd_wp_chatbot_host');
3148 delete_option('qlcd_wp_chatbot_agent');
3149 delete_option('qlcd_wp_chatbot_yes');
3150 delete_option('qlcd_wp_chatbot_no');
3151 delete_option('qlcd_wp_chatbot_or');
3152 delete_option('qlcd_wp_chatbot_sorry');
3153 delete_option('qlcd_wp_chatbot_agent_join');
3154 delete_option('qlcd_wp_chatbot_welcome');
3155 delete_option('qlcd_wp_chatbot_back_to_start');
3156 delete_option('qlcd_wp_chatbot_hi_there');
3157 delete_option('qlcd_wp_chatbot_hello');
3158 delete_option('qlcd_wp_chatbot_welcome_back');
3159 delete_option('qlcd_wp_chatbot_asking_name');
3160 delete_option('qlcd_wp_chatbot_name_greeting');
3161 delete_option('qlcd_wp_chatbot_i_am');
3162 delete_option('qlcd_wp_chatbot_wildcard_msg');
3163 delete_option('qlcd_wp_chatbot_empty_filter_msg');
3164 delete_option('qlcd_wp_chatbot_did_you_mean');
3165 delete_option('qlcd_wp_chatbot_wildcard_product');
3166 delete_option('qlcd_wp_chatbot_wildcard_catalog');
3167 delete_option('qlcd_wp_chatbot_featured_products');
3168 delete_option('qlcd_wp_chatbot_sale_products');
3169 delete_option('qlcd_wp_chatbot_wildcard_support');
3170 delete_option('qlcd_wp_chatbot_wildcard_site_search');
3171 delete_option('qlcd_wp_chatbot_messenger_label');
3172 delete_option('qlcd_wp_chatbot_product_success');
3173 delete_option('qlcd_wp_chatbot_product_fail');
3174 delete_option('qlcd_wp_chatbot_product_asking');
3175 delete_option('qlcd_wp_chatbot_product_suggest');
3176 delete_option('qlcd_wp_chatbot_product_infinite');
3177 delete_option('qlcd_wp_chatbot_load_more');
3178 delete_option('qlcd_wp_chatbot_wildcard_order');
3179 delete_option('qlcd_wp_chatbot_order_welcome');
3180 delete_option('qlcd_wp_chatbot_order_username_asking');
3181 delete_option('qlcd_wp_chatbot_order_username_password');
3182 delete_option('qlcd_wp_chatbot_support_welcome');
3183 delete_option('qlcd_wp_chatbot_support_email');
3184 delete_option('qlcd_wp_chatbot_asking_email');
3185 delete_option('qlcd_wp_chatbot_asking_msg');
3186 delete_option('qlcd_wp_chatbot_no_result');
3187 delete_option('qlcd_wp_chatbot_admin_email');
3188 delete_option('open_links_new_window');
3189 delete_option('qlcd_wp_chatbot_email_sub');
3190 delete_option('qlcd_wp_site_search');
3191 delete_option('qlcd_wp_chatbot_email_sent');
3192 delete_option('qlcd_wp_chatbot_support_phone');
3193 delete_option('qlcd_wp_chatbot_asking_phone');
3194 delete_option('qlcd_wp_chatbot_thank_for_phone');
3195 delete_option('qlcd_wp_chatbot_sys_key_help');
3196 delete_option('qlcd_wp_chatbot_sys_key_product');
3197 delete_option('qlcd_wp_chatbot_sys_key_catalog');
3198 delete_option('qlcd_wp_chatbot_sys_key_order');
3199 delete_option('qlcd_wp_chatbot_sys_key_support');
3200 delete_option('qlcd_wp_chatbot_sys_key_reset');
3201 delete_option('qlcd_wp_chatbot_sys_key_email');
3202 delete_option('qlcd_wp_chatbot_order_username_not_exist');
3203 delete_option('qlcd_wp_chatbot_order_username_thanks');
3204 delete_option('qlcd_wp_chatbot_order_password_incorrect');
3205 delete_option('qlcd_wp_chatbot_order_not_found');
3206 delete_option('qlcd_wp_chatbot_order_found');
3207 delete_option('qlcd_wp_chatbot_order_email_support');
3208 delete_option('qlcd_wp_chatbot_support_option_again');
3209 delete_option('qlcd_wp_chatbot_invalid_email');
3210 delete_option('qlcd_wp_chatbot_shopping_cart');
3211 delete_option('qlcd_wp_chatbot_add_to_cart');
3212 delete_option('qlcd_wp_chatbot_cart_link');
3213 delete_option('qlcd_wp_chatbot_checkout_link');
3214 delete_option('qlcd_wp_chatbot_cart_welcome');
3215 delete_option('qlcd_wp_chatbot_featured_product_welcome');
3216 delete_option('qlcd_wp_chatbot_viewed_product_welcome');
3217 delete_option('qlcd_wp_chatbot_latest_product_welcome');
3218 delete_option('qlcd_wp_chatbot_cart_title');
3219 delete_option('qlcd_wp_chatbot_cart_quantity');
3220 delete_option('qlcd_wp_chatbot_cart_price');
3221 delete_option('qlcd_wp_chatbot_no_cart_items');
3222 delete_option('qlcd_wp_chatbot_cart_updating');
3223 delete_option('qlcd_wp_chatbot_cart_removing');
3224 delete_option('qlcd_wp_chatbot_email_fail');
3225 delete_option('qlcd_wp_chatbot_relevant_post_link_openai');
3226 delete_option('support_query');
3227 delete_option('support_ans');
3228 delete_option('qlcd_wp_chatbot_notification_interval');
3229 delete_option('qlcd_wp_chatbot_notifications');
3230 delete_option( 'qlcd_wp_chatbot_search_option');
3231 delete_option( 'wp_chatbot_index_count');
3232 delete_option( 'wp_chatbot_app_pages');
3233 //messenger option
3234 delete_option( 'enable_wp_chatbot_messenger');
3235 delete_option( 'enable_wp_chatbot_messenger_floating_icon');
3236 delete_option( 'qlcd_wp_chatbot_fb_app_id');
3237 delete_option( 'qlcd_wp_chatbot_fb_page_id');
3238 delete_option( 'qlcd_wp_chatbot_fb_color');
3239 delete_option( 'qlcd_wp_chatbot_fb_in_msg');
3240 delete_option( 'qlcd_wp_chatbot_fb_out_msg');
3241 //skype option
3242 delete_option( 'enable_wp_chatbot_skype_floating_icon');
3243 delete_option( 'enable_wp_chatbot_skype_id');
3244 //whats app
3245 delete_option( 'enable_wp_chatbot_whats');
3246 delete_option( 'qlcd_wp_chatbot_whats_label');
3247 delete_option( 'enable_wp_chatbot_floating_whats');
3248 delete_option( 'qlcd_wp_chatbot_whats_num');
3249 // Viber
3250 delete_option( 'enable_wp_chatbot_floating_viber');
3251 delete_option( 'qlcd_wp_chatbot_viber_acc');
3252 //Integration others
3253 delete_option( 'enable_wp_chatbot_floating_phone');
3254 delete_option( 'qlcd_wp_chatbot_phone');
3255 delete_option( 'enable_wp_chatbot_floating_link');
3256 delete_option( 'qlcd_wp_chatbot_weblink');
3257 //Re Targetting
3258 delete_option( 'qlcd_wp_chatbot_ret_greet');
3259 delete_option( 'enable_wp_chatbot_exit_intent');
3260 delete_option( 'wp_chatbot_exit_intent_msg');
3261 delete_option( 'wp_chatbot_exit_intent_once');
3262
3263 delete_option( 'enable_wp_chatbot_scroll_open');
3264 delete_option( 'wp_chatbot_scroll_open_msg');
3265 delete_option( 'wp_chatbot_scroll_percent');
3266 delete_option( 'wp_chatbot_scroll_once');
3267
3268 delete_option( 'enable_wp_chatbot_auto_open');
3269 delete_option( 'enable_wp_chatbot_ret_sound');
3270 delete_option( 'enable_wp_chatbot_sound_initial');
3271 delete_option( 'disable_wp_chatbot_feedback');
3272 delete_option( 'disable_wp_chatbot_faq');
3273 delete_option( 'qlcd_wp_chatbot_feedback_label');
3274 delete_option( 'enable_wp_chatbot_meta_title');
3275 delete_option( 'qlcd_wp_chatbot_meta_label');
3276 delete_option( 'wp_chatbot_auto_open_msg');
3277 delete_option( 'wp_chatbot_auto_open_time');
3278 delete_option( 'wp_chatbot_auto_open_once');
3279 delete_option( 'wp_chatbot_inactive_once');
3280 delete_option( 'wp_chatbot_proactive_bg_color');
3281 delete_option( 'qlcd_wp_chatbot_phone_sent');
3282 delete_option( 'qlcd_wp_chatbot_phone_fail');
3283 delete_option('qlcd_wp_chatbot_asking_search_keyword');
3284 delete_option('qlcd_wp_chatbot_found_result');
3285 delete_option( 'disable_wp_chatbot_call_gen');
3286 delete_option( 'disable_wp_chatbot_site_search');
3287 delete_option( 'enable_wp_chatbot_post_content');
3288 delete_option( 'disable_wp_chatbot_call_sup');
3289
3290 delete_option( 'enable_wp_chatbot_ret_user_show');
3291 delete_option( 'enable_wp_chatbot_inactive_time_show');
3292 delete_option( 'wp_chatbot_inactive_time');
3293 delete_option( 'wp_chatbot_checkout_msg');
3294 delete_option( 'qlcd_wp_chatbot_shopper_demo_name');
3295 delete_option( 'qlcd_wp_chatbot_is_typing');
3296 delete_option( 'qlcd_wp_chatbot_send_a_msg');
3297 delete_option( 'qlcd_wp_chatbot_choose_option');
3298 delete_option( 'qlcd_wp_chatbot_viewed_products');
3299 delete_option( 'qlcd_wp_chatbot_help_welcome');
3300 delete_option( 'qlcd_wp_chatbot_help_msg');
3301 delete_option( 'qlcd_wp_chatbot_reset');
3302 delete_option( 'enable_wp_chatbot_opening_hour');
3303 delete_option( 'wpwbot_hours');
3304 delete_option( 'enable_wp_chatbot_dailogflow');
3305 delete_option( 'qlcd_wp_chatbot_dialogflow_client_token');
3306 delete_option( 'qlcd_wp_chatbot_dialogflow_defualt_reply');
3307 delete_option( 'qlcd_wp_chatbot_dialogflow_agent_language');
3308
3309 delete_option( 'qlcd_wp_chatbot_dialogflow_project_id');
3310 delete_option( 'wp_chatbot_df_api');
3311 delete_option( 'qlcd_wp_chatbot_dialogflow_project_key');
3312
3313 delete_option( 'wp_chatbot_bot_msg_bg_color');
3314 delete_option( 'wp_chatbot_bot_msg_text_color');
3315 delete_option( 'wp_chatbot_user_msg_bg_color');
3316 delete_option( 'wp_chatbot_user_msg_text_color');
3317 delete_option( 'wp_chatbot_buttons_bg_color');
3318 delete_option( 'wp_chatbot_buttons_text_color');
3319
3320 delete_option( 'wp_chatbot_buttons_bg_color_hover');
3321 delete_option( 'wp_chatbot_buttons_text_color_hover');
3322
3323 delete_option( 'wp_chatbot_theme_secondary_color');
3324 delete_option( 'wp_chatbot_theme_primary_color');
3325 delete_option( 'wp_chatbot_header_background_color');
3326 delete_option('wp_chatbot_font_size');
3327 delete_option('wp_chat_user_font_family');
3328 delete_option('wp_chat_bot_font_family');
3329 delete_option('wp_chatbot_bot_font');
3330 delete_option('wp_chatbot_user_font');
3331 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
3332 qcld_wb_chatboot_defualt_options();
3333 $html='Reset all options to default successfully.';
3334 wp_send_json($html);
3335 }
3336 }
3337
3338 if( !function_exists('wpbot_free_qc_upgrade_completed') ){
3339 function wpbot_free_qc_upgrade_completed( $upgrader_object, $options ) {
3340 // The path to our plugin's main file
3341 $our_plugin = plugin_basename( __FILE__ );
3342 // If an update has taken place and the updated type is plugins and the plugins element exists
3343 if( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) {
3344 // Iterate through the plugins being updated and check if ours is there
3345 foreach( $options['plugins'] as $plugin ) {
3346 if( $plugin == $our_plugin ) {
3347 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
3348 }
3349 }
3350 }
3351 update_option( 'qcld_openai_relevant_post', ['post','page'] );
3352 }
3353 }
3354 add_action( 'upgrader_process_complete', 'wpbot_free_qc_upgrade_completed', 10, 2 );
3355
3356
3357
3358 /**
3359 *
3360 * Open Ai integration
3361 *
3362 */
3363 if( !function_exists('wpbot_openAi_setting_func') ){
3364 function wpbot_openAi_setting_func (){
3365
3366 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/admin/templates/ai-admin.php");
3367 // require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."qcld-openai-bot.php");
3368
3369 }
3370 }
3371
3372 /**
3373 *
3374 * Function to load translation files.
3375 *
3376 */
3377
3378 if( !function_exists('wp_chatbot_lang_init') ){
3379 function wp_chatbot_lang_init() {
3380 load_plugin_textdomain( 'chatbot', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
3381 }
3382 }
3383 add_action( 'plugins_loaded', 'wp_chatbot_lang_init');
3384
3385 $wpbot_feedback = new Qcld_Wp_Usage_Feedback(
3386 __FILE__,
3387 'plugins@quantumcloud.com',
3388 false,
3389 true
3390
3391 );
3392 if( !function_exists('wpbot_help_page_callback_func') ){
3393 function wpbot_help_page_callback_func(){
3394 ?>
3395
3396
3397
3398 <div class="wrap qcld-main-wrapper">
3399 <div class="qcld-wp-chatbot-wrap-header">
3400 <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>
3401 <p><strong>Core Version:</strong> v<?php echo QCLD_wpCHATBOT_VERSION; ?></p>
3402 <ul class="qcld-wp-chatbot-wrap-version-wrapper">
3403 <li>
3404 <a class="wpchatbot-Upgrade" href="https://www.wpbot.pro/" target="_blank">Upgrade To Pro</a>
3405 </li>
3406 </ul>
3407 </div>
3408 <div class="qcld-wrap swpm-admin-menu-wrap">
3409 <div class="nav-tab-wrapper sld_nav_container wppt_nav_container qcld_help_wppt_nav_container">
3410 <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>
3411 <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>
3412 <a class="nav-tab sld_click_handle" id="general_debuggings" href="#general_debugging"><span class="wpwbot-admin-tab-icon "> <i class="fa fa-question-circle-o"></i> </span><?php echo esc_html('Troubleshooting & FAQ'); ?></a>
3413 </div>
3414 <div class="content_qcbot_help_secion">
3415 <div class=" wppt-settings-section" id="general_wp_nutshell" style="display:none;">
3416 <div class="content form-container qcbot_help_secion" style="">
3417 <!-- new Section -->
3418 <h3 class="qcld-wpbot-main-tabs-title"><?php echo esc_html__('WPBot – In a Nutshell', 'chatbot'); ?></h3>
3419 <p><?php echo esc_html__('This is by no means a comprehensive list of WPBot features. But knowing these core terms will help you understand how WPBot was designed to work.', 'chatbot'); ?></p>
3420 <div class="panel panel-default">
3421 <div class="panel-heading" role="tab" id="IntentheadingOne">
3422 <h4 class="panel-title">
3423 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#IntentcollapseOne" aria-expanded="false" aria-controls="IntentcollapseOne"> <?php esc_html_e('Intents', 'chatbot'); ?> </a>
3424 </h4>
3425 </div>
3426 <div id="IntentcollapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="IntentheadingOne">
3427 <div class="panel-body">
3428 <?php echo esc_html_e(' Intent is all about what the user wants to get out of the interaction. Whenever a user types something or clicks a button, the ChatBot will try to understand what the user wants and fulfill the request with appropriate responses.', 'chatbot'); ?></br></br>
3429 <?php echo esc_html_e('You have to create possible Intent Responses using different features of the WPBot so the bot can respond accordingly. You can create Responses for various Intents using:', 'chatbot'); ?><b>
3430 <?php echo esc_html_e('Simple Text Responses, Conversational form builder, FAQ, Site Search, Send an eMail, Newsletter Subscription, DialogFlow, OpenAI etc.', 'chatbot'); ?></b></br></br>
3431 <?php echo esc_html_e('Please check this article for', 'chatbot'); ?> <span class="wppt_nav_container qcld-plan-tab-text">
3432 <a href="#general_int"><?php echo esc_html_e('more details', 'chatbot'); ?></a> </span> <?php echo esc_html_e('on how you can create Intents and Responses.', 'chatbot'); ?>
3433 </div>
3434 </div>
3435 </div>
3436 <div class="panel panel-default">
3437 <div class="panel-heading" role="tab" id="headingSix">
3438 <h4 class="panel-title">
3439 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="false" aria-controls="collapseSix"> <?php esc_html_e('Start Menu', 'chatbot'); ?> </a>
3440 </h4>
3441 </div>
3442 <div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix">
3443 <div class="panel-body">
3444 <?php echo esc_html_e('While using a ChatBot, users can get lost or not know how to Interact with the Bot. That is why we have a Start menu to always give the user', 'chatbot'); ?> <b><?php echo esc_html_e('options to do more', 'chatbot'); ?></b>. <?php echo esc_html_e('From ChatBot->Settings->Start Menu you can drag Available Menu Items (Intents) to the Active Menu Items area.', 'chatbot'); ?></br></br>
3445 <?php echo esc_html_e('Besides the built-in Intents, you can also create custom Intents for your Start Menu using', 'chatbot'); ?> <b><?php echo esc_html_e('Simple Text Responses', 'chatbot'); ?></b> and <b><?php echo esc_html_e('Conversational form builder', 'chatbot'); ?></b>. <?php echo esc_html_e('You can create almost any kind of response with the combinations of the two.', 'chatbot'); ?></br></br>
3446 <?php echo esc_html_e('We recommend enabling', 'chatbot'); ?><b><?php echo esc_html_e(' Show Start Menu After Greetings ', 'chatbot'); ?></b><?php echo esc_html_e('from ChatBot Pro->Settings->General settings.', 'chatbot'); ?>
3447 </div>
3448 </div>
3449 </div>
3450 <div class="panel panel-default">
3451 <div class="panel-heading" role="tab" id="headingSeven">
3452 <h4 class="panel-title">
3453 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSeven" aria-expanded="false" aria-controls="collapseSeven"> <?php esc_html_e('Settings', 'chatbot'); ?> </a>
3454 </h4>
3455 </div>
3456 <div id="collapseSeven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSeven">
3457 <div class="panel-body">
3458 <?php echo esc_html_e('Head over to ChatBot Pro->Settings->General and make sure to Enable the Floating Icon. As soon as you do that, the ChatBot can start working for your users. Make sure to drag some items to the Active Menu area under the Start Menu.', 'chatbot'); ?></br></br>
3459 <?php echo esc_html_e('The ChatBot settings area is full of options. Do not be intimidated by that. You do not need to use all the options – just what you need. Head over to the Settings->', 'chatbot'); ?><b><?php echo esc_html_e('Icons and Themes', 'chatbot'); ?></b> <?php echo esc_html_e('for options to customize your ChatBot. You will also find options to embed the ChatBot on a page, click to chat, FAQ builder etc. under the Setting options.', 'chatbot'); ?>
3460 </div>
3461 </div>
3462 </div>
3463 <div class="panel panel-default">
3464 <div class="panel-heading" role="tab" id="headingEight">
3465 <h4 class="panel-title">
3466 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseEight" aria-expanded="false" aria-controls="collapseEight"> <?php esc_html_e('Language Center', 'chatbot'); ?> </a>
3467 </h4>
3468 </div>
3469 <div id="collapseEight" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingEight">
3470 <div class="panel-body">
3471 <?php echo esc_html_e('You can use the ChatBot in', 'chatbot'); ?> <b><?php echo esc_html_e('ANY language', 'chatbot'); ?></b>. <?php echo esc_html_e('Just translate the texts used by the ChatBot from the WordPress dashboard ChatBot Pro->', 'chatbot'); ?><b><?php echo esc_html_e('Language Center. Multi language', 'chatbot'); ?></b> <?php echo esc_html_e('module is available in the Master License..', 'chatbot'); ?>
3472 </div>
3473 </div>
3474 </div>
3475 <div class="panel panel-default">
3476 <div class="panel-heading" role="tab" id="headingtwo">
3477 <h4 class="panel-title">
3478 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapsetwo" aria-expanded="false" aria-controls="collapseOne"> <?php esc_html_e('Simple Text Responses', 'chatbot'); ?> </a>
3479 </h4>
3480 </div>
3481 <div id="collapsetwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingtwo">
3482 <div class="panel-body">
3483 <?php echo esc_html_e('You can use ChatBot Pro->Simple Text Responses to create', 'chatbot'); ?> <b><?php echo esc_html_e('text-based responses', 'chatbot'); ?></b> <?php echo esc_html_e('that users may ask your ChatBot. Just define the questions, answers, and some keywords and you are done. This is a much simpler', 'chatbot'); ?> <b><?php echo esc_html_e('alternative ', 'chatbot'); ?></b> <?php echo esc_html_e('to DialogFlow or OpenAI.', 'chatbot'); ?>
3484 </div>
3485 </div>
3486 </div>
3487 <div class="panel panel-default">
3488 <div class="panel-heading" role="tab" id="headingThree">
3489 <h4 class="panel-title">
3490 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <?php esc_html_e('Conversational Forms', 'chatbot'); ?> </a>
3491 </h4>
3492 </div>
3493 <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
3494 <div class="panel-body">
3495 <?php echo esc_html_e('Use conversational forms to collect information from the users. This is also great for Button driven workflow. Create conditional conversations and forms for a native WordPress ChatBot experience. Build Standard Forms, Dynamic Forms with', 'chatbot'); ?> <b> <?php echo esc_html_e('conditional fields, Calculators, Appointment booking', 'chatbot'); ?></b> <?php echo esc_html_e('etc.', 'chatbot'); ?>
3496 </div>
3497 </div>
3498 </div>
3499 <div class="panel panel-default">
3500 <div class="panel-heading" role="tab" id="headingten">
3501 <h4 class="panel-title">
3502 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseten" aria-expanded="false" aria-controls="collapseten"> <?php esc_html_e('Retargeting (Pro feature)', 'chatbot'); ?> </a>
3503 </h4>
3504 </div>
3505 <div id="collapseten" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingten">
3506 <div class="panel-body">
3507 <?php echo esc_html_e('Retargeting is a powerful feature to grab your user’s attention with motivating information (a sale, coupon, ebook etc.). You can trigger a Retargeting message and the ChatBot window will automatically', 'chatbot'); ?> <b> <?php echo esc_html_e('automatically ', 'chatbot'); ?></b><?php echo esc_html_e('open up with your message. You can trigger Retargeting for ', 'chatbot'); ?><b> <?php echo esc_html_e('Exit Intent, Exit Intent, Scroll Intent, Auto After “X” Seconds, Checkout', 'chatbot'); ?></b> <?php echo esc_html_e('etc.', 'chatbot'); ?>
3508 </div>
3509 </div>
3510 </div>
3511 <div class="panel panel-default">
3512 <div class="panel-heading" role="tab" id="headingFour">
3513 <h4 class="panel-title">
3514 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour"> <?php esc_html_e('OpenAI or DialogFlow', 'chatbot'); ?> </a>
3515 </h4>
3516 </div>
3517 <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
3518 <div class="panel-body">
3519 <?php echo esc_html_e('If you need a bot that can understand natural language better, use either OpenAI or DialogFlow. Between the two', 'chatbot'); ?> <b> <?php echo esc_html_e('DialogFlow', 'chatbot'); ?></b> <?php echo esc_html_e('is better if you want to', 'chatbot'); ?> <b> <?php echo esc_html_e('provide customer support', 'chatbot'); ?></b>. <?php echo esc_html_e('OpenAI is better at generic questions and training OpenAI also requires a large dataset. But you do not have to use either 3rd party service. Using OpenAI or DialogFlow requires some patience and', 'chatbot'); ?> <b> <?php echo esc_html_e('effort', 'chatbot'); ?></b>. <?php echo esc_html_e('You may very well achieve what you need using ', 'chatbot'); ?><b> <?php echo esc_html_e('Simple Text Responses', 'chatbot'); ?></b> <?php echo esc_html_e('and/or', 'chatbot'); ?> <b> <?php echo esc_html_e('Conversational form builder', 'chatbot'); ?></b> <?php echo esc_html_e('instead.', 'chatbot'); ?>
3520 </div>
3521 </div>
3522 </div>
3523 <div class="panel panel-default">
3524 <div class="panel-heading" role="tab" id="headingFive">
3525 <h4 class="panel-title">
3526 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFive" aria-expanded="false" aria-controls="collapseFive"> <?php esc_html_e('Getting Help', 'chatbot'); ?> </a>
3527 </h4>
3528 </div>
3529 <div id="collapseFive" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFive">
3530 <div class="panel-body">
3531 <?php echo esc_html_e('We have built-in Help section under each module. Please check them out and you will get many answers to the questions you may have. If you cannot find the answer to something particular, just contact us.', 'chatbot'); ?> <b><?php echo esc_html_e('Pro version ', 'chatbot'); ?></b><?php echo esc_html_e('users can open a support ticket from here. We are ', 'chatbot'); ?><b><?php echo esc_html_e('friendly ', 'chatbot'); ?></b><?php echo esc_html_e('and always here to help.', 'chatbot'); ?>
3532 </div>
3533 </div>
3534 </div>
3535 </div>
3536 </div>
3537 <div class=" wppt-settings-section" id="general_int">
3538 <div class="content form-container qcbot_help_secion" style="">
3539 <!-- new Section -->
3540 <h3 class="qcld-wpbot-main-tabs-title"><?php echo esc_html__('WPBot Interactions', 'chatbot'); ?></h3>
3541 <p><?php echo esc_html__('You can use WPBot to both answer user questions and collect information from the users.', 'chatbot'); ?></p>
3542 <h4><?php echo esc_html__('To create answers to user questions you can use:', 'chatbot'); ?></h4>
3543 <p> <b> <?php echo esc_html__('Simple Text Responses (built-in), FAQ(built-in), Site search(built-in), Product search(built-in Pro feature), DialogFlow(3rd Party) or OpenAI(3rd Party)', 'chatbot'); ?></b></p>
3544 <h4> <?php echo esc_html__('To collect information from your users you can use:', 'chatbot'); ?></h4>
3545 <p><?php echo esc_html__('Conversational forms(built-in), Mail us(built-in), Call me back(built-in), Collect feedback(built-in) features', 'chatbot'); ?></p>
3546 <hr>
3547 <p>
3548 <b> <?php echo esc_html__('When you activate the plugin, by default only the Site search option will work. Site search displays links to your website pages that contain the keywords in the user query. ', 'chatbot'); ?>
3549 </b></p>
3550 <p><b><?php echo esc_html__('To generate direct text responses, you need to use either Simple Text Responses or AI services. ', 'chatbot'); ?>
3551 </b></p>
3552 <hr>
3553 <h4><?php echo esc_html__('You can create user interactions in the following ways:', 'chatbot'); ?></h4>
3554 <div class="panel panel-default">
3555 <div class="panel-heading" role="tab" id="headingOne">
3556 <h4 class="panel-title">
3557 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"> <?php esc_html_e('Predefined intents - Built-in ChatBot Features', 'chatbot'); ?> </a>
3558 </h4>
3559 </div>
3560 <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
3561 <div class="panel-body">
3562 <?php esc_html_e('Predefined intents can work without integration to DialogFlow API and AI. These are readily available as soon as you install the plugin and can be turned on or off individually.', 'chatbot'); ?>
3563 <div class="section-container">
3564 <div class="wpb_column vc_column_container vc_col-sm-6">
3565 <div class="vc_column-inner ">
3566 <div class="wpb_wrapper">
3567 <div class="to-icon-box left txt-left">
3568 <div class="to-icon-txt fa-4x-txt ">
3569 <h3>
3570 <span>// </span><?php esc_html_e('Simple Text Responses', 'chatbot'); ?>
3571 </h3>
3572 <p><?php esc_html_e('Create unlimited text responses from your WordPress backend. The ChatBot uses advanced search algorithm for natural language phrase matching with user input.', 'chatbot'); ?> </p>
3573 </div>
3574 </div>
3575 <div class="to-icon-box left txt-left">
3576 <div class="to-icon-txt fa-4x-txt ">
3577 <h3>
3578 <span>// </span><?php esc_html_e('Send eMail, Call Me Back &amp; Feedback Collection', 'chatbot'); ?>
3579 </h3>
3580 <p><?php esc_html_e('Users can send a email to the site admin directly from the Chat window for customer support. The Call Me Back feature lets you get call requests from your customers which will be emailed to you. You can also use WPBot to collect Feedback from your customers regarding anything! You can disable/enable these features from the Start Menu.', 'chatbot'); ?></p>
3581 </div>
3582 </div>
3583 <div class="to-icon-box left txt-left">
3584 <div class="to-icon-txt fa-4x-txt ">
3585 <h3>
3586 <span>// </span><?php esc_html_e('Advanced Site Search', 'chatbot'); ?> <span class="qc_wpbot_pro">PRO</span>
3587 </h3>
3588 <p><?php esc_html_e('If no matching text response is found WPBot will conduct an advanced website search and try to match user queries with your website contents and show results.', 'chatbot'); ?> </p>
3589 </div>
3590 </div>
3591 </div>
3592 </div>
3593 </div>
3594 <div class="wpb_column vc_column_container vc_col-sm-6">
3595 <div class="vc_column-inner ">
3596 <div class="wpb_wrapper">
3597 <div class="to-icon-box left txt-left">
3598 <div class="to-icon-txt fa-4x-txt ">
3599 <h3>
3600 <span>// </span><?php esc_html_e('Frequently Asked Questions', 'chatbot'); ?>
3601 </h3>
3602 <p><?php esc_html_e('Create a set of Frequently Asked Questions or FAQ so users can quickly find answers to the most common questions they have.', 'chatbot'); ?></p>
3603 </div>
3604 </div>
3605 <div class="to-icon-box left txt-left">
3606 <div class="to-icon-txt fa-4x-txt ">
3607 <h3>
3608 <span>// </span>Ask for name, email, phone number etc.
3609 </h3>
3610 <p><?php esc_html_e('Asking for the name is the default workflow. In the pro version, you can also ask for an email and phone number if you want to or skip the Greetings part altogether and load any intent of your choice.', 'chatbot'); ?></p>
3611 </div>
3612 </div>
3613 <div class="to-icon-box left txt-left">
3614 <div class="to-icon-txt fa-4x-txt ">
3615 <h3>
3616 <span>// </span><?php esc_html_e('Newsletter Subscription', 'chatbot'); ?> <span class="qc_wpbot_pro">PRO</span>
3617 </h3>
3618 <p><?php esc_html_e('WPBot can prompt User for eMail subscription. Link this with your Retargeting ChatBot window popup and a special offer. People can register their email address that you can later export as CSV!', 'chatbot'); ?> <strong>GDPR compliant</strong> with unsubscribe option from the ChatBot! </p>
3619 </div>
3620 </div>
3621 </div>
3622 </div>
3623 </div>
3624 </div>
3625 </div>
3626 </div>
3627 </div>
3628 <div class="panel panel-default">
3629 <div class="panel-heading" role="tab" id="headingTwo">
3630 <h4 class="panel-title">
3631 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"><?php esc_html_e(' Menu Driven - Created with Conversational Form Builder Addon', 'chatbot'); ?> </a>
3632 </h4>
3633 </div>
3634 <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
3635 <div class="panel-body">
3636 <p><?php esc_html_e('Extend the Start Menu with the', 'chatbot'); ?> <strong><?php esc_html_e('powerful Conversational Forms', 'chatbot'); ?></strong>&nbsp;<?php esc_html_e(' Addon for WPBot. It extends WPBot’s functionality and adds the ability to create', 'chatbot'); ?> <strong><?php esc_html_e('conditional conversations', 'chatbot'); ?></strong> <?php esc_html_e('and/or', 'chatbot'); ?> <strong><?php esc_html_e('forms', 'chatbot'); ?></strong> <?php esc_html_e('for the WPBot. It is a visual,', 'chatbot'); ?> <strong><?php esc_html_e('drag and drop', 'chatbot'); ?></strong><?php esc_html_e(' form builder that is easy to use and very flexible. Supports conditional logic and use of variables to build all types of forms or just', 'chatbot'); ?> <strong><?php esc_html_e('menu driven', 'chatbot'); ?></strong>
3637 <strong><?php esc_html_e('conversations', 'chatbot'); ?> </strong><?php esc_html_e('with if else logic', 'chatbot'); ?> <strong>. </strong><?php esc_html_e('Conversations or forms can be', 'chatbot'); ?> <strong><?php esc_html_e('eMailed', 'chatbot'); ?></strong> <?php esc_html_e('to you and', 'chatbot'); ?> <strong><?php esc_html_e('saved in the database', 'chatbot'); ?></strong>.
3638 </p>
3639 <h4><?php esc_html_e('Conversational Form Builder Free or Pro version works with the WPBot Free or Pro versions.', 'chatbot'); ?></h4>
3640 <a class="FormBuilder" href="https://wordpress.org/plugins/conversational-forms/" target="_blank"><?php esc_html_e('Download Free Version', 'chatbot'); ?></a>
3641 <a class="FormBuilder" href="https://www.quantumcloud.com/products/conversations-and-form-builder/" target="_blank"><?php esc_html_e('Grab the Pro version', 'chatbot'); ?></a>
3642 <h4><?php esc_html_e('What Can You Do with it?', 'chatbot'); ?></h4>
3643 <p><?php esc_html_e('Conversation Forms allows you to create a wide variety of forms, that might include:', 'chatbot'); ?></p>
3644 <ul>
3645 <li><?php esc_html_e('Create menu or button driven conversations', 'chatbot'); ?></li>
3646 <li><?php esc_html_e('Conditional <strong>Menu Driven Conversations', 'chatbot'); ?></strong>
3647 <span class="qc_wpbot_pro" style="font-size: 9px;"><?php esc_html_e('PRO', 'chatbot'); ?></span>
3648 </li>
3649 <li><?php esc_html_e('Standard Contact Forms', 'chatbot'); ?></li>
3650 <li><?php esc_html_e('Dynamic,', 'chatbot'); ?> <strong><?php esc_html_e('conditional Forms', 'chatbot'); ?></strong> <?php esc_html_e('– where fields can change based on the user selections', 'chatbot'); ?> <span class="qc_wpbot_pro" style="font-size: 9px;">PRO</span>
3651 </li>
3652 <li>Job <strong><?php esc_html_e('Application Forms', 'chatbot'); ?></strong>
3653 </li>
3654 <li>
3655 <strong><?php esc_html_e('Lead Capture', 'chatbot'); ?></strong> <?php esc_html_e('Forms', 'chatbot'); ?>
3656 </li>
3657 <li><?php esc_html_e('Various types of', 'chatbot'); ?> <strong><?php esc_html_e('Calculators', 'chatbot'); ?></strong>
3658 <span class="qc_wpbot_pro" style="font-size: 9px;"><?php esc_html_e('PRO', 'chatbot'); ?></span>
3659 </li>
3660 <li><?php esc_html_e('Feedback', 'chatbot'); ?> <strong>Survey</strong><?php esc_html_e(' Forms etc.', 'chatbot'); ?> </li>
3661 </ul>
3662 </div>
3663 </div>
3664 </div>
3665 <div class="panel panel-default">
3666 <div class="panel-heading" role="tab" id="AIheadingThree">
3667 <h4 class="panel-title">
3668 <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#AIcollapseThree" aria-expanded="false" aria-controls="AIcollapseThree"> <?php esc_html_e('DialogFlow ES and CX, OpenAI', 'chatbot'); ?> </a>
3669 </h4>
3670 </div>
3671 <div id="AIcollapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="AIheadingThree">
3672 <div class="panel-body">
3673 <div class="section-container">
3674 <div class="wpb_column vc_column_container vc_col-sm-6">
3675 <div class="wpb_wrapper">
3676 <h3><?php esc_html_e('DialogFlow Essential', 'chatbot'); ?></h3>
3677 <?php esc_html_e('Intents created in Dialogflow give you the power to build a truly human like, intelligent and comprehensive chatbot. Build any type of Intents and Responses (including rich message responses) directly in DialogFlow and train the bot accordingly. When you create custom intents and responses in DialogFlow, WPBot will automatically display them when user inputs match with your Custom Intents along with the responses you created. You can also build Rich responses by enabling Facebook messenger Response option.', 'chatbot'); ?>
3678 <p><?php esc_html_e('In addition you can also Enable ', 'chatbot'); ?> <?php esc_html_e('Advanced Chained Question and Answers using follow up Intents, Contexts, Entities etc. and then have resulting answers from your users emailed to you. This feature lets you create a a series of questions in DialogFlow that will be asked by the bot and based on the user inputs a response will be displayed.', 'chatbot'); ?> <span class="qc_wpbot_pro" style="font-size: 9px;">PRO</span>
3679 </p>
3680 <p><?php esc_html_e('WPBot also supports Rich responses using Facebook Messenger integration. This allows you to display Image,', 'chatbot'); ?> Cards<?php esc_html_e(', Quick Text Reply or Custom PayLoad inside the ChatBot window. You can also insert an ', 'chatbot'); ?><?php esc_html_e('image', 'chatbot'); ?><?php esc_html_e(' or', 'chatbot'); ?> <?php esc_html_e('youtube video', 'chatbot'); ?><?php esc_html_e(' link inside the DialogFlow responses and they will be automatically rendered by the WPBot!', 'chatbot'); ?> <span class="qc_wpbot_pro" style="font-size: 9px;"><?php esc_html_e('PRO', 'chatbot'); ?></span>
3681 </p>
3682 <h3><?php esc_html_e('OpenAI', 'chatbot'); ?></h3>
3683 <?php esc_html_e('Connect the ChatBot to OpenAI. OpenAI’s API provides access to GPT-3, for a wide variety of natural language tasks. Train your ChatBot with (pre-trained) GPT-3 to answer any user questions using. Select your preferred Engine from DaVinci, Ada, Curie or Babbag! Add your own API key to the addon to connect to your OpenAI account. To go live, you need to apply to OpenAI.', 'chatbot'); ?>
3684 </div>
3685 </div>
3686 <div class="wpb_column vc_column_container vc_col-sm-6">
3687 <div class="wpb_wrapper">
3688 <h3><?php esc_html_e('DialogFlow CX', 'chatbot'); ?> <span class="qc_wpbot_pro">PRO</span>
3689 </h3>
3690 <p><?php esc_html_e('WPBot supports', 'chatbot'); ?> <?php esc_html_e('visual workflow builder', 'chatbot'); ?><?php esc_html_e(' Dialogflow CX. It provides a new way of designing agents, taking a state machine approach to agent design. This gives you clear and explicit control over a conversation, a better end-user experience, and a better development', 'chatbot'); ?> <?php esc_html_e('workflow', 'chatbot'); ?>. </p>
3691 <ul>
3692 <li>
3693 <?php esc_html_e('Console visualization', 'chatbot'); ?><?php esc_html_e(': A new', 'chatbot'); ?> <?php esc_html_e('visual builder', 'chatbot'); ?> <?php esc_html_e('makes building and maintaining agents easier. Conversation paths are graphed as a state machine model, which makes conversations easier to design, enhance, and maintain.', 'chatbot'); ?>
3694 </li>
3695 <li>
3696 <?php esc_html_e('Intuitive and powerful conversation control', 'chatbot'); ?>: <?php esc_html_e('Conversation states and state transitions are first-class types that provide explicit and powerful control over conversation paths. You can clearly define a series of steps that you want the end-user to go through.', 'chatbot'); ?>
3697 </li>
3698 <li>
3699 <?php esc_html_e('Flows for agent partitions', 'chatbot'); ?>: <?php esc_html_e('With flows, you can partition your agent into smaller conversation topics. Different team members can own different flows, which makes large and complex agents easy to build.', 'chatbot'); ?>
3700 </li>
3701 <img style="width:100%" src="<?php echo esc_url( QCLD_wpCHATBOT_IMG_URL . '/dialogflow-cx-1024x676.jpg' );?>" alt="Dialogflow CX">
3702 </ul>
3703 </div>
3704 </div>
3705 </div>
3706 </div>
3707 </div>
3708 </div>
3709 </div>
3710 </div>
3711 <div class=" wppt-settings-section" id="general_debugging" style="display:none;">
3712 <div class="content form-container qcbot_help_secion" >
3713 <div class="" >
3714 <h3 class="qcld-wpbot-main-tabs-title"><?php esc_html_e('Tips', 'chatbot'); ?></h3>
3715 <h3><?php esc_html_e('Tutorial', 'chatbot'); ?></h3>
3716 <p><?php esc_html_e('You will find some helpful video tutorials and the ChatBot workflow on this', 'chatbot'); ?> <a href="https://www.wpbot.pro/chatbot-workflow/" target="_blank">page</a>.</p>
3717 <h3><?php esc_html_e('Simple Text Responses', 'chatbot'); ?></h3>
3718 <p><?php esc_html_e('Create simple text responses easily for your chatbot. The ChatBot will use advanced search algorithm for natural language phrase matching with user input. You can also adjust the Phrase matching accuracy for better user experience.', 'chatbot'); ?></p>
3719 <h3><?php esc_html_e('Setting Updates', 'chatbot'); ?></h3>
3720 <p><?php esc_html_e('After making changes in the language center or settings, please type reset and hit enter in the ChatBot to start testing from the beginning or open a new Incognito window (Ctrl+Shit+N in chrome).', 'chatbot'); ?></p>
3721 <h3><?php esc_html_e('Note', 'chatbot'); ?></h3>
3722 <p><?php esc_html_e('You could use &lt;br&gt; tag in Language Center & Dialogflow Responses for line break.', 'chatbot'); ?></p>
3723 </div>
3724 </div>
3725 <div class="content form-container qcbot_help_secion">
3726 <h3><?php esc_html_e('Problem: I changed language and/or some settings but do not see the changes.', 'chatbot'); ?></h3>
3727 <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>
3728 </div>
3729 <div class="content form-container qcbot_help_secion">
3730 <h3><?php esc_html_e('Problem: I cannot connect to the DialogFlow', 'chatbot'); ?></h3>
3731 <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>
3732 <?php esc_html_e('2. Make sure that you have connected to the correct Dialogflow agent', 'chatbot'); ?><br>
3733 <?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>
3734 <?php esc_html_e(' 4. Make sure that the Google Client Package is Installed on Your Website.<br>
3735 5. For DialogFlow agent region, try choosing any region other than the EU region which has known issues.<br>
3736 6. Make sure to download and import the sample DialogFlow agent to your agent<br>
3737 7. Test the ChatBot in the browser Incognito mode', 'chatbot'); ?>
3738 </p>
3739 </div>
3740 <div class="content form-container qcbot_help_secion" >
3741 <h3><?php esc_html_e('Problem: I am not getting emails from the ChatBot', 'chatbot'); ?></h3>
3742 <p>
3743 <?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'); ?>
3744 </p>
3745 </div>
3746 <div class="content form-container qcbot_help_secion" >
3747 <h3><?php esc_html_e('Problem: Simple text responses are not working or getting an error', 'chatbot'); ?></h3>
3748 <p>
3749 <?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'); ?>
3750 </p>
3751 </div>
3752 <div class="content form-container qcbot_help_secion">
3753 <h3><?php esc_html_e('Problem: I changed language or some other settings but do not see them when testing', 'chatbot'); ?></h3>
3754 <p>
3755 <?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'); ?>
3756 </p>
3757 </div>
3758 <div class="content form-container qcbot_help_secion">
3759 <h3><?php esc_html_e('Problem: The ChatBot is NOT working in the front end.', 'chatbot'); ?></h3>
3760 <p>
3761 <?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>
3762 <?php esc_html_e(' Also go to Simple Text Responses and press the Re-Index button.', 'chatbot'); ?></br>
3763 <?php esc_html_e(' After that try purging any cache and test the chatbot in Incognito mode', 'chatbot'); ?><br>
3764 <?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'); ?>
3765 </p>
3766 </div>
3767 <div class="content form-container qcbot_help_secion">
3768 <h3><?php esc_html_e('Problem: The ChatBot is stuck on typing or loading', 'chatbot'); ?></h3>
3769 <p>
3770 <?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>
3771 <?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>
3772 <?php esc_html_e('Also go to Simple Text Responses and press the Re-Index button.', 'chatbot'); ?></br>
3773 <?php esc_html_e('After that remember to test in a browser Incognito mode to avoid cache and cookies.', 'chatbot'); ?>
3774 </p>
3775 </div>
3776 <div class="content form-container qcbot_help_secion">
3777 <h3><?php esc_html_e('Problem: How do I add new conversations to the ChatBot?', 'chatbot'); ?></h3>
3778 <p><?php esc_html_e('Please check the plugin`s Help Section for details on this', 'chatbot'); ?></p>
3779 </div>
3780 <div class="content form-container qcbot_help_secion" >
3781 <h3><?php esc_html_e('Problem: How do I add Line Breaks?', 'chatbot'); ?></h3>
3782 <p><?php esc_html_e('Please use the &lt;br&gt; tag for line breaks.', 'chatbot'); ?></p>
3783 </div>
3784 <div class="content form-container qcbot_help_secion">
3785 <h3><?php esc_html_e('Problem: Are HTML tags supported?', 'chatbot'); ?> </h3>
3786 <p><?php esc_html_e('Yes, common HTML tags link link href, strong, br etc. are supported.', 'chatbot'); ?></p>
3787 </div>
3788 <div class="content form-container qcbot_help_secion">
3789 <h3><?php esc_html_e('Problem: I want to add images, GIFs, Videos', 'chatbot'); ?></h3>
3790 <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>
3791 </div>
3792 <div class="content form-container qcbot_help_secion">
3793 <h3><?php esc_html_e('How to disable Predefined Intent?', 'chatbot'); ?></h3>
3794 <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>
3795 </div>
3796 </div>
3797 </div>
3798 </div>
3799 </div>
3800 <script type="text/javascript">
3801 jQuery(document).ready(function($){
3802 var url=document.URL;
3803 var arr=url.split('#');
3804 var tab_tar = '.'+arr[1];
3805 setTimeout(function(){
3806 jQuery(tab_tar).trigger('click');
3807 }, 500);
3808 jQuery('.wppt_nav_container .nav-tab').on('click', function(e){
3809 e.preventDefault();
3810 var section_id = jQuery(this).attr('href');
3811 jQuery('.wppt_nav_container .nav-tab').removeClass('nav-tab-active');
3812 jQuery(this).addClass('nav-tab-active');
3813 jQuery('.wppt-settings-section').hide();
3814 jQuery('.wppt-settings-section').each(function(){
3815 jQuery(section_id).show();
3816 });
3817 });
3818 })
3819 </script>
3820 <?php
3821 }
3822 }
3823
3824 add_action('init', 'qc_wp_latest_update_check');
3825 if( !function_exists('qc_wp_latest_update_check') ){
3826 function qc_wp_latest_update_check(){
3827 global $wpdb;
3828 if (current_user_can( 'manage_options' )) {
3829 if (isset($_POST['str_nonce'])) {
3830 $sanitized_nonce = sanitize_text_field(wp_unslash($_POST['str_nonce']));
3831 if (wp_verify_nonce($sanitized_nonce, 'str-nonce')) {
3832
3833 if(!get_option('qc_wp_ludate_ck')){
3834 update_option('qlcd_wp_chatbot_support_phone', 'Leave your number. We will call you back!');
3835 update_option('qlcd_wp_chatbot_support_email', 'Send us Email');
3836 update_option('qlcd_wp_chatbot_wildcard_support', 'FAQ');
3837 update_option('qlcd_wp_chatbot_wildcard_site_search', 'Site Search');
3838 update_option('qc_wp_ludate_ck', 'done');
3839 }
3840
3841 if( ! get_option( 'wpbot-admin-notice-oninstallation' ) ){
3842 update_option('wpbot-admin-notice-oninstallation', 'show');
3843 }
3844
3845 if(!get_option('qc_wpb_simple_response_db_upgrade_free2')){
3846
3847 $collate = '';
3848 if ( $wpdb->has_cap( 'collation' ) ) {
3849
3850 if ( ! empty( $wpdb->charset ) ) {
3851
3852 $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
3853 }
3854 if ( ! empty( $wpdb->collate ) ) {
3855
3856 $collate .= " COLLATE $wpdb->collate";
3857
3858 }
3859 }
3860 //Bot Response Table
3861 $table1 = $wpdb->prefix.'wpbot_response';
3862 $sql_sliders_Table1 = "
3863 CREATE TABLE IF NOT EXISTS `$table1` (
3864 `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
3865 `query` TEXT NOT NULL,
3866 `keyword` TEXT NOT NULL,
3867 `response` TEXT NOT NULL,
3868 `category` varchar(256) NOT NULL,
3869 `intent` varchar(256) NOT NULL,
3870 `custom` varchar(256) NOT NULL,
3871 `lang` varchar(25) NULL,
3872 FULLTEXT(`query`, `keyword`, `response`)
3873 ) $collate AUTO_INCREMENT=1 ENGINE=InnoDB";
3874
3875 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
3876 dbDelta( $sql_sliders_Table1 );
3877
3878 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
3879 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array('Did you mean?')));
3880 }
3881
3882 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
3883 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array('Did you mean?')));
3884 }
3885
3886 $sqlqry = $wpdb->get_results( $wpdb->prepare( "select * from $table1 where id = %d", 1 ) ); //DB Call OK, No Caching OK
3887 if(empty($sqlqry)){
3888
3889 $query = 'What Can WPBot do for you?';
3890 $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!';
3891
3892 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
3893 $format = array('%s','%s', '%s', '%s');
3894 $wpdb->insert($table1,$data,$format); //DB Call OK, No Caching OK
3895 }
3896
3897 update_option('qc_wpb_simple_response_db_upgrade_free2', 'done');
3898
3899 }
3900
3901 if(!get_option('qc_wp_db_engine_update_free')){
3902
3903 $table1 = $wpdb->prefix.'wpbot_response';
3904
3905 // phpcs:ignore
3906 $wpdb->query("ALTER TABLE $table1 ENGINE = InnoDB");
3907
3908 update_option('qc_wp_db_engine_update_free', 'done');
3909 }
3910 if(!get_option('qc_wp_db_engine_update_free_unassign')){
3911
3912 $table1 = $wpdb->prefix.'wpbot_response';
3913
3914 // phpcs:ignore
3915 $wpdb->query("ALTER TABLE $table1 CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;");
3916
3917 update_option('qc_wp_db_engine_update_free_unassign', 'done');
3918 }
3919
3920 if(isset($_POST['qc_bot_str_query']) && $_POST['qc_bot_str_query']!='' && !class_exists('Qcld_str_pro')){
3921
3922
3923 if ( ! isset( $_POST['str_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['str_nonce'] ) ), 'str-nonce' ) ) {
3924 die( esc_html__( 'Security check failed', 'chatbot' ) );
3925 }
3926 $query = sanitize_text_field(wp_unslash($_POST['qc_bot_str_query']));
3927 $keyword = sanitize_text_field(wp_unslash($_POST['qc_bot_str_keyword']));
3928 $intent = sanitize_text_field(wp_unslash($_POST['qc_bot_str_intent']));
3929
3930 $category = '';
3931
3932 $response = wp_kses(wp_unslash($_POST['qc_bot_str_response']), 'post');
3933
3934 $table = $wpdb->prefix.'wpbot_response';
3935 $data = array('query' => $query, 'keyword' => $keyword, 'response'=> $response, 'intent'=> $intent, 'category'=> $category);
3936 $format = array('%s','%s', '%s', '%s', '%s');
3937
3938 if(isset($_POST['qc_bot_str_id']) && $_POST['qc_bot_str_id']!=''){
3939 $id = sanitize_text_field($_POST['qc_bot_str_id']);
3940 $where = array('id'=>$id);
3941 $whereformat = array('%d');
3942 $wpdb->update( $table, $data, $where, $format, $whereformat ); //DB Call OK, No Caching OK
3943 }else{
3944 $wpdb->insert($table,$data,$format); //DB Call OK, No Caching OK
3945 }
3946
3947 qcld_mysql_remove_existing_indexes();
3948
3949 // phpcs:ignore
3950 $wpdb->query("ALTER TABLE $table ADD FULLTEXT(`query`, `keyword`, `response`)");
3951
3952 wp_redirect(admin_url('admin.php?page=simple-text-response'));exit;
3953
3954 }
3955 $table = $wpdb->prefix.'wpbot_response';
3956
3957 if(isset($_POST['qc-re-index'])){
3958
3959 qcld_mysql_remove_existing_indexes();
3960
3961 // phpcs:ignore
3962 $wpdb->query("ALTER TABLE $table ADD FULLTEXT(`query`, `keyword`)");
3963
3964 add_action('admin_notices', 'general_admin_notice_str' );
3965
3966 }
3967 if(isset($_POST['qc_bot_str_weight']) && $_POST['qc_bot_str_weight']!=''){
3968 $weight = sanitize_text_field($_POST['qc_bot_str_weight']);
3969 update_option('qc_bot_str_weight', $weight);
3970 }
3971 if(isset($_POST['qc_bot_str_remove_stopwords']) && $_POST['qc_bot_str_remove_stopwords']!=''){
3972
3973 $stopwords = sanitize_text_field($_POST['qc_bot_str_remove_stopwords']);
3974 update_option('qc_bot_str_remove_stopwords', '1');
3975 }
3976 if(isset($_POST['qc_bot_str_fields']) && !empty($_POST['qc_bot_str_fields'])){
3977 $table = $wpdb->prefix.'wpbot_response';
3978 $fields = rest_sanitize_array($_POST['qc_bot_str_fields']);
3979 update_option('qc_bot_str_fields', $fields);
3980 qcld_mysql_remove_existing_indexes();
3981
3982 if($fields && !empty($fields)){
3983
3984 // phpcs:ignore
3985 $wpdb->query("ALTER TABLE $table ADD FULLTEXT(".implode(', ', $fields).")");
3986
3987 }
3988 }
3989
3990 if(!get_option('wpbot_preloading_time')) {
3991 update_option('wpbot_preloading_time', '0.5');
3992 }
3993 }
3994 }
3995 }
3996 }
3997 if( !function_exists('general_admin_notice_str') ){
3998 function general_admin_notice_str(){
3999 if ( isset($_GET['page']) && $_GET['page'] == 'simple-text-response' ) {
4000 echo '<div class="notice notice-success is-dismissible">
4001 <p>Re-Indexing has been completed!</p>
4002 </div>';
4003 }
4004 }
4005 }
4006 }
4007 if( !function_exists('qcld_wpbot_simple_response_intent') ){
4008 function qcld_wpbot_simple_response_intent(){
4009 global $wpdb;
4010 $table = $wpdb->prefix.'wpbot_response';
4011 $results = $wpdb->get_results("SELECT `intent` FROM `$table` WHERE 1 and `intent` !=''"); //DB Call OK, No Caching OK
4012 $response = array();
4013 if(!empty($results)){
4014 foreach($results as $result){
4015 $response[] = $result->intent;
4016 }
4017 }
4018 return $response;
4019 }
4020 }
4021 if( !function_exists('qcld_mysql_remove_existing_indexes') ){
4022 function qcld_mysql_remove_existing_indexes(){
4023 global $wpdb;
4024 $table = $wpdb->prefix.'wpbot_response';
4025
4026 $results = $wpdb->get_results("SHOW INDEX FROM $table"); //DB Call OK, No Caching OK
4027 $indexes = array();
4028 foreach($results as $result){
4029
4030
4031
4032 if("PRIMARY" != $result->Key_name && !in_array($result->Key_name, $indexes)){
4033
4034 // phpcs:ignore
4035 $wpdb->query("ALTER TABLE $table DROP INDEX `".$result->Key_name."`;");
4036
4037 $indexes[] = $result->Key_name;
4038 }
4039
4040 }
4041 }
4042 }
4043
4044 add_action( 'activated_plugin', 'qc_wpbotfree_activation_redirect' );
4045 if( !function_exists('qc_wpbotfree_activation_redirect') ){
4046 function qc_wpbotfree_activation_redirect( $plugin ){
4047 $screen = get_current_screen();
4048 if( ( isset( $screen->base ) && $screen->base == 'plugins' ) && $plugin == plugin_basename( __FILE__ ) ) {
4049 if( $plugin == plugin_basename( __FILE__ ) ) {
4050 // phpcs:ignore
4051 exit( wp_redirect( esc_url( admin_url('admin.php?page=wpbot') ) ) );
4052 }
4053 }
4054 }
4055 }
4056
4057
4058