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

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