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

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