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

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

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