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

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