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

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

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