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

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

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