PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 7.1.5
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v7.1.5
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.1.5, at qcld-wpwbot.php

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