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

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