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

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