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

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