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

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

2,463 lines 145.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: ChatBot
4 * Plugin URI: https://wordpress.org/plugins/chatbot/
5 * Description: ChatBot is a WordPress ChatBot plugin to provide quick support and email functionality.
6 * Donate link: https://www.quantumcloud.com
7 * Version: 3.7.3
8 * @author QuantumCloud
9 * Author: QuantumCloud
10 * Author URI: https://www.quantumcloud.com/
11 * Requires at least: 4.6
12 * Tested up to: 5.7
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.7.3');
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'), esc_html('Help'), '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_enqueue_script('jquery');
211 wp_enqueue_script( 'jquery-ui-draggable' );
212 wp_enqueue_script( 'jquery-ui-droppable' );
213 wp_enqueue_script('jquery-ui-core');
214 wp_enqueue_style( 'wp-color-picker');
215 wp_enqueue_script( 'wp-color-picker');
216 wp_enqueue_script( 'jquery-ui-sortable');
217 wp_register_script('qcld-wp-chatbot-cbpFWTabs', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/cbpFWTabs.js', basename(__FILE__)), array(), true);
218 wp_enqueue_script('qcld-wp-chatbot-cbpFWTabs');
219 wp_register_script('qcld-wp-chatbot-modernizr-custom', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/modernizr.custom.js', basename(__FILE__)), array(), true);
220 wp_enqueue_script('qcld-wp-chatbot-modernizr-custom');
221 wp_register_script('qcld-wp-chatbot-bootstrap-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/bootstrap.js', basename(__FILE__)), array('jquery'), true);
222 wp_enqueue_script('qcld-wp-chatbot-bootstrap-js');
223 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');
224 wp_enqueue_style('qcld-wp-chatbot-bootstrap-css');
225 //jquery time picker
226 wp_register_script('qcld-wp-chatbot-timepicker-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/jquery.timepicker.js', basename(__FILE__)), array('jquery'), true);
227 wp_enqueue_script('qcld-wp-chatbot-timepicker-js');
228 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');
229 wp_enqueue_style('qcld-wp-chatbot-timepicker-css');
230
231 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);
232
233 wp_enqueue_script('qcld-wp-chatbot-admin-js');
234 wp_localize_script('qcld-wp-chatbot-admin-js', 'ajax_object',
235 array('ajax_url' => admin_url('admin-ajax.php'),'image_path' => QCLD_wpCHATBOT_IMG_URL));
236 // WordPress Media library
237 wp_enqueue_media();
238 }
239 }
240
241
242
243 public function qcld_wb_chatbot_frontend_scripts()
244 {
245 global $wpcommerce, $wp_scripts, $wpdb;
246
247
248
249 $conversation_form_ids = array();
250 $conversation_form_names = array();
251
252 if(class_exists('Qcformbuilder_Forms_Admin')){
253 $results = $wpdb->get_results("SELECT * FROM ". $wpdb->prefix."wfb_forms where 1 and type='primary'");
254 if(!empty($results)){
255
256 foreach($results as $result){
257 $form = unserialize($result->config);
258 $conversation_form_ids[] = $form['ID'];
259 $conversation_form_names[] = $form['name'];
260 }
261
262 }
263 }
264
265 $wp_chatbot_obj = array(
266 'wp_chatbot_position_x' => get_option('wp_chatbot_position_x'),
267 'wp_chatbot_position_y' => get_option('wp_chatbot_position_y'),
268 'disable_icon_animation' => get_option('disable_wp_chatbot_icon_animation'),
269 'disable_featured_product' => get_option('disable_wp_chatbot_featured_product'),
270 'disable_product_search' => get_option('disable_wp_chatbot_product_search'),
271 'disable_catalog' => get_option('disable_wp_chatbot_catalog'),
272 'disable_order_status' => get_option('disable_wp_chatbot_order_status'),
273 'disable_sale_product' => get_option('disable_wp_chatbot_sale_product'),
274 'open_product_detail' => get_option('wp_chatbot_open_product_detail'),
275 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
276 'ajax_url' => admin_url('admin-ajax.php'),
277 'image_path' => QCLD_wpCHATBOT_IMG_URL,
278 'yes' => str_replace('\\', '',get_option('qlcd_wp_chatbot_yes')),
279 'no' => str_replace('\\', '',get_option('qlcd_wp_chatbot_no')),
280 'or' => str_replace('\\', '',get_option('qlcd_wp_chatbot_or')),
281 'host' => str_replace('\\', '',get_option('qlcd_wp_chatbot_host')),
282 'agent' => str_replace('\\', '',get_option('qlcd_wp_chatbot_agent')),
283 'agent_image' => get_option('wp_chatbot_agent_image'),
284 'agent_image_path' => $this->qcld_wb_chatbot_agent_icon(),
285 'shopper_demo_name' => str_replace('\\', '',get_option('qlcd_wp_chatbot_shopper_demo_name')),
286 'agent_join' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_agent_join'))),
287 'welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome'))),
288 'welcome_back' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome_back'))),
289 'hi_there' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_hi_there'))),
290 'asking_name' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_name'))),
291 'i_am' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_i_am'))),
292 'name_greeting' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_name_greeting'))),
293 'wildcard_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_msg'))),
294 'empty_filter_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_empty_filter_msg'))),
295 'did_you_mean' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_did_you_mean'))),
296 'is_typing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_is_typing'))),
297 'send_a_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_send_a_msg'))),
298 'viewed_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_viewed_products'))),
299 'shopping_cart' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_shopping_cart'))),
300 'cart_updating' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_updating'))),
301 'cart_removing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_removing'))),
302 'imgurl' => QCLD_wpCHATBOT_IMG_URL,
303 'sys_key_help' => get_option('qlcd_wp_chatbot_sys_key_help'),
304 'sys_key_product' => get_option('qlcd_wp_chatbot_sys_key_product'),
305 'sys_key_catalog' => get_option('qlcd_wp_chatbot_sys_key_catalog'),
306 'sys_key_order' => get_option('qlcd_wp_chatbot_sys_key_order'),
307 'sys_key_support' => get_option('qlcd_wp_chatbot_sys_key_support'),
308 'sys_key_reset' => get_option('qlcd_wp_chatbot_sys_key_reset'),
309 'help_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_welcome'))),
310 'back_to_start' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_back_to_start'))),
311 'help_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_msg'))),
312 'reset' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_reset'))),
313 'wildcard_product' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_product'))),
314 'wildcard_catalog' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_catalog'))),
315 'featured_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_featured_products'))),
316 'sale_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_sale_products'))),
317 'wildcard_order' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_order'))),
318 'wildcard_support' => get_option('qlcd_wp_chatbot_wildcard_support'),
319 'product_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_asking'))),
320 'product_suggest' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_suggest'))),
321 'product_infinite' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_infinite'))),
322 'product_success' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_success'))),
323 'product_fail' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_fail'))),
324 'support_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_welcome'))),
325 'support_email' => get_option('qlcd_wp_chatbot_support_email'),
326 'support_option_again' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_option_again'))),
327 'asking_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_email'))),
328 'asking_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_msg'))),
329 'no_result' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_no_result'))),
330 'support_phone' => get_option('qlcd_wp_chatbot_support_phone'),
331 'asking_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_phone'))),
332 'thank_for_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_thank_for_phone'))),
333 'support_query' =>$this->qcld_wb_chatbot_str_replace(unserialize( get_option('support_query'))),
334 'support_ans' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('support_ans'))),
335 'notification_interval' => get_option('qlcd_wp_chatbot_notification_interval'),
336 'notifications' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_notifications'))),
337 'order_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_welcome'))),
338 'order_username_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_asking'))),
339 'order_username_password' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_password'))),
340 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
341 'order_login' => is_user_logged_in(),
342 'order_nonce' => wp_create_nonce("wpwbot-order-nonce"),
343 'order_email_support' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_email_support'))),
344 'email_fail' => str_replace('\\', '', get_option('qlcd_wp_chatbot_email_fail')),
345 'invalid_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_invalid_email'))),
346 'stop_words' => str_replace('\\', '', get_option('qlcd_wp_chatbot_stop_words')),
347 'currency_symbol' => '',
348 'enable_messenger' => get_option('enable_wp_chatbot_messenger'),
349 'messenger_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_messenger_label'))),
350 'fb_page_id' => get_option('qlcd_wp_chatbot_fb_page_id'),
351 'enable_skype' => get_option('enable_wp_chatbot_skype'),
352 'enable_whats' => get_option('enable_wp_chatbot_whats'),
353 'whats_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_whats_label'))),
354 'whats_num' => get_option('qlcd_wp_chatbot_whats_num'),
355 'ret_greet' => get_option('qlcd_wp_chatbot_ret_greet'),
356 'enable_exit_intent' => get_option('enable_wp_chatbot_exit_intent'),
357 'exit_intent_msg' => str_replace('\\', '', get_option('wp_chatbot_exit_intent_msg')),
358 'exit_intent_once' => get_option('wp_chatbot_exit_intent_once'),
359 'enable_scroll_open' => get_option('enable_wp_chatbot_scroll_open'),
360 'scroll_open_msg' => str_replace('\\', '', get_option('wp_chatbot_scroll_open_msg')),
361 'scroll_open_percent' => get_option('wp_chatbot_scroll_percent'),
362 'scroll_open_once' => get_option('wp_chatbot_scroll_once'),
363 'enable_auto_open' => get_option('enable_wp_chatbot_auto_open'),
364 'auto_open_msg' => str_replace('\\', '', get_option('wp_chatbot_auto_open_msg')),
365 'auto_open_time' => get_option('wp_chatbot_auto_open_time'),
366 'auto_open_once' => get_option('wp_chatbot_auto_open_once'),
367 'proactive_bg_color' => get_option('wp_chatbot_proactive_bg_color'),
368 'disable_feedback' => get_option('disable_wp_chatbot_feedback'),
369 'disable_faq' => get_option('disable_wp_chatbot_faq'),
370 'feedback_label' =>$this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_feedback_label'))),
371 'enable_meta_title' =>get_option('enable_wp_chatbot_meta_title'),
372 'meta_label' =>str_replace('\\', '', get_option('qlcd_wp_chatbot_meta_label')),
373 'phone_number' => get_option('qlcd_wp_chatbot_phone'),
374 'disable_site_search' => get_option('disable_wp_chatbot_site_search'),
375 'site_search' => get_option('qlcd_wp_site_search'),
376 'call_gen' => get_option('disable_wp_chatbot_call_gen'),
377 'call_sup' => get_option('disable_wp_chatbot_call_sup'),
378 'enable_ret_sound' => get_option('enable_wp_chatbot_ret_sound'),
379 'enable_ret_user_show' => get_option('enable_wp_chatbot_ret_user_show'),
380 'enable_inactive_time_show' => get_option('enable_wp_chatbot_inactive_time_show'),
381 'ret_inactive_user_once' => get_option('wp_chatbot_inactive_once'),
382 'mobile_full_screen' => get_option('enable_wp_chatbot_mobile_full_screen'),
383 'botpreloadingtime' => (get_option('wpbot_preloading_time')?get_option('wpbot_preloading_time'):100),
384 'inactive_time' => get_option('wp_chatbot_inactive_time'),
385 'checkout_msg' => str_replace('\\', '', get_option('wp_chatbot_checkout_msg')),
386 'ai_df_enable' => get_option('enable_wp_chatbot_dailogflow'),
387 'ai_df_token' => get_option('qlcd_wp_chatbot_dialogflow_client_token'),
388 'df_defualt_reply' => str_replace('\\', '', get_option('qlcd_wp_chatbot_dialogflow_defualt_reply')),
389 'df_agent_lan' => get_option('qlcd_wp_chatbot_dialogflow_agent_language'),
390 'start_menu' => wp_unslash(get_option('qc_wpbot_menu_order')),
391 'conversation_form_ids' => $conversation_form_ids,
392 'conversation_form_names' => $conversation_form_names,
393 'df_api_version' => (get_option('wp_chatbot_df_api')==''?'v1':get_option('wp_chatbot_df_api')),
394 'v2_client_url'=> esc_url(get_site_url().'/?action=qcld_dfv2_api'),
395 'show_menu_after_greetings'=> (get_option('show_menu_after_greetings')!=''?get_option('show_menu_after_greetings'):0),
396
397 );
398 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);
399 wp_enqueue_script('qcld-wp-chatbot-slimscroll-js');
400 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);
401 wp_enqueue_script('qcld-wp-chatbot-jquery-cookie');
402 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);
403 wp_enqueue_script('qcld-wp-chatbot-magnify-popup');
404 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);
405 wp_enqueue_script('qcld-wp-chatbot-plugin');
406 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);
407 wp_enqueue_script('qcld-wp-chatbot-front-js');
408 wp_localize_script('qcld-wp-chatbot-front-js', 'wp_chatbot_obj', $wp_chatbot_obj);
409 //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);
410 //wp_enqueue_script('qcld-wp-chatbot-frontend');
411 //wp_localize_script('qcld-wp-chatbot-frontend', 'wp_chatbot_obj', $wp_chatbot_obj);
412 wp_localize_script('qcld-wp-chatbot-frontend', 'wp_chatbot_obj', $wp_chatbot_obj);
413 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');
414 wp_enqueue_style('qcld-wp-chatbot-common-style');
415
416 if(get_option('wp_chatbot_floatingiconbg_color')!="") {
417 $custom_colors = ".wp-chatbot-ball{
418 background: ". get_option('wp_chatbot_floatingiconbg_color')." !important;
419 }
420 .wp-chatbot-ball:hover, .wp-chatbot-ball:focus{
421 background: ".get_option('wp_chatbot_floatingiconbg_color')." !important;
422 }";
423 wp_add_inline_style( 'qcld-wp-chatbot-common-style', $custom_colors );
424 }
425
426
427 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');
428 wp_enqueue_style('qcld-wp-chatbot-magnific-popup');
429 $qcld_wb_chatbot_theme = get_option('qcld_wb_chatbot_theme');
430 /* if (file_exists(QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/templates/' . $qcld_wb_chatbot_theme . '/style.css')) {
431 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');
432 wp_enqueue_style('qcld-wp-chatbot-style');
433 }*/
434 //Loading shortcode style
435 if (file_exists(QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/templates/' . $qcld_wb_chatbot_theme . '/shortcode.css')) {
436 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');
437 wp_enqueue_style('qcld-wp-chatbot-shortcode-style');
438 }
439 }
440 public function qcld_wb_chatbot_str_replace($messages=array()){
441 $refined_mesgses=array();
442 if(!empty($messages)){
443 foreach ($messages as $message){
444 $refined_msg=str_replace('\\', '', $message);
445 array_push($refined_mesgses,$refined_msg);
446 }
447 }
448 return $refined_mesgses;
449 }
450 //getting exact agent icon path
451 public function qcld_wb_chatbot_agent_icon(){
452
453 if(get_option('wp_chatbot_custom_agent_path')!="" && get_option('wp_chatbot_agent_image')=="custom-agent.png" ){
454 $wp_chatbot_custom_icon_path=get_option('wp_chatbot_custom_agent_path');
455 }
456 else if(get_option('wp_chatbot_custom_agent_path')!="" && get_option('wp_chatbot_agent_image')!="custom-agent.png"){
457 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.get_option('wp_chatbot_agent_image');
458 }
459 else
460 {
461 if(get_option('wp_chatbot_agent_image')!=''){
462 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.get_option('wp_chatbot_agent_image');
463 }else{
464 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.'custom-agent.png';
465 }
466
467 }
468
469 return $wp_chatbot_custom_icon_path;
470 }
471 /**
472 * Render the admin page
473 */
474
475 public function qcld_wb_chatbot_admin_page()
476 {
477 global $wpcommerce;
478 $action = 'admin.php?page=wpbot-panel';
479 require_once("admin_ui2.php");
480 }
481
482 public function qcld_wb_chatbot_admin_page_settings()
483 {
484 global $wpcommerce;
485 $action = 'admin.php?page=wpbot';
486 require_once("admin_ui.php");
487 }
488
489 public function qcld_wb_chatbot_dynamic_multi_option($options = array(), $option_name = "", $option_text = "")
490 {
491 ?>
492 <h4 class="qc-opt-title"><?php esc_html_e($option_text, 'wpchatbot'); ?></h4>
493 <div class="wp-chatbot-lng-items">
494 <?php
495 if (is_array($options) && count($options) > 0) {
496 foreach ($options as $key => $value) {
497 ?>
498 <div class="row" class="wp-chatbot-lng-item">
499 <div class="col-xs-10">
500 <input type="text"
501 class="form-control qc-opt-dcs-font"
502 name="<?php echo $option_name; ?>[]"
503 value="<?php echo str_replace('\\', '', $value); ?>">
504 </div>
505 <div class="col-xs-2">
506 <button type="button" class="btn btn-danger btn-sm wp-chatbot-lng-item-remove">
507 <span class="glyphicon glyphicon-remove"></span>
508 </button>
509 </div>
510 </div>
511 <?php
512 }
513 } else { ?>
514 <div class="row" class="wp-chatbot-lng-item">
515 <div class="col-xs-10">
516 <input type="text"
517 class="form-control qc-opt-dcs-font"
518 name="<?php echo $option_name; ?>[]"
519 value="<?php echo $option_text; ?>">
520 </div>
521 <div class="col-xs-2">
522 <span class="wp-chatbot-lng-item-remove"><?php esc_html_e('X', 'wpchatbot'); ?></span>
523 </div>
524 </div>
525 <?php } ?>
526 </div>
527 <div class="row">
528 <div class="col-sm-2 col-sm-offset-10">
529 <button type="button" class="btn btn-success btn-sm wp-chatbot-lng-item-add"> <span class="glyphicon glyphicon-plus"></span> </button>
530 </div>
531 </div>
532 <?php
533 }
534
535 function qcld_wb_chatbot_save_options()
536 {
537 //global $wpcommerce;
538 if (isset($_POST['_wpnonce']) && $_POST['_wpnonce']) {
539 wp_verify_nonce($_POST['_wpnonce'], 'wp_chatbot');
540 // Check if the form is submitted or not
541 if (isset($_POST['submit'])) {
542 //wpwboticon position settings.
543 if (isset($_POST["wp_chatbot_position_x"])) {
544 $wp_chatbot_position_x = intval(($_POST["wp_chatbot_position_x"]));
545 update_option('wp_chatbot_position_x', $wp_chatbot_position_x);
546 }
547 if (isset($_POST["wp_chatbot_position_y"])) {
548 $wp_chatbot_position_y = intval(($_POST["wp_chatbot_position_y"]));
549 update_option('wp_chatbot_position_y', $wp_chatbot_position_y);
550 }
551 //product search options
552 if(isset($_POST['qlcd_wp_chatbot_search_option'])){
553 $qlcd_wp_chatbot_search_option = sanitize_text_field($_POST['qlcd_wp_chatbot_search_option']);
554 update_option('qlcd_wp_chatbot_search_option', $qlcd_wp_chatbot_search_option);
555 }
556
557 //Enable /disable wpwbot
558 if(isset( $_POST["disable_wp_chatbot"])){
559 $disable_wp_chatbot = sanitize_text_field($_POST["disable_wp_chatbot"]);
560 }else{ $disable_wp_chatbot='';}
561 update_option('disable_wp_chatbot', wp_unslash($disable_wp_chatbot));
562
563 if(isset( $_POST["qlcd_wp_chatbot_admin_email"])){
564 $qlcd_wp_chatbot_admin_email = sanitize_email($_POST["qlcd_wp_chatbot_admin_email"]);
565 }else{ $qlcd_wp_chatbot_admin_email='';}
566 update_option('qlcd_wp_chatbot_admin_email', wp_unslash($qlcd_wp_chatbot_admin_email));
567
568
569 if(isset( $_POST["qlcd_wp_chatbot_from_email"])){
570 $qlcd_wp_chatbot_from_email = sanitize_email($_POST["qlcd_wp_chatbot_from_email"]);
571 }else{ $qlcd_wp_chatbot_from_email='';}
572 update_option('qlcd_wp_chatbot_from_email', wp_unslash($qlcd_wp_chatbot_from_email));
573
574 if(isset( $_POST["disable_wp_chatbot_on_mobile"])) {
575 $disable_wp_chatbot_on_mobile = sanitize_text_field($_POST["disable_wp_chatbot_on_mobile"]);
576 }else{ $disable_wp_chatbot_on_mobile='';}
577 update_option('disable_wp_chatbot_on_mobile', wp_unslash($disable_wp_chatbot_on_mobile));
578 if(isset( $_POST["disable_wp_chatbot_product_search"])) {
579 $disable_wp_chatbot_product_search = sanitize_text_field($_POST["disable_wp_chatbot_product_search"]);
580 }else{ $disable_wp_chatbot_product_search='';}
581 update_option('disable_wp_chatbot_product_search', wp_unslash($disable_wp_chatbot_product_search));
582 if(isset( $_POST["disable_wp_chatbot_catalog"])) {
583 $disable_wp_chatbot_catalog= sanitize_text_field($_POST["disable_wp_chatbot_catalog"]);
584 }else{ $disable_wp_chatbot_catalog='';}
585 update_option('disable_wp_chatbot_catalog', wp_unslash($disable_wp_chatbot_catalog));
586 if(isset( $_POST["disable_wp_chatbot_order_status"])) {
587 $disable_wp_chatbot_order_status = sanitize_text_field($_POST["disable_wp_chatbot_order_status"]);
588 }else{ $disable_wp_chatbot_order_status='';}
589 update_option('disable_wp_chatbot_order_status', wp_unslash($disable_wp_chatbot_order_status));
590 if(isset( $_POST["disable_wp_chatbot_notification"])) {
591 $disable_wp_chatbot_notification = sanitize_text_field($_POST["disable_wp_chatbot_notification"]);
592 }else{ $disable_wp_chatbot_notification='1';}
593 update_option('disable_wp_chatbot_notification', wp_unslash($disable_wp_chatbot_notification));
594
595 if(isset( $_POST["enable_wp_chatbot_rtl"])) {
596 $enable_wp_chatbot_rtl = sanitize_text_field($_POST["enable_wp_chatbot_rtl"]);
597 }else{ $enable_wp_chatbot_rtl='';}
598 update_option('enable_wp_chatbot_rtl', wp_unslash($enable_wp_chatbot_rtl));
599
600 if(isset( $_POST["show_menu_after_greetings"])) {
601 $show_menu_after_greetings = sanitize_text_field($_POST["show_menu_after_greetings"]);
602 }else{ $show_menu_after_greetings='';}
603 update_option('show_menu_after_greetings', wp_unslash($show_menu_after_greetings));
604
605 if(isset( $_POST["enable_wp_chatbot_mobile_full_screen"])) {
606 $enable_wp_chatbot_mobile_full_screen = sanitize_text_field($_POST["enable_wp_chatbot_mobile_full_screen"]);
607 }else{ $enable_wp_chatbot_mobile_full_screen='';}
608 update_option('enable_wp_chatbot_mobile_full_screen', wp_unslash($enable_wp_chatbot_mobile_full_screen));
609
610 if(isset( $_POST["wpbot_preloading_time"])) {
611 $wpbot_preloading_time = sanitize_text_field($_POST["wpbot_preloading_time"]);
612 }else{ $wpbot_preloading_time='100';}
613 update_option('wpbot_preloading_time', wp_unslash($wpbot_preloading_time));
614
615 if(isset( $_POST["disable_wp_chatbot_icon_animation"])) {
616 $disable_wp_chatbot_icon_animation = sanitize_text_field($_POST["disable_wp_chatbot_icon_animation"]);
617 }else{ $disable_wp_chatbot_icon_animation='';}
618 update_option('disable_wp_chatbot_icon_animation', wp_unslash($disable_wp_chatbot_icon_animation));
619 //Enable /disable Cart Item Number
620 if(isset( $_POST["disable_wp_chatbot_cart_item_number"])) {
621 $disable_wp_chatbot_cart_item_number = sanitize_text_field($_POST["disable_wp_chatbot_cart_item_number"]);
622 }else{ $disable_wp_chatbot_cart_item_number='';}
623 update_option('disable_wp_chatbot_cart_item_number', wp_unslash($disable_wp_chatbot_cart_item_number));
624 //Enable /disable featured products button.
625 if(isset( $_POST["disable_wp_chatbot_featured_product"])) {
626 $disable_wp_chatbot_featured_product = sanitize_text_field($_POST["disable_wp_chatbot_featured_product"]);
627 }else{ $disable_wp_chatbot_featured_product='';}
628 update_option('disable_wp_chatbot_featured_product', wp_unslash($disable_wp_chatbot_featured_product));
629 //Enable /disable sale products button
630 if(isset( $_POST["disable_wp_chatbot_sale_product"])) {
631 $disable_wp_chatbot_sale_product = sanitize_text_field($_POST["disable_wp_chatbot_sale_product"]);
632 }else{ $disable_wp_chatbot_sale_product='';}
633 update_option('disable_wp_chatbot_sale_product', wp_unslash($disable_wp_chatbot_sale_product));
634 //Enable Product details page.
635 if(isset( $_POST["wp_chatbot_open_product_detail"])) {
636 $wp_chatbot_open_product_detail = sanitize_text_field($_POST["wp_chatbot_open_product_detail"]);
637 }else{ $wp_chatbot_open_product_detail='';}
638 update_option('wp_chatbot_open_product_detail', wp_unslash($wp_chatbot_open_product_detail));
639 //product order and order by
640 if(isset($_POST['qlcd_wp_chatbot_product_orderby'])){
641 $qlcd_wp_chatbot_product_orderby = sanitize_text_field($_POST['qlcd_wp_chatbot_product_orderby']);
642 update_option('qlcd_wp_chatbot_product_orderby', sanitize_text_field($qlcd_wp_chatbot_product_orderby));
643 }
644 if(isset($_POST['qlcd_wp_chatbot_product_order'])){
645 $qlcd_wp_chatbot_product_order = sanitize_text_field($_POST['qlcd_wp_chatbot_product_order']);
646 update_option('qlcd_wp_chatbot_product_order', sanitize_text_field($qlcd_wp_chatbot_product_order));
647 }
648
649
650 //Product per page settings.
651 if (isset($_POST["qlcd_wp_chatbot_ppp"])) {
652 $qlcd_wp_chatbot_ppp = sanitize_text_field($_POST["qlcd_wp_chatbot_ppp"]);
653 update_option('qlcd_wp_chatbot_ppp', intval($qlcd_wp_chatbot_ppp));
654 }
655 if(isset( $_POST["wp_chatbot_exclude_stock_out_product"])) {
656 $wp_chatbot_exclude_stock_out_product = sanitize_text_field($_POST['wp_chatbot_exclude_stock_out_product']);
657 }else{ $wp_chatbot_exclude_stock_out_product='';}
658 update_option('wp_chatbot_exclude_stock_out_product', wp_unslash($wp_chatbot_exclude_stock_out_product));
659 if(isset( $_POST["wp_chatbot_show_parent_category"])) {
660 $wp_chatbot_show_parent_category = sanitize_text_field($_POST['wp_chatbot_show_parent_category']);
661 }else{ $wp_chatbot_show_parent_category='';}
662 update_option('wp_chatbot_show_parent_category', wp_unslash($wp_chatbot_show_parent_category));
663 if(isset( $_POST["wp_chatbot_show_sub_category"])) {
664 $wp_chatbot_show_sub_category = sanitize_text_field($_POST['wp_chatbot_show_sub_category']);
665 }else{ $wp_chatbot_show_sub_category='';}
666 update_option('wp_chatbot_show_sub_category', wp_unslash($wp_chatbot_show_sub_category));
667 if (isset($_POST["qlcd_wp_chatbot_order_user"])) {
668 $qlcd_wp_chatbot_order_user = sanitize_text_field($_POST["qlcd_wp_chatbot_order_user"]);
669 update_option('qlcd_wp_chatbot_order_user', sanitize_text_field($qlcd_wp_chatbot_order_user));
670 }
671
672 if(isset( $_POST["qc_wpbot_menu_order"]) && !empty($_POST["qc_wpbot_menu_order"])) {
673 $qc_wpbot_menu_order = wp_kses_post($_POST["qc_wpbot_menu_order"]);
674 }else{ $qc_wpbot_menu_order='';}
675 update_option('qc_wpbot_menu_order', ($qc_wpbot_menu_order));
676
677 //wpwBot Load control
678 if(isset($_POST["wp_chatbot_show_home_page"])){
679 $wp_chatbot_show_home_page = sanitize_key(($_POST["wp_chatbot_show_home_page"]));
680 update_option('wp_chatbot_show_home_page', $wp_chatbot_show_home_page);
681 }
682
683
684 if(isset($_POST["wp_chatbot_show_posts"])){
685 $wp_chatbot_show_posts = sanitize_key(($_POST["wp_chatbot_show_posts"]));
686 update_option('wp_chatbot_show_posts', $wp_chatbot_show_posts);
687 }
688
689
690 if(isset($_POST["wp_chatbot_show_pages"])){
691 $wp_chatbot_show_pages = sanitize_key(($_POST["wp_chatbot_show_pages"]));
692 update_option('wp_chatbot_show_pages', $wp_chatbot_show_pages);
693 }
694
695 if(isset( $_POST["wp_chatbot_show_pages_list"])) {
696 $wp_chatbot_show_pages_list = wp_parse_id_list($_POST["wp_chatbot_show_pages_list"]);
697 update_option('wp_chatbot_show_pages_list', serialize($wp_chatbot_show_pages_list));
698 }else{
699 $wp_chatbot_show_pages_list='';
700 update_option('wp_chatbot_show_pages_list', serialize($wp_chatbot_show_pages_list));
701 }
702 if(isset($_POST["wp_chatbot_show_wpcommerce"])){
703 $wp_chatbot_show_wpcommerce = sanitize_key(($_POST["wp_chatbot_show_wpcommerce"]));
704 update_option('wp_chatbot_show_wpcommerce', $wp_chatbot_show_wpcommerce);
705 }
706
707
708 //Stop Words Settings
709 if (isset($_POST["qlcd_wp_chatbot_stop_words_name"])) {
710 $qlcd_wp_chatbot_stop_words_name = sanitize_text_field($_POST["qlcd_wp_chatbot_stop_words_name"]);
711 update_option('qlcd_wp_chatbot_stop_words_name', $qlcd_wp_chatbot_stop_words_name);
712 }
713 if (isset($_POST["qlcd_wp_chatbot_stop_words"])) {
714 $qlcd_wp_chatbot_stop_words = sanitize_text_field($_POST["qlcd_wp_chatbot_stop_words"]);
715 update_option('qlcd_wp_chatbot_stop_words', $qlcd_wp_chatbot_stop_words);
716 }
717 //wpwbot icon settings.
718 $wp_chatbot_icon = isset( $_POST['wp_chatbot_icon'] ) ? sanitize_text_field($_POST['wp_chatbot_icon']) : 'icon-3.png';
719 update_option('wp_chatbot_icon', $wp_chatbot_icon);
720
721 $wp_chatbot_floatingiconbg_color = isset( $_POST['wp_chatbot_floatingiconbg_color'] ) ? sanitize_text_field($_POST['wp_chatbot_floatingiconbg_color']) : '#fff';
722 update_option('wp_chatbot_floatingiconbg_color', $wp_chatbot_floatingiconbg_color);
723
724 // upload custom wpwbot icon path
725 $wp_chatbot_custom_icon_path = sanitize_text_field($_POST['wp_chatbot_custom_icon_path']);
726 update_option('wp_chatbot_custom_icon_path', $wp_chatbot_custom_icon_path);
727 //Agent image
728 //wpwbot icon settings.
729 $wp_chatbot_icon = (isset($_POST['wp_chatbot_agent_image']) ? sanitize_text_field($_POST['wp_chatbot_agent_image']) : 'agent-0.png');
730 update_option('wp_chatbot_agent_image', $wp_chatbot_icon);
731 // upload custom wpwbot icon
732 if(isset($_POST['wp_chatbot_custom_agent_path'])){
733 $wp_chatbot_custom_agent_path = sanitize_text_field($_POST['wp_chatbot_custom_agent_path']);
734 update_option('wp_chatbot_custom_agent_path', $wp_chatbot_custom_agent_path);
735 }
736
737 //Theming
738 $qcld_wb_chatbot_theme = (isset($_POST['qcld_wb_chatbot_theme']) ? sanitize_text_field($_POST['qcld_wb_chatbot_theme']) : 'template-00');
739 update_option('qcld_wb_chatbot_theme', $qcld_wb_chatbot_theme);
740 //Theme custom background option
741 if(isset( $_POST["qcld_wb_chatbot_change_bg"])) {
742 $qcld_wb_chatbot_change_bg = sanitize_text_field($_POST["qcld_wb_chatbot_change_bg"]);
743 }else{$qcld_wb_chatbot_change_bg='';}
744 update_option('qcld_wb_chatbot_change_bg', $qcld_wb_chatbot_change_bg);
745 if(isset($_POST["qcld_wb_chatbot_board_bg_path"])){
746 $qcld_wb_chatbot_board_bg_path = sanitize_text_field($_POST["qcld_wb_chatbot_board_bg_path"]);
747 update_option('qcld_wb_chatbot_board_bg_path', wp_unslash($qcld_wb_chatbot_board_bg_path));
748 }
749
750
751 //To override style use custom css.
752 if(isset($_POST["wp_chatbot_custom_css"])){
753 $wp_chatbot_custom_css = wp_unslash($_POST["wp_chatbot_custom_css"]);
754 update_option('wp_chatbot_custom_css', $wp_chatbot_custom_css);
755 }
756
757 $qlcd_wp_chatbot_dialogflow_project_id= @$_POST["qlcd_wp_chatbot_dialogflow_project_id"];
758 update_option('qlcd_wp_chatbot_dialogflow_project_id', sanitize_text_field($qlcd_wp_chatbot_dialogflow_project_id));
759
760 $wp_chatbot_df_api= @$_POST["wp_chatbot_df_api"];
761 update_option('wp_chatbot_df_api', sanitize_text_field($wp_chatbot_df_api));
762
763
764
765 $qlcd_wp_chatbot_dialogflow_project_key= @$_POST["qlcd_wp_chatbot_dialogflow_project_key"];
766 update_option('qlcd_wp_chatbot_dialogflow_project_key', wp_unslash($qlcd_wp_chatbot_dialogflow_project_key));
767
768 /****Language center settings. ****/
769 //identity
770 $qlcd_wp_chatbot_host = @$_POST["qlcd_wp_chatbot_host"];
771 update_option('qlcd_wp_chatbot_host', sanitize_text_field($qlcd_wp_chatbot_host));
772 $qlcd_wp_chatbot_agent = @$_POST["qlcd_wp_chatbot_agent"];
773 update_option('qlcd_wp_chatbot_agent', sanitize_text_field($qlcd_wp_chatbot_agent));
774 $qlcd_wp_chatbot_shopper_demo_name = @$_POST["qlcd_wp_chatbot_shopper_demo_name"];
775 update_option('qlcd_wp_chatbot_shopper_demo_name', sanitize_text_field($qlcd_wp_chatbot_shopper_demo_name));
776 $qlcd_wp_chatbot_yes = @$_POST["qlcd_wp_chatbot_yes"];
777 update_option('qlcd_wp_chatbot_yes', sanitize_text_field($qlcd_wp_chatbot_yes));
778 $qlcd_wp_chatbot_no = @$_POST["qlcd_wp_chatbot_no"];
779 update_option('qlcd_wp_chatbot_no', sanitize_text_field($qlcd_wp_chatbot_no));
780 $qlcd_wp_chatbot_or = @$_POST["qlcd_wp_chatbot_or"];
781 update_option('qlcd_wp_chatbot_or', sanitize_text_field($qlcd_wp_chatbot_or));
782 $qlcd_wp_chatbot_sorry = @$_POST["qlcd_wp_chatbot_sorry"];
783 update_option('qlcd_wp_chatbot_sorry', sanitize_text_field($qlcd_wp_chatbot_sorry));
784 $qlcd_wp_chatbot_agent_join = @$_POST["qlcd_wp_chatbot_agent_join"];
785 update_option('qlcd_wp_chatbot_agent_join', serialize($qlcd_wp_chatbot_agent_join));
786 //Greeting.
787 $qlcd_wp_chatbot_welcome = @$_POST["qlcd_wp_chatbot_welcome"];
788 update_option('qlcd_wp_chatbot_welcome', serialize($qlcd_wp_chatbot_welcome));
789 $qlcd_wp_chatbot_back_to_start = @$_POST["qlcd_wp_chatbot_back_to_start"];
790 update_option('qlcd_wp_chatbot_back_to_start', serialize($qlcd_wp_chatbot_back_to_start));
791 $qlcd_wp_chatbot_hi_there = @$_POST["qlcd_wp_chatbot_hi_there"];
792 update_option('qlcd_wp_chatbot_hi_there', serialize($qlcd_wp_chatbot_hi_there));
793 $qlcd_wp_chatbot_welcome_back = @$_POST["qlcd_wp_chatbot_welcome_back"];
794 update_option('qlcd_wp_chatbot_welcome_back', serialize($qlcd_wp_chatbot_welcome_back));
795 $qlcd_wp_chatbot_asking_name = @$_POST["qlcd_wp_chatbot_asking_name"];
796 update_option('qlcd_wp_chatbot_asking_name', serialize($qlcd_wp_chatbot_asking_name));
797 $qlcd_wp_chatbot_name_greeting = @$_POST["qlcd_wp_chatbot_name_greeting"];
798 update_option('qlcd_wp_chatbot_name_greeting', serialize($qlcd_wp_chatbot_name_greeting));
799 $qlcd_wp_chatbot_i_am = @$_POST["qlcd_wp_chatbot_i_am"];
800 update_option('qlcd_wp_chatbot_i_am', serialize($qlcd_wp_chatbot_i_am));
801 $qlcd_wp_chatbot_is_typing = @$_POST["qlcd_wp_chatbot_is_typing"];
802 update_option('qlcd_wp_chatbot_is_typing', serialize($qlcd_wp_chatbot_is_typing));
803 $qlcd_wp_chatbot_send_a_msg= @$_POST["qlcd_wp_chatbot_send_a_msg"];
804 update_option('qlcd_wp_chatbot_send_a_msg', serialize($qlcd_wp_chatbot_send_a_msg));
805 $qlcd_wp_chatbot_choose_option= @$_POST["qlcd_wp_chatbot_choose_option"];
806 update_option('qlcd_wp_chatbot_choose_option', serialize($qlcd_wp_chatbot_choose_option));
807 $qlcd_wp_chatbot_viewed_products= @$_POST["qlcd_wp_chatbot_viewed_products"];
808 update_option('qlcd_wp_chatbot_viewed_products', serialize($qlcd_wp_chatbot_viewed_products));
809 $qlcd_wp_chatbot_shopping_cart= @$_POST["qlcd_wp_chatbot_shopping_cart"];
810 update_option('qlcd_wp_chatbot_shopping_cart', serialize($qlcd_wp_chatbot_shopping_cart));
811 $qlcd_wp_chatbot_add_to_cart= @$_POST["qlcd_wp_chatbot_add_to_cart"];
812 update_option('qlcd_wp_chatbot_add_to_cart', serialize($qlcd_wp_chatbot_add_to_cart));
813 $qlcd_wp_chatbot_cart_link= @$_POST["qlcd_wp_chatbot_cart_link"];
814 update_option('qlcd_wp_chatbot_cart_link', serialize($qlcd_wp_chatbot_cart_link));
815 $qlcd_wp_chatbot_checkout_link= @$_POST["qlcd_wp_chatbot_checkout_link"];
816 update_option('qlcd_wp_chatbot_checkout_link', serialize($qlcd_wp_chatbot_checkout_link));
817 $qlcd_wp_chatbot_cart_welcome= @$_POST["qlcd_wp_chatbot_cart_welcome"];
818 update_option('qlcd_wp_chatbot_cart_welcome', serialize($qlcd_wp_chatbot_cart_welcome));
819 $qlcd_wp_chatbot_featured_product_welcome= @$_POST["qlcd_wp_chatbot_featured_product_welcome"];
820 update_option('qlcd_wp_chatbot_featured_product_welcome', serialize($qlcd_wp_chatbot_featured_product_welcome));
821 $qlcd_wp_chatbot_viewed_product_welcome= @$_POST["qlcd_wp_chatbot_viewed_product_welcome"];
822 update_option('qlcd_wp_chatbot_viewed_product_welcome', serialize($qlcd_wp_chatbot_viewed_product_welcome));
823 $qlcd_wp_chatbot_latest_product_welcome= @$_POST["qlcd_wp_chatbot_latest_product_welcome"];
824 update_option('qlcd_wp_chatbot_latest_product_welcome', serialize($qlcd_wp_chatbot_latest_product_welcome));
825 $qlcd_wp_chatbot_cart_title= @$_POST["qlcd_wp_chatbot_cart_title"];
826 update_option('qlcd_wp_chatbot_cart_title', serialize($qlcd_wp_chatbot_cart_title));
827 $qlcd_wp_chatbot_cart_quantity= @$_POST["qlcd_wp_chatbot_cart_quantity"];
828 update_option('qlcd_wp_chatbot_cart_quantity', serialize($qlcd_wp_chatbot_cart_quantity));
829 $qlcd_wp_chatbot_cart_price= @$_POST["qlcd_wp_chatbot_cart_price"];
830 update_option('qlcd_wp_chatbot_cart_price', serialize($qlcd_wp_chatbot_cart_price));
831 $qlcd_wp_chatbot_no_cart_items= @$_POST["qlcd_wp_chatbot_no_cart_items"];
832 update_option('qlcd_wp_chatbot_no_cart_items', serialize($qlcd_wp_chatbot_no_cart_items));
833 $qlcd_wp_chatbot_cart_updating= @$_POST["qlcd_wp_chatbot_cart_updating"];
834 update_option('qlcd_wp_chatbot_cart_updating', serialize($qlcd_wp_chatbot_cart_updating));
835 $qlcd_wp_chatbot_cart_removing= @$_POST["qlcd_wp_chatbot_cart_removing"];
836 update_option('qlcd_wp_chatbot_cart_removing', serialize($qlcd_wp_chatbot_cart_removing));
837 //wpwBot wildcard settings
838 $qlcd_wp_chatbot_wildcard_msg = @$_POST["qlcd_wp_chatbot_wildcard_msg"];
839 update_option('qlcd_wp_chatbot_wildcard_msg', serialize($qlcd_wp_chatbot_wildcard_msg));
840 //empty filter message repeat.
841 $qlcd_wp_chatbot_empty_filter_msg = @$_POST["qlcd_wp_chatbot_empty_filter_msg"];
842 update_option('qlcd_wp_chatbot_empty_filter_msg', serialize($qlcd_wp_chatbot_empty_filter_msg));
843
844 $qlcd_wp_chatbot_did_you_mean = @$_POST["qlcd_wp_chatbot_did_you_mean"];
845 update_option('qlcd_wp_chatbot_did_you_mean', serialize($qlcd_wp_chatbot_did_you_mean));
846 //help welcome and message
847 $qlcd_wp_chatbot_help_welcome = @$_POST["qlcd_wp_chatbot_help_welcome"];
848 update_option('qlcd_wp_chatbot_help_welcome', serialize($qlcd_wp_chatbot_help_welcome));
849 $qlcd_wp_chatbot_help_msg = @$_POST["qlcd_wp_chatbot_help_msg"];
850 update_option('qlcd_wp_chatbot_help_msg', serialize($qlcd_wp_chatbot_help_msg));
851 //To clear Conversation history.
852 $qlcd_wp_chatbot_reset = @$_POST["qlcd_wp_chatbot_reset"];
853 update_option('qlcd_wp_chatbot_reset', serialize($qlcd_wp_chatbot_reset));
854 //systems keyword.
855 $qlcd_wp_chatbot_sys_key_help = @$_POST["qlcd_wp_chatbot_sys_key_help"];
856 update_option('qlcd_wp_chatbot_sys_key_help', sanitize_text_field($qlcd_wp_chatbot_sys_key_help));
857 $qlcd_wp_chatbot_sys_key_product = @$_POST["qlcd_wp_chatbot_sys_key_product"];
858 update_option('qlcd_wp_chatbot_sys_key_product', sanitize_text_field($qlcd_wp_chatbot_sys_key_product));
859 $qlcd_wp_chatbot_sys_key_catalog = @$_POST["qlcd_wp_chatbot_sys_key_catalog"];
860 update_option('qlcd_wp_chatbot_sys_key_catalog', sanitize_text_field($qlcd_wp_chatbot_sys_key_catalog));
861 $qlcd_wp_chatbot_sys_key_order = @$_POST["qlcd_wp_chatbot_sys_key_order"];
862 update_option('qlcd_wp_chatbot_sys_key_order', sanitize_text_field($qlcd_wp_chatbot_sys_key_order));
863 $qlcd_wp_chatbot_sys_key_support = @$_POST["qlcd_wp_chatbot_sys_key_support"];
864 update_option('qlcd_wp_chatbot_sys_key_support', sanitize_text_field($qlcd_wp_chatbot_sys_key_support));
865 $qlcd_wp_chatbot_sys_key_reset = @$_POST["qlcd_wp_chatbot_sys_key_reset"];
866 update_option('qlcd_wp_chatbot_sys_key_reset', sanitize_text_field($qlcd_wp_chatbot_sys_key_reset));
867 $qlcd_wp_chatbot_wildcard_product = @$_POST["qlcd_wp_chatbot_wildcard_product"];
868 update_option('qlcd_wp_chatbot_wildcard_product', serialize($qlcd_wp_chatbot_wildcard_product));
869 $qlcd_wp_chatbot_wildcard_catalog = @$_POST["qlcd_wp_chatbot_wildcard_catalog"];
870 update_option('qlcd_wp_chatbot_wildcard_catalog', serialize($qlcd_wp_chatbot_wildcard_catalog));
871 $qlcd_wp_chatbot_featured_products = @$_POST["qlcd_wp_chatbot_featured_products"];
872 update_option('qlcd_wp_chatbot_featured_products', serialize($qlcd_wp_chatbot_featured_products));
873 $qlcd_wp_chatbot_sale_products = @$_POST["qlcd_wp_chatbot_sale_products"];
874 update_option('qlcd_wp_chatbot_sale_products', serialize($qlcd_wp_chatbot_sale_products));
875 $qlcd_wp_chatbot_wildcard_support = @$_POST["qlcd_wp_chatbot_wildcard_support"];
876 update_option('qlcd_wp_chatbot_wildcard_support', sanitize_text_field($qlcd_wp_chatbot_wildcard_support));
877 $qlcd_wp_chatbot_messenger_label = @$_POST["qlcd_wp_chatbot_messenger_label"];
878 update_option('qlcd_wp_chatbot_messenger_label', serialize($qlcd_wp_chatbot_messenger_label));
879 //Products search .
880 if (isset($_POST["qlcd_wp_chatbot_product_success"])) {
881 $qlcd_wp_chatbot_product_success = @$_POST["qlcd_wp_chatbot_product_success"];
882 update_option('qlcd_wp_chatbot_product_success', serialize($qlcd_wp_chatbot_product_success));
883 }
884 if (isset($_POST["qlcd_wp_chatbot_product_fail"])) {
885 $qlcd_wp_chatbot_product_fail = @$_POST["qlcd_wp_chatbot_product_fail"];
886 update_option('qlcd_wp_chatbot_product_fail', serialize($qlcd_wp_chatbot_product_fail));
887 }
888 $qlcd_wp_chatbot_product_asking = @$_POST["qlcd_wp_chatbot_product_asking"];
889 update_option('qlcd_wp_chatbot_product_asking', serialize($qlcd_wp_chatbot_product_asking));
890 $qlcd_wp_chatbot_product_suggest = @$_POST["qlcd_wp_chatbot_product_suggest"];
891 update_option('qlcd_wp_chatbot_product_suggest', serialize($qlcd_wp_chatbot_product_suggest));
892 $qlcd_wp_chatbot_product_infinite = @$_POST["qlcd_wp_chatbot_product_infinite"];
893 update_option('qlcd_wp_chatbot_product_infinite', serialize($qlcd_wp_chatbot_product_infinite));
894 $qlcd_wp_chatbot_load_more = @$_POST["qlcd_wp_chatbot_load_more"];
895 update_option('qlcd_wp_chatbot_load_more', serialize($qlcd_wp_chatbot_load_more));
896 //Order
897 $qlcd_wp_chatbot_wildcard_order = @$_POST["qlcd_wp_chatbot_wildcard_order"];
898 update_option('qlcd_wp_chatbot_wildcard_order', serialize($qlcd_wp_chatbot_wildcard_order));
899 $qlcd_wp_chatbot_order_welcome = @$_POST["qlcd_wp_chatbot_order_welcome"];
900 update_option('qlcd_wp_chatbot_order_welcome', serialize($qlcd_wp_chatbot_order_welcome));
901 $qlcd_wp_chatbot_order_username_asking = @$_POST["qlcd_wp_chatbot_order_username_asking"];
902 update_option('qlcd_wp_chatbot_order_username_asking', serialize($qlcd_wp_chatbot_order_username_asking));
903 $qlcd_wp_chatbot_order_username_not_exist = @$_POST["qlcd_wp_chatbot_order_username_not_exist"];
904 update_option('qlcd_wp_chatbot_order_username_not_exist', serialize($qlcd_wp_chatbot_order_username_not_exist));
905 $qlcd_wp_chatbot_order_username_thanks = @$_POST["qlcd_wp_chatbot_order_username_thanks"];
906 update_option('qlcd_wp_chatbot_order_username_thanks', serialize($qlcd_wp_chatbot_order_username_thanks));
907 $qlcd_wp_chatbot_order_username_password = @$_POST["qlcd_wp_chatbot_order_username_password"];
908 update_option('qlcd_wp_chatbot_order_username_password', serialize($qlcd_wp_chatbot_order_username_password));
909 $qlcd_wp_chatbot_order_password_incorrect= @$_POST["qlcd_wp_chatbot_order_password_incorrect"];
910 update_option('qlcd_wp_chatbot_order_password_incorrect', serialize($qlcd_wp_chatbot_order_password_incorrect));
911 $qlcd_wp_chatbot_order_not_found= @$_POST["qlcd_wp_chatbot_order_not_found"];
912 update_option('qlcd_wp_chatbot_order_not_found', serialize($qlcd_wp_chatbot_order_not_found));
913 $qlcd_wp_chatbot_order_found= @$_POST["qlcd_wp_chatbot_order_found"];
914 update_option('qlcd_wp_chatbot_order_found', serialize($qlcd_wp_chatbot_order_found));
915 $qlcd_wp_chatbot_order_email_support= @$_POST["qlcd_wp_chatbot_order_email_support"];
916 update_option('qlcd_wp_chatbot_order_email_support', serialize($qlcd_wp_chatbot_order_email_support));
917 //Support
918 $qlcd_wp_chatbot_support_welcome = @$_POST["qlcd_wp_chatbot_support_welcome"];
919 update_option('qlcd_wp_chatbot_support_welcome', serialize($qlcd_wp_chatbot_support_welcome));
920 $qlcd_wp_chatbot_support_email = @$_POST["qlcd_wp_chatbot_support_email"];
921 update_option('qlcd_wp_chatbot_support_email', sanitize_text_field($qlcd_wp_chatbot_support_email));
922 $qlcd_wp_chatbot_asking_email = @$_POST["qlcd_wp_chatbot_asking_email"];
923 update_option('qlcd_wp_chatbot_asking_email', serialize($qlcd_wp_chatbot_asking_email));
924 $qlcd_wp_chatbot_asking_msg = @$_POST["qlcd_wp_chatbot_asking_msg"];
925 update_option('qlcd_wp_chatbot_asking_msg', serialize($qlcd_wp_chatbot_asking_msg));
926
927 $qlcd_wp_chatbot_no_result = @$_POST["qlcd_wp_chatbot_no_result"];
928 update_option('qlcd_wp_chatbot_no_result', serialize($qlcd_wp_chatbot_no_result));
929
930 $qlcd_wp_chatbot_support_option_again = @$_POST["qlcd_wp_chatbot_support_option_again"];
931 update_option('qlcd_wp_chatbot_support_option_again', serialize($qlcd_wp_chatbot_support_option_again));
932 $qlcd_wp_chatbot_invalid_email = @$_POST["qlcd_wp_chatbot_invalid_email"];
933 update_option('qlcd_wp_chatbot_invalid_email', serialize($qlcd_wp_chatbot_invalid_email));
934 $qlcd_wp_chatbot_support_phone= @$_POST["qlcd_wp_chatbot_support_phone"];
935
936 update_option('qlcd_wp_chatbot_support_phone', sanitize_text_field($qlcd_wp_chatbot_support_phone));
937 $qlcd_wp_chatbot_asking_phone= @$_POST["qlcd_wp_chatbot_asking_phone"];
938 update_option('qlcd_wp_chatbot_asking_phone', serialize($qlcd_wp_chatbot_asking_phone));
939 $qlcd_wp_chatbot_thank_for_phone= @$_POST["qlcd_wp_chatbot_thank_for_phone"];
940 update_option('qlcd_wp_chatbot_thank_for_phone', serialize($qlcd_wp_chatbot_thank_for_phone));
941 $qlcd_wp_chatbot_admin_email = @$_POST["qlcd_wp_chatbot_admin_email"];
942 update_option('qlcd_wp_chatbot_admin_email', sanitize_text_field($qlcd_wp_chatbot_admin_email));
943
944 $qlcd_wp_chatbot_email_sub = @$_POST["qlcd_wp_chatbot_email_sub"];
945 update_option('qlcd_wp_chatbot_email_sub', sanitize_text_field($qlcd_wp_chatbot_email_sub));
946
947 $qlcd_wp_site_search = @$_POST["qlcd_wp_site_search"];
948 update_option('qlcd_wp_site_search', sanitize_text_field($qlcd_wp_site_search));
949
950 $qlcd_wp_chatbot_email_sent = @$_POST["qlcd_wp_chatbot_email_sent"];
951 update_option('qlcd_wp_chatbot_email_sent', sanitize_text_field($qlcd_wp_chatbot_email_sent));
952 $qlcd_wp_chatbot_email_fail = @$_POST["qlcd_wp_chatbot_email_fail"];
953 update_option('qlcd_wp_chatbot_email_fail', sanitize_text_field($qlcd_wp_chatbot_email_fail));
954 //Notifications messages building.
955 $qlcd_wp_chatbot_notification_interval = @$_POST["qlcd_wp_chatbot_notification_interval"];
956 update_option('qlcd_wp_chatbot_notification_interval', sanitize_text_field($qlcd_wp_chatbot_notification_interval));
957 $qlcd_wp_chatbot_notifications = @$_POST["qlcd_wp_chatbot_notifications"];
958 update_option('qlcd_wp_chatbot_notifications', serialize($qlcd_wp_chatbot_notifications));
959 //Support building part.
960 $support_query = @$_POST["support_query"];
961 update_option('support_query', serialize($support_query));
962 $support_ans = @$_POST["support_ans"];
963 update_option('support_ans', serialize($support_ans));
964 //Create Mobile app pages.
965 if(isset( $_POST["wp_chatbot_app_pages"])) {
966 $wp_chatbot_app_pages = $_POST["wp_chatbot_app_pages"];
967 }else{ $wp_chatbot_app_pages='';}
968 update_option('wp_chatbot_app_pages', wp_unslash($wp_chatbot_app_pages));
969 //Messenger Options
970 if(isset( $_POST["enable_wp_chatbot_messenger"])) {
971 $enable_wp_chatbot_messenger = $_POST["enable_wp_chatbot_messenger"];
972 }else{ $enable_wp_chatbot_messenger='';}
973 update_option('enable_wp_chatbot_messenger', wp_unslash($enable_wp_chatbot_messenger));
974 if(isset( $_POST["enable_wp_chatbot_messenger_floating_icon"])) {
975 $enable_wp_chatbot_messenger_floating_icon = $_POST["enable_wp_chatbot_messenger_floating_icon"];
976 }else{ $enable_wp_chatbot_messenger_floating_icon='';}
977 update_option('enable_wp_chatbot_messenger_floating_icon', wp_unslash($enable_wp_chatbot_messenger_floating_icon));
978 $qlcd_wp_chatbot_fb_app_id = @$_POST["qlcd_wp_chatbot_fb_app_id"];
979 update_option('qlcd_wp_chatbot_fb_app_id', sanitize_text_field($qlcd_wp_chatbot_fb_app_id));
980 $qlcd_wp_chatbot_fb_page_id = @$_POST["qlcd_wp_chatbot_fb_page_id"];
981 update_option('qlcd_wp_chatbot_fb_page_id', sanitize_text_field($qlcd_wp_chatbot_fb_page_id));
982 $qlcd_wp_chatbot_fb_color= @$_POST["qlcd_wp_chatbot_fb_color"];
983 update_option('qlcd_wp_chatbot_fb_color', wp_unslash($qlcd_wp_chatbot_fb_color));
984 $qlcd_wp_chatbot_fb_in_msg = @$_POST["qlcd_wp_chatbot_fb_in_msg"];
985 update_option('qlcd_wp_chatbot_fb_in_msg', sanitize_text_field($qlcd_wp_chatbot_fb_in_msg));
986 $qlcd_wp_chatbot_fb_out_msg = @$_POST["qlcd_wp_chatbot_fb_out_msg"];
987 update_option('qlcd_wp_chatbot_fb_out_msg', sanitize_text_field($qlcd_wp_chatbot_fb_out_msg));
988 //Skype option
989 if(isset( $_POST["enable_wp_chatbot_skype_floating_icon"])) {
990 $enable_wp_chatbot_skype_floating_icon = $_POST["enable_wp_chatbot_skype_floating_icon"];
991 }else{ $enable_wp_chatbot_skype_floating_icon='';}
992 update_option('enable_wp_chatbot_skype_floating_icon', sanitize_text_field($enable_wp_chatbot_skype_floating_icon));
993 if(isset( $_POST["enable_wp_chatbot_skype_id"])) {
994 $enable_wp_chatbot_skype_id = $_POST["enable_wp_chatbot_skype_id"];
995 }else{ $enable_wp_chatbot_skype_id='';}
996 update_option('enable_wp_chatbot_skype_id', sanitize_text_field($enable_wp_chatbot_skype_id));
997 //WhatsApp
998 if(isset( $_POST["enable_wp_chatbot_whats"])) {
999 $enable_wp_chatbot_whats= $_POST["enable_wp_chatbot_whats"];
1000 }else{ $enable_wp_chatbot_whats='';}
1001 update_option('enable_wp_chatbot_whats', sanitize_text_field($enable_wp_chatbot_whats));
1002 $qlcd_wp_chatbot_whats_label = @$_POST["qlcd_wp_chatbot_whats_label"];
1003 update_option('qlcd_wp_chatbot_whats_label', serialize($qlcd_wp_chatbot_whats_label));
1004 if(isset( $_POST["enable_wp_chatbot_floating_whats"])) {
1005 $enable_wp_chatbot_floating_whats= $_POST["enable_wp_chatbot_floating_whats"];
1006 }else{ $enable_wp_chatbot_floating_whats='';}
1007 update_option('enable_wp_chatbot_floating_whats', sanitize_text_field($enable_wp_chatbot_floating_whats));
1008 $qlcd_wp_chatbot_whats_num = @$_POST["qlcd_wp_chatbot_whats_num"];
1009 update_option('qlcd_wp_chatbot_whats_num', sanitize_text_field($qlcd_wp_chatbot_whats_num));
1010 //Viber
1011 if(isset( $_POST["enable_wp_chatbot_floating_viber"])) {
1012 $enable_wp_chatbot_floating_viber = $_POST["enable_wp_chatbot_floating_viber"];
1013 }else{ $enable_wp_chatbot_floating_viber='';}
1014 update_option('enable_wp_chatbot_floating_viber', sanitize_text_field($enable_wp_chatbot_floating_viber));
1015 $qlcd_wp_chatbot_viber_acc = @$_POST["qlcd_wp_chatbot_viber_acc"];
1016 update_option('qlcd_wp_chatbot_viber_acc', sanitize_text_field($qlcd_wp_chatbot_viber_acc));
1017 //Others integration
1018 if(isset( $_POST["enable_wp_chatbot_floating_phone"])) {
1019 $enable_wp_chatbot_floating_phone = $_POST["enable_wp_chatbot_floating_phone"];
1020 }else{ $enable_wp_chatbot_floating_phone='';}
1021 update_option('enable_wp_chatbot_floating_phone', sanitize_text_field($enable_wp_chatbot_floating_phone));
1022 $qlcd_wp_chatbot_phone = @$_POST["qlcd_wp_chatbot_phone"];
1023 update_option('qlcd_wp_chatbot_phone', sanitize_text_field($qlcd_wp_chatbot_phone));
1024
1025 if(isset( $_POST["enable_wp_chatbot_floating_link"])) {
1026 $enable_wp_chatbot_floating_link = $_POST["enable_wp_chatbot_floating_link"];
1027 }else{ $enable_wp_chatbot_floating_link='';}
1028 update_option('enable_wp_chatbot_floating_link', sanitize_text_field($enable_wp_chatbot_floating_link));
1029 $qlcd_wp_chatbot_weblink = @$_POST["qlcd_wp_chatbot_weblink"];
1030 update_option('qlcd_wp_chatbot_weblink', sanitize_text_field($qlcd_wp_chatbot_weblink));
1031
1032 //Re Targetting.
1033 $qlcd_wp_chatbot_ret_greet = @$_POST["qlcd_wp_chatbot_ret_greet"];
1034 update_option('qlcd_wp_chatbot_ret_greet', sanitize_text_field($qlcd_wp_chatbot_ret_greet));
1035
1036 if(isset( $_POST["enable_wp_chatbot_exit_intent"])) {
1037 $enable_wp_chatbot_exit_intent = $_POST["enable_wp_chatbot_exit_intent"];
1038 }else{ $enable_wp_chatbot_exit_intent='';}
1039 update_option('enable_wp_chatbot_exit_intent', sanitize_text_field($enable_wp_chatbot_exit_intent));
1040
1041 $wp_chatbot_exit_intent_msg = @$_POST["wp_chatbot_exit_intent_msg"];
1042 update_option('wp_chatbot_exit_intent_msg', wp_unslash($wp_chatbot_exit_intent_msg));
1043
1044 if(isset( $_POST["wp_chatbot_exit_intent_once"])) {
1045 $wp_chatbot_exit_intent_once = $_POST["wp_chatbot_exit_intent_once"];
1046 }else{ $wp_chatbot_exit_intent_once='';}
1047 update_option('wp_chatbot_exit_intent_once', sanitize_text_field($wp_chatbot_exit_intent_once));
1048
1049 if(isset( $_POST["enable_wp_chatbot_scroll_open"])) {
1050 $enable_wp_chatbot_scroll_open = $_POST["enable_wp_chatbot_scroll_open"];
1051 }else{ $enable_wp_chatbot_scroll_open='';}
1052 update_option('enable_wp_chatbot_scroll_open', sanitize_text_field($enable_wp_chatbot_scroll_open));
1053
1054 $wp_chatbot_scroll_open_msg= @$_POST["wp_chatbot_scroll_open_msg"];
1055 update_option('wp_chatbot_scroll_open_msg', wp_unslash($wp_chatbot_scroll_open_msg));
1056
1057 $wp_chatbot_scroll_percent= @$_POST["wp_chatbot_scroll_percent"];
1058 update_option('wp_chatbot_scroll_percent', wp_unslash($wp_chatbot_scroll_percent));
1059
1060 if(isset( $_POST["wp_chatbot_scroll_once"])) {
1061 $wp_chatbot_scroll_once = sanitize_text_field($_POST["wp_chatbot_scroll_once"]);
1062 }else{ $wp_chatbot_scroll_once='';}
1063 update_option('wp_chatbot_scroll_once', $wp_chatbot_scroll_once);
1064
1065 if(isset( $_POST["enable_wp_chatbot_auto_open"])) {
1066 $enable_wp_chatbot_auto_open = sanitize_text_field($_POST["enable_wp_chatbot_auto_open"]);
1067 }else{ $enable_wp_chatbot_auto_open='';}
1068 update_option('enable_wp_chatbot_auto_open', $enable_wp_chatbot_auto_open);
1069
1070 if(isset( $_POST["enable_wp_chatbot_ret_sound"])) {
1071 $enable_wp_chatbot_ret_sound = sanitize_text_field($_POST["enable_wp_chatbot_ret_sound"]);
1072 }else{ $enable_wp_chatbot_ret_sound='';}
1073 update_option('enable_wp_chatbot_ret_sound', $enable_wp_chatbot_ret_sound);
1074
1075 if(isset( $_POST["enable_wp_chatbot_sound_initial"])) {
1076 $enable_wp_chatbot_sound_initial = sanitize_text_field($_POST["enable_wp_chatbot_sound_initial"]);
1077 }else{ $enable_wp_chatbot_sound_initial='';}
1078 update_option('enable_wp_chatbot_sound_initial', $enable_wp_chatbot_sound_initial);
1079
1080
1081 $wp_chatbot_auto_open_msg = @$_POST["wp_chatbot_auto_open_msg"];
1082 update_option('wp_chatbot_auto_open_msg', wp_unslash($wp_chatbot_auto_open_msg));
1083
1084 $wp_chatbot_auto_open_time = @$_POST["wp_chatbot_auto_open_time"];
1085 update_option('wp_chatbot_auto_open_time', wp_unslash($wp_chatbot_auto_open_time));
1086 //to complate checkout
1087 if(isset( $_POST["enable_wp_chatbot_ret_user_show"])) {
1088 $enable_wp_chatbot_ret_user_show = sanitize_text_field($_POST["enable_wp_chatbot_ret_user_show"]);
1089 }else{ $enable_wp_chatbot_ret_user_show='';}
1090 update_option('enable_wp_chatbot_ret_user_show', $enable_wp_chatbot_ret_user_show);
1091
1092 if(isset( $_POST["enable_wp_chatbot_inactive_time_show"])) {
1093 $enable_wp_chatbot_inactive_time_show = sanitize_text_field($_POST["enable_wp_chatbot_inactive_time_show"]);
1094 }else{ $enable_wp_chatbot_inactive_time_show='';}
1095 update_option('enable_wp_chatbot_inactive_time_show', $enable_wp_chatbot_inactive_time_show);
1096
1097 $wp_chatbot_inactive_time = @$_POST["wp_chatbot_inactive_time"];
1098 update_option('wp_chatbot_inactive_time', sanitize_text_field($wp_chatbot_inactive_time));
1099
1100 $wp_chatbot_checkout_msg = @$_POST["wp_chatbot_checkout_msg"];
1101 update_option('wp_chatbot_checkout_msg', wp_unslash($wp_chatbot_checkout_msg));
1102
1103 if(isset( $_POST["wp_chatbot_auto_open_once"])) {
1104 $wp_chatbot_auto_open_once = sanitize_text_field($_POST["wp_chatbot_auto_open_once"]);
1105 }else{ $wp_chatbot_auto_open_once='';}
1106 update_option('wp_chatbot_auto_open_once', $wp_chatbot_auto_open_once);
1107
1108 if(isset( $_POST["wp_chatbot_inactive_once"])) {
1109 $wp_chatbot_inactive_once = sanitize_text_field($_POST["wp_chatbot_inactive_once"]);
1110 }else{ $wp_chatbot_inactive_once='';}
1111 update_option('wp_chatbot_inactive_once', $wp_chatbot_inactive_once);
1112
1113
1114 $wp_chatbot_proactive_bg_color = @$_POST["wp_chatbot_proactive_bg_color"];
1115 update_option('wp_chatbot_proactive_bg_color', sanitize_text_field($wp_chatbot_proactive_bg_color));
1116
1117 if(isset( $_POST["disable_wp_chatbot_call_gen"])) {
1118 $disable_wp_chatbot_call_gen = sanitize_text_field($_POST["disable_wp_chatbot_call_gen"]);
1119 }else{ $disable_wp_chatbot_call_gen='';}
1120 update_option('disable_wp_chatbot_call_gen', $disable_wp_chatbot_call_gen);
1121
1122 if(isset( $_POST["disable_wp_chatbot_site_search"])) {
1123 $disable_wp_chatbot_site_search = sanitize_text_field($_POST["disable_wp_chatbot_site_search"]);
1124 }else{ $disable_wp_chatbot_site_search='';}
1125 update_option('disable_wp_chatbot_site_search', $disable_wp_chatbot_site_search);
1126
1127 if(isset( $_POST["disable_wp_chatbot_call_sup"])) {
1128 $disable_wp_chatbot_call_sup = sanitize_text_field($_POST["disable_wp_chatbot_call_sup"]);
1129 }else{ $disable_wp_chatbot_call_sup='';}
1130 update_option('disable_wp_chatbot_call_sup', $disable_wp_chatbot_call_sup);
1131
1132 if(isset( $_POST["disable_wp_chatbot_feedback"])) {
1133 $disable_wp_chatbot_feedback = sanitize_text_field($_POST["disable_wp_chatbot_feedback"]);
1134 }else{ $disable_wp_chatbot_feedback='';}
1135 update_option('disable_wp_chatbot_feedback', $disable_wp_chatbot_feedback);
1136
1137 if(isset( $_POST["disable_wp_chatbot_faq"])) {
1138 $disable_wp_chatbot_faq = sanitize_text_field($_POST["disable_wp_chatbot_faq"]);
1139 }else{ $disable_wp_chatbot_faq='';}
1140 update_option('disable_wp_chatbot_faq', $disable_wp_chatbot_faq);
1141
1142 $qlcd_wp_chatbot_feedback_label = @$_POST["qlcd_wp_chatbot_feedback_label"];
1143 update_option('qlcd_wp_chatbot_feedback_label', serialize($qlcd_wp_chatbot_feedback_label));
1144
1145 if(isset( $_POST["enable_wp_chatbot_meta_title"])) {
1146 $enable_wp_chatbot_meta_title = sanitize_text_field($_POST["enable_wp_chatbot_meta_title"]);
1147 }else{ $enable_wp_chatbot_meta_title='';}
1148 update_option('enable_wp_chatbot_meta_title', $enable_wp_chatbot_meta_title);
1149
1150 $qlcd_wp_chatbot_meta_label = @$_POST["qlcd_wp_chatbot_meta_label"];
1151 update_option('qlcd_wp_chatbot_meta_label', sanitize_text_field($qlcd_wp_chatbot_meta_label));
1152
1153 $qlcd_wp_chatbot_phone_sent = @$_POST["qlcd_wp_chatbot_phone_sent"];
1154 update_option('qlcd_wp_chatbot_phone_sent', sanitize_text_field($qlcd_wp_chatbot_phone_sent));
1155
1156 $qlcd_wp_chatbot_phone_fail = @$_POST["qlcd_wp_chatbot_phone_fail"];
1157 update_option('qlcd_wp_chatbot_phone_fail', sanitize_text_field($qlcd_wp_chatbot_phone_fail));
1158
1159 if(isset( $_POST["enable_wp_chatbot_opening_hour"])) {
1160 $enable_wp_chatbot_opening_hour = sanitize_text_field($_POST["enable_wp_chatbot_opening_hour"]);
1161 }else{ $enable_wp_chatbot_opening_hour='';}
1162 update_option('enable_wp_chatbot_opening_hour', $enable_wp_chatbot_opening_hour);
1163
1164 $wpwbot_hours= @$_POST["wpwbot_hours"];
1165 update_option('wpwbot_hours', serialize($wpwbot_hours));
1166
1167 if(isset( $_POST["enable_wp_chatbot_dailogflow"])) {
1168 $enable_wp_chatbot_dailogflow = sanitize_text_field($_POST["enable_wp_chatbot_dailogflow"]);
1169 }else{ $enable_wp_chatbot_dailogflow='';}
1170 update_option('enable_wp_chatbot_dailogflow', $enable_wp_chatbot_dailogflow);
1171
1172 $qlcd_wp_chatbot_dialogflow_client_token= @$_POST["qlcd_wp_chatbot_dialogflow_client_token"];
1173 update_option('qlcd_wp_chatbot_dialogflow_client_token', sanitize_text_field($qlcd_wp_chatbot_dialogflow_client_token));
1174
1175 $qlcd_wp_chatbot_dialogflow_defualt_reply= @$_POST["qlcd_wp_chatbot_dialogflow_defualt_reply"];
1176 update_option('qlcd_wp_chatbot_dialogflow_defualt_reply', sanitize_text_field($qlcd_wp_chatbot_dialogflow_defualt_reply));
1177
1178 $qlcd_wp_chatbot_dialogflow_agent_language= @$_POST["qlcd_wp_chatbot_dialogflow_agent_language"];
1179 update_option('qlcd_wp_chatbot_dialogflow_agent_language', sanitize_text_field($qlcd_wp_chatbot_dialogflow_agent_language));
1180
1181 }
1182 }
1183 }
1184 /**
1185 * Display Notifications on specific criteria.
1186 *
1187 * @since 2.14
1188 */
1189 public static function wpcommerce_inactive_notice_for_wp_chatbot()
1190 {
1191 if (current_user_can('activate_plugins')) :
1192 if (!class_exists('wpCommerce')) :
1193 deactivate_plugins(plugin_basename(__FILE__));
1194 ?>
1195 <div id="message" class="error">
1196 <p>
1197 <?php
1198 printf(
1199 __('%s WPBot for wpCommerce REQUIRES wpCommerce%s %swpCommerce%s must be active for WPBot to work. Please install & activate wpCommerce.', 'wpchatbot'),
1200 '<strong>',
1201 '</strong><br>',
1202 '<a href="http://wordpress.org/extend/plugins/wpcommerce/" target="_blank" >',
1203 '</a>'
1204 );
1205 ?>
1206 </p>
1207 </div>
1208 <?php
1209 elseif (version_compare(get_option('wpcommerce_db_version'), QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION, '<')) :
1210 ?>
1211 <div id="message" class="error">
1212 <!--<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>-->
1213 <p>
1214 <?php
1215 printf(
1216 __('%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'),
1217 '<strong>',
1218 '</strong><br>',
1219 QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION
1220 );
1221 ?>
1222 </p>
1223 <div style="clear:both;"></div>
1224 </div>
1225 <?php
1226 endif;
1227 endif;
1228 }
1229 /**
1230 * Admin notice for table reindex
1231 */
1232 public function admin_notice_reindex() { ?>
1233 <div class="updated notice is-dismissible">
1234 <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>
1235 </div>
1236 <?php }
1237 }
1238 /**
1239 * Instantiate plugin.
1240 *
1241 */
1242 if (!function_exists('qcld_wb_chatboot_plugin_init')) {
1243 function qcld_wb_chatboot_plugin_init()
1244 {
1245 global $qcld_wb_chatbot;
1246 $qcld_wb_chatbot = qcld_wb_Chatbot::qcld_wb_chatbot_get_instance();
1247 }
1248 }
1249 add_action('plugins_loaded', 'qcld_wb_chatboot_plugin_init');
1250 /*
1251 * Initial Options will be insert as defualt data
1252 */
1253 register_activation_hook(__FILE__, 'qcld_wb_chatboot_defualt_options');
1254 function qcld_wb_chatboot_defualt_options(){
1255
1256 global $wpdb;
1257 $collate = '';
1258
1259 if ( $wpdb->has_cap( 'collation' ) ) {
1260
1261 if ( ! empty( $wpdb->charset ) ) {
1262
1263 $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
1264 }
1265 if ( ! empty( $wpdb->collate ) ) {
1266
1267 $collate .= " COLLATE $wpdb->collate";
1268
1269 }
1270 }
1271
1272 //Bot User Table
1273 $table1 = $wpdb->prefix.'wpbot_sessions';
1274 $sql_sliders_Table1 = "
1275 CREATE TABLE IF NOT EXISTS `$table1` (
1276 `id` int(11) NOT NULL AUTO_INCREMENT,
1277 `session` int(11) NOT NULL,
1278 PRIMARY KEY (`id`)
1279 ) $collate AUTO_INCREMENT=1 ";
1280
1281 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
1282 dbDelta( $sql_sliders_Table1 );
1283
1284 //Bot Response Table
1285 $table1 = $wpdb->prefix.'wpbot_response';
1286 $sql_sliders_Table1 = "
1287 CREATE TABLE IF NOT EXISTS `$table1` (
1288 `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
1289 `query` TEXT NOT NULL,
1290 `keyword` TEXT NOT NULL,
1291 `response` TEXT NOT NULL,
1292 `category` varchar(256) NOT NULL,
1293 `intent` varchar(256) NOT NULL,
1294 `custom` varchar(256) NOT NULL,
1295 FULLTEXT(`query`, `keyword`, `response`)
1296 ) $collate AUTO_INCREMENT=1 ENGINE=InnoDB";
1297
1298 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
1299 dbDelta( $sql_sliders_Table1 );
1300
1301 $sqlqry = $wpdb->get_results("select * from $table1");
1302 if(empty($sqlqry)){
1303
1304 $query = 'What Can WPBot do for you?';
1305 $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!';
1306
1307 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
1308 $format = array('%s','%s', '%s', '%s');
1309 $wpdb->insert($table1,$data,$format);
1310 }
1311
1312 $url = get_site_url();
1313 $url = parse_url($url);
1314 $domain = $url['host'];
1315 //$admin_email = "admin@" . $domain;
1316 $admin_email = get_option('admin_email');
1317
1318 if(!get_option('wp_chatbot_position_x')) {
1319 update_option('wp_chatbot_position_x', 50);
1320 }
1321 if(!get_option('wp_chatbot_position_y')) {
1322 update_option('wp_chatbot_position_y', 50);
1323 }
1324 if(!get_option('disable_wp_chatbot')) {
1325 update_option('disable_wp_chatbot', '');
1326 }
1327 if(!get_option('disable_wp_chatbot_icon_animation')) {
1328 update_option('disable_wp_chatbot_icon_animation', '');
1329 }
1330 if(!get_option('disable_wp_chatbot_on_mobile')) {
1331 update_option('disable_wp_chatbot_on_mobile', '');
1332 }
1333 if(!get_option('qlcd_wp_chatbot_admin_email')) {
1334 update_option('qlcd_wp_chatbot_admin_email', get_option('admin_email'));
1335 }
1336 if(!get_option('disable_wp_chatbot_product_search')) {
1337 update_option('disable_wp_chatbot_product_search', '');
1338 }
1339 if(!get_option('disable_wp_chatbot_catalog')) {
1340 update_option('disable_wp_chatbot_catalog', '');
1341 }
1342 if(!get_option('disable_wp_chatbot_order_status')) {
1343 update_option('disable_wp_chatbot_order_status', '');
1344 }
1345 if(!get_option('enable_wp_chatbot_rtl')) {
1346 update_option('enable_wp_chatbot_rtl', '');
1347 }
1348 if(!get_option('show_menu_after_greetings')) {
1349 update_option('show_menu_after_greetings', '');
1350 }
1351 if(!get_option('enable_wp_chatbot_mobile_full_screen')) {
1352 update_option('enable_wp_chatbot_mobile_full_screen', 1);
1353 }
1354 if(!get_option('wpbot_preloading_time')) {
1355 update_option('wpbot_preloading_time', '0.5');
1356 }
1357
1358 if(!get_option('disable_wp_chatbot_notification')) {
1359 update_option('disable_wp_chatbot_notification', '1');
1360 }
1361 if(!get_option('disable_wp_chatbot_cart_item_number')) {
1362 update_option('disable_wp_chatbot_cart_item_number', '');
1363 }
1364 if(!get_option('disable_wp_chatbot_featured_product')) {
1365 update_option('disable_wp_chatbot_featured_product', '');
1366 }
1367 if(!get_option('disable_wp_chatbot_sale_product')) {
1368 update_option('disable_wp_chatbot_sale_product', '');
1369 }
1370 if(!get_option('wp_chatbot_open_product_detail')) {
1371 update_option('wp_chatbot_open_product_detail', '');
1372 }
1373 if(!get_option('qlcd_wp_chatbot_product_orderby')) {
1374 update_option('qlcd_wp_chatbot_product_orderby', sanitize_text_field('title'));
1375 }
1376 if(!get_option('qlcd_wp_chatbot_product_order')) {
1377 update_option('qlcd_wp_chatbot_product_order', sanitize_text_field('ASC'));
1378 }
1379 if(!get_option('qlcd_wp_chatbot_ppp')) {
1380 update_option('qlcd_wp_chatbot_ppp', intval(6));
1381 }
1382 if(!get_option('wp_chatbot_exclude_stock_out_product')) {
1383 update_option('wp_chatbot_exclude_stock_out_product', '');
1384 }
1385 if(!get_option('wp_chatbot_show_sub_category')) {
1386 update_option('wp_chatbot_show_sub_category', '');
1387 }
1388 if(!get_option('wp_chatbot_vertical_custom')){
1389 update_option('wp_chatbot_vertical_custom', 'Go To');
1390 }
1391 if(!get_option('wp_chatbot_show_home_page')) {
1392 update_option('wp_chatbot_show_home_page', 'on');
1393 }
1394 if(!get_option('qc_wpbot_menu_order')) {
1395 update_option('qc_wpbot_menu_order', '');
1396 }
1397
1398 if(!get_option('wp_chatbot_show_posts')) {
1399 update_option('wp_chatbot_show_posts', 'on');
1400 }
1401 if(!get_option('wp_chatbot_show_pages')){
1402 update_option('wp_chatbot_show_pages', 'on');
1403 }
1404 if(!get_option('wp_chatbot_show_pages_list')) {
1405 update_option('wp_chatbot_show_pages_list', serialize(array()));
1406 }
1407 if(!get_option('wp_chatbot_show_wpcommerce')) {
1408 update_option('wp_chatbot_show_wpcommerce', 'on');
1409 }
1410 if(!get_option('qlcd_wp_chatbot_stop_words_name')) {
1411 update_option('qlcd_wp_chatbot_stop_words_name', 'english');
1412 }
1413 if(!get_option('qlcd_wp_chatbot_stop_words')) {
1414 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");
1415 }
1416 if(!get_option('qlcd_wp_chatbot_order_user')) {
1417 update_option('qlcd_wp_chatbot_order_user', sanitize_text_field('login'));
1418 }
1419 if(!get_option('wp_chatbot_custom_agent_path')) {
1420 update_option('wp_chatbot_custom_agent_path', '');
1421 }
1422 if(!get_option('wp_chatbot_custom_icon_path')) {
1423 update_option('wp_chatbot_custom_icon_path', '');
1424 }
1425
1426 if(!get_option('wp_chatbot_icon')) {
1427 update_option('wp_chatbot_icon', sanitize_text_field('icon-13.png'));
1428 }
1429 if(!get_option('wp_chatbot_floatingiconbg_color')) {
1430 update_option('wp_chatbot_floatingiconbg_color', '#fff');
1431 }
1432 if(!get_option('wp_chatbot_agent_image')){
1433 update_option('wp_chatbot_agent_image',sanitize_text_field('agent-0.png'));
1434 }
1435 if(!get_option('qcld_wb_chatbot_theme')) {
1436 update_option('qcld_wb_chatbot_theme', sanitize_text_field('template-00'));
1437 }
1438 if(!get_option('qcld_wb_chatbot_change_bg')) {
1439 update_option('qcld_wb_chatbot_change_bg', '');
1440 }
1441 if(!get_option('wp_chatbot_custom_css')) {
1442 update_option('wp_chatbot_custom_css', '');
1443 }
1444 if(!get_option('qlcd_wp_chatbot_host')) {
1445 update_option('qlcd_wp_chatbot_host', sanitize_text_field('Our Website'));
1446 }
1447 if(!get_option('qlcd_wp_chatbot_agent')) {
1448 update_option('qlcd_wp_chatbot_agent', sanitize_text_field('Carrie'));
1449 }
1450 if(!get_option('qlcd_wp_chatbot_host')) {
1451 update_option('qlcd_wp_chatbot_host', sanitize_text_field('Our Website'));
1452 }
1453 if(!get_option('qlcd_wp_chatbot_shopper_demo_name')) {
1454 update_option('qlcd_wp_chatbot_shopper_demo_name', sanitize_text_field('Amigo'));
1455 }
1456 if(!get_option('qlcd_wp_chatbot_yes')) {
1457 update_option('qlcd_wp_chatbot_yes', sanitize_text_field('YES'));
1458 }
1459 if(!get_option('qlcd_wp_chatbot_no')) {
1460 update_option('qlcd_wp_chatbot_no', sanitize_text_field('NO'));
1461 }
1462 if(!get_option('qlcd_wp_chatbot_or')) {
1463 update_option('qlcd_wp_chatbot_or', sanitize_text_field('OR'));
1464 }
1465 if(!get_option('qlcd_wp_chatbot_sorry')) {
1466 update_option('qlcd_wp_chatbot_sorry', sanitize_text_field('Sorry'));
1467 }
1468
1469 if(!get_option('qlcd_wp_chatbot_dialogflow_project_id')) {
1470 update_option('qlcd_wp_chatbot_dialogflow_project_id', '');
1471 }
1472 if(!get_option('wp_chatbot_df_api')) {
1473 update_option('wp_chatbot_df_api', 'v1');
1474 }
1475
1476
1477 if(!get_option('qlcd_wp_chatbot_dialogflow_project_key')) {
1478 update_option('qlcd_wp_chatbot_dialogflow_project_key', '');
1479 }
1480
1481 if(!get_option('qlcd_wp_chatbot_agent_join')) {
1482 update_option('qlcd_wp_chatbot_agent_join', serialize(array('has joined the conversation')));
1483 }
1484 if(!get_option('qlcd_wp_chatbot_welcome')) {
1485 update_option('qlcd_wp_chatbot_welcome', serialize(array('Welcome to', 'Glad to have you at')));
1486 }
1487 if(!get_option('qlcd_wp_chatbot_back_to_start')) {
1488 update_option('qlcd_wp_chatbot_back_to_start', serialize(array('Back to Start')));
1489 }
1490 if(!get_option('qlcd_wp_chatbot_hi_there')) {
1491 update_option('qlcd_wp_chatbot_hi_there', serialize(array('Hi There!')));
1492 }
1493 if(!get_option('qlcd_wp_chatbot_welcome_back')) {
1494 update_option('qlcd_wp_chatbot_welcome_back', serialize(array('Welcome back', 'Good to see your again')));
1495 }
1496 if(!get_option('qlcd_wp_chatbot_asking_name')) {
1497 update_option('qlcd_wp_chatbot_asking_name', serialize(array('May I know your name?', 'What should I call you?')));
1498 }
1499 if(!get_option('qlcd_wp_chatbot_name_greeting')) {
1500 update_option('qlcd_wp_chatbot_name_greeting', serialize(array('Nice to meet you')));
1501 }
1502 if(!get_option('qlcd_wp_chatbot_i_am')) {
1503 update_option('qlcd_wp_chatbot_i_am', serialize(array('I am', 'This is')));
1504 }
1505 if(!get_option('qlcd_wp_chatbot_is_typing')) {
1506 update_option('qlcd_wp_chatbot_is_typing', serialize(array('is typing...')));
1507 }
1508 if(!get_option('qlcd_wp_chatbot_send_a_msg')) {
1509 update_option('qlcd_wp_chatbot_send_a_msg', serialize(array('Send a message.')));
1510 }
1511 if(!get_option('qlcd_wp_chatbot_choose_option')) {
1512 update_option('qlcd_wp_chatbot_choose_option', serialize(array('Choose an option.')));
1513 }
1514 if(!get_option('qlcd_wp_chatbot_viewed_products')) {
1515 update_option('qlcd_wp_chatbot_viewed_products', serialize(array('Recently viewed products')));
1516 }
1517 if(!get_option('qlcd_wp_chatbot_add_to_cart')) {
1518 update_option('qlcd_wp_chatbot_add_to_cart', serialize(array('Add to Cart')));
1519 }
1520 if(!get_option('qlcd_wp_chatbot_cart_link')) {
1521 update_option('qlcd_wp_chatbot_cart_link', serialize(array('Cart')));
1522 }
1523 if(!get_option('qlcd_wp_chatbot_checkout_link')) {
1524 update_option('qlcd_wp_chatbot_checkout_link', serialize(array('Checkout')));
1525 }
1526 if(!get_option('qlcd_wp_chatbot_featured_product_welcome')) {
1527 update_option('qlcd_wp_chatbot_featured_product_welcome', serialize(array('I have found following featured products')));
1528 }
1529 if(!get_option('qlcd_wp_chatbot_viewed_product_welcome')) {
1530 update_option('qlcd_wp_chatbot_viewed_product_welcome', serialize(array('I have found following recently viewed products')));
1531 }
1532 if(!get_option('qlcd_wp_chatbot_latest_product_welcome')) {
1533 update_option('qlcd_wp_chatbot_latest_product_welcome', serialize(array('I have found following latest products')));
1534 }
1535 if(!get_option('qlcd_wp_chatbot_cart_welcome')) {
1536 update_option('qlcd_wp_chatbot_cart_welcome', serialize(array('I have found following items from Shopping Cart.')));
1537 }
1538 if(!get_option('qlcd_wp_chatbot_cart_title')) {
1539 update_option('qlcd_wp_chatbot_cart_title', serialize(array('Title')));
1540 }
1541 if(!get_option('qlcd_wp_chatbot_cart_quantity')) {
1542 update_option('qlcd_wp_chatbot_cart_quantity', serialize(array('Qty')));
1543 }
1544 if(!get_option('qlcd_wp_chatbot_cart_price')) {
1545 update_option('qlcd_wp_chatbot_cart_price', serialize(array('Price')));
1546 }
1547 if(!get_option('qlcd_wp_chatbot_no_cart_items')) {
1548 update_option('qlcd_wp_chatbot_no_cart_items', serialize(array('No items in the cart')));
1549 }
1550 if(!get_option('qlcd_wp_chatbot_cart_updating')) {
1551 update_option('qlcd_wp_chatbot_cart_updating', serialize(array('Updating cart items ...')));
1552 }
1553 if(!get_option('qlcd_wp_chatbot_cart_removing')) {
1554 update_option('qlcd_wp_chatbot_cart_removing', serialize(array('Removing cart items ...')));
1555 }
1556 if(!get_option('qlcd_wp_chatbot_wildcard_msg')) {
1557 update_option('qlcd_wp_chatbot_wildcard_msg', serialize(array('I am here to find what you need. What are you looking for?')));
1558 }
1559 if(!get_option('qlcd_wp_chatbot_empty_filter_msg')) {
1560 update_option('qlcd_wp_chatbot_empty_filter_msg', serialize(array('Sorry, I did not understand you.')));
1561 }
1562 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
1563 update_option('qlcd_wp_chatbot_did_you_mean', serialize(array('Did you mean?')));
1564 }
1565 if(!get_option('qlcd_wp_chatbot_sys_key_help')) {
1566 update_option('qlcd_wp_chatbot_sys_key_help', 'start');
1567 }
1568 if(!get_option('qlcd_wp_chatbot_sys_key_product')) {
1569 update_option('qlcd_wp_chatbot_sys_key_product', 'product');
1570 }
1571 if(!get_option('qlcd_wp_chatbot_sys_key_catalog')) {
1572 update_option('qlcd_wp_chatbot_sys_key_catalog', 'catalog');
1573 }
1574 if(!get_option('qlcd_wp_chatbot_sys_key_order')) {
1575 update_option('qlcd_wp_chatbot_sys_key_order', 'order');
1576 }
1577 if(!get_option('qlcd_wp_chatbot_sys_key_support')) {
1578 update_option('qlcd_wp_chatbot_sys_key_support', 'faq');
1579 }
1580 if(!get_option('qlcd_wp_chatbot_sys_key_reset')) {
1581 update_option('qlcd_wp_chatbot_sys_key_reset', 'reset');
1582 }
1583 if(!get_option('qlcd_wp_chatbot_help_welcome')) {
1584 update_option('qlcd_wp_chatbot_help_welcome', serialize(array('Welcome to Help Section.')));
1585 }
1586 if(!get_option('qlcd_wp_chatbot_help_msg')) {
1587 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.')));
1588 }
1589 if(!get_option('qlcd_wp_chatbot_reset')) {
1590 update_option('qlcd_wp_chatbot_reset', serialize(array('Do you want to clear our chat history and start over?')));
1591 }
1592 if(!get_option('qlcd_wp_chatbot_wildcard_product')) {
1593 update_option('qlcd_wp_chatbot_wildcard_product', serialize(array('Product Search')));
1594 }
1595 if(!get_option('qlcd_wp_chatbot_wildcard_catalog')) {
1596 update_option('qlcd_wp_chatbot_wildcard_catalog', serialize(array('Catalog')));
1597 }
1598 if(!get_option('qlcd_wp_chatbot_featured_products')) {
1599 update_option('qlcd_wp_chatbot_featured_products', serialize(array('Featured Products')));
1600 }
1601 if(!get_option('qlcd_wp_chatbot_sale_products')) {
1602 update_option('qlcd_wp_chatbot_sale_products', serialize(array('Products on Sale')));
1603 }
1604 if(!get_option('qlcd_wp_chatbot_wildcard_support')) {
1605 update_option('qlcd_wp_chatbot_wildcard_support', 'FAQ');
1606 }
1607 if(!get_option('qlcd_wp_chatbot_messenger_label')) {
1608 update_option('qlcd_wp_chatbot_messenger_label', serialize(array('Chat with Us on Facebook Messenger')));
1609 }
1610 if(!get_option('qlcd_wp_chatbot_product_success')) {
1611 update_option('qlcd_wp_chatbot_product_success', serialize(array('Great! We have these products for', 'Found these products for')));
1612 }
1613 if(!get_option('qlcd_wp_chatbot_product_fail')) {
1614 update_option('qlcd_wp_chatbot_product_fail', serialize(array('Oops! Nothing matches your criteria', 'Sorry, I found nothing')));
1615 }
1616 if(!get_option('qlcd_wp_chatbot_product_asking')) {
1617 update_option('qlcd_wp_chatbot_product_asking', serialize(array('What are you shopping for?')));
1618 }
1619 if(!get_option('qlcd_wp_chatbot_product_suggest')) {
1620 update_option('qlcd_wp_chatbot_product_suggest', serialize(array('You can browse our extensive catalog. Just pick a category from below:')));
1621 }
1622 if(!get_option('qlcd_wp_chatbot_product_infinite')) {
1623 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?')));
1624 }
1625 if(!get_option('qlcd_wp_chatbot_load_more')) {
1626 update_option('qlcd_wp_chatbot_load_more', serialize(array('Load More')));
1627 }
1628 if(!get_option('qlcd_wp_chatbot_wildcard_order')) {
1629 update_option('qlcd_wp_chatbot_wildcard_order', serialize(array('Order Status')));
1630 }
1631 if(!get_option('qlcd_wp_chatbot_order_welcome')) {
1632 update_option('qlcd_wp_chatbot_order_welcome', serialize(array('Welcome to Order status section!')));
1633 }
1634 if(!get_option('qlcd_wp_chatbot_order_username_asking')) {
1635 update_option('qlcd_wp_chatbot_order_username_asking', serialize(array('Please type your username?')));
1636 }
1637 if(!get_option('qlcd_wp_chatbot_order_username_password')) {
1638 update_option('qlcd_wp_chatbot_order_username_password', serialize(array('Please type your password')));
1639 }
1640 if(!get_option('qlcd_wp_chatbot_order_username_not_exist')) {
1641 update_option('qlcd_wp_chatbot_order_username_not_exist', serialize(array('This username does not exist.')));
1642 }
1643 if(!get_option('qlcd_wp_chatbot_order_username_thanks')) {
1644 update_option('qlcd_wp_chatbot_order_username_thanks', serialize(array('Thank you for the username')));
1645 }
1646 if(!get_option('qlcd_wp_chatbot_order_password_incorrect')) {
1647 update_option('qlcd_wp_chatbot_order_password_incorrect', serialize(array('Sorry Password is not correct!')));
1648 }
1649 if(!get_option('qlcd_wp_chatbot_asking_email')) {
1650 update_option('qlcd_wp_chatbot_asking_email', serialize(array('Please provide your email address')));
1651 }
1652 if(!get_option('qlcd_wp_chatbot_order_not_found')) {
1653 update_option('qlcd_wp_chatbot_order_not_found', serialize(array('I did not find any order by you')));
1654 }
1655 if(!get_option('qlcd_wp_chatbot_order_found')) {
1656 update_option('qlcd_wp_chatbot_order_found', serialize(array('I have found the following orders')));
1657 }
1658 if(!get_option('qlcd_wp_chatbot_order_email_support')) {
1659 update_option('qlcd_wp_chatbot_order_email_support', serialize(array('Email our support center about your order.')));
1660 }
1661 if(!get_option('qlcd_wp_chatbot_support_welcome')) {
1662 update_option('qlcd_wp_chatbot_support_welcome', serialize(array('Welcome to FAQ Section')));
1663 }
1664 if(!get_option('qlcd_wp_chatbot_support_email')) {
1665 update_option('qlcd_wp_chatbot_support_email', 'Send us Email.');
1666 }
1667 if(!get_option('qlcd_wp_chatbot_asking_msg')) {
1668 update_option('qlcd_wp_chatbot_asking_msg', serialize(array('Thank you for email address. Please write your message now.')));
1669 }
1670 if(!get_option('qlcd_wp_chatbot_no_result')) {
1671 update_option('qlcd_wp_chatbot_no_result', serialize(array('Sorry, No result found!')));
1672 }
1673 if(!get_option('qlcd_wp_chatbot_invalid_email')) {
1674 update_option('qlcd_wp_chatbot_invalid_email', serialize(array('Sorry, Email address is not valid! Please provide a valid email.')));
1675 }
1676 if(!get_option('qlcd_wp_chatbot_support_phone')) {
1677 update_option('qlcd_wp_chatbot_support_phone', 'Leave your number. We will call you back!');
1678 }
1679 if(!get_option('qlcd_wp_chatbot_asking_phone')) {
1680 update_option('qlcd_wp_chatbot_asking_phone', serialize(array('Please provide your Phone number')));
1681 }
1682 if(!get_option('qlcd_wp_chatbot_thank_for_phone')) {
1683 update_option('qlcd_wp_chatbot_thank_for_phone', serialize(array('Thank you for Phone number')));
1684 }
1685 if(!get_option('qlcd_wp_chatbot_support_option_again')) {
1686 update_option('qlcd_wp_chatbot_support_option_again', serialize(array('You may choose option from below.')));
1687 }
1688 if(!get_option('qlcd_wp_chatbot_admin_email')) {
1689 update_option('qlcd_wp_chatbot_admin_email', $admin_email);
1690 }
1691 if(!get_option('qlcd_wp_chatbot_email_sub')) {
1692 update_option('qlcd_wp_chatbot_email_sub', sanitize_text_field('WPBot Support Mail'));
1693 }
1694 if(!get_option('qlcd_wp_site_search')) {
1695 update_option('qlcd_wp_site_search', sanitize_text_field('Site Search'));
1696 }
1697 if(!get_option('qlcd_wp_chatbot_email_sent')) {
1698 update_option('qlcd_wp_chatbot_email_sent', sanitize_text_field('Your email was sent successfully.Thanks!'));
1699 }
1700 if(!get_option('qlcd_wp_chatbot_email_fail')) {
1701 update_option('qlcd_wp_chatbot_email_fail', sanitize_text_field('Sorry! I could not send your mail! Please contact the webmaster.'));
1702 }
1703 if(!get_option('qlcd_wp_chatbot_notification_interval')) {
1704 update_option('qlcd_wp_chatbot_notification_interval', sanitize_text_field(5));
1705 }
1706 if(!get_option('qlcd_wp_chatbot_notifications')) {
1707 update_option('qlcd_wp_chatbot_notifications', serialize(array('Welcome to WPBot')));
1708 }
1709 if(!get_option('support_query')) {
1710 update_option('support_query', serialize(array('What is WPBot?')));
1711 }
1712 if(!get_option('support_ans')) {
1713 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.')));
1714 }
1715 if(!get_option('qlcd_wp_chatbot_search_option')) {
1716 update_option('qlcd_wp_chatbot_search_option', 'standard');
1717 }
1718 if(!get_option('wp_chatbot_index_count')) {
1719 update_option('wp_chatbot_index_count', 0);
1720 }
1721 if(!get_option('wp_chatbot_app_pages')) {
1722 update_option('wp_chatbot_app_pages', 0);
1723 }
1724 //messenger options.
1725 if(!get_option('enable_wp_chatbot_messenger')) {
1726 update_option('enable_wp_chatbot_messenger', '');
1727 }
1728 if(!get_option('enable_wp_chatbot_messenger_floating_icon')) {
1729 update_option('enable_wp_chatbot_messenger_floating_icon', '');
1730 }
1731 if(!get_option('qlcd_wp_chatbot_fb_app_id')) {
1732 update_option('qlcd_wp_chatbot_fb_app_id', '');
1733 }
1734 if(!get_option('qlcd_wp_chatbot_fb_page_id')) {
1735 update_option('qlcd_wp_chatbot_fb_page_id', '');
1736 }
1737 if(!get_option('qlcd_wp_chatbot_fb_color')) {
1738 update_option('qlcd_wp_chatbot_fb_color', '#0084ff');
1739 }
1740 if(!get_option('qlcd_wp_chatbot_fb_in_msg')) {
1741 update_option('qlcd_wp_chatbot_fb_in_msg', 'Welcome to WPBot!');
1742 }
1743 if(!get_option('qlcd_wp_chatbot_fb_out_msg')) {
1744 update_option('qlcd_wp_chatbot_fb_out_msg', 'You are not logged in');
1745 }
1746 //Skype option
1747 if(!get_option('enable_wp_chatbot_skype_floating_icon')) {
1748 update_option('enable_wp_chatbot_skype_floating_icon', '');
1749 }
1750 if(!get_option('enable_wp_chatbot_skype_id')) {
1751 update_option('enable_wp_chatbot_skype_id', '');
1752 }
1753 //Whats App
1754 if(!get_option('enable_wp_chatbot_whats')) {
1755 update_option('enable_wp_chatbot_whats', '');
1756 }
1757 if(!get_option('qlcd_wp_chatbot_whats_label')) {
1758 update_option('qlcd_wp_chatbot_whats_label', serialize(array('Chat with Us on WhatsApp')));
1759 }
1760 if(!get_option('enable_wp_chatbot_floating_whats')) {
1761 update_option('enable_wp_chatbot_floating_whats', '');
1762 }
1763 if(!get_option('qlcd_wp_chatbot_whats_num')) {
1764 update_option('qlcd_wp_chatbot_whats_num', '');
1765 }
1766 //Viber
1767 if(!get_option('enable_wp_chatbot_floating_viber')) {
1768 update_option('enable_wp_chatbot_floating_viber', '');
1769 }
1770 if(!get_option('qlcd_wp_chatbot_viber_acc')) {
1771 update_option('qlcd_wp_chatbot_viber_acc', '');
1772 }
1773 //Integration others
1774 if(!get_option('enable_wp_chatbot_floating_phone')) {
1775 update_option('enable_wp_chatbot_floating_phone', '');
1776 }
1777 if(!get_option('qlcd_wp_chatbot_phone')) {
1778 update_option('qlcd_wp_chatbot_phone', '');
1779 }
1780 if(!get_option('enable_wp_chatbot_floating_link')) {
1781 update_option('enable_wp_chatbot_floating_link', '');
1782 }
1783
1784 if(!get_option('qlcd_wp_chatbot_weblink')) {
1785 update_option('qlcd_wp_chatbot_weblink', '');
1786 }
1787 //Re-Tagetting
1788 if(!get_option('qlcd_wp_chatbot_ret_greet')) {
1789 update_option('qlcd_wp_chatbot_ret_greet', 'Hello');
1790 }
1791 if(!get_option('enable_wp_chatbot_exit_intent')) {
1792 update_option('enable_wp_chatbot_exit_intent', '');
1793 }
1794 if(!get_option('wp_chatbot_exit_intent_msg')) {
1795 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.');
1796 }
1797 if(!get_option('wp_chatbot_exit_intent_once')) {
1798 update_option('wp_chatbot_exit_intent_once', '');
1799 }
1800
1801 if(!get_option('enable_wp_chatbot_scroll_open')) {
1802 update_option('enable_wp_chatbot_scroll_open', '');
1803 }
1804 if(!get_option('wp_chatbot_scroll_open_msg')) {
1805 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.');
1806 }
1807 if(!get_option('wp_chatbot_scroll_percent')) {
1808 update_option('wp_chatbot_scroll_percent', 50);
1809 }
1810 if(!get_option('wp_chatbot_scroll_once')) {
1811 update_option('wp_chatbot_scroll_once', '');
1812 }
1813
1814 if(!get_option('enable_wp_chatbot_auto_open')) {
1815 update_option('enable_wp_chatbot_auto_open', '');
1816 }
1817
1818 if(!get_option('enable_wp_chatbot_ret_sound')) {
1819 update_option('enable_wp_chatbot_ret_sound', '');
1820 }
1821 if(!get_option('enable_wp_chatbot_sound_initial')) {
1822 update_option('enable_wp_chatbot_sound_initial', '');
1823 }
1824
1825
1826 if(!get_option('wp_chatbot_auto_open_msg')) {
1827 update_option('wp_chatbot_auto_open_msg', 'A SPECIAL OFFER FOR YOU! Get Your 50% Discount Now. Use Coupon Code QC50 during checkout.');
1828 }
1829 if(!get_option('wp_chatbot_auto_open_time')) {
1830 update_option('wp_chatbot_auto_open_time', 10);
1831 }
1832 if(!get_option('wp_chatbot_auto_open_once')) {
1833 update_option('wp_chatbot_auto_open_once', '');
1834 }
1835 if(!get_option('wp_chatbot_inactive_once')) {
1836 update_option('wp_chatbot_inactive_once', '');
1837 }
1838
1839 //To complete checkout.
1840 if(!get_option('enable_wp_chatbot_ret_user_show')) {
1841 update_option('enable_wp_chatbot_ret_user_show', '');
1842 }
1843 if(!get_option('wp_chatbot_auto_open_msg')) {
1844 update_option('wp_chatbot_checkout_msg', 'You have products in shopping cart, please complete your order.');
1845 }
1846 if(!get_option('wp_chatbot_inactive_time')) {
1847 update_option('wp_chatbot_inactive_time', 300);
1848 }
1849 if(!get_option('enable_wp_chatbot_inactive_time_show')) {
1850 update_option('enable_wp_chatbot_inactive_time_show', '');
1851 }
1852
1853 if(!get_option('wp_chatbot_proactive_bg_color')) {
1854 update_option('wp_chatbot_proactive_bg_color', '#ffffff');
1855 }
1856 if(!get_option('disable_wp_chatbot_feedback')) {
1857 update_option('disable_wp_chatbot_feedback','');
1858 }
1859 if(!get_option('disable_wp_chatbot_faq')) {
1860 update_option('disable_wp_chatbot_faq','');
1861 }
1862 if(!get_option('qlcd_wp_chatbot_feedback_label')) {
1863 update_option('qlcd_wp_chatbot_feedback_label',serialize(array('Send Feedback')));
1864 }
1865
1866 if(!get_option('enable_wp_chatbot_meta_title')) {
1867 update_option('enable_wp_chatbot_meta_title','');
1868 }
1869 if(!get_option('qlcd_wp_chatbot_meta_label')) {
1870 update_option('qlcd_wp_chatbot_meta_label','*New Messages');
1871 }
1872
1873 if(!get_option('disable_wp_chatbot_call_gen')) {
1874 update_option('disable_wp_chatbot_call_gen', '');
1875 }
1876
1877 if(!get_option('disable_wp_chatbot_site_search')) {
1878 update_option('disable_wp_chatbot_site_search', '');
1879 }
1880 if(!get_option('disable_wp_chatbot_call_sup')) {
1881 update_option('disable_wp_chatbot_call_sup', '');
1882 }
1883
1884 if(!get_option('qlcd_wp_chatbot_phone_sent')) {
1885 update_option('qlcd_wp_chatbot_phone_sent', 'Thanks for your phone number. We will call you ASAP!');
1886 }
1887 if(!get_option('qlcd_wp_chatbot_phone_fail')) {
1888 update_option('qlcd_wp_chatbot_phone_fail', 'Sorry! I could not collect your phone number!');
1889 }
1890 if(!get_option('enable_wp_chatbot_opening_hour')) {
1891 update_option('enable_wp_chatbot_opening_hour', '');
1892 }
1893 if(!get_option('enable_wp_chatbot_opening_hour')) {
1894 update_option('wpwbot_hours', array());
1895 }
1896
1897 if(!get_option('enable_wp_chatbot_dailogflow')) {
1898 update_option('enable_wp_chatbot_dailogflow', '');
1899 }
1900 if(!get_option('qlcd_wp_chatbot_dialogflow_client_token')) {
1901 update_option('qlcd_wp_chatbot_dialogflow_client_token', '');
1902 }
1903 if(!get_option('qlcd_wp_chatbot_dialogflow_defualt_reply')) {
1904 update_option('qlcd_wp_chatbot_dialogflow_defualt_reply', 'Sorry, I did not understand you. You may browse');
1905 }
1906 if(!get_option('qlcd_wp_chatbot_dialogflow_agent_language')) {
1907 update_option('qlcd_wp_chatbot_dialogflow_agent_language', 'en');
1908 }
1909
1910 }
1911 /*
1912 * Reset Options will be insert as defualt data
1913 */
1914 add_action('wp_ajax_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
1915 add_action('wp_ajax_nopriv_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
1916 //Jarvis all option will be delete during uninstlling.
1917 function qcld_wb_chatboot_delete_all_options(){
1918 delete_option('disable_wp_chatbot');
1919 delete_option('disable_wp_chatbot_icon_animation');
1920 delete_option('disable_wp_chatbot_on_mobile');
1921 delete_option('qlcd_wp_chatbot_admin_email');
1922 delete_option('qlcd_wp_chatbot_from_email');
1923
1924 delete_option('disable_wp_chatbot_product_search');
1925 delete_option('disable_wp_chatbot_catalog');
1926 delete_option('disable_wp_chatbot_order_status');
1927 delete_option('disable_wp_chatbot_notification');
1928 delete_option('enable_wp_chatbot_rtl');
1929 delete_option('show_menu_after_greetings');
1930 delete_option('enable_wp_chatbot_mobile_full_screen');
1931 delete_option('wpbot_preloading_time');
1932 delete_option('disable_wp_chatbot_cart_item_number');
1933 delete_option('disable_wp_chatbot_featured_product');
1934 delete_option('disable_wp_chatbot_sale_product');
1935 delete_option('wp_chatbot_open_product_detail');
1936 delete_option('qlcd_wp_chatbot_product_orderby');
1937 delete_option('qlcd_wp_chatbot_product_order');
1938 delete_option('qlcd_wp_chatbot_ppp');
1939 delete_option('wp_chatbot_show_parent_category');
1940 delete_option('wp_chatbot_show_sub_category');
1941 delete_option('wp_chatbot_exclude_stock_out_product');
1942 delete_option('wp_chatbot_show_home_page');
1943 delete_option('qc_wpbot_menu_order');
1944
1945 delete_option('wp_chatbot_show_posts');
1946 delete_option('wp_chatbot_show_pages');
1947 delete_option('wp_chatbot_show_pages_list');
1948 delete_option('wp_chatbot_show_wpcommerce');
1949 delete_option('qlcd_wp_chatbot_stop_words_name');
1950 delete_option('qlcd_wp_chatbot_stop_words');
1951 delete_option('qlcd_wp_chatbot_order_user');
1952 delete_option('wp_chatbot_icon');
1953 delete_option('wp_chatbot_floatingiconbg_color');
1954 delete_option('wp_chatbot_agent_image');
1955 delete_option('qcld_wb_chatbot_theme');
1956 delete_option('qcld_wb_chatbot_change_bg');
1957 delete_option('wp_chatbot_custom_css');
1958 delete_option('qlcd_wp_chatbot_host');
1959 delete_option('qlcd_wp_chatbot_agent');
1960 delete_option('qlcd_wp_chatbot_yes');
1961 delete_option('qlcd_wp_chatbot_no');
1962 delete_option('qlcd_wp_chatbot_or');
1963 delete_option('qlcd_wp_chatbot_sorry');
1964 delete_option('qlcd_wp_chatbot_agent_join');
1965 delete_option('qlcd_wp_chatbot_welcome');
1966 delete_option('qlcd_wp_chatbot_back_to_start');
1967 delete_option('qlcd_wp_chatbot_hi_there');
1968 delete_option('qlcd_wp_chatbot_welcome_back');
1969 delete_option('qlcd_wp_chatbot_asking_name');
1970 delete_option('qlcd_wp_chatbot_name_greeting');
1971 delete_option('qlcd_wp_chatbot_i_am');
1972 delete_option('qlcd_wp_chatbot_wildcard_msg');
1973 delete_option('qlcd_wp_chatbot_empty_filter_msg');
1974 delete_option('qlcd_wp_chatbot_did_you_mean');
1975 delete_option('qlcd_wp_chatbot_wildcard_product');
1976 delete_option('qlcd_wp_chatbot_wildcard_catalog');
1977 delete_option('qlcd_wp_chatbot_featured_products');
1978 delete_option('qlcd_wp_chatbot_sale_products');
1979 delete_option('qlcd_wp_chatbot_wildcard_support');
1980 delete_option('qlcd_wp_chatbot_messenger_label');
1981 delete_option('qlcd_wp_chatbot_product_success');
1982 delete_option('qlcd_wp_chatbot_product_fail');
1983 delete_option('qlcd_wp_chatbot_product_asking');
1984 delete_option('qlcd_wp_chatbot_product_suggest');
1985 delete_option('qlcd_wp_chatbot_product_infinite');
1986 delete_option('qlcd_wp_chatbot_load_more');
1987 delete_option('qlcd_wp_chatbot_wildcard_order');
1988 delete_option('qlcd_wp_chatbot_order_welcome');
1989 delete_option('qlcd_wp_chatbot_order_username_asking');
1990 delete_option('qlcd_wp_chatbot_order_username_password');
1991 delete_option('qlcd_wp_chatbot_support_welcome');
1992 delete_option('qlcd_wp_chatbot_support_email');
1993 delete_option('qlcd_wp_chatbot_asking_email');
1994 delete_option('qlcd_wp_chatbot_asking_msg');
1995 delete_option('qlcd_wp_chatbot_no_result');
1996 delete_option('qlcd_wp_chatbot_admin_email');
1997 delete_option('qlcd_wp_chatbot_email_sub');
1998 delete_option('qlcd_wp_site_search');
1999 delete_option('qlcd_wp_chatbot_email_sent');
2000 delete_option('qlcd_wp_chatbot_support_phone');
2001 delete_option('qlcd_wp_chatbot_asking_phone');
2002 delete_option('qlcd_wp_chatbot_thank_for_phone');
2003 delete_option('qlcd_wp_chatbot_sys_key_help');
2004 delete_option('qlcd_wp_chatbot_sys_key_product');
2005 delete_option('qlcd_wp_chatbot_sys_key_catalog');
2006 delete_option('qlcd_wp_chatbot_sys_key_order');
2007 delete_option('qlcd_wp_chatbot_sys_key_support');
2008 delete_option('qlcd_wp_chatbot_sys_key_reset');
2009 delete_option('qlcd_wp_chatbot_order_username_not_exist');
2010 delete_option('qlcd_wp_chatbot_order_username_thanks');
2011 delete_option('qlcd_wp_chatbot_order_password_incorrect');
2012 delete_option('qlcd_wp_chatbot_order_not_found');
2013 delete_option('qlcd_wp_chatbot_order_found');
2014 delete_option('qlcd_wp_chatbot_order_email_support');
2015 delete_option('qlcd_wp_chatbot_support_option_again');
2016 delete_option('qlcd_wp_chatbot_invalid_email');
2017 delete_option('qlcd_wp_chatbot_shopping_cart');
2018 delete_option('qlcd_wp_chatbot_add_to_cart');
2019 delete_option('qlcd_wp_chatbot_cart_link');
2020 delete_option('qlcd_wp_chatbot_checkout_link');
2021 delete_option('qlcd_wp_chatbot_cart_welcome');
2022 delete_option('qlcd_wp_chatbot_featured_product_welcome');
2023 delete_option('qlcd_wp_chatbot_viewed_product_welcome');
2024 delete_option('qlcd_wp_chatbot_latest_product_welcome');
2025 delete_option('qlcd_wp_chatbot_cart_title');
2026 delete_option('qlcd_wp_chatbot_cart_quantity');
2027 delete_option('qlcd_wp_chatbot_cart_price');
2028 delete_option('qlcd_wp_chatbot_no_cart_items');
2029 delete_option('qlcd_wp_chatbot_cart_updating');
2030 delete_option('qlcd_wp_chatbot_cart_removing');
2031 delete_option('qlcd_wp_chatbot_email_fail');
2032 delete_option('support_query');
2033 delete_option('support_ans');
2034 delete_option('qlcd_wp_chatbot_notification_interval');
2035 delete_option('qlcd_wp_chatbot_notifications');
2036 delete_option( 'qlcd_wp_chatbot_search_option');
2037 delete_option( 'wp_chatbot_index_count');
2038 delete_option( 'wp_chatbot_app_pages');
2039 //messenger option
2040 delete_option( 'enable_wp_chatbot_messenger');
2041 delete_option( 'enable_wp_chatbot_messenger_floating_icon');
2042 delete_option( 'qlcd_wp_chatbot_fb_app_id');
2043 delete_option( 'qlcd_wp_chatbot_fb_page_id');
2044 delete_option( 'qlcd_wp_chatbot_fb_color');
2045 delete_option( 'qlcd_wp_chatbot_fb_in_msg');
2046 delete_option( 'qlcd_wp_chatbot_fb_out_msg');
2047 //skype option
2048 delete_option( 'enable_wp_chatbot_skype_floating_icon');
2049 delete_option( 'enable_wp_chatbot_skype_id');
2050 //whats app
2051 delete_option( 'enable_wp_chatbot_whats');
2052 delete_option( 'qlcd_wp_chatbot_whats_label');
2053 delete_option( 'enable_wp_chatbot_floating_whats');
2054 delete_option( 'qlcd_wp_chatbot_whats_num');
2055 // Viber
2056 delete_option( 'enable_wp_chatbot_floating_viber');
2057 delete_option( 'qlcd_wp_chatbot_viber_acc');
2058 //Integration others
2059 delete_option( 'enable_wp_chatbot_floating_phone');
2060 delete_option( 'qlcd_wp_chatbot_phone');
2061 delete_option( 'enable_wp_chatbot_floating_link');
2062 delete_option( 'qlcd_wp_chatbot_weblink');
2063 //Re Targetting
2064 delete_option( 'qlcd_wp_chatbot_ret_greet');
2065 delete_option( 'enable_wp_chatbot_exit_intent');
2066 delete_option( 'wp_chatbot_exit_intent_msg');
2067 delete_option( 'wp_chatbot_exit_intent_once');
2068
2069 delete_option( 'enable_wp_chatbot_scroll_open');
2070 delete_option( 'wp_chatbot_scroll_open_msg');
2071 delete_option( 'wp_chatbot_scroll_percent');
2072 delete_option( 'wp_chatbot_scroll_once');
2073
2074 delete_option( 'enable_wp_chatbot_auto_open');
2075 delete_option( 'enable_wp_chatbot_ret_sound');
2076 delete_option( 'enable_wp_chatbot_sound_initial');
2077 delete_option( 'disable_wp_chatbot_feedback');
2078 delete_option( 'disable_wp_chatbot_faq');
2079 delete_option( 'qlcd_wp_chatbot_feedback_label');
2080 delete_option( 'enable_wp_chatbot_meta_title');
2081 delete_option( 'qlcd_wp_chatbot_meta_label');
2082 delete_option( 'wp_chatbot_auto_open_msg');
2083 delete_option( 'wp_chatbot_auto_open_time');
2084 delete_option( 'wp_chatbot_auto_open_once');
2085 delete_option( 'wp_chatbot_inactive_once');
2086 delete_option( 'wp_chatbot_proactive_bg_color');
2087 delete_option( 'qlcd_wp_chatbot_phone_sent');
2088 delete_option( 'qlcd_wp_chatbot_phone_fail');
2089 delete_option( 'disable_wp_chatbot_call_gen');
2090 delete_option( 'disable_wp_chatbot_site_search');
2091 delete_option( 'disable_wp_chatbot_call_sup');
2092
2093 delete_option( 'enable_wp_chatbot_ret_user_show');
2094 delete_option( 'enable_wp_chatbot_inactive_time_show');
2095 delete_option( 'wp_chatbot_inactive_time');
2096 delete_option( 'wp_chatbot_checkout_msg');
2097 delete_option( 'qlcd_wp_chatbot_shopper_demo_name');
2098 delete_option( 'qlcd_wp_chatbot_is_typing');
2099 delete_option( 'qlcd_wp_chatbot_send_a_msg');
2100 delete_option( 'qlcd_wp_chatbot_choose_option');
2101 delete_option( 'qlcd_wp_chatbot_viewed_products');
2102 delete_option( 'qlcd_wp_chatbot_help_welcome');
2103 delete_option( 'qlcd_wp_chatbot_help_msg');
2104 delete_option( 'qlcd_wp_chatbot_reset');
2105 delete_option( 'enable_wp_chatbot_opening_hour');
2106 delete_option( 'wpwbot_hours');
2107 delete_option( 'enable_wp_chatbot_dailogflow');
2108 delete_option( 'qlcd_wp_chatbot_dialogflow_client_token');
2109 delete_option( 'qlcd_wp_chatbot_dialogflow_defualt_reply');
2110 delete_option( 'qlcd_wp_chatbot_dialogflow_agent_language');
2111
2112 delete_option( 'qlcd_wp_chatbot_dialogflow_project_id');
2113 delete_option( 'wp_chatbot_df_api');
2114 delete_option( 'qlcd_wp_chatbot_dialogflow_project_key');
2115
2116 qcld_wb_chatboot_defualt_options();
2117 $html='Reset all options to default successfully.';
2118 wp_send_json($html);
2119 }
2120 /**
2121 *
2122 * Function to load translation files.
2123 *
2124 */
2125 function wp_chatbot_lang_init() {
2126 load_plugin_textdomain( 'wpchatbot', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
2127 }
2128 add_action( 'plugins_loaded', 'wp_chatbot_lang_init');
2129
2130 $wpbot_feedback = new Wp_Usage_Feedback(
2131 __FILE__,
2132 'plugins@quantumcloud.com',
2133 false,
2134 true
2135
2136 );
2137
2138 function wpbot_help_page_callback_func(){
2139 ?>
2140 <div class="wrap swpm-admin-menu-wrap">
2141 <div class="container" style="margin-right:unset;margin-left:unset;">
2142 <h2></h2>
2143 <h1>&nbsp;Chatbot Help</h1>
2144 <div class="content form-container qcbot_help_secion" style="padding: 10px;color:#fff">
2145
2146 <h2 style="font-size:20px;margin-top: 10px;">Tutorials</h2>
2147 <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>
2148
2149 <h2 style="font-size:20px">Simple Text Responses</h2>
2150 <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>
2151
2152 <h2 style="font-size:20px">How to disable Predefined Intent?</h2>
2153 <p>You can disable predefined intents FAQ, eMail, Call me from WPBot Lite > Settings page's Start Menu Section.</p>
2154 <h2 style="font-size:20px">Setting Updates</h2>
2155 <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>
2156 <h2 style="font-size:20px">Tips</h2>
2157 <p>You could use &lt;br&gt; tag in Language Center & Dialogflow Responses for line break.</p>
2158
2159 </div>
2160 <div class="content form-container qcbot_help_secion" style="padding: 10px;color:#fff">
2161 <!-- new Section -->
2162
2163 <h2 style="margin-top: 10px;">WPBot Interactions</h2>
2164
2165 <h3 class="to-accordion-title qc_accordion_title" data-accordion="qc_accordion_content_first" style="font-size: 20px">Predefined intents - Built-in ChatBot Features<span class="to-accordion-open"><i class="fa fa-minus accentColorHover"></i></span></h3>
2166 <div class="qc_accordion_content_first" style="display:block">
2167 <p>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.</p>
2168
2169 <div class="section-container">
2170 <div class="wpb_column vc_column_container vc_col-sm-6">
2171 <div class="vc_column-inner ">
2172 <div class="wpb_wrapper">
2173 <div class="to-icon-box left txt-left">
2174 <i class="to-icon steadysets-icon-comment fa-4x fa fa-file-text-o"></i>
2175 <div class="to-icon-txt fa-4x-txt ">
2176 <h3>Simple Text Responses</h3>
2177 <p>Create unlimited text responses from your WordPress backend. The ChatBot uses advanced search algorithm for natural language phrase matching with user input. </p>
2178 </div>
2179 </div>
2180 <div class="to-icon-box left txt-left">
2181 <i class="to-icon icon-et-magnifying-glass fa-4x fa fa-search"></i>
2182 <div class="to-icon-txt fa-4x-txt ">
2183 <h3>Advanced Site Search <span class="qc_wpbot_pro">PRO</span></h3>
2184 <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>
2185 </div>
2186 </div>
2187 <div class="to-icon-box left txt-left">
2188 <i class="to-icon devices-headset fa-4x fa fa-phone"></i>
2189 <div class="to-icon-txt fa-4x-txt ">
2190 <h3>Send eMail, Call Me Back &amp; Feedback Collection </h3>
2191 <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!</p>
2192 </div>
2193 </div>
2194 </div>
2195 </div>
2196 </div>
2197 <div class="wpb_column vc_column_container vc_col-sm-6">
2198 <div class="vc_column-inner ">
2199 <div class="wpb_wrapper">
2200 <div class="to-icon-box left txt-left">
2201 <i class="to-icon steadysets-icon-bullhorn fa-4x fa fa-bullhorn"></i>
2202 <div class="to-icon-txt fa-4x-txt ">
2203 <h3>Frequently Asked Questions</h3>
2204 <p>Create a set of Frequently Asked Questions or FAQ so users can quickly find answers to the most common questions they have.</p>
2205 </div>
2206 </div>
2207 <div class="to-icon-box left txt-left">
2208 <i class="to-icon li_mail fa-4x fa fa-envelope-open-o"></i>
2209 <div class="to-icon-txt fa-4x-txt ">
2210 <h3>Newsletter Subscription <span class="qc_wpbot_pro">PRO</span></h3>
2211 <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>
2212 </div>
2213 </div>
2214 </div>
2215 </div>
2216 </div>
2217 </div>
2218 </div>
2219 <div style="clear:both"></div>
2220
2221 <h3 class="to-accordion-title qc_accordion_title" data-accordion="qc_accordion_content_second" style="padding-top: 20px;margin-top: 20px !important;border-top: 1px solid;font-size: 20px;">DialogFlow ES and CX<span class="to-accordion-open"><i class="fa fa-plus accentColorHover"></i></span></h3>
2222 <div class="qc_accordion_content_second">
2223 <div class="wpb_text_column wpb_content_element ">
2224 <div class="section-container">
2225 <div class="wpb_column vc_column_container vc_col-sm-6">
2226 <div class="wpb_wrapper">
2227 <h2 style="font-size: 20px;">DialogFlow Essential</h2>
2228 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.
2229 <p></p>
2230 <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></p>
2231 <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></p>
2232 </div>
2233 </div>
2234 <div class="wpb_column vc_column_container vc_col-sm-6">
2235 <div class="wpb_wrapper">
2236 <h2 style="font-size: 20px;">DialogFlow CX <span class="qc_wpbot_pro">PRO</span></h2>
2237 <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>
2238 <ul>
2239 <li><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.</li>
2240 <li><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.</li>
2241 <li><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.</li>
2242 <img style="width:100%" src="<?php echo QCLD_wpCHATBOT_IMG_URL; ?>dialogflow-cx-1024x676.jpg" alt="Dialogflow CX" />
2243 </ul>
2244 </div>
2245 </div>
2246 </div>
2247 </div>
2248 </div>
2249 <div style="clear:both"></div>
2250
2251 <h3 class="to-accordion-title qc_accordion_title" data-accordion="qc_accordion_content_third" style="padding-top: 20px;margin-top: 20px !important;border-top: 1px solid;font-size: 20px;">Menu Driven - Created with Conversational Form Builder Addon<span class="to-accordion-open"><i class="fa fa-plus accentColorHover"></i></span></h3>
2252 <div class="qc_accordion_content_third">
2253 <div class="wpb_text_column wpb_content_element ">
2254 <div class="wpb_wrapper">
2255 <p>Extend the Start Menu with the <strong>powerful <a href="https://www.quantumcloud.com/products/chatbot-addons/#bargain" target="_blank" rel="noopener noreferrer">Conversational Forms</a></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> <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>.</p>
2256 <h4>What Can You Do with it?</h4>
2257 <p>Conversation Forms allows you to create a wide variety of forms, that might include:</p>
2258 <ul>
2259 <li>Conditional <strong>Menu Driven Conversations</strong> <span class="qc_wpbot_pro" style="font-size: 9px;">PRO</span></li>
2260 <li>Standard Contact Forms</li>
2261 <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></li>
2262 <li>Job <strong>Application Forms</strong></li>
2263 <li><strong>Lead Capture</strong> Forms</li>
2264 <li>Various types of <strong>Calculators</strong> <span class="qc_wpbot_pro" style="font-size: 9px;">PRO</span></li>
2265 <li>Feedback <strong>Survey</strong> Forms etc.</li>
2266 </ul>
2267
2268 </div>
2269 </div>
2270 </div>
2271
2272 <!-- end new Section -->
2273
2274 </div>
2275 <div class="content form-container qcbot_help_secion" style="padding: 10px;color:#fff">
2276 <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>
2277 </div>
2278
2279 </div>
2280
2281 </div>
2282 <?php
2283 }
2284
2285 add_action('init', 'qc_wp_latest_update_check');
2286 function qc_wp_latest_update_check(){
2287 global $wpdb;
2288 if(!get_option('qc_wp_ludate_ck')){
2289 update_option('qlcd_wp_chatbot_support_phone', 'Leave your number. We will call you back!');
2290 update_option('qlcd_wp_chatbot_support_email', 'Send us Email');
2291 update_option('qlcd_wp_chatbot_wildcard_support', 'FAQ');
2292 update_option('qc_wp_ludate_ck', 'done');
2293 }
2294
2295 if( ! get_option( 'wpbot-admin-notice-oninstallation' ) ){
2296 update_option('wpbot-admin-notice-oninstallation', 'show');
2297 }
2298
2299 if(!get_option('qc_wpb_simple_response_db_upgrade_free2')){
2300
2301 $collate = '';
2302 if ( $wpdb->has_cap( 'collation' ) ) {
2303
2304 if ( ! empty( $wpdb->charset ) ) {
2305
2306 $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
2307 }
2308 if ( ! empty( $wpdb->collate ) ) {
2309
2310 $collate .= " COLLATE $wpdb->collate";
2311
2312 }
2313 }
2314 //Bot Response Table
2315 $table1 = $wpdb->prefix.'wpbot_response';
2316 $sql_sliders_Table1 = "
2317 CREATE TABLE IF NOT EXISTS `$table1` (
2318 `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
2319 `query` TEXT NOT NULL,
2320 `keyword` TEXT NOT NULL,
2321 `response` TEXT NOT NULL,
2322 `category` varchar(256) NOT NULL,
2323 `intent` varchar(256) NOT NULL,
2324 `custom` varchar(256) NOT NULL,
2325 FULLTEXT(`query`, `keyword`, `response`)
2326 ) $collate AUTO_INCREMENT=1 ENGINE=InnoDB";
2327
2328 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
2329 dbDelta( $sql_sliders_Table1 );
2330
2331 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
2332 update_option('qlcd_wp_chatbot_did_you_mean', serialize(array('Did you mean?')));
2333 }
2334
2335 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
2336 update_option('qlcd_wp_chatbot_did_you_mean', serialize(array('Did you mean?')));
2337 }
2338
2339 $sqlqry = $wpdb->get_results("select * from $table1");
2340 if(empty($sqlqry)){
2341
2342 $query = 'What Can WPBot do for you?';
2343 $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!';
2344
2345 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
2346 $format = array('%s','%s', '%s', '%s');
2347 $wpdb->insert($table1,$data,$format);
2348 }
2349
2350 update_option('qc_wpb_simple_response_db_upgrade_free2', 'done');
2351
2352 }
2353
2354 if(!get_option('qc_wp_db_engine_update_free')){
2355 $table1 = $wpdb->prefix.'wpbot_response';
2356 $wpdb->query("ALTER TABLE $table1 ENGINE = InnoDB");
2357
2358 update_option('qc_wp_db_engine_update_free', 'done');
2359 }
2360 if(!get_option('qc_wp_db_engine_update_free_unassign')){
2361 $table1 = $wpdb->prefix.'wpbot_response';
2362 $wpdb->query("ALTER TABLE $table1 CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;");
2363 update_option('qc_wp_db_engine_update_free_unassign', 'done');
2364 }
2365
2366 if(isset($_POST['qc_bot_str_query']) && $_POST['qc_bot_str_query']!='' && !class_exists('Qcld_str_pro')){
2367
2368 $query = wp_unslash(sanitize_text_field($_POST['qc_bot_str_query']));
2369 $keyword = wp_unslash(sanitize_text_field($_POST['qc_bot_str_keyword']));
2370 $intent = wp_unslash(sanitize_text_field($_POST['qc_bot_str_intent']));
2371
2372 $category = '';
2373
2374 $response = wp_kses(wp_unslash($_POST['qc_bot_str_response']), 'post');
2375
2376 $table = $wpdb->prefix.'wpbot_response';
2377 $data = array('query' => $query, 'keyword' => $keyword, 'response'=> $response, 'intent'=> $intent, 'category'=> $category);
2378 $format = array('%s','%s', '%s', '%s', '%s');
2379
2380 if(isset($_POST['qc_bot_str_id']) && $_POST['qc_bot_str_id']!=''){
2381 $id = sanitize_text_field($_POST['qc_bot_str_id']);
2382 $where = array('id'=>$id);
2383 $whereformat = array('%d');
2384 $wpdb->update( $table, $data, $where, $format, $whereformat );
2385 }else{
2386 $wpdb->insert($table,$data,$format);
2387 }
2388
2389 qc_mysql_remove_existing_indexes();
2390 $wpdb->query("ALTER TABLE $table ADD FULLTEXT(`query`, `keyword`, `response`)");
2391
2392 wp_redirect(admin_url('admin.php?page=simple-text-response'));exit;
2393
2394 }
2395 if(isset($_POST['qc_bot_str_weight']) && $_POST['qc_bot_str_weight']!=''){
2396 $weight = sanitize_text_field($_POST['qc_bot_str_weight']);
2397 update_option('qc_bot_str_weight', $weight);
2398 }
2399 if(isset($_POST['qc_bot_str_remove_stopwords']) && $_POST['qc_bot_str_remove_stopwords']!=''){
2400 $stopwords = sanitize_text_field($_POST['qc_bot_str_remove_stopwords']);
2401 update_option('qc_bot_str_remove_stopwords', $stopwords);
2402 }
2403 if(isset($_POST['qc_bot_str_fields']) && !empty($_POST['qc_bot_str_fields'])){
2404
2405 $table = $wpdb->prefix.'wpbot_response';
2406 $fields = ($_POST['qc_bot_str_fields']);
2407 qc_mysql_remove_existing_indexes();
2408
2409 if($fields && !empty($fields)){
2410 $wpdb->query("ALTER TABLE $table ADD FULLTEXT(".implode(', ', $fields).")");
2411 }
2412 update_option('qc_bot_str_fields', $fields);
2413 }
2414
2415 if(!get_option('wpbot_preloading_time')) {
2416 update_option('wpbot_preloading_time', '0.5');
2417 }
2418
2419 }
2420
2421 function qc_wpbot_simple_response_intent(){
2422 global $wpdb;
2423 $table = $wpdb->prefix.'wpbot_response';
2424 $results = $wpdb->get_results("SELECT `intent` FROM `wp_wpbot_response` WHERE 1 and `intent` !=''");
2425 $response = array();
2426 if(!empty($results)){
2427 foreach($results as $result){
2428 $response[] = $result->intent;
2429 }
2430 }
2431 return $response;
2432 }
2433
2434 function qc_mysql_remove_existing_indexes(){
2435 global $wpdb;
2436 $table = $wpdb->prefix.'wpbot_response';
2437
2438 $results = $wpdb->get_results("SHOW INDEX FROM $table");
2439 $indexes = array();
2440 foreach($results as $result){
2441
2442
2443
2444 if("PRIMARY" != $result->Key_name && !in_array($result->Key_name, $indexes)){
2445 $wpdb->query("ALTER TABLE $table DROP INDEX `".$result->Key_name
2446 ."`;");
2447 $indexes[] = $result->Key_name;
2448 }
2449
2450 }
2451 }
2452
2453 add_action( 'activated_plugin', 'qc_wpbotfree_activation_redirect' );
2454 function qc_wpbotfree_activation_redirect( $plugin ){
2455
2456 if( $plugin == plugin_basename( __FILE__ ) ) {
2457 exit( wp_redirect( admin_url('admin.php?page=wpbot_help_page') ) );
2458 }
2459 }
2460
2461
2462
2463