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

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