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

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

1,883 lines 115.3 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 Chat Bot plugin to provide quick support and email functionality.
6 * Donate link: https://www.quantumcloud.com
7 * Version: 2.9.0
8 * @author QuantumCloud
9 * Author: QunatumCloud
10 * Author URI: https://www.quantumcloud.com/
11 * Requires at least: 4.9
12 * Tested up to: 5.2
13 * Text Domain: wpbot
14 * Domain Path: /lang
15 * License: GPL2
16 */
17
18
19 if (!defined('ABSPATH')) exit; // Exit if accessed directly
20 define('QCLD_wpCHATBOT_VERSION', '1.0');
21 define('QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION', 2.2);
22 define('QCLD_wpCHATBOT_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
23 define('QCLD_wpCHATBOT_PLUGIN_URL', plugin_dir_url(__FILE__));
24 define('QCLD_wpCHATBOT_IMG_URL', QCLD_wpCHATBOT_PLUGIN_URL . "images/");
25 define('QCLD_wpCHATBOT_IMG_ABSOLUTE_PATH', plugin_dir_path(__FILE__) . "images");
26 define('QCLD_wpCHATBOT_INDEX_TABLE', 'wpwbot_index');
27 //define('QCLD_wpCHATBOT_CACHE_TABLE', 'wpwbot_cache');
28 require_once("qcld-wpwbot-search.php");
29 require_once("class-qc-free-plugin-upgrade-notice.php");
30 require_once("class-plugin-deactivate-feedback.php");
31 require_once("qc-support-promo-page/class-qc-support-promo-page.php");
32 require_once("functions.php");
33 /*
34 if(file_exists(QCLD_wpCHATBOT_PLUGIN_DIR_PATH. "/conversion-tracker/class-qc-conversion-tracker.php")){
35 require_once (QCLD_wpCHATBOT_PLUGIN_DIR_PATH. "/conversion-tracker/class-qc-conversion-tracker.php");
36 }
37 */
38 /**
39 * Main Class.
40 */
41 class qcld_wb_Chatbot
42 {
43 private $id = 'wpbot';
44 private static $instance;
45 /**
46 * Get Instance creates a singleton class that's cached to stop duplicate instances
47 */
48 public static function qcld_wb_chatbot_get_instance()
49 {
50 if (!self::$instance) {
51 self::$instance = new self();
52 self::$instance->qcld_wb_chatbot_init();
53 }
54 return self::$instance;
55 }
56 /**
57 * Construct empty on purpose
58 */
59 private function __construct()
60 {
61 }
62 /**
63 * Init behaves like, and replaces, construct
64 */
65 public function qcld_wb_chatbot_init()
66 {
67 // Check if wpCommerce is active, and is required wpCommerce version.
68 /*if (!class_exists('wpCommerce') || version_compare(get_option('wpcommerce_db_version'), QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION, '<')) {
69 add_action('admin_notices', array($this, 'wpcommerce_inactive_notice_for_wp_chatbot'));
70 return;
71 }*/
72 add_action('admin_menu', array($this, 'qcld_wb_chatbot_admin_menu'));
73 if ((!empty($_GET["page"])) && ($_GET["page"] == "wpbot")) {
74 add_action('admin_init', array($this, 'qcld_wb_chatbot_save_options'));
75 }
76 if (is_admin() && !empty($_GET["page"]) && ($_GET["page"] == "wpbot")) {
77 add_action('admin_enqueue_scripts', array($this, 'qcld_wb_chatbot_admin_scripts'));
78 if( get_option('wp_chatbot_index_count')<=0 && get_option('qlcd_wp_chatbot_search_option')=='advanced'){
79 add_action( 'admin_notices', array( $this, 'admin_notice_reindex' ) );
80 }
81 }
82 if (!is_admin()) {
83 add_action('wp_enqueue_scripts', array($this, 'qcld_wb_chatbot_frontend_scripts'));
84 }
85 }
86 /**
87 * Add a submenu item to the wpCommerce menu
88 */
89 public function qcld_wb_chatbot_admin_menu()
90 {
91 /* add_submenu_page('wpcommerce',
92 __('wpwBot Pro', 'wpchatbot'),
93 __('wpwBot Pro', 'wpchatbot'),
94 'manage_wpcommerce',
95 $this->id,
96 array($this, 'qcld_wb_chatbot_admin_page'));*/
97 add_menu_page( 'WPBot Lite', 'WPBot Lite', 'manage_options','wpbot', array($this, 'qcld_wb_chatbot_admin_page'),'dashicons-format-status', 6 );
98
99 add_submenu_page( 'wpbot', 'Support', 'Support', 'manage_options','wpbot_support_page', 'qcpromo_support_page_callback_func' );
100 }
101 /**
102 * Include admin scripts
103 */
104 public function qcld_wb_chatbot_admin_scripts($hook)
105 {
106 global $wpcommerce, $wp_scripts;
107 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
108 if (((!empty($_GET["page"])) && ($_GET["page"] == "wpbot")) || ($hook == "widgets.php")) {
109 wp_enqueue_script('jquery');
110 //wp_enqueue_style('wpcommerce_admin_styles', $wpcommerce->plugin_url() . '/assets/css/admin.css');
111 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');
112 wp_enqueue_style('qlcd-wp-chatbot-admin-style');
113 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');
114 wp_enqueue_style('qlcd-wp-chatbot-font-awesome');
115 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');
116 wp_enqueue_style('qlcd-wp-chatbot-tabs-style');
117 wp_enqueue_script('jquery');
118 wp_enqueue_script('jquery-ui-core');
119 wp_enqueue_style( 'wp-color-picker');
120 wp_enqueue_script( 'wp-color-picker');
121 wp_enqueue_script( 'jquery-ui-sortable');
122 wp_register_script('qcld-wp-chatbot-cbpFWTabs', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/cbpFWTabs.js', basename(__FILE__)), array(), true);
123 wp_enqueue_script('qcld-wp-chatbot-cbpFWTabs');
124 wp_register_script('qcld-wp-chatbot-modernizr-custom', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/modernizr.custom.js', basename(__FILE__)), array(), true);
125 wp_enqueue_script('qcld-wp-chatbot-modernizr-custom');
126 wp_register_script('qcld-wp-chatbot-bootstrap-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/bootstrap.js', basename(__FILE__)), array('jquery'), true);
127 wp_enqueue_script('qcld-wp-chatbot-bootstrap-js');
128 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');
129 wp_enqueue_style('qcld-wp-chatbot-bootstrap-css');
130 //jquery time picker
131 wp_register_script('qcld-wp-chatbot-timepicker-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/jquery.timepicker.js', basename(__FILE__)), array('jquery'), true);
132 wp_enqueue_script('qcld-wp-chatbot-timepicker-js');
133 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');
134 wp_enqueue_style('qcld-wp-chatbot-timepicker-css');
135 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);
136 wp_enqueue_script('qcld-wp-chatbot-admin-js');
137 wp_localize_script('qcld-wp-chatbot-admin-js', 'ajax_object',
138 array('ajax_url' => admin_url('admin-ajax.php'),'image_path' => QCLD_wpCHATBOT_IMG_URL));
139 // WordPress Media library
140 wp_enqueue_media();
141 }
142 }
143 public function qcld_wb_chatbot_frontend_scripts()
144 {
145 global $wpcommerce, $wp_scripts;
146 $wp_chatbot_obj = array(
147 'wp_chatbot_position_x' => get_option('wp_chatbot_position_x'),
148 'wp_chatbot_position_y' => get_option('wp_chatbot_position_y'),
149 'disable_icon_animation' => get_option('disable_wp_chatbot_icon_animation'),
150 'disable_featured_product' => get_option('disable_wp_chatbot_featured_product'),
151 'disable_product_search' => get_option('disable_wp_chatbot_product_search'),
152 'disable_catalog' => get_option('disable_wp_chatbot_catalog'),
153 'disable_order_status' => get_option('disable_wp_chatbot_order_status'),
154 'disable_sale_product' => get_option('disable_wp_chatbot_sale_product'),
155 'open_product_detail' => get_option('wp_chatbot_open_product_detail'),
156 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
157 'ajax_url' => admin_url('admin-ajax.php'),
158 'image_path' => QCLD_wpCHATBOT_IMG_URL,
159 'yes' => str_replace('\\', '',get_option('qlcd_wp_chatbot_yes')),
160 'no' => str_replace('\\', '',get_option('qlcd_wp_chatbot_no')),
161 'or' => str_replace('\\', '',get_option('qlcd_wp_chatbot_or')),
162 'host' => str_replace('\\', '',get_option('qlcd_wp_chatbot_host')),
163 'agent' => str_replace('\\', '',get_option('qlcd_wp_chatbot_agent')),
164 'agent_image' => get_option('wp_chatbot_agent_image'),
165 'agent_image_path' => $this->qcld_wb_chatbot_agent_icon(),
166 'shopper_demo_name' => str_replace('\\', '',get_option('qlcd_wp_chatbot_shopper_demo_name')),
167 'agent_join' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_agent_join'))),
168 'welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome'))),
169 'welcome_back' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_welcome_back'))),
170 'hi_there' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_hi_there'))),
171 'asking_name' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_name'))),
172 'i_am' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_i_am'))),
173 'name_greeting' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_name_greeting'))),
174 'wildcard_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_msg'))),
175 'empty_filter_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_empty_filter_msg'))),
176 'is_typing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_is_typing'))),
177 'send_a_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_send_a_msg'))),
178 'viewed_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_viewed_products'))),
179 'shopping_cart' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_shopping_cart'))),
180 'cart_updating' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_updating'))),
181 'cart_removing' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_cart_removing'))),
182 'sys_key_help' => get_option('qlcd_wp_chatbot_sys_key_help'),
183 'sys_key_product' => get_option('qlcd_wp_chatbot_sys_key_product'),
184 'sys_key_catalog' => get_option('qlcd_wp_chatbot_sys_key_catalog'),
185 'sys_key_order' => get_option('qlcd_wp_chatbot_sys_key_order'),
186 'sys_key_support' => get_option('qlcd_wp_chatbot_sys_key_support'),
187 'sys_key_reset' => get_option('qlcd_wp_chatbot_sys_key_reset'),
188 'help_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_welcome'))),
189 'back_to_start' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_back_to_start'))),
190 'help_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_msg'))),
191 'reset' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_reset'))),
192 'wildcard_product' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_product'))),
193 'wildcard_catalog' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_catalog'))),
194 'featured_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_featured_products'))),
195 'sale_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_sale_products'))),
196 'wildcard_order' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_order'))),
197 'wildcard_support' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_support'))),
198 'product_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_asking'))),
199 'product_suggest' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_suggest'))),
200 'product_infinite' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_infinite'))),
201 'product_success' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_success'))),
202 'product_fail' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_fail'))),
203 'support_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_welcome'))),
204 'support_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_email'))),
205 'support_option_again' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_option_again'))),
206 'asking_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_email'))),
207 'asking_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_msg'))),
208 'no_result' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_no_result'))),
209 'support_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_phone'))),
210 'asking_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_phone'))),
211 'thank_for_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_thank_for_phone'))),
212 'support_query' =>$this->qcld_wb_chatbot_str_replace(unserialize( get_option('support_query'))),
213 'support_ans' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('support_ans'))),
214 'notification_interval' => get_option('qlcd_wp_chatbot_notification_interval'),
215 'notifications' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_notifications'))),
216 'order_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_welcome'))),
217 'order_username_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_asking'))),
218 'order_username_password' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_password'))),
219 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
220 'order_login' => is_user_logged_in(),
221 'order_nonce' => wp_create_nonce("wpwbot-order-nonce"),
222 'order_email_support' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_email_support'))),
223 'email_fail' => str_replace('\\', '', get_option('qlcd_wp_chatbot_email_fail')),
224 'invalid_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_invalid_email'))),
225 'stop_words' => str_replace('\\', '', get_option('qlcd_wp_chatbot_stop_words')),
226 'currency_symbol' => '',
227 'enable_messenger' => get_option('enable_wp_chatbot_messenger'),
228 'messenger_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_messenger_label'))),
229 'fb_page_id' => get_option('qlcd_wp_chatbot_fb_page_id'),
230 'enable_skype' => get_option('enable_wp_chatbot_skype'),
231 'enable_whats' => get_option('enable_wp_chatbot_whats'),
232 'whats_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_whats_label'))),
233 'whats_num' => get_option('qlcd_wp_chatbot_whats_num'),
234 'ret_greet' => get_option('qlcd_wp_chatbot_ret_greet'),
235 'enable_exit_intent' => get_option('enable_wp_chatbot_exit_intent'),
236 'exit_intent_msg' => str_replace('\\', '', get_option('wp_chatbot_exit_intent_msg')),
237 'exit_intent_once' => get_option('wp_chatbot_exit_intent_once'),
238 'enable_scroll_open' => get_option('enable_wp_chatbot_scroll_open'),
239 'scroll_open_msg' => str_replace('\\', '', get_option('wp_chatbot_scroll_open_msg')),
240 'scroll_open_percent' => get_option('wp_chatbot_scroll_percent'),
241 'scroll_open_once' => get_option('wp_chatbot_scroll_once'),
242 'enable_auto_open' => get_option('enable_wp_chatbot_auto_open'),
243 'auto_open_msg' => str_replace('\\', '', get_option('wp_chatbot_auto_open_msg')),
244 'auto_open_time' => get_option('wp_chatbot_auto_open_time'),
245 'auto_open_once' => get_option('wp_chatbot_auto_open_once'),
246 'proactive_bg_color' => get_option('wp_chatbot_proactive_bg_color'),
247 'disable_feedback' => get_option('disable_wp_chatbot_feedback'),
248 'disable_faq' => get_option('disable_wp_chatbot_faq'),
249 'feedback_label' =>$this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_feedback_label'))),
250 'enable_meta_title' =>get_option('enable_wp_chatbot_meta_title'),
251 'meta_label' =>str_replace('\\', '', get_option('qlcd_wp_chatbot_meta_label')),
252 'phone_number' => get_option('qlcd_wp_chatbot_phone'),
253 'disable_site_search' => get_option('disable_wp_chatbot_site_search'),
254 'site_search' => get_option('qlcd_wp_site_search'),
255 'call_gen' => get_option('disable_wp_chatbot_call_gen'),
256 'call_sup' => get_option('disable_wp_chatbot_call_sup'),
257 'enable_ret_sound' => get_option('enable_wp_chatbot_ret_sound'),
258 'enable_ret_user_show' => get_option('enable_wp_chatbot_ret_user_show'),
259 'enable_inactive_time_show' => get_option('enable_wp_chatbot_inactive_time_show'),
260 'ret_inactive_user_once' => get_option('wp_chatbot_inactive_once'),
261 'mobile_full_screen' => get_option('enable_wp_chatbot_mobile_full_screen'),
262 'inactive_time' => get_option('wp_chatbot_inactive_time'),
263 'checkout_msg' => str_replace('\\', '', get_option('wp_chatbot_checkout_msg')),
264 'ai_df_enable' => get_option('enable_wp_chatbot_dailogflow'),
265 'ai_df_token' => get_option('qlcd_wp_chatbot_dialogflow_client_token'),
266 'df_defualt_reply' => str_replace('\\', '', get_option('qlcd_wp_chatbot_dialogflow_defualt_reply')),
267 'df_agent_lan' => get_option('qlcd_wp_chatbot_dialogflow_agent_language'),
268 );
269 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);
270 wp_enqueue_script('qcld-wp-chatbot-slimscroll-js');
271 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);
272 wp_enqueue_script('qcld-wp-chatbot-jquery-cookie');
273 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);
274 wp_enqueue_script('qcld-wp-chatbot-magnify-popup');
275 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);
276 wp_enqueue_script('qcld-wp-chatbot-plugin');
277 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);
278 wp_enqueue_script('qcld-wp-chatbot-front-js');
279 wp_localize_script('qcld-wp-chatbot-front-js', 'wp_chatbot_obj', $wp_chatbot_obj);
280 //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);
281 //wp_enqueue_script('qcld-wp-chatbot-frontend');
282 //wp_localize_script('qcld-wp-chatbot-frontend', 'wp_chatbot_obj', $wp_chatbot_obj);
283 wp_localize_script('qcld-wp-chatbot-frontend', 'wp_chatbot_obj', $wp_chatbot_obj);
284 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');
285 wp_enqueue_style('qcld-wp-chatbot-common-style');
286 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');
287 wp_enqueue_style('qcld-wp-chatbot-magnific-popup');
288 $qcld_wb_chatbot_theme = get_option('qcld_wb_chatbot_theme');
289 /* if (file_exists(QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/templates/' . $qcld_wb_chatbot_theme . '/style.css')) {
290 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');
291 wp_enqueue_style('qcld-wp-chatbot-style');
292 }*/
293 //Loading shortcode style
294 if (file_exists(QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/templates/' . $qcld_wb_chatbot_theme . '/shortcode.css')) {
295 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');
296 wp_enqueue_style('qcld-wp-chatbot-shortcode-style');
297 }
298 }
299 public function qcld_wb_chatbot_str_replace($messages=array()){
300 $refined_mesgses=array();
301 if(!empty($messages)){
302 foreach ($messages as $message){
303 $refined_msg=str_replace('\\', '', $message);
304 array_push($refined_mesgses,$refined_msg);
305 }
306 }
307 return $refined_mesgses;
308 }
309 //getting exact agent icon path
310 public function qcld_wb_chatbot_agent_icon(){
311
312 if(get_option('wp_chatbot_custom_agent_path')!="" && get_option('wp_chatbot_agent_image')=="custom-agent.png" ){
313 $wp_chatbot_custom_icon_path=get_option('wp_chatbot_custom_agent_path');
314 }
315 else if(get_option('wp_chatbot_custom_agent_path')!="" && get_option('wp_chatbot_agent_image')!="custom-agent.png"){
316 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.get_option('wp_chatbot_agent_image');
317 }
318 else
319 {
320 if(get_option('wp_chatbot_agent_image')!=''){
321 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.get_option('wp_chatbot_agent_image');
322 }else{
323 $wp_chatbot_custom_icon_path=QCLD_wpCHATBOT_IMG_URL.'custom-agent.png';
324 }
325
326 }
327
328 return $wp_chatbot_custom_icon_path;
329 }
330 /**
331 * Render the admin page
332 */
333 public function qcld_wb_chatbot_admin_page()
334 {
335 global $wpcommerce;
336 $action = 'admin.php?page=wpbot';
337 require_once("admin_ui.php");
338 }
339 public function qcld_wb_chatbot_dynamic_multi_option($options = array(), $option_name = "", $option_text = "")
340 {
341 ?>
342 <h4 class="qc-opt-title"><?php _e($option_text, 'wpchatbot'); ?></h4>
343 <div class="wp-chatbot-lng-items">
344 <?php
345 if (is_array($options) && count($options) > 0) {
346 foreach ($options as $key => $value) {
347 ?>
348 <div class="row" class="wp-chatbot-lng-item">
349 <div class="col-xs-10">
350 <input type="text"
351 class="form-control qc-opt-dcs-font"
352 name="<?php echo $option_name; ?>[]"
353 value="<?php echo str_replace('\\', '', $value); ?>">
354 </div>
355 <div class="col-xs-2">
356 <button type="button" class="btn btn-danger btn-sm wp-chatbot-lng-item-remove">
357 <span class="glyphicon glyphicon-remove"></span>
358 </button>
359 </div>
360 </div>
361 <?php
362 }
363 } else { ?>
364 <div class="row" class="wp-chatbot-lng-item">
365 <div class="col-xs-10">
366 <input type="text"
367 class="form-control qc-opt-dcs-font"
368 name="<?php echo $option_name; ?>[]"
369 value="<?php echo $option_text; ?>">
370 </div>
371 <div class="col-xs-2">
372 <span class="wp-chatbot-lng-item-remove"><?php _e('X', 'wpchatbot'); ?></span>
373 </div>
374 </div>
375 <?php } ?>
376 </div>
377 <div class="row">
378 <div class="col-sm-2 col-sm-offset-10">
379 <button type="button" class="btn btn-success btn-sm wp-chatbot-lng-item-add"> <span class="glyphicon glyphicon-plus"></span> </button>
380 </div>
381 </div>
382 <?php
383 }
384 public function wp_chatbot_opening_hours($day_name,$wpwbot_times){
385 if(!empty($wpwbot_times) && isset($wpwbot_times[$day_name])){
386 $day_times=$wpwbot_times[$day_name];
387 if(!empty($day_times)){
388 $segment=0;
389 foreach ($day_times as $day_time ){
390 ?>
391 <div class="wp-chatbot-hours-container">
392 <div class="wp-chatbot-hours">
393 <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";} ?>" >
394 <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";} ?>" >
395 </div>
396 <div class="wp-chatbot-hours-remove">
397 <button type="button" class="btn btn-danger btn-sm wp-chatbot-hours-remove-btn">
398 <i class="fa fa-times" aria-hidden="true"></i>
399 </button>
400 </div>
401 </div>
402
403 <?php
404 $segment++;
405 }
406 }
407 }else{
408 ?>
409 <div class="wp-chatbot-hours-container">
410 <div class="wp-chatbot-hours">
411 <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">
412 </div>
413 <div class="wp-chatbot-hours-remove">
414 <button type="button" class="btn btn-danger btn-sm wp-chatbot-hours-remove-btn">
415 <i class="fa fa-times" aria-hidden="true"></i>
416 </button>
417 </div>
418 </div>
419 <?php
420 }
421 }
422 function qcld_wb_chatbot_save_options()
423 {
424 //global $wpcommerce;
425 if (isset($_POST['_wpnonce']) && $_POST['_wpnonce']) {
426 wp_verify_nonce($_POST['_wpnonce'], 'wp_chatbot');
427 // Check if the form is submitted or not
428 if (isset($_POST['submit'])) {
429 //wpwboticon position settings.
430 if (isset($_POST["wp_chatbot_position_x"])) {
431 $wp_chatbot_position_x = stripslashes(($_POST["wp_chatbot_position_x"]));
432 update_option('wp_chatbot_position_x', $wp_chatbot_position_x);
433 }
434 if (isset($_POST["wp_chatbot_position_y"])) {
435 $wp_chatbot_position_y = stripslashes(($_POST["wp_chatbot_position_y"]));
436 update_option('wp_chatbot_position_y', $wp_chatbot_position_y);
437 }
438 //product search options
439 if(isset($_POST['qlcd_wp_chatbot_search_option'])){
440 $qlcd_wp_chatbot_search_option = $_POST['qlcd_wp_chatbot_search_option'];
441 update_option('qlcd_wp_chatbot_search_option', sanitize_text_field($qlcd_wp_chatbot_search_option));
442 }
443
444 //Enable /disable wpwbot
445 if(isset( $_POST["disable_wp_chatbot"])){
446 $disable_wp_chatbot = $_POST["disable_wp_chatbot"];
447 }else{ $disable_wp_chatbot='';}
448 update_option('disable_wp_chatbot', stripslashes($disable_wp_chatbot));
449
450 if(isset( $_POST["qlcd_wp_chatbot_admin_email"])){
451 $qlcd_wp_chatbot_admin_email = $_POST["qlcd_wp_chatbot_admin_email"];
452 }else{ $qlcd_wp_chatbot_admin_email='';}
453 update_option('qlcd_wp_chatbot_admin_email', stripslashes($qlcd_wp_chatbot_admin_email));
454
455 if(isset( $_POST["disable_wp_chatbot_on_mobile"])) {
456 $disable_wp_chatbot_on_mobile = sanitize_text_field($_POST["disable_wp_chatbot_on_mobile"]);
457 }else{ $disable_wp_chatbot_on_mobile='';}
458 update_option('disable_wp_chatbot_on_mobile', stripslashes($disable_wp_chatbot_on_mobile));
459 if(isset( $_POST["disable_wp_chatbot_product_search"])) {
460 $disable_wp_chatbot_product_search = sanitize_text_field($_POST["disable_wp_chatbot_product_search"]);
461 }else{ $disable_wp_chatbot_product_search='';}
462 update_option('disable_wp_chatbot_product_search', stripslashes($disable_wp_chatbot_product_search));
463 if(isset( $_POST["disable_wp_chatbot_catalog"])) {
464 $disable_wp_chatbot_catalog= sanitize_text_field($_POST["disable_wp_chatbot_catalog"]);
465 }else{ $disable_wp_chatbot_catalog='';}
466 update_option('disable_wp_chatbot_catalog', stripslashes($disable_wp_chatbot_catalog));
467 if(isset( $_POST["disable_wp_chatbot_order_status"])) {
468 $disable_wp_chatbot_order_status = sanitize_text_field($_POST["disable_wp_chatbot_order_status"]);
469 }else{ $disable_wp_chatbot_order_status='';}
470 update_option('disable_wp_chatbot_order_status', stripslashes($disable_wp_chatbot_order_status));
471 if(isset( $_POST["disable_wp_chatbot_notification"])) {
472 $disable_wp_chatbot_notification = sanitize_text_field($_POST["disable_wp_chatbot_notification"]);
473 }else{ $disable_wp_chatbot_notification='1';}
474 update_option('disable_wp_chatbot_notification', stripslashes($disable_wp_chatbot_notification));
475
476 if(isset( $_POST["enable_wp_chatbot_rtl"])) {
477 $enable_wp_chatbot_rtl = $_POST["enable_wp_chatbot_rtl"];
478 }else{ $enable_wp_chatbot_rtl='';}
479 update_option('enable_wp_chatbot_rtl', stripslashes($enable_wp_chatbot_rtl));
480
481 if(isset( $_POST["enable_wp_chatbot_mobile_full_screen"])) {
482 $enable_wp_chatbot_mobile_full_screen = sanitize_text_field($_POST["enable_wp_chatbot_mobile_full_screen"]);
483 }else{ $enable_wp_chatbot_mobile_full_screen='';}
484 update_option('enable_wp_chatbot_mobile_full_screen', stripslashes($enable_wp_chatbot_mobile_full_screen));
485
486 if(isset( $_POST["disable_wp_chatbot_icon_animation"])) {
487 $disable_wp_chatbot_icon_animation = sanitize_text_field($_POST["disable_wp_chatbot_icon_animation"]);
488 }else{ $disable_wp_chatbot_icon_animation='';}
489 update_option('disable_wp_chatbot_icon_animation', stripslashes($disable_wp_chatbot_icon_animation));
490 //Enable /disable Cart Item Number
491 if(isset( $_POST["disable_wp_chatbot_cart_item_number"])) {
492 $disable_wp_chatbot_cart_item_number = sanitize_text_field($_POST["disable_wp_chatbot_cart_item_number"]);
493 }else{ $disable_wp_chatbot_cart_item_number='';}
494 update_option('disable_wp_chatbot_cart_item_number', stripslashes($disable_wp_chatbot_cart_item_number));
495 //Enable /disable featured products button.
496 if(isset( $_POST["disable_wp_chatbot_featured_product"])) {
497 $disable_wp_chatbot_featured_product = sanitize_text_field($_POST["disable_wp_chatbot_featured_product"]);
498 }else{ $disable_wp_chatbot_featured_product='';}
499 update_option('disable_wp_chatbot_featured_product', stripslashes($disable_wp_chatbot_featured_product));
500 //Enable /disable sale products button
501 if(isset( $_POST["disable_wp_chatbot_sale_product"])) {
502 $disable_wp_chatbot_sale_product = sanitize_text_field($_POST["disable_wp_chatbot_sale_product"]);
503 }else{ $disable_wp_chatbot_sale_product='';}
504 update_option('disable_wp_chatbot_sale_product', stripslashes($disable_wp_chatbot_sale_product));
505 //Enable Product details page.
506 if(isset( $_POST["wp_chatbot_open_product_detail"])) {
507 $wp_chatbot_open_product_detail = sanitize_text_field($_POST["wp_chatbot_open_product_detail"]);
508 }else{ $wp_chatbot_open_product_detail='';}
509 update_option('wp_chatbot_open_product_detail', stripslashes($wp_chatbot_open_product_detail));
510 //product order and order by
511 if(isset($_POST['qlcd_wp_chatbot_product_orderby'])){
512 $qlcd_wp_chatbot_product_orderby = sanitize_text_field($_POST['qlcd_wp_chatbot_product_orderby']);
513 update_option('qlcd_wp_chatbot_product_orderby', sanitize_text_field($qlcd_wp_chatbot_product_orderby));
514 }
515 if(isset($_POST['qlcd_wp_chatbot_product_order'])){
516 $qlcd_wp_chatbot_product_order = sanitize_text_field($_POST['qlcd_wp_chatbot_product_order']);
517 update_option('qlcd_wp_chatbot_product_order', sanitize_text_field($qlcd_wp_chatbot_product_order));
518 }
519
520
521 //Product per page settings.
522 if (isset($_POST["qlcd_wp_chatbot_ppp"])) {
523 $qlcd_wp_chatbot_ppp = $_POST["qlcd_wp_chatbot_ppp"];
524 update_option('qlcd_wp_chatbot_ppp', intval($qlcd_wp_chatbot_ppp));
525 }
526 if(isset( $_POST["wp_chatbot_exclude_stock_out_product"])) {
527 $wp_chatbot_exclude_stock_out_product = sanitize_text_field($_POST['wp_chatbot_exclude_stock_out_product']);
528 }else{ $wp_chatbot_exclude_stock_out_product='';}
529 update_option('wp_chatbot_exclude_stock_out_product', stripslashes($wp_chatbot_exclude_stock_out_product));
530 if(isset( $_POST["wp_chatbot_show_parent_category"])) {
531 $wp_chatbot_show_parent_category = sanitize_text_field($_POST['wp_chatbot_show_parent_category']);
532 }else{ $wp_chatbot_show_parent_category='';}
533 update_option('wp_chatbot_show_parent_category', stripslashes($wp_chatbot_show_parent_category));
534 if(isset( $_POST["wp_chatbot_show_sub_category"])) {
535 $wp_chatbot_show_sub_category = sanitize_text_field($_POST['wp_chatbot_show_sub_category']);
536 }else{ $wp_chatbot_show_sub_category='';}
537 update_option('wp_chatbot_show_sub_category', stripslashes($wp_chatbot_show_sub_category));
538 if (isset($_POST["qlcd_wp_chatbot_order_user"])) {
539 $qlcd_wp_chatbot_order_user = sanitize_text_field($_POST["qlcd_wp_chatbot_order_user"]);
540 update_option('qlcd_wp_chatbot_order_user', sanitize_text_field($qlcd_wp_chatbot_order_user));
541 }
542 //wpwBot Load control
543 if(isset($_POST["wp_chatbot_show_home_page"])){
544 $wp_chatbot_show_home_page = sanitize_key(($_POST["wp_chatbot_show_home_page"]));
545 update_option('wp_chatbot_show_home_page', $wp_chatbot_show_home_page);
546 }
547
548
549 if(isset($_POST["wp_chatbot_show_posts"])){
550 $wp_chatbot_show_posts = sanitize_key(($_POST["wp_chatbot_show_posts"]));
551 update_option('wp_chatbot_show_posts', $wp_chatbot_show_posts);
552 }
553
554
555 if(isset($_POST["wp_chatbot_show_pages"])){
556 $wp_chatbot_show_pages = sanitize_key(($_POST["wp_chatbot_show_pages"]));
557 update_option('wp_chatbot_show_pages', $wp_chatbot_show_pages);
558 }
559
560
561 if(isset( $_POST["wp_chatbot_show_pages_list"])) {
562 $wp_chatbot_show_pages_list = $_POST["wp_chatbot_show_pages_list"];
563 }else{ $wp_chatbot_show_pages_list='';}
564 update_option('wp_chatbot_show_pages_list', serialize($wp_chatbot_show_pages_list));
565 if(isset($_POST["wp_chatbot_show_wpcommerce"])){
566 $wp_chatbot_show_wpcommerce = sanitize_key(($_POST["wp_chatbot_show_wpcommerce"]));
567 update_option('wp_chatbot_show_wpcommerce', $wp_chatbot_show_wpcommerce);
568 }
569
570
571 //Stop Words Settings
572 if (isset($_POST["qlcd_wp_chatbot_stop_words_name"])) {
573 $qlcd_wp_chatbot_stop_words_name = $_POST["qlcd_wp_chatbot_stop_words_name"];
574 update_option('qlcd_wp_chatbot_stop_words_name', sanitize_text_field($qlcd_wp_chatbot_stop_words_name));
575 }
576 if (isset($_POST["qlcd_wp_chatbot_stop_words"])) {
577 $qlcd_wp_chatbot_stop_words = $_POST["qlcd_wp_chatbot_stop_words"];
578 update_option('qlcd_wp_chatbot_stop_words', sanitize_text_field($qlcd_wp_chatbot_stop_words));
579 }
580 //wpwbot icon settings.
581 $wp_chatbot_icon = $_POST['wp_chatbot_icon'] ? $_POST['wp_chatbot_icon'] : 'icon-3.png';
582 update_option('wp_chatbot_icon', sanitize_text_field($wp_chatbot_icon));
583 // upload custom wpwbot icon path
584 $wp_chatbot_custom_icon_path = $_POST['wp_chatbot_custom_icon_path'];
585 update_option('wp_chatbot_custom_icon_path', sanitize_text_field($wp_chatbot_custom_icon_path));
586 //Agent image
587 //wpwbot icon settings.
588 $wp_chatbot_icon = (isset($_POST['wp_chatbot_agent_image']) ? $_POST['wp_chatbot_agent_image'] : 'agent-0.png');
589 update_option('wp_chatbot_agent_image', sanitize_text_field($wp_chatbot_icon));
590 // upload custom wpwbot icon
591 if(isset($_POST['wp_chatbot_custom_agent_path'])){
592 $wp_chatbot_custom_agent_path = $_POST['wp_chatbot_custom_agent_path'];
593 update_option('wp_chatbot_custom_agent_path', sanitize_text_field($wp_chatbot_custom_agent_path));
594 }
595
596 //Theming
597 $qcld_wb_chatbot_theme = (isset($_POST['qcld_wb_chatbot_theme']) ? $_POST['qcld_wb_chatbot_theme'] : 'template-00');
598 update_option('qcld_wb_chatbot_theme', sanitize_text_field($qcld_wb_chatbot_theme));
599 //Theme custom background option
600 if(isset( $_POST["qcld_wb_chatbot_change_bg"])) {
601 $qcld_wb_chatbot_change_bg = $_POST["qcld_wb_chatbot_change_bg"];
602 }else{$qcld_wb_chatbot_change_bg='';}
603 update_option('qcld_wb_chatbot_change_bg', stripslashes($qcld_wb_chatbot_change_bg));
604 if(isset($_POST["qcld_wb_chatbot_board_bg_path"])){
605 $qcld_wb_chatbot_board_bg_path = $_POST["qcld_wb_chatbot_board_bg_path"];
606 update_option('qcld_wb_chatbot_board_bg_path', stripslashes($qcld_wb_chatbot_board_bg_path));
607 }
608
609
610 //To override style use custom css.
611 if(isset($_POST["wp_chatbot_custom_css"])){
612 $wp_chatbot_custom_css = $_POST["wp_chatbot_custom_css"];
613 update_option('wp_chatbot_custom_css', stripslashes($wp_chatbot_custom_css));
614 }
615
616 /****Language center settings. ****/
617 //identity
618 $qlcd_wp_chatbot_host = @$_POST["qlcd_wp_chatbot_host"];
619 update_option('qlcd_wp_chatbot_host', sanitize_text_field($qlcd_wp_chatbot_host));
620 $qlcd_wp_chatbot_agent = @$_POST["qlcd_wp_chatbot_agent"];
621 update_option('qlcd_wp_chatbot_agent', sanitize_text_field($qlcd_wp_chatbot_agent));
622 $qlcd_wp_chatbot_shopper_demo_name = @$_POST["qlcd_wp_chatbot_shopper_demo_name"];
623 update_option('qlcd_wp_chatbot_shopper_demo_name', sanitize_text_field($qlcd_wp_chatbot_shopper_demo_name));
624 $qlcd_wp_chatbot_yes = @$_POST["qlcd_wp_chatbot_yes"];
625 update_option('qlcd_wp_chatbot_yes', sanitize_text_field($qlcd_wp_chatbot_yes));
626 $qlcd_wp_chatbot_no = @$_POST["qlcd_wp_chatbot_no"];
627 update_option('qlcd_wp_chatbot_no', sanitize_text_field($qlcd_wp_chatbot_no));
628 $qlcd_wp_chatbot_or = @$_POST["qlcd_wp_chatbot_or"];
629 update_option('qlcd_wp_chatbot_or', sanitize_text_field($qlcd_wp_chatbot_or));
630 $qlcd_wp_chatbot_sorry = @$_POST["qlcd_wp_chatbot_sorry"];
631 update_option('qlcd_wp_chatbot_sorry', sanitize_text_field($qlcd_wp_chatbot_sorry));
632 $qlcd_wp_chatbot_agent_join = @$_POST["qlcd_wp_chatbot_agent_join"];
633 update_option('qlcd_wp_chatbot_agent_join', serialize($qlcd_wp_chatbot_agent_join));
634 //Greeting.
635 $qlcd_wp_chatbot_welcome = @$_POST["qlcd_wp_chatbot_welcome"];
636 update_option('qlcd_wp_chatbot_welcome', serialize($qlcd_wp_chatbot_welcome));
637 $qlcd_wp_chatbot_back_to_start = @$_POST["qlcd_wp_chatbot_back_to_start"];
638 update_option('qlcd_wp_chatbot_back_to_start', serialize($qlcd_wp_chatbot_back_to_start));
639 $qlcd_wp_chatbot_hi_there = @$_POST["qlcd_wp_chatbot_hi_there"];
640 update_option('qlcd_wp_chatbot_hi_there', serialize($qlcd_wp_chatbot_hi_there));
641 $qlcd_wp_chatbot_welcome_back = @$_POST["qlcd_wp_chatbot_welcome_back"];
642 update_option('qlcd_wp_chatbot_welcome_back', serialize($qlcd_wp_chatbot_welcome_back));
643 $qlcd_wp_chatbot_asking_name = @$_POST["qlcd_wp_chatbot_asking_name"];
644 update_option('qlcd_wp_chatbot_asking_name', serialize($qlcd_wp_chatbot_asking_name));
645 $qlcd_wp_chatbot_name_greeting = @$_POST["qlcd_wp_chatbot_name_greeting"];
646 update_option('qlcd_wp_chatbot_name_greeting', serialize($qlcd_wp_chatbot_name_greeting));
647 $qlcd_wp_chatbot_i_am = @$_POST["qlcd_wp_chatbot_i_am"];
648 update_option('qlcd_wp_chatbot_i_am', serialize($qlcd_wp_chatbot_i_am));
649 $qlcd_wp_chatbot_is_typing = @$_POST["qlcd_wp_chatbot_is_typing"];
650 update_option('qlcd_wp_chatbot_is_typing', serialize($qlcd_wp_chatbot_is_typing));
651 $qlcd_wp_chatbot_send_a_msg= @$_POST["qlcd_wp_chatbot_send_a_msg"];
652 update_option('qlcd_wp_chatbot_send_a_msg', serialize($qlcd_wp_chatbot_send_a_msg));
653 $qlcd_wp_chatbot_choose_option= @$_POST["qlcd_wp_chatbot_choose_option"];
654 update_option('qlcd_wp_chatbot_choose_option', serialize($qlcd_wp_chatbot_choose_option));
655 $qlcd_wp_chatbot_viewed_products= @$_POST["qlcd_wp_chatbot_viewed_products"];
656 update_option('qlcd_wp_chatbot_viewed_products', serialize($qlcd_wp_chatbot_viewed_products));
657 $qlcd_wp_chatbot_shopping_cart= @$_POST["qlcd_wp_chatbot_shopping_cart"];
658 update_option('qlcd_wp_chatbot_shopping_cart', serialize($qlcd_wp_chatbot_shopping_cart));
659 $qlcd_wp_chatbot_add_to_cart= @$_POST["qlcd_wp_chatbot_add_to_cart"];
660 update_option('qlcd_wp_chatbot_add_to_cart', serialize($qlcd_wp_chatbot_add_to_cart));
661 $qlcd_wp_chatbot_cart_link= @$_POST["qlcd_wp_chatbot_cart_link"];
662 update_option('qlcd_wp_chatbot_cart_link', serialize($qlcd_wp_chatbot_cart_link));
663 $qlcd_wp_chatbot_checkout_link= @$_POST["qlcd_wp_chatbot_checkout_link"];
664 update_option('qlcd_wp_chatbot_checkout_link', serialize($qlcd_wp_chatbot_checkout_link));
665 $qlcd_wp_chatbot_cart_welcome= @$_POST["qlcd_wp_chatbot_cart_welcome"];
666 update_option('qlcd_wp_chatbot_cart_welcome', serialize($qlcd_wp_chatbot_cart_welcome));
667 $qlcd_wp_chatbot_featured_product_welcome= @$_POST["qlcd_wp_chatbot_featured_product_welcome"];
668 update_option('qlcd_wp_chatbot_featured_product_welcome', serialize($qlcd_wp_chatbot_featured_product_welcome));
669 $qlcd_wp_chatbot_viewed_product_welcome= @$_POST["qlcd_wp_chatbot_viewed_product_welcome"];
670 update_option('qlcd_wp_chatbot_viewed_product_welcome', serialize($qlcd_wp_chatbot_viewed_product_welcome));
671 $qlcd_wp_chatbot_latest_product_welcome= @$_POST["qlcd_wp_chatbot_latest_product_welcome"];
672 update_option('qlcd_wp_chatbot_latest_product_welcome', serialize($qlcd_wp_chatbot_latest_product_welcome));
673 $qlcd_wp_chatbot_cart_title= @$_POST["qlcd_wp_chatbot_cart_title"];
674 update_option('qlcd_wp_chatbot_cart_title', serialize($qlcd_wp_chatbot_cart_title));
675 $qlcd_wp_chatbot_cart_quantity= @$_POST["qlcd_wp_chatbot_cart_quantity"];
676 update_option('qlcd_wp_chatbot_cart_quantity', serialize($qlcd_wp_chatbot_cart_quantity));
677 $qlcd_wp_chatbot_cart_price= @$_POST["qlcd_wp_chatbot_cart_price"];
678 update_option('qlcd_wp_chatbot_cart_price', serialize($qlcd_wp_chatbot_cart_price));
679 $qlcd_wp_chatbot_no_cart_items= @$_POST["qlcd_wp_chatbot_no_cart_items"];
680 update_option('qlcd_wp_chatbot_no_cart_items', serialize($qlcd_wp_chatbot_no_cart_items));
681 $qlcd_wp_chatbot_cart_updating= @$_POST["qlcd_wp_chatbot_cart_updating"];
682 update_option('qlcd_wp_chatbot_cart_updating', serialize($qlcd_wp_chatbot_cart_updating));
683 $qlcd_wp_chatbot_cart_removing= @$_POST["qlcd_wp_chatbot_cart_removing"];
684 update_option('qlcd_wp_chatbot_cart_removing', serialize($qlcd_wp_chatbot_cart_removing));
685 //wpwBot wildcard settings
686 $qlcd_wp_chatbot_wildcard_msg = @$_POST["qlcd_wp_chatbot_wildcard_msg"];
687 update_option('qlcd_wp_chatbot_wildcard_msg', serialize($qlcd_wp_chatbot_wildcard_msg));
688 //empty filter message repeat.
689 $qlcd_wp_chatbot_empty_filter_msg = @$_POST["qlcd_wp_chatbot_empty_filter_msg"];
690 update_option('qlcd_wp_chatbot_empty_filter_msg', serialize($qlcd_wp_chatbot_empty_filter_msg));
691 //help welcome and message
692 $qlcd_wp_chatbot_help_welcome = @$_POST["qlcd_wp_chatbot_help_welcome"];
693 update_option('qlcd_wp_chatbot_help_welcome', serialize($qlcd_wp_chatbot_help_welcome));
694 $qlcd_wp_chatbot_help_msg = @$_POST["qlcd_wp_chatbot_help_msg"];
695 update_option('qlcd_wp_chatbot_help_msg', serialize($qlcd_wp_chatbot_help_msg));
696 //To clear Conversation history.
697 $qlcd_wp_chatbot_reset = @$_POST["qlcd_wp_chatbot_reset"];
698 update_option('qlcd_wp_chatbot_reset', serialize($qlcd_wp_chatbot_reset));
699 //systems keyword.
700 $qlcd_wp_chatbot_sys_key_help = @$_POST["qlcd_wp_chatbot_sys_key_help"];
701 update_option('qlcd_wp_chatbot_sys_key_help', sanitize_text_field($qlcd_wp_chatbot_sys_key_help));
702 $qlcd_wp_chatbot_sys_key_product = @$_POST["qlcd_wp_chatbot_sys_key_product"];
703 update_option('qlcd_wp_chatbot_sys_key_product', sanitize_text_field($qlcd_wp_chatbot_sys_key_product));
704 $qlcd_wp_chatbot_sys_key_catalog = @$_POST["qlcd_wp_chatbot_sys_key_catalog"];
705 update_option('qlcd_wp_chatbot_sys_key_catalog', sanitize_text_field($qlcd_wp_chatbot_sys_key_catalog));
706 $qlcd_wp_chatbot_sys_key_order = @$_POST["qlcd_wp_chatbot_sys_key_order"];
707 update_option('qlcd_wp_chatbot_sys_key_order', sanitize_text_field($qlcd_wp_chatbot_sys_key_order));
708 $qlcd_wp_chatbot_sys_key_support = @$_POST["qlcd_wp_chatbot_sys_key_support"];
709 update_option('qlcd_wp_chatbot_sys_key_support', sanitize_text_field($qlcd_wp_chatbot_sys_key_support));
710 $qlcd_wp_chatbot_sys_key_reset = @$_POST["qlcd_wp_chatbot_sys_key_reset"];
711 update_option('qlcd_wp_chatbot_sys_key_reset', sanitize_text_field($qlcd_wp_chatbot_sys_key_reset));
712 $qlcd_wp_chatbot_wildcard_product = @$_POST["qlcd_wp_chatbot_wildcard_product"];
713 update_option('qlcd_wp_chatbot_wildcard_product', serialize($qlcd_wp_chatbot_wildcard_product));
714 $qlcd_wp_chatbot_wildcard_catalog = @$_POST["qlcd_wp_chatbot_wildcard_catalog"];
715 update_option('qlcd_wp_chatbot_wildcard_catalog', serialize($qlcd_wp_chatbot_wildcard_catalog));
716 $qlcd_wp_chatbot_featured_products = @$_POST["qlcd_wp_chatbot_featured_products"];
717 update_option('qlcd_wp_chatbot_featured_products', serialize($qlcd_wp_chatbot_featured_products));
718 $qlcd_wp_chatbot_sale_products = @$_POST["qlcd_wp_chatbot_sale_products"];
719 update_option('qlcd_wp_chatbot_sale_products', serialize($qlcd_wp_chatbot_sale_products));
720 $qlcd_wp_chatbot_wildcard_support = @$_POST["qlcd_wp_chatbot_wildcard_support"];
721 update_option('qlcd_wp_chatbot_wildcard_support', serialize($qlcd_wp_chatbot_wildcard_support));
722 $qlcd_wp_chatbot_messenger_label = @$_POST["qlcd_wp_chatbot_messenger_label"];
723 update_option('qlcd_wp_chatbot_messenger_label', serialize($qlcd_wp_chatbot_messenger_label));
724 //Products search .
725 if (isset($_POST["qlcd_wp_chatbot_product_success"])) {
726 $qlcd_wp_chatbot_product_success = @$_POST["qlcd_wp_chatbot_product_success"];
727 update_option('qlcd_wp_chatbot_product_success', serialize($qlcd_wp_chatbot_product_success));
728 }
729 if (isset($_POST["qlcd_wp_chatbot_product_fail"])) {
730 $qlcd_wp_chatbot_product_fail = @$_POST["qlcd_wp_chatbot_product_fail"];
731 update_option('qlcd_wp_chatbot_product_fail', serialize($qlcd_wp_chatbot_product_fail));
732 }
733 $qlcd_wp_chatbot_product_asking = @$_POST["qlcd_wp_chatbot_product_asking"];
734 update_option('qlcd_wp_chatbot_product_asking', serialize($qlcd_wp_chatbot_product_asking));
735 $qlcd_wp_chatbot_product_suggest = @$_POST["qlcd_wp_chatbot_product_suggest"];
736 update_option('qlcd_wp_chatbot_product_suggest', serialize($qlcd_wp_chatbot_product_suggest));
737 $qlcd_wp_chatbot_product_infinite = @$_POST["qlcd_wp_chatbot_product_infinite"];
738 update_option('qlcd_wp_chatbot_product_infinite', serialize($qlcd_wp_chatbot_product_infinite));
739 $qlcd_wp_chatbot_load_more = @$_POST["qlcd_wp_chatbot_load_more"];
740 update_option('qlcd_wp_chatbot_load_more', serialize($qlcd_wp_chatbot_load_more));
741 //Order
742 $qlcd_wp_chatbot_wildcard_order = @$_POST["qlcd_wp_chatbot_wildcard_order"];
743 update_option('qlcd_wp_chatbot_wildcard_order', serialize($qlcd_wp_chatbot_wildcard_order));
744 $qlcd_wp_chatbot_order_welcome = @$_POST["qlcd_wp_chatbot_order_welcome"];
745 update_option('qlcd_wp_chatbot_order_welcome', serialize($qlcd_wp_chatbot_order_welcome));
746 $qlcd_wp_chatbot_order_username_asking = @$_POST["qlcd_wp_chatbot_order_username_asking"];
747 update_option('qlcd_wp_chatbot_order_username_asking', serialize($qlcd_wp_chatbot_order_username_asking));
748 $qlcd_wp_chatbot_order_username_not_exist = @$_POST["qlcd_wp_chatbot_order_username_not_exist"];
749 update_option('qlcd_wp_chatbot_order_username_not_exist', serialize($qlcd_wp_chatbot_order_username_not_exist));
750 $qlcd_wp_chatbot_order_username_thanks = @$_POST["qlcd_wp_chatbot_order_username_thanks"];
751 update_option('qlcd_wp_chatbot_order_username_thanks', serialize($qlcd_wp_chatbot_order_username_thanks));
752 $qlcd_wp_chatbot_order_username_password = @$_POST["qlcd_wp_chatbot_order_username_password"];
753 update_option('qlcd_wp_chatbot_order_username_password', serialize($qlcd_wp_chatbot_order_username_password));
754 $qlcd_wp_chatbot_order_password_incorrect= @$_POST["qlcd_wp_chatbot_order_password_incorrect"];
755 update_option('qlcd_wp_chatbot_order_password_incorrect', serialize($qlcd_wp_chatbot_order_password_incorrect));
756 $qlcd_wp_chatbot_order_not_found= @$_POST["qlcd_wp_chatbot_order_not_found"];
757 update_option('qlcd_wp_chatbot_order_not_found', serialize($qlcd_wp_chatbot_order_not_found));
758 $qlcd_wp_chatbot_order_found= @$_POST["qlcd_wp_chatbot_order_found"];
759 update_option('qlcd_wp_chatbot_order_found', serialize($qlcd_wp_chatbot_order_found));
760 $qlcd_wp_chatbot_order_email_support= @$_POST["qlcd_wp_chatbot_order_email_support"];
761 update_option('qlcd_wp_chatbot_order_email_support', serialize($qlcd_wp_chatbot_order_email_support));
762 //Support
763 $qlcd_wp_chatbot_support_welcome = @$_POST["qlcd_wp_chatbot_support_welcome"];
764 update_option('qlcd_wp_chatbot_support_welcome', serialize($qlcd_wp_chatbot_support_welcome));
765 $qlcd_wp_chatbot_support_email = @$_POST["qlcd_wp_chatbot_support_email"];
766 update_option('qlcd_wp_chatbot_support_email', serialize($qlcd_wp_chatbot_support_email));
767 $qlcd_wp_chatbot_asking_email = @$_POST["qlcd_wp_chatbot_asking_email"];
768 update_option('qlcd_wp_chatbot_asking_email', serialize($qlcd_wp_chatbot_asking_email));
769 $qlcd_wp_chatbot_asking_msg = @$_POST["qlcd_wp_chatbot_asking_msg"];
770 update_option('qlcd_wp_chatbot_asking_msg', serialize($qlcd_wp_chatbot_asking_msg));
771
772 $qlcd_wp_chatbot_no_result = @$_POST["qlcd_wp_chatbot_no_result"];
773 update_option('qlcd_wp_chatbot_no_result', serialize($qlcd_wp_chatbot_no_result));
774
775 $qlcd_wp_chatbot_support_option_again = @$_POST["qlcd_wp_chatbot_support_option_again"];
776 update_option('qlcd_wp_chatbot_support_option_again', serialize($qlcd_wp_chatbot_support_option_again));
777 $qlcd_wp_chatbot_invalid_email = @$_POST["qlcd_wp_chatbot_invalid_email"];
778 update_option('qlcd_wp_chatbot_invalid_email', serialize($qlcd_wp_chatbot_invalid_email));
779 $qlcd_wp_chatbot_support_phone= @$_POST["qlcd_wp_chatbot_support_phone"];
780 update_option('qlcd_wp_chatbot_support_phone', serialize($qlcd_wp_chatbot_support_phone));
781 $qlcd_wp_chatbot_asking_phone= @$_POST["qlcd_wp_chatbot_asking_phone"];
782 update_option('qlcd_wp_chatbot_asking_phone', serialize($qlcd_wp_chatbot_asking_phone));
783 $qlcd_wp_chatbot_thank_for_phone= @$_POST["qlcd_wp_chatbot_thank_for_phone"];
784 update_option('qlcd_wp_chatbot_thank_for_phone', serialize($qlcd_wp_chatbot_thank_for_phone));
785 $qlcd_wp_chatbot_admin_email = @$_POST["qlcd_wp_chatbot_admin_email"];
786 update_option('qlcd_wp_chatbot_admin_email', sanitize_text_field($qlcd_wp_chatbot_admin_email));
787
788 $qlcd_wp_chatbot_email_sub = @$_POST["qlcd_wp_chatbot_email_sub"];
789 update_option('qlcd_wp_chatbot_email_sub', sanitize_text_field($qlcd_wp_chatbot_email_sub));
790
791 $qlcd_wp_site_search = @$_POST["qlcd_wp_site_search"];
792 update_option('qlcd_wp_site_search', sanitize_text_field($qlcd_wp_site_search));
793
794 $qlcd_wp_chatbot_email_sent = @$_POST["qlcd_wp_chatbot_email_sent"];
795 update_option('qlcd_wp_chatbot_email_sent', sanitize_text_field($qlcd_wp_chatbot_email_sent));
796 $qlcd_wp_chatbot_email_fail = @$_POST["qlcd_wp_chatbot_email_fail"];
797 update_option('qlcd_wp_chatbot_email_fail', sanitize_text_field($qlcd_wp_chatbot_email_fail));
798 //Notifications messages building.
799 $qlcd_wp_chatbot_notification_interval = @$_POST["qlcd_wp_chatbot_notification_interval"];
800 update_option('qlcd_wp_chatbot_notification_interval', sanitize_text_field($qlcd_wp_chatbot_notification_interval));
801 $qlcd_wp_chatbot_notifications = @$_POST["qlcd_wp_chatbot_notifications"];
802 update_option('qlcd_wp_chatbot_notifications', serialize($qlcd_wp_chatbot_notifications));
803 //Support building part.
804 $support_query = @$_POST["support_query"];
805 update_option('support_query', serialize($support_query));
806 $support_ans = @$_POST["support_ans"];
807 update_option('support_ans', serialize($support_ans));
808 //Create Mobile app pages.
809 if(isset( $_POST["wp_chatbot_app_pages"])) {
810 $wp_chatbot_app_pages = $_POST["wp_chatbot_app_pages"];
811 }else{ $wp_chatbot_app_pages='';}
812 update_option('wp_chatbot_app_pages', stripslashes($wp_chatbot_app_pages));
813 //Messenger Options
814 if(isset( $_POST["enable_wp_chatbot_messenger"])) {
815 $enable_wp_chatbot_messenger = $_POST["enable_wp_chatbot_messenger"];
816 }else{ $enable_wp_chatbot_messenger='';}
817 update_option('enable_wp_chatbot_messenger', stripslashes($enable_wp_chatbot_messenger));
818 if(isset( $_POST["enable_wp_chatbot_messenger_floating_icon"])) {
819 $enable_wp_chatbot_messenger_floating_icon = $_POST["enable_wp_chatbot_messenger_floating_icon"];
820 }else{ $enable_wp_chatbot_messenger_floating_icon='';}
821 update_option('enable_wp_chatbot_messenger_floating_icon', stripslashes($enable_wp_chatbot_messenger_floating_icon));
822 $qlcd_wp_chatbot_fb_app_id = @$_POST["qlcd_wp_chatbot_fb_app_id"];
823 update_option('qlcd_wp_chatbot_fb_app_id', sanitize_text_field($qlcd_wp_chatbot_fb_app_id));
824 $qlcd_wp_chatbot_fb_page_id = @$_POST["qlcd_wp_chatbot_fb_page_id"];
825 update_option('qlcd_wp_chatbot_fb_page_id', sanitize_text_field($qlcd_wp_chatbot_fb_page_id));
826 $qlcd_wp_chatbot_fb_color= @$_POST["qlcd_wp_chatbot_fb_color"];
827 update_option('qlcd_wp_chatbot_fb_color', stripslashes($qlcd_wp_chatbot_fb_color));
828 $qlcd_wp_chatbot_fb_in_msg = @$_POST["qlcd_wp_chatbot_fb_in_msg"];
829 update_option('qlcd_wp_chatbot_fb_in_msg', sanitize_text_field($qlcd_wp_chatbot_fb_in_msg));
830 $qlcd_wp_chatbot_fb_out_msg = @$_POST["qlcd_wp_chatbot_fb_out_msg"];
831 update_option('qlcd_wp_chatbot_fb_out_msg', sanitize_text_field($qlcd_wp_chatbot_fb_out_msg));
832 //Skype option
833 if(isset( $_POST["enable_wp_chatbot_skype_floating_icon"])) {
834 $enable_wp_chatbot_skype_floating_icon = $_POST["enable_wp_chatbot_skype_floating_icon"];
835 }else{ $enable_wp_chatbot_skype_floating_icon='';}
836 update_option('enable_wp_chatbot_skype_floating_icon', sanitize_text_field($enable_wp_chatbot_skype_floating_icon));
837 if(isset( $_POST["enable_wp_chatbot_skype_id"])) {
838 $enable_wp_chatbot_skype_id = $_POST["enable_wp_chatbot_skype_id"];
839 }else{ $enable_wp_chatbot_skype_id='';}
840 update_option('enable_wp_chatbot_skype_id', sanitize_text_field($enable_wp_chatbot_skype_id));
841 //WhatsApp
842 if(isset( $_POST["enable_wp_chatbot_whats"])) {
843 $enable_wp_chatbot_whats= $_POST["enable_wp_chatbot_whats"];
844 }else{ $enable_wp_chatbot_whats='';}
845 update_option('enable_wp_chatbot_whats', sanitize_text_field($enable_wp_chatbot_whats));
846 $qlcd_wp_chatbot_whats_label = @$_POST["qlcd_wp_chatbot_whats_label"];
847 update_option('qlcd_wp_chatbot_whats_label', serialize($qlcd_wp_chatbot_whats_label));
848 if(isset( $_POST["enable_wp_chatbot_floating_whats"])) {
849 $enable_wp_chatbot_floating_whats= $_POST["enable_wp_chatbot_floating_whats"];
850 }else{ $enable_wp_chatbot_floating_whats='';}
851 update_option('enable_wp_chatbot_floating_whats', sanitize_text_field($enable_wp_chatbot_floating_whats));
852 $qlcd_wp_chatbot_whats_num = @$_POST["qlcd_wp_chatbot_whats_num"];
853 update_option('qlcd_wp_chatbot_whats_num', sanitize_text_field($qlcd_wp_chatbot_whats_num));
854 //Viber
855 if(isset( $_POST["enable_wp_chatbot_floating_viber"])) {
856 $enable_wp_chatbot_floating_viber = $_POST["enable_wp_chatbot_floating_viber"];
857 }else{ $enable_wp_chatbot_floating_viber='';}
858 update_option('enable_wp_chatbot_floating_viber', sanitize_text_field($enable_wp_chatbot_floating_viber));
859 $qlcd_wp_chatbot_viber_acc = @$_POST["qlcd_wp_chatbot_viber_acc"];
860 update_option('qlcd_wp_chatbot_viber_acc', sanitize_text_field($qlcd_wp_chatbot_viber_acc));
861 //Others integration
862 if(isset( $_POST["enable_wp_chatbot_floating_phone"])) {
863 $enable_wp_chatbot_floating_phone = $_POST["enable_wp_chatbot_floating_phone"];
864 }else{ $enable_wp_chatbot_floating_phone='';}
865 update_option('enable_wp_chatbot_floating_phone', sanitize_text_field($enable_wp_chatbot_floating_phone));
866 $qlcd_wp_chatbot_phone = @$_POST["qlcd_wp_chatbot_phone"];
867 update_option('qlcd_wp_chatbot_phone', sanitize_text_field($qlcd_wp_chatbot_phone));
868
869 if(isset( $_POST["enable_wp_chatbot_floating_link"])) {
870 $enable_wp_chatbot_floating_link = $_POST["enable_wp_chatbot_floating_link"];
871 }else{ $enable_wp_chatbot_floating_link='';}
872 update_option('enable_wp_chatbot_floating_link', sanitize_text_field($enable_wp_chatbot_floating_link));
873 $qlcd_wp_chatbot_weblink = @$_POST["qlcd_wp_chatbot_weblink"];
874 update_option('qlcd_wp_chatbot_weblink', sanitize_text_field($qlcd_wp_chatbot_weblink));
875
876 //Re Targetting.
877 $qlcd_wp_chatbot_ret_greet = @$_POST["qlcd_wp_chatbot_ret_greet"];
878 update_option('qlcd_wp_chatbot_ret_greet', sanitize_text_field($qlcd_wp_chatbot_ret_greet));
879
880 if(isset( $_POST["enable_wp_chatbot_exit_intent"])) {
881 $enable_wp_chatbot_exit_intent = $_POST["enable_wp_chatbot_exit_intent"];
882 }else{ $enable_wp_chatbot_exit_intent='';}
883 update_option('enable_wp_chatbot_exit_intent', sanitize_text_field($enable_wp_chatbot_exit_intent));
884
885 $wp_chatbot_exit_intent_msg = @$_POST["wp_chatbot_exit_intent_msg"];
886 update_option('wp_chatbot_exit_intent_msg', stripslashes($wp_chatbot_exit_intent_msg));
887
888 if(isset( $_POST["wp_chatbot_exit_intent_once"])) {
889 $wp_chatbot_exit_intent_once = $_POST["wp_chatbot_exit_intent_once"];
890 }else{ $wp_chatbot_exit_intent_once='';}
891 update_option('wp_chatbot_exit_intent_once', sanitize_text_field($wp_chatbot_exit_intent_once));
892
893 if(isset( $_POST["enable_wp_chatbot_scroll_open"])) {
894 $enable_wp_chatbot_scroll_open = $_POST["enable_wp_chatbot_scroll_open"];
895 }else{ $enable_wp_chatbot_scroll_open='';}
896 update_option('enable_wp_chatbot_scroll_open', sanitize_text_field($enable_wp_chatbot_scroll_open));
897
898 $wp_chatbot_scroll_open_msg= @$_POST["wp_chatbot_scroll_open_msg"];
899 update_option('wp_chatbot_scroll_open_msg', stripslashes($wp_chatbot_scroll_open_msg));
900
901 $wp_chatbot_scroll_percent= @$_POST["wp_chatbot_scroll_percent"];
902 update_option('wp_chatbot_scroll_percent', stripslashes($wp_chatbot_scroll_percent));
903
904 if(isset( $_POST["wp_chatbot_scroll_once"])) {
905 $wp_chatbot_scroll_once = $_POST["wp_chatbot_scroll_once"];
906 }else{ $wp_chatbot_scroll_once='';}
907 update_option('wp_chatbot_scroll_once', sanitize_text_field($wp_chatbot_scroll_once));
908
909 if(isset( $_POST["enable_wp_chatbot_auto_open"])) {
910 $enable_wp_chatbot_auto_open = $_POST["enable_wp_chatbot_auto_open"];
911 }else{ $enable_wp_chatbot_auto_open='';}
912 update_option('enable_wp_chatbot_auto_open', sanitize_text_field($enable_wp_chatbot_auto_open));
913
914 if(isset( $_POST["enable_wp_chatbot_ret_sound"])) {
915 $enable_wp_chatbot_ret_sound = $_POST["enable_wp_chatbot_ret_sound"];
916 }else{ $enable_wp_chatbot_ret_sound='';}
917 update_option('enable_wp_chatbot_ret_sound', sanitize_text_field($enable_wp_chatbot_ret_sound));
918
919 if(isset( $_POST["enable_wp_chatbot_sound_initial"])) {
920 $enable_wp_chatbot_sound_initial = $_POST["enable_wp_chatbot_sound_initial"];
921 }else{ $enable_wp_chatbot_sound_initial='';}
922 update_option('enable_wp_chatbot_sound_initial', sanitize_text_field($enable_wp_chatbot_sound_initial));
923
924
925 $wp_chatbot_auto_open_msg = @$_POST["wp_chatbot_auto_open_msg"];
926 update_option('wp_chatbot_auto_open_msg', stripslashes($wp_chatbot_auto_open_msg));
927
928 $wp_chatbot_auto_open_time = @$_POST["wp_chatbot_auto_open_time"];
929 update_option('wp_chatbot_auto_open_time', stripslashes($wp_chatbot_auto_open_time));
930 //to complate checkout
931 if(isset( $_POST["enable_wp_chatbot_ret_user_show"])) {
932 $enable_wp_chatbot_ret_user_show = $_POST["enable_wp_chatbot_ret_user_show"];
933 }else{ $enable_wp_chatbot_ret_user_show='';}
934 update_option('enable_wp_chatbot_ret_user_show', sanitize_text_field($enable_wp_chatbot_ret_user_show));
935
936 if(isset( $_POST["enable_wp_chatbot_inactive_time_show"])) {
937 $enable_wp_chatbot_inactive_time_show = $_POST["enable_wp_chatbot_inactive_time_show"];
938 }else{ $enable_wp_chatbot_inactive_time_show='';}
939 update_option('enable_wp_chatbot_inactive_time_show', sanitize_text_field($enable_wp_chatbot_inactive_time_show));
940
941 $wp_chatbot_inactive_time = @$_POST["wp_chatbot_inactive_time"];
942 update_option('wp_chatbot_inactive_time', sanitize_text_field($wp_chatbot_inactive_time));
943
944 $wp_chatbot_checkout_msg = @$_POST["wp_chatbot_checkout_msg"];
945 update_option('wp_chatbot_checkout_msg', stripslashes($wp_chatbot_checkout_msg));
946
947 if(isset( $_POST["wp_chatbot_auto_open_once"])) {
948 $wp_chatbot_auto_open_once = $_POST["wp_chatbot_auto_open_once"];
949 }else{ $wp_chatbot_auto_open_once='';}
950 update_option('wp_chatbot_auto_open_once', sanitize_text_field($wp_chatbot_auto_open_once));
951
952 if(isset( $_POST["wp_chatbot_inactive_once"])) {
953 $wp_chatbot_inactive_once = $_POST["wp_chatbot_inactive_once"];
954 }else{ $wp_chatbot_inactive_once='';}
955 update_option('wp_chatbot_inactive_once', sanitize_text_field($wp_chatbot_inactive_once));
956
957
958 $wp_chatbot_proactive_bg_color = @$_POST["wp_chatbot_proactive_bg_color"];
959 update_option('wp_chatbot_proactive_bg_color', sanitize_text_field($wp_chatbot_proactive_bg_color));
960
961 if(isset( $_POST["disable_wp_chatbot_call_gen"])) {
962 $disable_wp_chatbot_call_gen = $_POST["disable_wp_chatbot_call_gen"];
963 }else{ $disable_wp_chatbot_call_gen='';}
964 update_option('disable_wp_chatbot_call_gen', sanitize_text_field($disable_wp_chatbot_call_gen));
965
966 if(isset( $_POST["disable_wp_chatbot_site_search"])) {
967 $disable_wp_chatbot_site_search = $_POST["disable_wp_chatbot_site_search"];
968 }else{ $disable_wp_chatbot_site_search='';}
969 update_option('disable_wp_chatbot_site_search', sanitize_text_field($disable_wp_chatbot_site_search));
970
971 if(isset( $_POST["disable_wp_chatbot_call_sup"])) {
972 $disable_wp_chatbot_call_sup = $_POST["disable_wp_chatbot_call_sup"];
973 }else{ $disable_wp_chatbot_call_sup='';}
974 update_option('disable_wp_chatbot_call_sup', sanitize_text_field($disable_wp_chatbot_call_sup));
975
976 if(isset( $_POST["disable_wp_chatbot_feedback"])) {
977 $disable_wp_chatbot_feedback = $_POST["disable_wp_chatbot_feedback"];
978 }else{ $disable_wp_chatbot_feedback='';}
979 update_option('disable_wp_chatbot_feedback', sanitize_text_field($disable_wp_chatbot_feedback));
980
981 if(isset( $_POST["disable_wp_chatbot_faq"])) {
982 $disable_wp_chatbot_faq = $_POST["disable_wp_chatbot_faq"];
983 }else{ $disable_wp_chatbot_faq='';}
984 update_option('disable_wp_chatbot_faq', sanitize_text_field($disable_wp_chatbot_faq));
985
986 $qlcd_wp_chatbot_feedback_label = @$_POST["qlcd_wp_chatbot_feedback_label"];
987 update_option('qlcd_wp_chatbot_feedback_label', serialize($qlcd_wp_chatbot_feedback_label));
988
989 if(isset( $_POST["enable_wp_chatbot_meta_title"])) {
990 $enable_wp_chatbot_meta_title = $_POST["enable_wp_chatbot_meta_title"];
991 }else{ $enable_wp_chatbot_meta_title='';}
992 update_option('enable_wp_chatbot_meta_title', sanitize_text_field($enable_wp_chatbot_meta_title));
993
994 $qlcd_wp_chatbot_meta_label = @$_POST["qlcd_wp_chatbot_meta_label"];
995 update_option('qlcd_wp_chatbot_meta_label', sanitize_text_field($qlcd_wp_chatbot_meta_label));
996
997 $qlcd_wp_chatbot_phone_sent = @$_POST["qlcd_wp_chatbot_phone_sent"];
998 update_option('qlcd_wp_chatbot_phone_sent', sanitize_text_field($qlcd_wp_chatbot_phone_sent));
999
1000 $qlcd_wp_chatbot_phone_fail = @$_POST["qlcd_wp_chatbot_phone_fail"];
1001 update_option('qlcd_wp_chatbot_phone_fail', sanitize_text_field($qlcd_wp_chatbot_phone_fail));
1002
1003 if(isset( $_POST["enable_wp_chatbot_opening_hour"])) {
1004 $enable_wp_chatbot_opening_hour = $_POST["enable_wp_chatbot_opening_hour"];
1005 }else{ $enable_wp_chatbot_opening_hour='';}
1006 update_option('enable_wp_chatbot_opening_hour', sanitize_text_field($enable_wp_chatbot_opening_hour));
1007
1008 $wpwbot_hours= @$_POST["wpwbot_hours"];
1009 update_option('wpwbot_hours', serialize($wpwbot_hours));
1010
1011 if(isset( $_POST["enable_wp_chatbot_dailogflow"])) {
1012 $enable_wp_chatbot_dailogflow = $_POST["enable_wp_chatbot_dailogflow"];
1013 }else{ $enable_wp_chatbot_dailogflow='';}
1014 update_option('enable_wp_chatbot_dailogflow', sanitize_text_field($enable_wp_chatbot_dailogflow));
1015
1016 $qlcd_wp_chatbot_dialogflow_client_token= @$_POST["qlcd_wp_chatbot_dialogflow_client_token"];
1017 update_option('qlcd_wp_chatbot_dialogflow_client_token', sanitize_text_field($qlcd_wp_chatbot_dialogflow_client_token));
1018
1019 $qlcd_wp_chatbot_dialogflow_defualt_reply= @$_POST["qlcd_wp_chatbot_dialogflow_defualt_reply"];
1020 update_option('qlcd_wp_chatbot_dialogflow_defualt_reply', sanitize_text_field($qlcd_wp_chatbot_dialogflow_defualt_reply));
1021
1022 $qlcd_wp_chatbot_dialogflow_agent_language= @$_POST["qlcd_wp_chatbot_dialogflow_agent_language"];
1023 update_option('qlcd_wp_chatbot_dialogflow_agent_language', sanitize_text_field($qlcd_wp_chatbot_dialogflow_agent_language));
1024
1025 }
1026 }
1027 }
1028 /**
1029 * Display Notifications on specific criteria.
1030 *
1031 * @since 2.14
1032 */
1033 public static function wpcommerce_inactive_notice_for_wp_chatbot()
1034 {
1035 if (current_user_can('activate_plugins')) :
1036 if (!class_exists('wpCommerce')) :
1037 deactivate_plugins(plugin_basename(__FILE__));
1038 ?>
1039 <div id="message" class="error">
1040 <p>
1041 <?php
1042 printf(
1043 __('%s WPBot for wpCommerce REQUIRES wpCommerce%s %swpCommerce%s must be active for WPBot to work. Please install & activate wpCommerce.', 'wpchatbot'),
1044 '<strong>',
1045 '</strong><br>',
1046 '<a href="http://wordpress.org/extend/plugins/wpcommerce/" target="_blank" >',
1047 '</a>'
1048 );
1049 ?>
1050 </p>
1051 </div>
1052 <?php
1053 elseif (version_compare(get_option('wpcommerce_db_version'), QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION, '<')) :
1054 ?>
1055 <div id="message" class="error">
1056 <!--<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>-->
1057 <p>
1058 <?php
1059 printf(
1060 __('%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'),
1061 '<strong>',
1062 '</strong><br>',
1063 QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION
1064 );
1065 ?>
1066 </p>
1067 <div style="clear:both;"></div>
1068 </div>
1069 <?php
1070 endif;
1071 endif;
1072 }
1073 /**
1074 * Admin notice for table reindex
1075 */
1076 public function admin_notice_reindex() { ?>
1077 <div class="updated notice is-dismissible">
1078 <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>
1079 </div>
1080 <?php }
1081 }
1082 /**
1083 * Instantiate plugin.
1084 *
1085 */
1086 if (!function_exists('qcld_wb_chatboot_plugin_init')) {
1087 function qcld_wb_chatboot_plugin_init()
1088 {
1089 global $qcld_wb_chatbot;
1090 $qcld_wb_chatbot = qcld_wb_Chatbot::qcld_wb_chatbot_get_instance();
1091 }
1092 }
1093 add_action('plugins_loaded', 'qcld_wb_chatboot_plugin_init');
1094 /*
1095 * Initial Options will be insert as defualt data
1096 */
1097 register_activation_hook(__FILE__, 'qcld_wb_chatboot_defualt_options');
1098 function qcld_wb_chatboot_defualt_options(){
1099 $url = get_site_url();
1100 $url = parse_url($url);
1101 $domain = $url['host'];
1102 //$admin_email = "admin@" . $domain;
1103 $admin_email = get_option('admin_email');
1104
1105 if(!get_option('wp_chatbot_position_x')) {
1106 update_option('wp_chatbot_position_x', 50);
1107 }
1108 if(!get_option('wp_chatbot_position_y')) {
1109 update_option('wp_chatbot_position_y', 50);
1110 }
1111 if(!get_option('disable_wp_chatbot')) {
1112 update_option('disable_wp_chatbot', '');
1113 }
1114 if(!get_option('disable_wp_chatbot_icon_animation')) {
1115 update_option('disable_wp_chatbot_icon_animation', '');
1116 }
1117 if(!get_option('disable_wp_chatbot_on_mobile')) {
1118 update_option('disable_wp_chatbot_on_mobile', '');
1119 }
1120 if(!get_option('qlcd_wp_chatbot_admin_email')) {
1121 update_option('qlcd_wp_chatbot_admin_email', get_option('admin_email'));
1122 }
1123 if(!get_option('disable_wp_chatbot_product_search')) {
1124 update_option('disable_wp_chatbot_product_search', '');
1125 }
1126 if(!get_option('disable_wp_chatbot_catalog')) {
1127 update_option('disable_wp_chatbot_catalog', '');
1128 }
1129 if(!get_option('disable_wp_chatbot_order_status')) {
1130 update_option('disable_wp_chatbot_order_status', '');
1131 }
1132 if(!get_option('enable_wp_chatbot_rtl')) {
1133 update_option('enable_wp_chatbot_rtl', '');
1134 }
1135 if(!get_option('enable_wp_chatbot_mobile_full_screen')) {
1136 update_option('enable_wp_chatbot_mobile_full_screen', '');
1137 }
1138
1139 if(!get_option('disable_wp_chatbot_notification')) {
1140 update_option('disable_wp_chatbot_notification', '1');
1141 }
1142 if(!get_option('disable_wp_chatbot_cart_item_number')) {
1143 update_option('disable_wp_chatbot_cart_item_number', '');
1144 }
1145 if(!get_option('disable_wp_chatbot_featured_product')) {
1146 update_option('disable_wp_chatbot_featured_product', '');
1147 }
1148 if(!get_option('disable_wp_chatbot_sale_product')) {
1149 update_option('disable_wp_chatbot_sale_product', '');
1150 }
1151 if(!get_option('wp_chatbot_open_product_detail')) {
1152 update_option('wp_chatbot_open_product_detail', '');
1153 }
1154 if(!get_option('qlcd_wp_chatbot_product_orderby')) {
1155 update_option('qlcd_wp_chatbot_product_orderby', sanitize_text_field('title'));
1156 }
1157 if(!get_option('qlcd_wp_chatbot_product_order')) {
1158 update_option('qlcd_wp_chatbot_product_order', sanitize_text_field('ASC'));
1159 }
1160 if(!get_option('qlcd_wp_chatbot_ppp')) {
1161 update_option('qlcd_wp_chatbot_ppp', intval(6));
1162 }
1163 if(!get_option('wp_chatbot_exclude_stock_out_product')) {
1164 update_option('wp_chatbot_exclude_stock_out_product', '');
1165 }
1166 if(!get_option('wp_chatbot_show_sub_category')) {
1167 update_option('wp_chatbot_show_sub_category', '');
1168 }
1169 if(!get_option('wp_chatbot_vertical_custom')){
1170 update_option('wp_chatbot_vertical_custom', 'Go To');
1171 }
1172 if(!get_option('wp_chatbot_show_home_page')) {
1173 update_option('wp_chatbot_show_home_page', 'on');
1174 }
1175 if(!get_option('wp_chatbot_show_posts')) {
1176 update_option('wp_chatbot_show_posts', 'on');
1177 }
1178 if(!get_option('wp_chatbot_show_pages')){
1179 update_option('wp_chatbot_show_pages', 'on');
1180 }
1181 if(!get_option('wp_chatbot_show_pages_list')) {
1182 update_option('wp_chatbot_show_pages_list', serialize(array()));
1183 }
1184 if(!get_option('wp_chatbot_show_wpcommerce')) {
1185 update_option('wp_chatbot_show_wpcommerce', 'on');
1186 }
1187 if(!get_option('qlcd_wp_chatbot_stop_words_name')) {
1188 update_option('qlcd_wp_chatbot_stop_words_name', 'english');
1189 }
1190 if(!get_option('qlcd_wp_chatbot_stop_words')) {
1191 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");
1192 }
1193 if(!get_option('qlcd_wp_chatbot_order_user')) {
1194 update_option('qlcd_wp_chatbot_order_user', sanitize_text_field('login'));
1195 }
1196 if(!get_option('wp_chatbot_custom_agent_path')) {
1197 update_option('wp_chatbot_custom_agent_path', '');
1198 }
1199 if(!get_option('wp_chatbot_custom_icon_path')) {
1200 update_option('wp_chatbot_custom_icon_path', '');
1201 }
1202
1203 if(!get_option('wp_chatbot_icon')) {
1204 update_option('wp_chatbot_icon', sanitize_text_field('icon-13.png'));
1205 }
1206 if(!get_option('wp_chatbot_agent_image')){
1207 update_option('wp_chatbot_agent_image',sanitize_text_field('agent-0.png'));
1208 }
1209 if(!get_option('qcld_wb_chatbot_theme')) {
1210 update_option('qcld_wb_chatbot_theme', sanitize_text_field('template-00'));
1211 }
1212 if(!get_option('qcld_wb_chatbot_change_bg')) {
1213 update_option('qcld_wb_chatbot_change_bg', '');
1214 }
1215 if(!get_option('wp_chatbot_custom_css')) {
1216 update_option('wp_chatbot_custom_css', '');
1217 }
1218 if(!get_option('qlcd_wp_chatbot_host')) {
1219 update_option('qlcd_wp_chatbot_host', sanitize_text_field('Our Website'));
1220 }
1221 if(!get_option('qlcd_wp_chatbot_agent')) {
1222 update_option('qlcd_wp_chatbot_agent', sanitize_text_field('Carrie'));
1223 }
1224 if(!get_option('qlcd_wp_chatbot_host')) {
1225 update_option('qlcd_wp_chatbot_host', sanitize_text_field('Our Website'));
1226 }
1227 if(!get_option('qlcd_wp_chatbot_shopper_demo_name')) {
1228 update_option('qlcd_wp_chatbot_shopper_demo_name', sanitize_text_field('Amigo'));
1229 }
1230 if(!get_option('qlcd_wp_chatbot_yes')) {
1231 update_option('qlcd_wp_chatbot_yes', sanitize_text_field('YES'));
1232 }
1233 if(!get_option('qlcd_wp_chatbot_no')) {
1234 update_option('qlcd_wp_chatbot_no', sanitize_text_field('NO'));
1235 }
1236 if(!get_option('qlcd_wp_chatbot_or')) {
1237 update_option('qlcd_wp_chatbot_or', sanitize_text_field('OR'));
1238 }
1239 if(!get_option('qlcd_wp_chatbot_sorry')) {
1240 update_option('qlcd_wp_chatbot_sorry', sanitize_text_field('Sorry'));
1241 }
1242 if(!get_option('qlcd_wp_chatbot_agent_join')) {
1243 update_option('qlcd_wp_chatbot_agent_join', serialize(array('has joined the conversation')));
1244 }
1245 if(!get_option('qlcd_wp_chatbot_welcome')) {
1246 update_option('qlcd_wp_chatbot_welcome', serialize(array('Welcome to', 'Glad to have you at')));
1247 }
1248 if(!get_option('qlcd_wp_chatbot_back_to_start')) {
1249 update_option('qlcd_wp_chatbot_back_to_start', serialize(array('Back to Start')));
1250 }
1251 if(!get_option('qlcd_wp_chatbot_hi_there')) {
1252 update_option('qlcd_wp_chatbot_hi_there', serialize(array('Hi There!')));
1253 }
1254 if(!get_option('qlcd_wp_chatbot_welcome_back')) {
1255 update_option('qlcd_wp_chatbot_welcome_back', serialize(array('Welcome back', 'Good to see your again')));
1256 }
1257 if(!get_option('qlcd_wp_chatbot_asking_name')) {
1258 update_option('qlcd_wp_chatbot_asking_name', serialize(array('May I know your name?', 'What should I call you?')));
1259 }
1260 if(!get_option('qlcd_wp_chatbot_name_greeting')) {
1261 update_option('qlcd_wp_chatbot_name_greeting', serialize(array('Nice to meet you')));
1262 }
1263 if(!get_option('qlcd_wp_chatbot_i_am')) {
1264 update_option('qlcd_wp_chatbot_i_am', serialize(array('I am', 'This is')));
1265 }
1266 if(!get_option('qlcd_wp_chatbot_is_typing')) {
1267 update_option('qlcd_wp_chatbot_is_typing', serialize(array('is typing...')));
1268 }
1269 if(!get_option('qlcd_wp_chatbot_send_a_msg')) {
1270 update_option('qlcd_wp_chatbot_send_a_msg', serialize(array('Send a message.')));
1271 }
1272 if(!get_option('qlcd_wp_chatbot_choose_option')) {
1273 update_option('qlcd_wp_chatbot_choose_option', serialize(array('Choose an option.')));
1274 }
1275 if(!get_option('qlcd_wp_chatbot_viewed_products')) {
1276 update_option('qlcd_wp_chatbot_viewed_products', serialize(array('Recently viewed products')));
1277 }
1278 if(!get_option('qlcd_wp_chatbot_add_to_cart')) {
1279 update_option('qlcd_wp_chatbot_add_to_cart', serialize(array('Add to Cart')));
1280 }
1281 if(!get_option('qlcd_wp_chatbot_cart_link')) {
1282 update_option('qlcd_wp_chatbot_cart_link', serialize(array('Cart')));
1283 }
1284 if(!get_option('qlcd_wp_chatbot_checkout_link')) {
1285 update_option('qlcd_wp_chatbot_checkout_link', serialize(array('Checkout')));
1286 }
1287 if(!get_option('qlcd_wp_chatbot_featured_product_welcome')) {
1288 update_option('qlcd_wp_chatbot_featured_product_welcome', serialize(array('I have found following featured products')));
1289 }
1290 if(!get_option('qlcd_wp_chatbot_viewed_product_welcome')) {
1291 update_option('qlcd_wp_chatbot_viewed_product_welcome', serialize(array('I have found following recently viewed products')));
1292 }
1293 if(!get_option('qlcd_wp_chatbot_latest_product_welcome')) {
1294 update_option('qlcd_wp_chatbot_latest_product_welcome', serialize(array('I have found following latest products')));
1295 }
1296 if(!get_option('qlcd_wp_chatbot_cart_welcome')) {
1297 update_option('qlcd_wp_chatbot_cart_welcome', serialize(array('I have found following items from Shopping Cart.')));
1298 }
1299 if(!get_option('qlcd_wp_chatbot_cart_title')) {
1300 update_option('qlcd_wp_chatbot_cart_title', serialize(array('Title')));
1301 }
1302 if(!get_option('qlcd_wp_chatbot_cart_quantity')) {
1303 update_option('qlcd_wp_chatbot_cart_quantity', serialize(array('Qty')));
1304 }
1305 if(!get_option('qlcd_wp_chatbot_cart_price')) {
1306 update_option('qlcd_wp_chatbot_cart_price', serialize(array('Price')));
1307 }
1308 if(!get_option('qlcd_wp_chatbot_no_cart_items')) {
1309 update_option('qlcd_wp_chatbot_no_cart_items', serialize(array('No items in the cart')));
1310 }
1311 if(!get_option('qlcd_wp_chatbot_cart_updating')) {
1312 update_option('qlcd_wp_chatbot_cart_updating', serialize(array('Updating cart items ...')));
1313 }
1314 if(!get_option('qlcd_wp_chatbot_cart_removing')) {
1315 update_option('qlcd_wp_chatbot_cart_removing', serialize(array('Removing cart items ...')));
1316 }
1317 if(!get_option('qlcd_wp_chatbot_wildcard_msg')) {
1318 update_option('qlcd_wp_chatbot_wildcard_msg', serialize(array('I am here to find what you need. What are you looking for?')));
1319 }
1320 if(!get_option('qlcd_wp_chatbot_empty_filter_msg')) {
1321 update_option('qlcd_wp_chatbot_empty_filter_msg', serialize(array('Sorry, I did not understand you.')));
1322 }
1323 if(!get_option('qlcd_wp_chatbot_sys_key_help')) {
1324 update_option('qlcd_wp_chatbot_sys_key_help', 'start');
1325 }
1326 if(!get_option('qlcd_wp_chatbot_sys_key_product')) {
1327 update_option('qlcd_wp_chatbot_sys_key_product', 'product');
1328 }
1329 if(!get_option('qlcd_wp_chatbot_sys_key_catalog')) {
1330 update_option('qlcd_wp_chatbot_sys_key_catalog', 'catalog');
1331 }
1332 if(!get_option('qlcd_wp_chatbot_sys_key_order')) {
1333 update_option('qlcd_wp_chatbot_sys_key_order', 'order');
1334 }
1335 if(!get_option('qlcd_wp_chatbot_sys_key_support')) {
1336 update_option('qlcd_wp_chatbot_sys_key_support', 'faq');
1337 }
1338 if(!get_option('qlcd_wp_chatbot_sys_key_reset')) {
1339 update_option('qlcd_wp_chatbot_sys_key_reset', 'reset');
1340 }
1341 if(!get_option('qlcd_wp_chatbot_help_welcome')) {
1342 update_option('qlcd_wp_chatbot_help_welcome', serialize(array('Welcome to Help Section.')));
1343 }
1344 if(!get_option('qlcd_wp_chatbot_help_msg')) {
1345 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.')));
1346 }
1347 if(!get_option('qlcd_wp_chatbot_reset')) {
1348 update_option('qlcd_wp_chatbot_reset', serialize(array('Do you want to clear our chat history and start over?')));
1349 }
1350 if(!get_option('qlcd_wp_chatbot_wildcard_product')) {
1351 update_option('qlcd_wp_chatbot_wildcard_product', serialize(array('Product Search')));
1352 }
1353 if(!get_option('qlcd_wp_chatbot_wildcard_catalog')) {
1354 update_option('qlcd_wp_chatbot_wildcard_catalog', serialize(array('Catalog')));
1355 }
1356 if(!get_option('qlcd_wp_chatbot_featured_products')) {
1357 update_option('qlcd_wp_chatbot_featured_products', serialize(array('Featured Products')));
1358 }
1359 if(!get_option('qlcd_wp_chatbot_sale_products')) {
1360 update_option('qlcd_wp_chatbot_sale_products', serialize(array('Products on Sale')));
1361 }
1362 if(!get_option('qlcd_wp_chatbot_wildcard_support')) {
1363 update_option('qlcd_wp_chatbot_wildcard_support', serialize(array('FAQ')));
1364 }
1365 if(!get_option('qlcd_wp_chatbot_messenger_label')) {
1366 update_option('qlcd_wp_chatbot_messenger_label', serialize(array('Chat with Us on Facebook Messenger')));
1367 }
1368 if(!get_option('qlcd_wp_chatbot_product_success')) {
1369 update_option('qlcd_wp_chatbot_product_success', serialize(array('Great! We have these products for', 'Found these products for')));
1370 }
1371 if(!get_option('qlcd_wp_chatbot_product_fail')) {
1372 update_option('qlcd_wp_chatbot_product_fail', serialize(array('Oops! Nothing matches your criteria', 'Sorry, I found nothing')));
1373 }
1374 if(!get_option('qlcd_wp_chatbot_product_asking')) {
1375 update_option('qlcd_wp_chatbot_product_asking', serialize(array('What are you shopping for?')));
1376 }
1377 if(!get_option('qlcd_wp_chatbot_product_suggest')) {
1378 update_option('qlcd_wp_chatbot_product_suggest', serialize(array('You can browse our extensive catalog. Just pick a category from below:')));
1379 }
1380 if(!get_option('qlcd_wp_chatbot_product_infinite')) {
1381 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?')));
1382 }
1383 if(!get_option('qlcd_wp_chatbot_load_more')) {
1384 update_option('qlcd_wp_chatbot_load_more', serialize(array('Load More')));
1385 }
1386 if(!get_option('qlcd_wp_chatbot_wildcard_order')) {
1387 update_option('qlcd_wp_chatbot_wildcard_order', serialize(array('Order Status')));
1388 }
1389 if(!get_option('qlcd_wp_chatbot_order_welcome')) {
1390 update_option('qlcd_wp_chatbot_order_welcome', serialize(array('Welcome to Order status section!')));
1391 }
1392 if(!get_option('qlcd_wp_chatbot_order_username_asking')) {
1393 update_option('qlcd_wp_chatbot_order_username_asking', serialize(array('Please type your username?')));
1394 }
1395 if(!get_option('qlcd_wp_chatbot_order_username_password')) {
1396 update_option('qlcd_wp_chatbot_order_username_password', serialize(array('Please type your password')));
1397 }
1398 if(!get_option('qlcd_wp_chatbot_order_username_not_exist')) {
1399 update_option('qlcd_wp_chatbot_order_username_not_exist', serialize(array('This username does not exist.')));
1400 }
1401 if(!get_option('qlcd_wp_chatbot_order_username_thanks')) {
1402 update_option('qlcd_wp_chatbot_order_username_thanks', serialize(array('Thank you for the username')));
1403 }
1404 if(!get_option('qlcd_wp_chatbot_order_password_incorrect')) {
1405 update_option('qlcd_wp_chatbot_order_password_incorrect', serialize(array('Sorry Password is not correct!')));
1406 }
1407 if(!get_option('qlcd_wp_chatbot_asking_email')) {
1408 update_option('qlcd_wp_chatbot_asking_email', serialize(array('Please provide your email address')));
1409 }
1410 if(!get_option('qlcd_wp_chatbot_order_not_found')) {
1411 update_option('qlcd_wp_chatbot_order_not_found', serialize(array('I did not find any order by you')));
1412 }
1413 if(!get_option('qlcd_wp_chatbot_order_found')) {
1414 update_option('qlcd_wp_chatbot_order_found', serialize(array('I have found the following orders')));
1415 }
1416 if(!get_option('qlcd_wp_chatbot_order_email_support')) {
1417 update_option('qlcd_wp_chatbot_order_email_support', serialize(array('Email our support center about your order.')));
1418 }
1419 if(!get_option('qlcd_wp_chatbot_support_welcome')) {
1420 update_option('qlcd_wp_chatbot_support_welcome', serialize(array('Welcome to FAQ Section')));
1421 }
1422 if(!get_option('qlcd_wp_chatbot_support_email')) {
1423 update_option('qlcd_wp_chatbot_support_email', serialize(array('Click me if you want to send us a email.')));
1424 }
1425 if(!get_option('qlcd_wp_chatbot_asking_msg')) {
1426 update_option('qlcd_wp_chatbot_asking_msg', serialize(array('Thank you for email address. Please write your message now.')));
1427 }
1428 if(!get_option('qlcd_wp_chatbot_no_result')) {
1429 update_option('qlcd_wp_chatbot_no_result', serialize(array('Sorry, No result found!')));
1430 }
1431 if(!get_option('qlcd_wp_chatbot_invalid_email')) {
1432 update_option('qlcd_wp_chatbot_invalid_email', serialize(array('Sorry, Email address is not valid! Please provide a valid email.')));
1433 }
1434 if(!get_option('qlcd_wp_chatbot_support_phone')) {
1435 update_option('qlcd_wp_chatbot_support_phone', serialize(array('Leave your number. We will call you back!')));
1436 }
1437 if(!get_option('qlcd_wp_chatbot_asking_phone')) {
1438 update_option('qlcd_wp_chatbot_asking_phone', serialize(array('Please provide your Phone number')));
1439 }
1440 if(!get_option('qlcd_wp_chatbot_thank_for_phone')) {
1441 update_option('qlcd_wp_chatbot_thank_for_phone', serialize(array('Thank you for Phone number')));
1442 }
1443 if(!get_option('qlcd_wp_chatbot_support_option_again')) {
1444 update_option('qlcd_wp_chatbot_support_option_again', serialize(array('You may choose option from below.')));
1445 }
1446 if(!get_option('qlcd_wp_chatbot_admin_email')) {
1447 update_option('qlcd_wp_chatbot_admin_email', $admin_email);
1448 }
1449 if(!get_option('qlcd_wp_chatbot_email_sub')) {
1450 update_option('qlcd_wp_chatbot_email_sub', sanitize_text_field('WPBot Support Mail'));
1451 }
1452 if(!get_option('qlcd_wp_site_search')) {
1453 update_option('qlcd_wp_site_search', sanitize_text_field('Site Search'));
1454 }
1455 if(!get_option('qlcd_wp_chatbot_email_sent')) {
1456 update_option('qlcd_wp_chatbot_email_sent', sanitize_text_field('Your email was sent successfully.Thanks!'));
1457 }
1458 if(!get_option('qlcd_wp_chatbot_email_fail')) {
1459 update_option('qlcd_wp_chatbot_email_fail', sanitize_text_field('Sorry! I could not send your mail! Please contact the webmaster.'));
1460 }
1461 if(!get_option('qlcd_wp_chatbot_notification_interval')) {
1462 update_option('qlcd_wp_chatbot_notification_interval', sanitize_text_field(5));
1463 }
1464 if(!get_option('qlcd_wp_chatbot_notifications')) {
1465 update_option('qlcd_wp_chatbot_notifications', serialize(array('Welcome to WPBot')));
1466 }
1467 if(!get_option('support_query')) {
1468 update_option('support_query', serialize(array('What is WPBot?')));
1469 }
1470 if(!get_option('support_ans')) {
1471 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.')));
1472 }
1473 if(!get_option('qlcd_wp_chatbot_search_option')) {
1474 update_option('qlcd_wp_chatbot_search_option', 'standard');
1475 }
1476 if(!get_option('wp_chatbot_index_count')) {
1477 update_option('wp_chatbot_index_count', 0);
1478 }
1479 if(!get_option('wp_chatbot_app_pages')) {
1480 update_option('wp_chatbot_app_pages', 0);
1481 }
1482 //messenger options.
1483 if(!get_option('enable_wp_chatbot_messenger')) {
1484 update_option('enable_wp_chatbot_messenger', '');
1485 }
1486 if(!get_option('enable_wp_chatbot_messenger_floating_icon')) {
1487 update_option('enable_wp_chatbot_messenger_floating_icon', '');
1488 }
1489 if(!get_option('qlcd_wp_chatbot_fb_app_id')) {
1490 update_option('qlcd_wp_chatbot_fb_app_id', '');
1491 }
1492 if(!get_option('qlcd_wp_chatbot_fb_page_id')) {
1493 update_option('qlcd_wp_chatbot_fb_page_id', '');
1494 }
1495 if(!get_option('qlcd_wp_chatbot_fb_color')) {
1496 update_option('qlcd_wp_chatbot_fb_color', '#0084ff');
1497 }
1498 if(!get_option('qlcd_wp_chatbot_fb_in_msg')) {
1499 update_option('qlcd_wp_chatbot_fb_in_msg', 'Welcome to WPBot!');
1500 }
1501 if(!get_option('qlcd_wp_chatbot_fb_out_msg')) {
1502 update_option('qlcd_wp_chatbot_fb_out_msg', 'You are not logged in');
1503 }
1504 //Skype option
1505 if(!get_option('enable_wp_chatbot_skype_floating_icon')) {
1506 update_option('enable_wp_chatbot_skype_floating_icon', '');
1507 }
1508 if(!get_option('enable_wp_chatbot_skype_id')) {
1509 update_option('enable_wp_chatbot_skype_id', '');
1510 }
1511 //Whats App
1512 if(!get_option('enable_wp_chatbot_whats')) {
1513 update_option('enable_wp_chatbot_whats', '');
1514 }
1515 if(!get_option('qlcd_wp_chatbot_whats_label')) {
1516 update_option('qlcd_wp_chatbot_whats_label', serialize(array('Chat with Us on WhatsApp')));
1517 }
1518 if(!get_option('enable_wp_chatbot_floating_whats')) {
1519 update_option('enable_wp_chatbot_floating_whats', '');
1520 }
1521 if(!get_option('qlcd_wp_chatbot_whats_num')) {
1522 update_option('qlcd_wp_chatbot_whats_num', '');
1523 }
1524 //Viber
1525 if(!get_option('enable_wp_chatbot_floating_viber')) {
1526 update_option('enable_wp_chatbot_floating_viber', '');
1527 }
1528 if(!get_option('qlcd_wp_chatbot_viber_acc')) {
1529 update_option('qlcd_wp_chatbot_viber_acc', '');
1530 }
1531 //Integration others
1532 if(!get_option('enable_wp_chatbot_floating_phone')) {
1533 update_option('enable_wp_chatbot_floating_phone', '');
1534 }
1535 if(!get_option('qlcd_wp_chatbot_phone')) {
1536 update_option('qlcd_wp_chatbot_phone', '');
1537 }
1538 if(!get_option('enable_wp_chatbot_floating_link')) {
1539 update_option('enable_wp_chatbot_floating_link', '');
1540 }
1541
1542 if(!get_option('qlcd_wp_chatbot_weblink')) {
1543 update_option('qlcd_wp_chatbot_weblink', '');
1544 }
1545 //Re-Tagetting
1546 if(!get_option('qlcd_wp_chatbot_ret_greet')) {
1547 update_option('qlcd_wp_chatbot_ret_greet', 'Hello');
1548 }
1549 if(!get_option('enable_wp_chatbot_exit_intent')) {
1550 update_option('enable_wp_chatbot_exit_intent', '');
1551 }
1552 if(!get_option('wp_chatbot_exit_intent_msg')) {
1553 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.');
1554 }
1555 if(!get_option('wp_chatbot_exit_intent_once')) {
1556 update_option('wp_chatbot_exit_intent_once', '');
1557 }
1558
1559 if(!get_option('enable_wp_chatbot_scroll_open')) {
1560 update_option('enable_wp_chatbot_scroll_open', '');
1561 }
1562 if(!get_option('wp_chatbot_scroll_open_msg')) {
1563 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.');
1564 }
1565 if(!get_option('wp_chatbot_scroll_percent')) {
1566 update_option('wp_chatbot_scroll_percent', 50);
1567 }
1568 if(!get_option('wp_chatbot_scroll_once')) {
1569 update_option('wp_chatbot_scroll_once', '');
1570 }
1571
1572 if(!get_option('enable_wp_chatbot_auto_open')) {
1573 update_option('enable_wp_chatbot_auto_open', '');
1574 }
1575
1576 if(!get_option('enable_wp_chatbot_ret_sound')) {
1577 update_option('enable_wp_chatbot_ret_sound', '');
1578 }
1579 if(!get_option('enable_wp_chatbot_sound_initial')) {
1580 update_option('enable_wp_chatbot_sound_initial', '');
1581 }
1582
1583
1584 if(!get_option('wp_chatbot_auto_open_msg')) {
1585 update_option('wp_chatbot_auto_open_msg', 'A SPECIAL OFFER FOR YOU! Get Your 50% Discount Now. Use Coupon Code QC50 during checkout.');
1586 }
1587 if(!get_option('wp_chatbot_auto_open_time')) {
1588 update_option('wp_chatbot_auto_open_time', 10);
1589 }
1590 if(!get_option('wp_chatbot_auto_open_once')) {
1591 update_option('wp_chatbot_auto_open_once', '');
1592 }
1593 if(!get_option('wp_chatbot_inactive_once')) {
1594 update_option('wp_chatbot_inactive_once', '');
1595 }
1596
1597 //To complete checkout.
1598 if(!get_option('enable_wp_chatbot_ret_user_show')) {
1599 update_option('enable_wp_chatbot_ret_user_show', '');
1600 }
1601 if(!get_option('wp_chatbot_auto_open_msg')) {
1602 update_option('wp_chatbot_checkout_msg', 'You have products in shopping cart, please complete your order.');
1603 }
1604 if(!get_option('wp_chatbot_inactive_time')) {
1605 update_option('wp_chatbot_inactive_time', 300);
1606 }
1607 if(!get_option('enable_wp_chatbot_inactive_time_show')) {
1608 update_option('enable_wp_chatbot_inactive_time_show', '');
1609 }
1610
1611 if(!get_option('wp_chatbot_proactive_bg_color')) {
1612 update_option('wp_chatbot_proactive_bg_color', '#ffffff');
1613 }
1614 if(!get_option('disable_wp_chatbot_feedback')) {
1615 update_option('disable_wp_chatbot_feedback','');
1616 }
1617 if(!get_option('disable_wp_chatbot_faq')) {
1618 update_option('disable_wp_chatbot_faq','');
1619 }
1620 if(!get_option('qlcd_wp_chatbot_feedback_label')) {
1621 update_option('qlcd_wp_chatbot_feedback_label',serialize(array('Send Feedback')));
1622 }
1623
1624 if(!get_option('enable_wp_chatbot_meta_title')) {
1625 update_option('enable_wp_chatbot_meta_title','');
1626 }
1627 if(!get_option('qlcd_wp_chatbot_meta_label')) {
1628 update_option('qlcd_wp_chatbot_meta_label','*New Messages');
1629 }
1630
1631 if(!get_option('disable_wp_chatbot_call_gen')) {
1632 update_option('disable_wp_chatbot_call_gen', '');
1633 }
1634
1635 if(!get_option('disable_wp_chatbot_site_search')) {
1636 update_option('disable_wp_chatbot_site_search', '');
1637 }
1638 if(!get_option('disable_wp_chatbot_call_sup')) {
1639 update_option('disable_wp_chatbot_call_sup', '');
1640 }
1641
1642 if(!get_option('qlcd_wp_chatbot_phone_sent')) {
1643 update_option('qlcd_wp_chatbot_phone_sent', 'Thanks for your phone number. We will call you ASAP!');
1644 }
1645 if(!get_option('qlcd_wp_chatbot_phone_fail')) {
1646 update_option('qlcd_wp_chatbot_phone_fail', 'Sorry! I could not collect your phone number!');
1647 }
1648 if(!get_option('enable_wp_chatbot_opening_hour')) {
1649 update_option('enable_wp_chatbot_opening_hour', '');
1650 }
1651 if(!get_option('enable_wp_chatbot_opening_hour')) {
1652 update_option('wpwbot_hours', array());
1653 }
1654
1655 if(!get_option('enable_wp_chatbot_dailogflow')) {
1656 update_option('enable_wp_chatbot_dailogflow', '');
1657 }
1658 if(!get_option('qlcd_wp_chatbot_dialogflow_client_token')) {
1659 update_option('qlcd_wp_chatbot_dialogflow_client_token', '');
1660 }
1661 if(!get_option('qlcd_wp_chatbot_dialogflow_defualt_reply')) {
1662 update_option('qlcd_wp_chatbot_dialogflow_defualt_reply', 'Sorry, I did not understand you. You may browse');
1663 }
1664 if(!get_option('qlcd_wp_chatbot_dialogflow_agent_language')) {
1665 update_option('qlcd_wp_chatbot_dialogflow_agent_language', 'en');
1666 }
1667
1668 }
1669 /*
1670 * Reset Options will be insert as defualt data
1671 */
1672 add_action('wp_ajax_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
1673 add_action('wp_ajax_nopriv_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
1674 //Jarvis all option will be delete during uninstlling.
1675 function qcld_wb_chatboot_delete_all_options(){
1676 delete_option('disable_wp_chatbot');
1677 delete_option('disable_wp_chatbot_icon_animation');
1678 delete_option('disable_wp_chatbot_on_mobile');
1679 delete_option('qlcd_wp_chatbot_admin_email');
1680 delete_option('disable_wp_chatbot_product_search');
1681 delete_option('disable_wp_chatbot_catalog');
1682 delete_option('disable_wp_chatbot_order_status');
1683 delete_option('disable_wp_chatbot_notification');
1684 delete_option('enable_wp_chatbot_rtl');
1685 delete_option('enable_wp_chatbot_mobile_full_screen');
1686 delete_option('disable_wp_chatbot_cart_item_number');
1687 delete_option('disable_wp_chatbot_featured_product');
1688 delete_option('disable_wp_chatbot_sale_product');
1689 delete_option('wp_chatbot_open_product_detail');
1690 delete_option('qlcd_wp_chatbot_product_orderby');
1691 delete_option('qlcd_wp_chatbot_product_order');
1692 delete_option('qlcd_wp_chatbot_ppp');
1693 delete_option('wp_chatbot_show_parent_category');
1694 delete_option('wp_chatbot_show_sub_category');
1695 delete_option('wp_chatbot_exclude_stock_out_product');
1696 delete_option('wp_chatbot_show_home_page');
1697 delete_option('wp_chatbot_show_posts');
1698 delete_option('wp_chatbot_show_pages');
1699 delete_option('wp_chatbot_show_pages_list');
1700 delete_option('wp_chatbot_show_wpcommerce');
1701 delete_option('qlcd_wp_chatbot_stop_words_name');
1702 delete_option('qlcd_wp_chatbot_stop_words');
1703 delete_option('qlcd_wp_chatbot_order_user');
1704 delete_option('wp_chatbot_icon');
1705 delete_option('wp_chatbot_agent_image');
1706 delete_option('qcld_wb_chatbot_theme');
1707 delete_option('qcld_wb_chatbot_change_bg');
1708 delete_option('wp_chatbot_custom_css');
1709 delete_option('qlcd_wp_chatbot_host');
1710 delete_option('qlcd_wp_chatbot_agent');
1711 delete_option('qlcd_wp_chatbot_yes');
1712 delete_option('qlcd_wp_chatbot_no');
1713 delete_option('qlcd_wp_chatbot_or');
1714 delete_option('qlcd_wp_chatbot_sorry');
1715 delete_option('qlcd_wp_chatbot_agent_join');
1716 delete_option('qlcd_wp_chatbot_welcome');
1717 delete_option('qlcd_wp_chatbot_back_to_start');
1718 delete_option('qlcd_wp_chatbot_hi_there');
1719 delete_option('qlcd_wp_chatbot_welcome_back');
1720 delete_option('qlcd_wp_chatbot_asking_name');
1721 delete_option('qlcd_wp_chatbot_name_greeting');
1722 delete_option('qlcd_wp_chatbot_i_am');
1723 delete_option('qlcd_wp_chatbot_wildcard_msg');
1724 delete_option('qlcd_wp_chatbot_empty_filter_msg');
1725 delete_option('qlcd_wp_chatbot_wildcard_product');
1726 delete_option('qlcd_wp_chatbot_wildcard_catalog');
1727 delete_option('qlcd_wp_chatbot_featured_products');
1728 delete_option('qlcd_wp_chatbot_sale_products');
1729 delete_option('qlcd_wp_chatbot_wildcard_support');
1730 delete_option('qlcd_wp_chatbot_messenger_label');
1731 delete_option('qlcd_wp_chatbot_product_success');
1732 delete_option('qlcd_wp_chatbot_product_fail');
1733 delete_option('qlcd_wp_chatbot_product_asking');
1734 delete_option('qlcd_wp_chatbot_product_suggest');
1735 delete_option('qlcd_wp_chatbot_product_infinite');
1736 delete_option('qlcd_wp_chatbot_load_more');
1737 delete_option('qlcd_wp_chatbot_wildcard_order');
1738 delete_option('qlcd_wp_chatbot_order_welcome');
1739 delete_option('qlcd_wp_chatbot_order_username_asking');
1740 delete_option('qlcd_wp_chatbot_order_username_password');
1741 delete_option('qlcd_wp_chatbot_support_welcome');
1742 delete_option('qlcd_wp_chatbot_support_email');
1743 delete_option('qlcd_wp_chatbot_asking_email');
1744 delete_option('qlcd_wp_chatbot_asking_msg');
1745 delete_option('qlcd_wp_chatbot_no_result');
1746 delete_option('qlcd_wp_chatbot_admin_email');
1747 delete_option('qlcd_wp_chatbot_email_sub');
1748 delete_option('qlcd_wp_site_search');
1749 delete_option('qlcd_wp_chatbot_email_sent');
1750 delete_option('qlcd_wp_chatbot_support_phone');
1751 delete_option('qlcd_wp_chatbot_asking_phone');
1752 delete_option('qlcd_wp_chatbot_thank_for_phone');
1753 delete_option('qlcd_wp_chatbot_sys_key_help');
1754 delete_option('qlcd_wp_chatbot_sys_key_product');
1755 delete_option('qlcd_wp_chatbot_sys_key_catalog');
1756 delete_option('qlcd_wp_chatbot_sys_key_order');
1757 delete_option('qlcd_wp_chatbot_sys_key_support');
1758 delete_option('qlcd_wp_chatbot_sys_key_reset');
1759 delete_option('qlcd_wp_chatbot_order_username_not_exist');
1760 delete_option('qlcd_wp_chatbot_order_username_thanks');
1761 delete_option('qlcd_wp_chatbot_order_password_incorrect');
1762 delete_option('qlcd_wp_chatbot_order_not_found');
1763 delete_option('qlcd_wp_chatbot_order_found');
1764 delete_option('qlcd_wp_chatbot_order_email_support');
1765 delete_option('qlcd_wp_chatbot_support_option_again');
1766 delete_option('qlcd_wp_chatbot_invalid_email');
1767 delete_option('qlcd_wp_chatbot_shopping_cart');
1768 delete_option('qlcd_wp_chatbot_add_to_cart');
1769 delete_option('qlcd_wp_chatbot_cart_link');
1770 delete_option('qlcd_wp_chatbot_checkout_link');
1771 delete_option('qlcd_wp_chatbot_cart_welcome');
1772 delete_option('qlcd_wp_chatbot_featured_product_welcome');
1773 delete_option('qlcd_wp_chatbot_viewed_product_welcome');
1774 delete_option('qlcd_wp_chatbot_latest_product_welcome');
1775 delete_option('qlcd_wp_chatbot_cart_title');
1776 delete_option('qlcd_wp_chatbot_cart_quantity');
1777 delete_option('qlcd_wp_chatbot_cart_price');
1778 delete_option('qlcd_wp_chatbot_no_cart_items');
1779 delete_option('qlcd_wp_chatbot_cart_updating');
1780 delete_option('qlcd_wp_chatbot_cart_removing');
1781 delete_option('qlcd_wp_chatbot_email_fail');
1782 delete_option('support_query');
1783 delete_option('support_ans');
1784 delete_option('qlcd_wp_chatbot_notification_interval');
1785 delete_option('qlcd_wp_chatbot_notifications');
1786 delete_option( 'qlcd_wp_chatbot_search_option');
1787 delete_option( 'wp_chatbot_index_count');
1788 delete_option( 'wp_chatbot_app_pages');
1789 //messenger option
1790 delete_option( 'enable_wp_chatbot_messenger');
1791 delete_option( 'enable_wp_chatbot_messenger_floating_icon');
1792 delete_option( 'qlcd_wp_chatbot_fb_app_id');
1793 delete_option( 'qlcd_wp_chatbot_fb_page_id');
1794 delete_option( 'qlcd_wp_chatbot_fb_color');
1795 delete_option( 'qlcd_wp_chatbot_fb_in_msg');
1796 delete_option( 'qlcd_wp_chatbot_fb_out_msg');
1797 //skype option
1798 delete_option( 'enable_wp_chatbot_skype_floating_icon');
1799 delete_option( 'enable_wp_chatbot_skype_id');
1800 //whats app
1801 delete_option( 'enable_wp_chatbot_whats');
1802 delete_option( 'qlcd_wp_chatbot_whats_label');
1803 delete_option( 'enable_wp_chatbot_floating_whats');
1804 delete_option( 'qlcd_wp_chatbot_whats_num');
1805 // Viber
1806 delete_option( 'enable_wp_chatbot_floating_viber');
1807 delete_option( 'qlcd_wp_chatbot_viber_acc');
1808 //Integration others
1809 delete_option( 'enable_wp_chatbot_floating_phone');
1810 delete_option( 'qlcd_wp_chatbot_phone');
1811 delete_option( 'enable_wp_chatbot_floating_link');
1812 delete_option( 'qlcd_wp_chatbot_weblink');
1813 //Re Targetting
1814 delete_option( 'qlcd_wp_chatbot_ret_greet');
1815 delete_option( 'enable_wp_chatbot_exit_intent');
1816 delete_option( 'wp_chatbot_exit_intent_msg');
1817 delete_option( 'wp_chatbot_exit_intent_once');
1818
1819 delete_option( 'enable_wp_chatbot_scroll_open');
1820 delete_option( 'wp_chatbot_scroll_open_msg');
1821 delete_option( 'wp_chatbot_scroll_percent');
1822 delete_option( 'wp_chatbot_scroll_once');
1823
1824 delete_option( 'enable_wp_chatbot_auto_open');
1825 delete_option( 'enable_wp_chatbot_ret_sound');
1826 delete_option( 'enable_wp_chatbot_sound_initial');
1827 delete_option( 'disable_wp_chatbot_feedback');
1828 delete_option( 'disable_wp_chatbot_faq');
1829 delete_option( 'qlcd_wp_chatbot_feedback_label');
1830 delete_option( 'enable_wp_chatbot_meta_title');
1831 delete_option( 'qlcd_wp_chatbot_meta_label');
1832 delete_option( 'wp_chatbot_auto_open_msg');
1833 delete_option( 'wp_chatbot_auto_open_time');
1834 delete_option( 'wp_chatbot_auto_open_once');
1835 delete_option( 'wp_chatbot_inactive_once');
1836 delete_option( 'wp_chatbot_proactive_bg_color');
1837 delete_option( 'qlcd_wp_chatbot_phone_sent');
1838 delete_option( 'qlcd_wp_chatbot_phone_fail');
1839 delete_option( 'disable_wp_chatbot_call_gen');
1840 delete_option( 'disable_wp_chatbot_site_search');
1841 delete_option( 'disable_wp_chatbot_call_sup');
1842
1843 delete_option( 'enable_wp_chatbot_ret_user_show');
1844 delete_option( 'enable_wp_chatbot_inactive_time_show');
1845 delete_option( 'wp_chatbot_inactive_time');
1846 delete_option( 'wp_chatbot_checkout_msg');
1847 delete_option( 'qlcd_wp_chatbot_shopper_demo_name');
1848 delete_option( 'qlcd_wp_chatbot_is_typing');
1849 delete_option( 'qlcd_wp_chatbot_send_a_msg');
1850 delete_option( 'qlcd_wp_chatbot_choose_option');
1851 delete_option( 'qlcd_wp_chatbot_viewed_products');
1852 delete_option( 'qlcd_wp_chatbot_help_welcome');
1853 delete_option( 'qlcd_wp_chatbot_help_msg');
1854 delete_option( 'qlcd_wp_chatbot_reset');
1855 delete_option( 'enable_wp_chatbot_opening_hour');
1856 delete_option( 'wpwbot_hours');
1857 delete_option( 'enable_wp_chatbot_dailogflow');
1858 delete_option( 'qlcd_wp_chatbot_dialogflow_client_token');
1859 delete_option( 'qlcd_wp_chatbot_dialogflow_defualt_reply');
1860 delete_option( 'qlcd_wp_chatbot_dialogflow_agent_language');
1861
1862 qcld_wb_chatboot_defualt_options();
1863 $html='Reset all options to default successfully.';
1864 wp_send_json($html);
1865 }
1866 /**
1867 *
1868 * Function to load translation files.
1869 *
1870 */
1871 function wp_chatbot_lang_init() {
1872 load_plugin_textdomain( 'wpchatbot', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
1873 }
1874 add_action( 'plugins_loaded', 'wp_chatbot_lang_init');
1875
1876 $wpbot_feedback = new Wp_Usage_Feedback(
1877 __FILE__,
1878 'plugins@quantumcloud.com',
1879 false,
1880 true
1881
1882 );
1883