PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 8.3.8
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v8.3.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 8.5.2 All 533 releases
← All changes | qcld-wpwbot.php +115 -525 8.7.78.3.8 View file →
@@ -1,16 +1,16 @@
1 1 <?php
2 2 /**
3 3 * Plugin Name: AI ChatBot - WPBot
4 - * Plugin URI: https://www.wpbot.pro/
4 + * Plugin URI: https://wordpress.org/plugins/chatbot/
5 5 * Description: ChatBot is a native WordPress ChatBot plugin to provide live chat support and lead generation
6 6 * Donate link: https://www.wpbot.pro/
7 - * Version: 8.7.7
7 + * Version: 8.3.8
8 8 * @author QuantumCloud
9 9 * Author: ChatBot for WordPress - WPBot
10 10 * Author URI: https://www.wpbot.pro/
11 - * Requires at least: 5.5
12 - * Tested up to: 7.1
11 + * Requires at least: 4.6
12 + * Tested up to: 7.0
13 13 * Text Domain: chatbot
14 14 * Domain Path: /languages
15 15 * License: GPL2
16 16 */
@@ -18,38 +18,31 @@
18 18
19 19
20 20 if (!defined('ABSPATH')) exit; // Exit if accessed directly.
21 21
22 -// Abort execution if Pro version is active to prevent conflicts
23 -if ( ! function_exists( 'is_plugin_active' ) ) {
24 - require_once ABSPATH . 'wp-admin/includes/plugin.php';
25 -}
22 +add_action( 'plugins_loaded', 'qcld_chatbot_existing_plugin_activate_check_callback' );
23 +if( !function_exists('qcld_chatbot_existing_plugin_activate_check_callback') ){
24 + function qcld_chatbot_existing_plugin_activate_check_callback(){
26 25
27 -$active_plugins = (array) get_option( 'active_plugins', array() );
28 -if ( is_multisite() ) {
29 - $active_plugins = array_merge( $active_plugins, array_keys( (array) get_site_option( 'active_sitewide_plugins', array() ) ) );
30 -}
26 + $check_existing_plugin = get_option('qcld_chatbot_existing_plugin_activate_check');
31 27
32 -$current_plugin = plugin_basename( __FILE__ );
33 28
34 -foreach ( $active_plugins as $plugin ) {
35 - if ( $plugin !== $current_plugin && basename( $plugin ) === 'qcld-wpwbot.php' ) {
36 - return;
29 + if ( class_exists( 'qcld_wb_Chatbot' ) && isset($check_existing_plugin) && ($check_existing_plugin !== 'yes') ) {
30 + update_option('qcld_chatbot_existing_plugin_activate_check', 'yes');
31 + }else if ( ! class_exists( 'qcld_wb_Chatbot' ) ) {
32 + delete_option('qcld_chatbot_existing_plugin_activate_check');
33 + }
34 +
37 35 }
38 36 }
39 37
40 -// Also abort if we are currently activating the Pro plugin
41 -if ( isset($_REQUEST['action']) ) {
42 - if ( $_REQUEST['action'] == 'activate' && isset($_REQUEST['plugin']) && ( ( strpos($_REQUEST['plugin'], 'wpbot-pro-master') !== false ) || ( strpos($_REQUEST['plugin'], 'wpbot-pro-professional') !== false ) || ( strpos($_REQUEST['plugin'], 'wpbot-pro-professional') !== false ) || ( strpos($_REQUEST['plugin'], 'wpbot-pro-starter') !== false ) ) ) {
43 - return;
44 - }
45 - if ( $_REQUEST['action'] == 'activate-selected' && isset($_POST['checked']) && ( in_array('wpbot-pro-master/qcld-wpwbot.php', $_POST['checked']) || in_array('wpbot-pro-professional/qcld-wpwbot.php', $_POST['checked']) || in_array('wpbot-pro-starter/qcld-wpwbot.php', $_POST['checked']) ) ) {
46 - return;
47 - }
38 +$check_existing_plugin = get_option('qcld_chatbot_existing_plugin_activate_check');
39 +if ( isset($check_existing_plugin) && ($check_existing_plugin == 'yes') || class_exists( 'qcld_wb_Chatbot' ) ) {
40 + return;
48 41 }
49 42
50 43 if ( ! defined( 'QCLD_wpCHATBOT_VERSION' ) ) {
51 - define('QCLD_wpCHATBOT_VERSION', '8.7.6');
44 + define('QCLD_wpCHATBOT_VERSION', '8.3.8');
52 45 }
53 46 if ( ! defined( 'QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION' ) ) {
54 47 define('QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION', 2.2);
55 48 }
@@ -87,9 +80,8 @@
87 80 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openai/qcld-bot-openai.php");
88 81 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/openrouter/qcld-bot-openrouter.php");
89 82 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/gemini/qcld-bot-gemini.php");
90 83 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/grok/qcld-bot-grok.php");
91 -require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/integration/claude/qcld-bot-claude.php");
92 84 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."class-qc-free-plugin-upgrade-notice.php");
93 85 require_once("class-plugin-deactivate-feedback.php");
94 86 require_once("qc-support-promo-page/class-qc-support-promo-page.php");
95 87 require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."/functions.php");
@@ -103,17 +95,8 @@
103 95 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/qcld-floating-openai-style-filter.php' );
104 96 // require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/inc/qcld_openai_floating_content.php' );
105 97 // }
106 98
107 -// Built-in Chat Sessions & Analytics module.
108 -// Defers to the Pro addon automatically when it's active.
109 -require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/chat-sessions/wpbot-chat-sessions.php' );
110 -
111 -// Load Automator addon if it exists
112 -if ( file_exists( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'addons/automator/wpbot-automator.php' ) ) {
113 - require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'addons/automator/wpbot-automator.php' );
114 -}
115 -
116 99 /**
117 100 * Main Class.
118 101 */
119 102
@@ -159,18 +142,18 @@
159 142 add_action('admin_init', array($this, 'qcld_wb_chatbot_save_options'));
160 143
161 144 }
162 145
163 - if( ( !empty($_GET['page']) && $_GET["page"] == "wpbot") || ( !empty($_GET['page']) && $_GET["page"] == "wpbot-panel")|| ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_openAi') || ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_ai_actions') || ( !empty($_GET['page']) && $_GET['page'] == 'simple-text-response') ){
146 + if( ( !empty($_GET['page']) && $_GET["page"] == "wpbot") || ( !empty($_GET['page']) && $_GET["page"] == "wpbot-panel")|| ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_openAi') || ( !empty($_GET['page']) && $_GET['page'] == 'simple-text-response') ){
164 147 // add_action( 'admin_notices', array( $this, 'promotion_notice' ) );
165 148
166 149 }
167 150
168 151 if (is_admin() && !empty($_GET["page"]) && ($_GET["page"] == "wpbot") || (!empty($_GET['page']) && $_GET['page']=='wpbot_help_page')
169 - || ( !empty($_GET['page']) && $_GET['page'] == 'wpbot_ai_actions')
152 +
170 153 || (!empty($_GET['page']) && $_GET['page']=='wpbot_openAi')
171 154
172 - || (!empty($_GET['page']) && $_GET['page']=='wpbot-panel') || ( !empty($_GET['page']) && $_GET["page"] == "wbcs-botsessions-page") || ( !empty($_GET['page']) && $_GET["page"] == "wpbot_ai_actions") ) {
155 + || (!empty($_GET['page']) && $_GET['page']=='wpbot-panel') || ( !empty($_GET['page']) && $_GET["page"] == "wbcs-botsessions-page") ) {
173 156 add_action('admin_enqueue_scripts', array($this, 'qcld_wb_chatbot_admin_scripts'));
174 157 if( get_option('wp_chatbot_index_count')<=0 && get_option('qlcd_wp_chatbot_search_option')=='advanced'){
175 158
176 159 add_action( 'admin_notices', array( $this, 'admin_notice_reindex' ) );
@@ -189,30 +172,20 @@
189 172 if (!is_admin() && get_option('disable_wp_chatbot') != 1 && wp_chatbot_load_controlling() === true) {
190 173 add_action('wp_enqueue_scripts', array($this, 'qcld_wb_chatbot_frontend_scripts'));
191 174 }
192 175 }
193 - public function qcld_register_ai_form_cpt() {
194 - $args = array(
195 - 'public' => false,
196 - 'show_ui' => true,
197 - 'show_in_menu' => 'wpbot', // under WPBot menu
198 - 'label' => 'AI Form Entries',
199 - 'supports' => array('title', 'custom-fields')
200 - );
201 - register_post_type('wpbot_form_entry', $args);
202 - }
203 176 public function qcld_wpchatbot_init2_fnc(){
204 - $this->qcld_register_ai_form_cpt();
205 177 global $wpdb;
206 178 if( is_admin() ){
207 179
208 - $content = $wpdb->db_server_info();
209 - if ( empty( $content ) ) {
180 + $connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
181 + if($connection === false){
210 182 return;
211 183 }
184 + $content = $connection->server_info;
185 +
186 + $mysql_server_info = $wpdb->db_server_info();
212 187
213 - $mysql_server_info = $content;
214 -
215 188 // Check for the MariaDB.
216 189 $is_mariadb = false;
217 190 if ( ! empty( $mysql_server_info ) && strpos( strtolower( $mysql_server_info ), 'maria' ) !== false ) {
218 191 $is_mariadb = true;
@@ -237,8 +210,9 @@
237 210 }
238 211
239 212 }
240 213
214 + $connection->close();
241 215 }
242 216 }
243 217
244 218 public function mysql_version_notice(){
@@ -262,34 +236,21 @@
262 236 $capability = 'publish_posts';
263 237 }else{
264 238 $capability = 'manage_options';
265 239 }
266 - add_menu_page( esc_html('WPBot - ChatBot'), esc_html('WPBot - ChatBot'), 'manage_options','wpbot-panel', array($this, 'qcld_wb_chatbot_admin_page'),'dashicons-format-status', 6 );
240 + add_menu_page( esc_html('ChatBot WPBot Lite'), esc_html('ChatBot WPBot Lite'), 'manage_options','wpbot-panel', array($this, 'qcld_wb_chatbot_admin_page'),'dashicons-format-status', 6 );
267 241
268 - add_submenu_page( 'wpbot-panel', esc_html('General Settings'), esc_html('General Settings'), 'manage_options','wpbot', array($this, 'qcld_wb_chatbot_admin_page_settings') );
242 + add_submenu_page( 'wpbot-panel', esc_html('Settings'), esc_html('Settings'), 'manage_options','wpbot', array($this, 'qcld_wb_chatbot_admin_page_settings') );
243 +
269 244 add_submenu_page( 'wpbot-panel', esc_html('AI Settings'), esc_html('AI Settings'), 'manage_options','wpbot_openAi', 'wpbot_openAi_setting_func' );
270 - add_submenu_page( 'wpbot-panel', esc_html('AI Actions'), esc_html('AI Actions'), 'manage_options','wpbot_ai_actions', 'wpbot_Ai_actions_func' );
271 -
272 - if ( class_exists( '\WPbot_Automator\Core\Plugin' ) && method_exists( '\WPbot_Automator\Core\Plugin', 'render_admin_page' ) ) {
273 - add_submenu_page( 'wpbot-panel', esc_html('Automator'), esc_html('Automator'), 'manage_options', 'wpbot-automator', array( '\WPbot_Automator\Core\Plugin', 'render_admin_page' ) );
274 - }
275 245
276 - if ( function_exists( 'qc_wpbot_cs_tabbed_wrapper' ) ) {
277 - add_submenu_page( 'wpbot-panel', esc_html('Chat Sessions'), esc_html('Chat Sessions'), $capability, 'wbcs-botsessions-page', 'qc_wpbot_cs_tabbed_wrapper' );
278 - }
246 + $hook = add_submenu_page( 'wpbot-panel', esc_html('Simple Text Responses'), esc_html('Simple Text Responses'), $capability,'simple-text-response', array($this, 'qcld_wb_chatbot_admin_str') );
279 247
280 - $hook = add_submenu_page( 'wpbot-panel', esc_html('Simple Text Responses'), esc_html('Simple Text Responses'), $capability,'simple-text-response', array($this, 'qcld_wb_chatbot_admin_str') );
281 248 add_action( "load-$hook", [ $this, 'screen_option' ] );
282 249
283 - add_submenu_page( 'wpbot-panel', esc_html('User Data'), esc_html('User Data'), 'manage_options','email-subscription', array($this, 'qcld_wb_chatbot_admin_page1') );
284 -
285 -
286 - //$hook = add_submenu_page( 'wpbot-panel', esc_html('Simple Text Responses'), esc_html('Simple Text Responses'), $capability,'simple-text-response', array($this, 'qcld_wb_chatbot_admin_str') );
287 -
288 -
289 250 // add_submenu_page( 'wpbot-panel', esc_html('Conversational Form '), esc_html('Conversational Form'), 'manage_options','wpbots', [$this, 'qcld_wb_chatbot_admin_conversational_settings'] );
290 251
291 - add_submenu_page( 'wpbot-panel', esc_html('Get Support'), esc_html('Get Support'), 'manage_options','wpbot_support_page', 'qcpromo_wpbot_free_support_page_callback_func' );
252 + add_submenu_page( 'wpbot-panel', esc_html('Support'), esc_html('Support'), 'manage_options','wpbot_support_page', 'qcpromo_wpbot_free_support_page_callback_func' );
292 253
293 254 add_submenu_page( 'wpbot-panel', esc_html('Help and Debugging'), esc_html('Help and Debugging'), 'manage_options','wpbot_help_page', 'wpbot_help_page_callback_func' );
294 255
295 256
@@ -328,9 +289,9 @@
328 289 global $wpcommerce, $wp_scripts;
329 290 $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
330 291
331 292 if (((!empty($_GET["page"])) && ($_GET["page"] == "wpbot")) || ($hook == "widgets.php") || $_GET['page']=='wpbot_help_page' || $_GET['page']=='wpbot_openAi' || $_GET['page']=='simple-text-response'
332 - || $_GET['page']=='wpbot-panel' || $_GET["page"] == "wbcs-botsessions-page" || $_GET["page"] == "wpbot_ai_actions" ) {
293 + || $_GET['page']=='wpbot-panel' || $_GET["page"] == "wbcs-botsessions-page" ) {
333 294
334 295 wp_enqueue_script('jquery');
335 296 //wp_enqueue_style('wpcommerce_admin_styles', $wpcommerce->plugin_url() . '/assets/css/admin.css');
336 297
@@ -355,9 +316,9 @@
355 316 wp_enqueue_script( 'wp-color-picker');
356 317 wp_enqueue_script( 'jquery-ui-sortable');
357 318 wp_register_script('qcld-wp-fontpicker', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/fontpicker.js', basename(__FILE__)), array(), true);
358 319 wp_enqueue_script('qcld-wp-fontpicker');
359 - wp_register_script('qcld-wp-chatbot-cbpFWTabs', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/cbpFWTabs.js', basename(__FILE__)), array(), QCLD_wpCHATBOT_VERSION, true);
320 + wp_register_script('qcld-wp-chatbot-cbpFWTabs', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/cbpFWTabs.js', basename(__FILE__)), array(), true);
360 321 wp_enqueue_script('qcld-wp-chatbot-cbpFWTabs');
361 322 wp_register_script('qcld-wp-chatbot-modernizr-custom', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/modernizr.custom.js', basename(__FILE__)), array(), true);
362 323 wp_enqueue_script('qcld-wp-chatbot-modernizr-custom');
363 324 wp_register_script('qcld-wp-chatbot-bootstrap-js', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/bootstrap.js', basename(__FILE__)), array('jquery'), true);
@@ -378,9 +339,9 @@
378 339 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');
379 340 wp_enqueue_style('qcld-wp-chatbot-timepicker-css');
380 341 wp_register_script('qcld-wp-chatbot-sweetalrt', plugins_url(basename(plugin_dir_path(__FILE__)) . '/js/sweetalrt.js', basename(__FILE__)), array(), true);
381 342 wp_enqueue_script('qcld-wp-chatbot-sweetalrt');
382 - 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','jquery-ui-droppable','wp-color-picker','qcld-wp-chatbot-timepicker-js'), QCLD_wpCHATBOT_VERSION, true);
343 + 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','jquery-ui-droppable','wp-color-picker','qcld-wp-chatbot-timepicker-js'), true);
383 344 wp_enqueue_script('qcld-wp-chatbot-admin-js');
384 345 wp_localize_script('qcld-wp-chatbot-admin-js', 'qcld_gemini_admin_data',
385 346 array('ajax_url' => admin_url('admin-ajax.php'),'ajax_nonce' => wp_create_nonce('wp_chatbot'),'image_path' => QCLD_wpCHATBOT_IMG_URL));
386 347 // WordPress Media library
@@ -396,9 +357,9 @@
396 357 public function qcld_get_formbuilder_forms(){
397 358 global $wpdb;
398 359 $forms = array();
399 360 if(class_exists('Qcformbuilder_Forms_Admin')){
400 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
361 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
401 362 if(!empty($results)){
402 363 foreach($results as $result){
403 364 $form = maybe_unserialize($result->config);
404 365 $forms[] = trim($form['name']);
@@ -410,15 +371,12 @@
410 371 }else{
411 372 return array();
412 373 }
413 374 }
414 - public function qcld_wb_chatbot_admin_page1() {
415 - require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/admin/templates/email_subscription.php';
416 - }
417 375 public function qcld_wpbot_simple_response_intent(){
418 376 global $wpdb;
419 377 $table = $wpdb->prefix.'wpbot_response';
420 - $results = $wpdb->get_results("SELECT `intent` FROM `{$table}` WHERE 1 and `intent` !=''"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
378 + $results = $wpdb->get_results("SELECT `intent` FROM `$table` WHERE 1 and `intent` !=''"); //DB Call OK, No Caching OK
421 379 $response = array();
422 380 if(!empty($results)){
423 381 foreach($results as $result){
424 382 $response[] = $result->intent;
@@ -430,9 +388,9 @@
430 388 global $wpdb;
431 389 $command = array();
432 390 if(class_exists('Qcformbuilder_Forms_Admin')){
433 391 $primary = 'primary';
434 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type = %s", $primary)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
392 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type = %s", $primary)); //DB Call OK, No Caching OK
435 393
436 394 if(!empty($results)){
437 395 foreach($results as $result){
438 396 $form = maybe_unserialize($result->config);
@@ -451,8 +409,9 @@
451 409 }
452 410 }
453 411 public function promotion_notice(){
454 412 $screen = get_current_screen();
413 + // var_dump($screen->base );
455 414 // if( isset($screen->base) && (( $screen->base == 'wpbot-lite_page_wpbot') || ( $screen->base == 'toplevel_page_wpbot-panel"'))){
456 415 ?>
457 416 <div id="promotion-wpchatbot" data-dismiss-type="qcbot-feedback-notice" class="notice is-dismissible qcbot-feedback" style="background: #120976 !important">
458 417 <div class="">
@@ -469,9 +428,9 @@
469 428 public function qcld_get_formbuilder_form_ids(){
470 429 global $wpdb;
471 430 $forms = array();
472 431 if(class_exists('Qcformbuilder_Forms_Admin')){
473 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
432 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
474 433
475 434 if(!empty($results)){
476 435 foreach($results as $result){
477 436 $form = maybe_unserialize($result->config);
@@ -505,9 +464,9 @@
505 464 $conversation_form_ids = array();
506 465 $conversation_form_names = array();
507 466
508 467 if(class_exists('Qcformbuilder_Forms_Admin')){
509 - $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
468 + $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ". $wpdb->prefix."wfb_forms WHERE type=%s", 'primary')); //DB Call OK, No Caching OK
510 469 if(!empty($results)){
511 470
512 471 foreach($results as $result){
513 472 $form = maybe_unserialize($result->config);
@@ -533,12 +492,12 @@
533 492 'yes' => str_replace('\\', '',get_option('qlcd_wp_chatbot_yes')),
534 493 'no' => str_replace('\\', '',get_option('qlcd_wp_chatbot_no')),
535 494 'or' => str_replace('\\', '',get_option('qlcd_wp_chatbot_or')),
536 495 'host' => str_replace('\\', '',get_option('qlcd_wp_chatbot_host')),
537 - 'agent' => str_replace(['\\','<','>'], '',esc_html(is_array(maybe_unserialize(get_option('qlcd_wp_chatbot_agent'))) ? current(maybe_unserialize(get_option('qlcd_wp_chatbot_agent'))) : get_option('qlcd_wp_chatbot_agent'))),
496 + 'agent' => str_replace(['\\','<','>'], '',esc_html(get_option('qlcd_wp_chatbot_agent'))),
538 497 'agent_image' => get_option('wp_chatbot_agent_image'),
539 498 'agent_image_path' => esc_url((!empty(get_option('wp_chatbot_custom_icon_path')) && !is_404(get_option('wp_chatbot_custom_icon_path'))) ? $this->qcld_wb_chatbot_agent_icon() : QCLD_wpCHATBOT_IMG_URL . 'icon-1.png'),
540 - 'shopper_demo_name' => str_replace('\\', '', is_array(maybe_unserialize(get_option('qlcd_wp_chatbot_shopper_demo_name'))) ? current(maybe_unserialize(get_option('qlcd_wp_chatbot_shopper_demo_name'))) : get_option('qlcd_wp_chatbot_shopper_demo_name')),
499 + 'shopper_demo_name' => str_replace('\\', '',get_option('qlcd_wp_chatbot_shopper_demo_name')),
541 500 'agent_join' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_agent_join'))),
542 501 'welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_welcome'))),
543 502 'welcome_back' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_welcome_back'))),
544 503 'hi_there' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_hi_there'))),
@@ -564,54 +523,54 @@
564 523 'sys_key_order' => get_option('qlcd_wp_chatbot_sys_key_order'),
565 524 'sys_key_support' => get_option('qlcd_wp_chatbot_sys_key_support'),
566 525 'sys_key_reset' => get_option('qlcd_wp_chatbot_sys_key_reset'),
567 526 'sys_key_email' => get_option('qlcd_wp_chatbot_sys_key_email'),
568 - 'help_welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_help_welcome'))),
569 - 'back_to_start' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_back_to_start'))),
570 - 'help_msg' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_help_msg'))),
571 - 'reset' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_reset'))),
572 - 'wildcard_product' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_wildcard_product'))),
573 - 'wildcard_catalog' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_wildcard_catalog'))),
574 - 'featured_products' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_featured_products'))),
575 - 'sale_products' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_sale_products'))),
576 - 'wildcard_order' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_wildcard_order'))),
527 + 'help_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_welcome'))),
528 + 'back_to_start' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_back_to_start'))),
529 + 'help_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_help_msg'))),
530 + 'reset' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_reset'))),
531 + 'wildcard_product' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_product'))),
532 + 'wildcard_catalog' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_catalog'))),
533 + 'featured_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_featured_products'))),
534 + 'sale_products' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_sale_products'))),
535 + 'wildcard_order' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_wildcard_order'))),
577 536 'wildcard_support' => get_option('qlcd_wp_chatbot_wildcard_support'),
578 - 'product_asking' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_asking'))),
579 - 'product_suggest' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_suggest'))),
580 - 'product_infinite' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_infinite'))),
581 - 'product_success' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_success'))),
582 - 'product_fail' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_product_fail'))),
583 - 'support_welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_support_welcome'))),
537 + 'product_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_asking'))),
538 + 'product_suggest' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_suggest'))),
539 + 'product_infinite' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_infinite'))),
540 + 'product_success' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_success'))),
541 + 'product_fail' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_product_fail'))),
542 + 'support_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_welcome'))),
584 543 'support_email' => get_option('qlcd_wp_chatbot_support_email'),
585 - 'support_option_again' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_support_option_again'))),
586 - 'asking_email' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_asking_email'))),
587 - 'asking_msg' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_asking_msg'))),
588 - 'no_result' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_no_result'))),
544 + 'support_option_again' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_support_option_again'))),
545 + 'asking_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_email'))),
546 + 'asking_msg' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_msg'))),
547 + 'no_result' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_no_result'))),
589 548 'support_phone' => get_option('qlcd_wp_chatbot_support_phone'),
590 - 'asking_phone' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_asking_phone'))),
591 - 'thank_for_phone' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_thank_for_phone'))),
592 - 'support_query' => ((gettype(get_option('support_query')) == 'string') ? $this->qcld_wb_chatbot_str_replace(maybe_unserialize( get_option('support_query'))) : $this->qcld_wb_chatbot_str_replace(( get_option('support_query')))),
593 - 'support_ans' => (gettype(get_option('support_ans')) == 'string') ? $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('support_ans'))) : $this->qcld_wb_chatbot_str_replace((get_option('support_ans'))),
549 + 'asking_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_asking_phone'))),
550 + 'thank_for_phone' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_thank_for_phone'))),
551 + 'support_query' => ((gettype(get_option('support_query')) == 'string') ? $this->qcld_wb_chatbot_str_replace(unserialize( get_option('support_query'))) : $this->qcld_wb_chatbot_str_replace(( get_option('support_query')))),
552 + 'support_ans' => (gettype(get_option('support_ans')) == 'string') ? $this->qcld_wb_chatbot_str_replace(unserialize(get_option('support_ans'))) : $this->qcld_wb_chatbot_str_replace((get_option('support_ans'))),
594 553 'notification_interval' => get_option('qlcd_wp_chatbot_notification_interval'),
595 - 'notifications' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_notifications'))),
596 - 'order_welcome' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_welcome'))),
597 - 'order_username_asking' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_username_asking'))),
598 - 'order_username_password' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_username_password'))),
554 + 'notifications' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_notifications'))),
555 + 'order_welcome' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_welcome'))),
556 + 'order_username_asking' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_asking'))),
557 + 'order_username_password' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_username_password'))),
599 558 'order_user' => get_option('qlcd_wp_chatbot_order_user'),
600 559 'order_login' => is_user_logged_in(),
601 560 'is_chat_session_active' => qcld_wpbot_is_active_chat_history(),
602 561 'order_nonce' => wp_create_nonce("wpwbot-order-nonce"),
603 - 'order_email_support' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_order_email_support'))),
562 + 'order_email_support' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_order_email_support'))),
604 563 'email_fail' => str_replace('\\', '', get_option('qlcd_wp_chatbot_email_fail')),
605 - 'invalid_email' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_invalid_email'))),
564 + 'invalid_email' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_invalid_email'))),
606 565 'stop_words' => str_replace('\\', '', get_option('qlcd_wp_chatbot_stop_words')),
607 566 'currency_symbol' => '',
608 567 'enable_messenger' => get_option('enable_wp_chatbot_messenger'),
609 - 'messenger_label' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_messenger_label'))),
568 + 'messenger_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_messenger_label'))),
610 569 'fb_page_id' => get_option('qlcd_wp_chatbot_fb_page_id'),
611 570 'enable_skype' => get_option('enable_wp_chatbot_skype'),
612 571 'enable_whats' => get_option('enable_wp_chatbot_whats'),
613 - 'whats_label' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_whats_label'))),
572 + 'whats_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_whats_label'))),
614 573 'whats_num' => get_option('qlcd_wp_chatbot_whats_num'),
615 574 'ret_greet' => get_option('qlcd_wp_chatbot_ret_greet'),
616 575 'enable_exit_intent' => get_option('enable_wp_chatbot_exit_intent'),
617 576 'exit_intent_msg' => str_replace('\\', '', get_option('wp_chatbot_exit_intent_msg')),
@@ -626,9 +585,9 @@
626 585 'auto_open_once' => get_option('wp_chatbot_auto_open_once'),
627 586 'proactive_bg_color' => get_option('wp_chatbot_proactive_bg_color'),
628 587 'disable_feedback' => get_option('disable_wp_chatbot_feedback'),
629 588 'disable_faq' => get_option('disable_wp_chatbot_faq'),
630 - 'feedback_label' => $this->qcld_wb_chatbot_str_replace(maybe_unserialize(get_option('qlcd_wp_chatbot_feedback_label'))),
589 + 'feedback_label' => $this->qcld_wb_chatbot_str_replace(unserialize(get_option('qlcd_wp_chatbot_feedback_label'))),
631 590 'enable_meta_title' =>get_option('enable_wp_chatbot_meta_title'),
632 591 'meta_label' =>str_replace('\\', '', get_option('qlcd_wp_chatbot_meta_label')),
633 592 'phone_number' => get_option('qlcd_wp_chatbot_phone'),
634 593 'disable_site_search' => get_option('disable_wp_chatbot_site_search'),
@@ -644,10 +603,8 @@
644 603 'enable_ret_user_show' => get_option('enable_wp_chatbot_ret_user_show'),
645 604 'enable_inactive_time_show' => get_option('enable_wp_chatbot_inactive_time_show'),
646 605 'ret_inactive_user_once' => get_option('wp_chatbot_inactive_once'),
647 606 'mobile_full_screen' => '1',
648 - 'chatbot_content' => get_option( 'chatbot_content_max_height' ),
649 - 'chatbot_content_responsive' => get_option( 'chatbot_content_max_height_responsive' ),
650 607 'botpreloadingtime' => (get_option('wpbot_preloading_time')?get_option('wpbot_preloading_time'):800),
651 608 'inactive_time' => get_option('wp_chatbot_inactive_time'),
652 609 'checkout_msg' => str_replace('\\', '', get_option('wp_chatbot_checkout_msg')),
653 610 'ai_df_enable' => get_option('enable_wp_chatbot_dailogflow'),
@@ -658,9 +615,8 @@
658 615 'is_stream_enabled' => ( get_option('is_stream_enabled', '1') == '1' ? '1' : '0' ),
659 616 'qcld_openai_append_content' => get_option('qcld_openai_append_content'),
660 617 'openrouter_enabled' => (get_option('qcld_openrouter_enabled')=='1'? get_option('qcld_openrouter_enabled') : '0'),
661 618 'gemini_enabled' => (get_option('qcld_gemini_enabled')=='1'? get_option('qcld_gemini_enabled') : '0'),
662 - 'claude_enabled' => (get_option('qcld_claude_enabled')=='1'? get_option('qcld_claude_enabled') : '0'),
663 619 'grok_enabled' => (get_option('qcld_grok_enabled')=='1'? get_option('qcld_grok_enabled') : '0'),
664 620 'qcld_gemini_prepend_content' => get_option('qcld_gemini_prepend_content'),
665 621 'qcld_gemini_append_content' => get_option('qcld_gemini_append_content'),
666 622 'qcld_openrouter_append_content' => get_option('qcld_openrouter_append_content'),
@@ -679,12 +635,8 @@
679 635 'current_user_id' => $user_id,
680 636 'display_name' => esc_html( $display_name ),
681 637 'skip_wp_greetings' => get_option('skip_wp_greetings'),
682 638 'skip_greetings_and_menu' => get_option('skip_wp_greetings_donot_show_menu'),
683 - 'skip_wp_greetings_trigger_intent' => get_option('skip_wp_greetings_trigger_intent'),
684 - 'intent_for_non_logged_in_user' => get_option('qlcd_wp_chatbot_intent_for_non_logged_in_user'),
685 - 'intent_for_logged_in_user' => get_option('qlcd_wp_chatbot_intent_for_logged_in_user'),
686 - 'ask_email_wp_greetings' => get_option('enable_asking_for_email'),
687 639 'skip_chat_reactions_menu' => get_option('skip_chat_reactions_menu'),
688 640 'qlcd_wp_chatbot_like_text' => get_option('qlcd_wp_chatbot_like_text'),
689 641 'qlcd_wp_chatbot_dislike_text' => get_option('qlcd_wp_chatbot_dislike_text'),
690 642 'enable_chat_report_menu' => get_option('enable_chat_report_menu'),
@@ -690,10 +642,8 @@
690 642 'enable_chat_report_menu' => get_option('enable_chat_report_menu'),
691 643 'qlcd_wp_chatbot_report_text' => get_option('qlcd_wp_chatbot_report_text'),
692 644 'enable_chat_share_menu' => get_option('enable_chat_share_menu'),
693 645 'qlcd_wp_chatbot_share_text' => get_option('qlcd_wp_chatbot_share_text'),
694 - 'icon_video' => get_option('wp_chatbot_icon_video', ''),
695 - 'icon_video_delay' => absint(get_option('wp_chatbot_icon_video_delay', 0)),
696 646
697 647 );
698 648 $user_font = get_option('wp_chatbot_user_font') != '' ? get_option('wp_chatbot_user_font') : '';
699 649 if($user_font != '' ){
@@ -741,18 +691,8 @@
741 691 wp_enqueue_script('qcld-wp-chatbot-magnify-popup');
742 692 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);
743 693 wp_enqueue_script('qcld-wp-chatbot-plugin');
744 694
745 - $saved_ai_forms = get_option('wpbot_ai_forms', array());
746 - $ai_form_titles = array();
747 - if (is_array($saved_ai_forms)) {
748 - foreach ($saved_ai_forms as $form) {
749 - if (!isset($form['interactive']) || $form['interactive'] == 1) {
750 - $ai_form_titles[] = trim(strtolower($form['title']));
751 - }
752 - }
753 - }
754 -
755 695 $nonce = wp_create_nonce('wp_chatbot');
756 696 // Pass data to JS
757 697 wp_localize_script('qcld-wp-chatbot-plugin', 'qcld_chatbot_obj', [
758 698 'ajax_url' => admin_url('admin-ajax.php'),
@@ -757,9 +697,8 @@
757 697 wp_localize_script('qcld-wp-chatbot-plugin', 'qcld_chatbot_obj', [
758 698 'ajax_url' => admin_url('admin-ajax.php'),
759 699 'nonce' => $nonce,
760 700 'stream_endpoint' => admin_url('admin-ajax.php?action=qcld_stream_openai'),
761 - 'ai_form_titles' => $ai_form_titles,
762 701 ]);
763 702
764 703 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);
765 704 wp_enqueue_script('qcld-wp-chatbot-front-js');
@@ -823,11 +762,8 @@
823 762 $user_msg_text_color = sanitize_hex_color( get_option('wp_chatbot_user_msg_text_color') );
824 763 $wp_chatbot_text_color = sanitize_hex_color( get_option('wp_chatbot_text_color') );
825 764 $user_msg_bg_color = sanitize_hex_color( get_option('wp_chatbot_user_msg_bg_color') );
826 765 $header_background_color = sanitize_hex_color( get_option('wp_chatbot_header_background_color') );
827 - $chatbot_content_max_height = sanitize_text_field( get_option('chatbot_content_max_height') );
828 - $chatbot_content_max_height_responsive = sanitize_text_field( get_option('chatbot_content_max_height_responsive') );
829 -
830 766
831 767 $inline_chat_custom_styles .= "
832 768 #wp-chatbot-chat-container, .wp-chatbot-product-description, .wp-chatbot-product-description p,.wp-chatbot-product-quantity label, .wp-chatbot-product-variable label {
833 769 color: ". $text_color ." !important;
@@ -919,11 +855,8 @@
919 855 font-style: ".$bot_font_family->fontStyle.";
920 856 font-size: ". get_option('wp_chatbot_font_size'). "px;
921 857 }
922 858
923 -
924 -
925 -
926 859 ";
927 860 }
928 861 if ( get_option('enable_wp_chatbot_custom_color') == 1 && ! empty($bot_font) ) {
929 862
@@ -946,9 +879,10 @@
946 879 font-style: {$font_style};
947 880 font-size: {$font_size};
948 881 }
949 882 ";
950 -
883 +
884 + wp_add_inline_style( 'qcld-wp-chatbot-common-style', $custom_colors );
951 885 }
952 886
953 887 if(get_option('wp_chatbot_custom_css')!=""){
954 888
@@ -953,89 +887,8 @@
953 887 if(get_option('wp_chatbot_custom_css')!=""){
954 888
955 889 wp_add_inline_style( 'qcld-wp-chatbot-common-style', get_option('wp_chatbot_custom_css') );
956 890 }
957 -
958 -
959 -
960 -
961 - if ( ( get_option( 'chatbot_content_max_height' ) != '' ) ) {
962 - $chatbot_h_vh = absint( get_option( 'chatbot_content_max_height' ) );
963 - if ( $chatbot_h_vh <= 0 ) {
964 - $chatbot_h_vh = 80;
965 - }
966 - if ( $chatbot_h_vh > 100 ) {
967 - $chatbot_h_vh = 100;
968 - }
969 - // Expand adds a modest bump based on admin height (never above 100vh).
970 - $chatbot_h_expanded_vh = min( 100, $chatbot_h_vh + 8 );
971 -
972 - $chatbot_h_mobile_vh = absint( get_option( 'chatbot_content_max_height_responsive' ) );
973 - if ( $chatbot_h_mobile_vh <= 0 ) {
974 - $chatbot_h_mobile_vh = 90;
975 - }
976 - if ( $chatbot_h_mobile_vh > 100 ) {
977 - $chatbot_h_mobile_vh = 100;
978 - }
979 -
980 - $custom_colors .= ' .slimScrollDiv{
981 - height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
982 - max-height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
983 - }';
984 -
985 -
986 - $custom_colors .= 'div#wp-chatbot-board-container{
987 - height: calc(' . $chatbot_h_vh . 'vh - 100px) !important;
988 - max-height: calc(' . $chatbot_h_vh . 'vh - 100px) !important;
989 - }';
990 -
991 - $custom_colors .= '.wp-chatbot-content{
992 - height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
993 - max-height: calc(' . $chatbot_h_vh . 'vh - 270px) !important;
994 - }';
995 -
996 - // Desktop expand: width toggle also grows height from admin base + bump.
997 - $custom_colors .= '
998 - div#wp-chatbot-board-container.wp-chatbot-expanded,
999 - .wp-chatbot-board-container.wp-chatbot-expanded {
1000 - height: calc(' . $chatbot_h_expanded_vh . 'vh - 100px) !important;
1001 - max-height: calc(' . $chatbot_h_expanded_vh . 'vh - 100px) !important;
1002 - }
1003 - div#wp-chatbot-board-container.wp-chatbot-expanded .slimScrollDiv,
1004 - div#wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-content,
1005 - div#wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-ball-inner,
1006 - .wp-chatbot-board-container.wp-chatbot-expanded .slimScrollDiv,
1007 - .wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-content,
1008 - .wp-chatbot-board-container.wp-chatbot-expanded .wp-chatbot-ball-inner {
1009 - height: calc(' . $chatbot_h_expanded_vh . 'vh - 270px) !important;
1010 - max-height: calc(' . $chatbot_h_expanded_vh . 'vh - 270px) !important;
1011 - }
1012 - ';
1013 -
1014 -
1015 -
1016 - $custom_colors .= '
1017 - @media screen and (max-width: 480px) {
1018 - div#wp-chatbot-board-container{
1019 - height: calc(' . $chatbot_h_mobile_vh . 'vh - 0px) !important;
1020 - max-height: calc(' . $chatbot_h_mobile_vh . 'vh - 0px) !important;
1021 - }
1022 -
1023 - .slimScrollDiv{
1024 - height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1025 - max-height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1026 - }
1027 -
1028 - .wp-chatbot-content{
1029 - height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1030 - max-height: calc(' . $chatbot_h_mobile_vh . 'vh - 170px) !important;
1031 - }
1032 - }
1033 - ';
1034 -
1035 -
1036 - }
1037 - wp_add_inline_style( 'qcld-wp-chatbot-common-style', $custom_colors );
1038 891 }
1039 892 public function qcld_wb_chatbot_str_replace($messages=array()){
1040 893 $allowed_html = array(
1041 894 'a' => array(
@@ -1217,26 +1070,8 @@
1217 1070 if(isset( $_POST["skip_wp_greetings"])){
1218 1071 $skip_wp_greetings = sanitize_text_field(wp_unslash($_POST["skip_wp_greetings"]));
1219 1072 }else{ $skip_wp_greetings='';}
1220 1073 update_option('skip_wp_greetings', wp_unslash($skip_wp_greetings));
1221 -
1222 - if( $skip_wp_greetings == '1' || $skip_wp_greetings_donot_show_menu == '1' ){
1223 - $ask_email_wp_greetings = '';
1224 - $enable_asking_for_email = '';
1225 - } else {
1226 - if (isset( $_POST["ask_email_wp_greetings"])) {
1227 - $ask_email_wp_greetings = sanitize_text_field(wp_unslash($_POST["ask_email_wp_greetings"]));
1228 - } else {
1229 - $ask_email_wp_greetings = '';
1230 - }
1231 - if (isset( $_POST["enable_asking_for_email"])) {
1232 - $enable_asking_for_email = sanitize_text_field(wp_unslash($_POST["enable_asking_for_email"]));
1233 - } else {
1234 - $enable_asking_for_email = '';
1235 - }
1236 - }
1237 - update_option('ask_email_wp_greetings', wp_unslash($ask_email_wp_greetings));
1238 - update_option('enable_asking_for_email', wp_unslash($enable_asking_for_email));
1239 1074 //Enable /disable wpwbot
1240 1075 if(isset( $_POST["disable_wp_chatbot"])){
1241 1076 $disable_wp_chatbot = sanitize_text_field(wp_unslash($_POST["disable_wp_chatbot"]));
1242 1077 }else{ $disable_wp_chatbot='';}
@@ -1283,21 +1118,9 @@
1283 1118 if(isset( $_POST["enable_wp_chatbot_rtl"])) {
1284 1119 $enable_wp_chatbot_rtl = sanitize_text_field(wp_unslash($_POST["enable_wp_chatbot_rtl"]));
1285 1120 }else{ $enable_wp_chatbot_rtl='';}
1286 1121 update_option('enable_wp_chatbot_rtl', wp_unslash($enable_wp_chatbot_rtl));
1287 -
1288 - if(isset( $_POST["chatbot_content_max_height"])) {
1289 - $chatbot_content_max_height = sanitize_text_field(wp_unslash($_POST["chatbot_content_max_height"]));
1290 - }else{ $chatbot_content_max_height='';}
1291 - update_option('chatbot_content_max_height', wp_unslash($chatbot_content_max_height));
1292 -
1293 -
1294 - if(isset( $_POST["chatbot_content_max_height_responsive"])) {
1295 - $chatbot_content_max_height_responsive = sanitize_text_field(wp_unslash($_POST["chatbot_content_max_height_responsive"]));
1296 - }else{ $chatbot_content_max_height_responsive='';}
1297 - update_option('chatbot_content_max_height_responsive', wp_unslash($chatbot_content_max_height_responsive));
1298 -
1299 -
1122 +
1300 1123 if(isset( $_POST["show_menu_after_greetings"])) {
1301 1124 $show_menu_after_greetings = sanitize_text_field(wp_unslash($_POST["show_menu_after_greetings"]));
1302 1125 }else{ $show_menu_after_greetings='';}
1303 1126 update_option('show_menu_after_greetings', wp_unslash($show_menu_after_greetings));
@@ -1438,17 +1261,8 @@
1438 1261 update_option('wp_chatbot_icon', $wp_chatbot_icon);
1439 1262
1440 1263 $wp_chatbot_floatingiconbg_color = isset( $_POST['wp_chatbot_floatingiconbg_color'] ) ? sanitize_text_field(wp_unslash($_POST['wp_chatbot_floatingiconbg_color'])) : '#fff';
1441 1264 update_option('wp_chatbot_floatingiconbg_color', $wp_chatbot_floatingiconbg_color);
1442 -
1443 - // Custom icon video / YouTube link
1444 - $wp_chatbot_icon_youtube_url = isset( $_POST['wp_chatbot_icon_youtube_url'] ) ? esc_url_raw( $_POST['wp_chatbot_icon_youtube_url'] ) : '';
1445 - $wp_chatbot_icon_video_upload = isset( $_POST['wp_chatbot_icon_video'] ) ? esc_url_raw( $_POST['wp_chatbot_icon_video'] ) : '';
1446 - // YouTube URL takes priority; fall back to uploaded video
1447 - $wp_chatbot_icon_video = ( $wp_chatbot_icon_youtube_url !== '' ) ? $wp_chatbot_icon_youtube_url : $wp_chatbot_icon_video_upload;
1448 - update_option( 'wp_chatbot_icon_video', $wp_chatbot_icon_video );
1449 - $wp_chatbot_icon_video_delay = isset( $_POST['wp_chatbot_icon_video_delay'] ) ? absint( $_POST['wp_chatbot_icon_video_delay'] ) : 0;
1450 - update_option( 'wp_chatbot_icon_video_delay', $wp_chatbot_icon_video_delay );
1451 1265
1452 1266 // upload custom wpwbot icon path
1453 1267 $wp_chatbot_custom_icon_path = sanitize_text_field(wp_unslash($_POST['wp_chatbot_custom_icon_path']));
1454 1268 update_option('wp_chatbot_custom_icon_path', $wp_chatbot_custom_icon_path);
@@ -1464,14 +1278,8 @@
1464 1278
1465 1279 //Theming
1466 1280 $qcld_wb_chatbot_theme = (isset($_POST['qcld_wb_chatbot_theme']) ? sanitize_text_field(wp_unslash($_POST['qcld_wb_chatbot_theme'])) : 'template-00');
1467 1281 update_option('qcld_wb_chatbot_theme', $qcld_wb_chatbot_theme);
1468 -
1469 - //Avatar Location
1470 - if(isset($_POST['qcld_chatbot_avatar_location'])) {
1471 - $qcld_chatbot_avatar_location = sanitize_text_field(wp_unslash($_POST['qcld_chatbot_avatar_location']));
1472 - update_option('qcld_chatbot_avatar_location', $qcld_chatbot_avatar_location);
1473 - }
1474 1282 //Theme custom background option
1475 1283 if(isset( $_POST["qcld_wb_chatbot_change_bg"])) {
1476 1284 $qcld_wb_chatbot_change_bg = sanitize_text_field(wp_unslash($_POST["qcld_wb_chatbot_change_bg"]));
1477 1285 }else{$qcld_wb_chatbot_change_bg='';}
@@ -1485,9 +1293,9 @@
1485 1293
1486 1294 //To override style use custom css.
1487 1295 if(isset($_POST["wp_chatbot_custom_css"])){
1488 1296 $wp_chatbot_custom_css = wp_unslash($_POST["wp_chatbot_custom_css"]);
1489 - update_option('wp_chatbot_custom_css', sanitize_textarea_field($wp_chatbot_custom_css));
1297 + update_option('wp_chatbot_custom_css', sanitize_text_field($wp_chatbot_custom_css));
1490 1298 }
1491 1299
1492 1300 if (isset($_POST["qlcd_wp_chatbot_dialogflow_project_id"])) {
1493 1301 $qlcd_wp_chatbot_dialogflow_project_id = sanitize_text_field(wp_unslash($_POST["qlcd_wp_chatbot_dialogflow_project_id"]));
@@ -2653,15 +2461,13 @@
2653 2461
2654 2462 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
2655 2463 dbDelta( $sql_sliders_Table1 );
2656 2464
2657 -
2658 2465 //Bot Response Table
2659 2466 $table_rag_documents = $wpdb->prefix . "rag_documents";
2660 2467
2661 2468 $charset = $wpdb->get_charset_collate();
2662 - if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_rag_documents))) != $table_rag_documents) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
2663 - // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
2469 + if ($wpdb->get_var("SHOW TABLES LIKE '$table_rag_documents'") != $table_rag_documents) {
2664 2470 $sql_rag_documents = "CREATE TABLE $table_rag_documents (
2665 2471 id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
2666 2472 doc_id VARCHAR(100) DEFAULT NULL,
2667 2473 title VARCHAR(255) NOT NULL,
@@ -2675,14 +2481,12 @@
2675 2481 created_at DATETIME DEFAULT CURRENT_TIMESTAMP
2676 2482 ) $charset;";
2677 2483 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2678 2484 dbDelta($sql_rag_documents);
2679 - // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange
2680 2485 }
2681 2486 $table_report = $wpdb->prefix . 'wpbot_chat_report';
2682 2487
2683 - if ( $wpdb->get_var( $wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_report)) ) != $table_report ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
2684 - // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
2488 + if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_report'" ) != $table_report ) {
2685 2489 $sql_report = "
2686 2490 CREATE TABLE `$table_report` (
2687 2491 `id` int(11) NOT NULL AUTO_INCREMENT,
2688 2492 `user_id` int(11) NOT NULL,
@@ -2696,40 +2500,20 @@
2696 2500 ";
2697 2501
2698 2502 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2699 2503 dbDelta( $sql_report );
2700 - // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange
2701 2504 }
2702 2505
2703 - $sqlqry = $wpdb->get_results($wpdb->prepare("select * from {$table1} where id = %d", 1)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
2506 + $sqlqry = $wpdb->get_results($wpdb->prepare("select * from $table1 where id = %d", 1)); //DB Call OK, No Caching OK
2704 2507 if(empty($sqlqry)){
2705 2508
2706 - $query = 'Sample Question ?';
2707 - $response = 'Sample Answer';
2509 + $query = 'What Can WPBot do for you?';
2510 + $response = 'WPBot can converse fluidly with users on website and FB messenger. It can search your website, send/collect eMails, user feedback & phone numbers . You can create Custom Intents from DialogFlow with Rich Messages & Card responses!';
2708 2511
2709 2512 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
2710 2513 $format = array('%s','%s', '%s', '%s');
2711 - $wpdb->insert($table1,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, PluginCheck.Security.DirectDB.UnescapedDBParameter
2514 + $wpdb->insert($table1,$data,$format); //DB Call OK, No Caching OK
2712 2515 }
2713 -
2714 - $table = $wpdb->prefix . 'wpbot_subscription';
2715 - if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
2716 - // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
2717 - $sql_sliders_Table = "
2718 - CREATE TABLE IF NOT EXISTS `$table` (
2719 - `id` int(11) NOT NULL AUTO_INCREMENT,
2720 - `name` varchar(256) NOT NULL,
2721 - `email` varchar(256) NOT NULL,
2722 - `phone` varchar(256) NOT NULL,
2723 - `url` text NOT NULL,
2724 - `date` datetime NOT NULL,
2725 - `user_agent` text NOT NULL,
2726 - PRIMARY KEY (`id`)
2727 - ) $collate AUTO_INCREMENT=1 ";
2728 - require_once ABSPATH . 'wp-admin/includes/upgrade.php';
2729 - dbDelta($sql_sliders_Table);
2730 - // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange
2731 - }
2732 2516
2733 2517 $url = get_site_url();
2734 2518 $url = wp_parse_url($url);
2735 2519 $domain = $url['host'];
@@ -2821,19 +2605,11 @@
2821 2605 if(!get_option('wp_chatbot_show_home_page')) {
2822 2606 update_option('wp_chatbot_show_home_page', 'on');
2823 2607 }
2824 2608 if(!get_option('qc_wpbot_menu_order')) {
2825 - $site_search_label = get_option('qlcd_wp_chatbot_wildcard_site_search') != '' ? get_option('qlcd_wp_chatbot_wildcard_site_search') : 'Site Search';
2826 - $support_email_label = get_option('qlcd_wp_chatbot_support_email') != '' ? get_option('qlcd_wp_chatbot_support_email') : 'Send us Email.';
2827 - $support_phone_label = get_option('qlcd_wp_chatbot_support_phone') != '' ? get_option('qlcd_wp_chatbot_support_phone') : 'Leave your number. We will call you back!';
2828 - $default_menu = '<span class="qcld-chatbot-wildcard qc_draggable_item qcld-chatbot-site-search" data-wildcart="site_search">' . esc_attr($site_search_label) . '</span>';
2829 - $default_menu .= '<span class="qcld-chatbot-suggest-email qc_draggable_item">' . esc_attr($support_email_label) . '</span>';
2830 - $default_menu .= '<span class="qcld-chatbot-suggest-phone qc_draggable_item">' . esc_attr($support_phone_label) . '</span>';
2831 - update_option('qc_wpbot_menu_order', $default_menu);
2609 + update_option('qc_wpbot_menu_order', '');
2832 2610 }
2833 - if(!get_option('qcld_chatbot_avatar_location')) {
2834 - update_option('qcld_chatbot_avatar_location', 'side');
2835 - }
2611 +
2836 2612 if(!get_option('wp_chatbot_show_posts')) {
2837 2613 update_option('wp_chatbot_show_posts', 'on');
2838 2614 }
2839 2615 if(!get_option('wp_chatbot_show_pages')){
@@ -3160,12 +2936,12 @@
3160 2936 if(!get_option('qlcd_wp_chatbot_notifications')) {
3161 2937 update_option('qlcd_wp_chatbot_notifications', maybe_serialize(array('Welcome to WPBot')));
3162 2938 }
3163 2939 if(!get_option('support_query')) {
3164 - update_option('support_query', maybe_serialize(array('Sample Question?')));
2940 + update_option('support_query', maybe_serialize(array('What is WPBot?')));
3165 2941 }
3166 2942 if(!get_option('support_ans')) {
3167 - update_option('support_ans', maybe_serialize(array('Sample Answer')));
2943 + update_option('support_ans', maybe_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.')));
3168 2944 }
3169 2945 if(!get_option('qlcd_wp_chatbot_search_option')) {
3170 2946 update_option('qlcd_wp_chatbot_search_option', 'standard');
3171 2947 }
@@ -3352,10 +3128,9 @@
3352 3128 }
3353 3129 if(!get_option('enable_wp_chatbot_opening_hour')) {
3354 3130 update_option('wpwbot_hours', array());
3355 3131 }
3356 - wpbot_free_set_content_height_defaults();
3357 -
3132 +
3358 3133 if(!get_option('enable_wp_chatbot_dailogflow')) {
3359 3134 update_option('enable_wp_chatbot_dailogflow', '');
3360 3135 }
3361 3136 if(!get_option('qlcd_wp_chatbot_dialogflow_client_token')) {
@@ -3389,159 +3164,8 @@
3389 3164 * Reset Options will be insert as defualt data
3390 3165 */
3391 3166 add_action('wp_ajax_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
3392 3167 //add_action('wp_ajax_nopriv_qcld_wb_chatboot_delete_all_options', 'qcld_wb_chatboot_delete_all_options');
3393 -
3394 -add_action('wp_ajax_qcld_save_ai_form', 'qcld_save_ai_form');
3395 -add_action('wp_ajax_nopriv_qcld_save_ai_form', 'qcld_save_ai_form');
3396 -
3397 -function qcld_save_ai_form() {
3398 - check_ajax_referer('wp_chatbot', 'nonce');
3399 - if (isset($_POST['data'])) {
3400 - $data_string = stripslashes($_POST['data']);
3401 - $json_data = json_decode($data_string, true);
3402 - if ($json_data && isset($json_data['form_title'])) {
3403 - $post_title = sanitize_text_field($json_data['form_title']) . ' - ' . current_time('mysql');
3404 - $post_id = wp_insert_post(array(
3405 - 'post_title' => $post_title,
3406 - 'post_type' => 'wpbot_form_entry',
3407 - 'post_status' => 'publish'
3408 - ));
3409 - if ($post_id && isset($json_data['data']) && is_array($json_data['data'])) {
3410 - $email_body = "<h2>" . esc_html__('New AI Action Submission', 'chatbot') . "</h2>";
3411 - $email_body .= "<p><strong>" . esc_html__('Action', 'chatbot') . ":</strong> " . sanitize_text_field($json_data['form_title']) . "</p>";
3412 - $email_body .= "<table border='1' cellpadding='10' cellspacing='0' style='border-collapse: collapse; width: 100%; max-width: 600px; font-family: sans-serif;'>";
3413 -
3414 - // Extract user's email for Reply-To (not From, to avoid SMTP rejection)
3415 - $reply_to = '';
3416 -
3417 - foreach ($json_data['data'] as $key => $value) {
3418 - update_post_meta($post_id, sanitize_text_field($key), sanitize_text_field($value));
3419 - $clean_key = ucwords(str_replace(array('-', '_'), ' ', sanitize_text_field($key)));
3420 - $email_body .= "<tr><td style='background: #f4f4f4; width: 40%;'><strong>" . esc_html($clean_key) . "</strong></td><td>" . esc_html(sanitize_text_field($value)) . "</td></tr>";
3421 -
3422 - // Extract email from value — handles plain, [bracketed], and combined answers
3423 - if (preg_match('/\[?([a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,})\]?/', $value, $email_match)) {
3424 - $candidate = sanitize_email(trim($email_match[1]));
3425 - if (is_email($candidate)) {
3426 - $reply_to = $candidate;
3427 - }
3428 - }
3429 - }
3430 - $email_body .= "</table>";
3431 -
3432 - $email_enabled = true; // Default to true if not found for backwards compatibility
3433 - $per_action_emails = '';
3434 - $saved_forms = get_option('wpbot_ai_forms', array());
3435 - $ai_form_title = strtolower( trim( sanitize_text_field( $json_data['form_title'] ) ) );
3436 - if (is_array($saved_forms)) {
3437 - foreach ($saved_forms as $form) {
3438 - if ( strtolower( trim( $form['title'] ) ) === $ai_form_title ) {
3439 - if (isset($form['email'])) {
3440 - $email_enabled = $form['email'] == 1;
3441 - }
3442 - $per_action_emails = isset($form['email_addresses']) ? trim($form['email_addresses']) : '';
3443 - break;
3444 - }
3445 - }
3446 - }
3447 -
3448 - if ($email_enabled) {
3449 - if (!empty($per_action_emails)) {
3450 - $to = array_map('trim', explode(',', $per_action_emails));
3451 - } else {
3452 - $default = get_option('qlcd_wp_chatbot_admin_email', '');
3453 - $to = !empty($default) ? array_map('trim', explode(',', $default)) : get_option('admin_email');
3454 - }
3455 - $subject = sanitize_text_field($json_data['form_title']) . " - " . esc_html__('New AI Action Submission', 'chatbot');
3456 - $headers = array('Content-Type: text/html; charset=UTF-8');
3457 - if (!empty($reply_to)) {
3458 - $headers[] = 'Reply-To: ' . $reply_to;
3459 - }
3460 - wp_mail($to, $subject, $email_body, $headers);
3461 - }
3462 -
3463 - wp_send_json_success('Saved successfully');
3464 - }
3465 - }
3466 - }
3467 - wp_send_json_error('Failed to save');
3468 -}
3469 -
3470 -add_action('wp_ajax_qcld_get_ai_form_entries', 'qcld_get_ai_form_entries');
3471 -function qcld_get_ai_form_entries() {
3472 - check_ajax_referer('wp_chatbot_ai_actions', 'nonce');
3473 - if (!current_user_can('manage_options')) {
3474 - wp_send_json_error('Unauthorized');
3475 - }
3476 - $form_title = isset($_POST['form_title']) ? sanitize_text_field($_POST['form_title']) : '';
3477 - if (empty($form_title)) {
3478 - wp_send_json_error('No title provided');
3479 - }
3480 -
3481 - global $wpdb;
3482 - $title_prefix = $form_title . ' - ';
3483 - $where_filter = function ( $where ) use ( $wpdb, $title_prefix ) {
3484 - $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_title LIKE %s", $wpdb->esc_like( $title_prefix ) . '%' );
3485 - return $where;
3486 - };
3487 - add_filter( 'posts_where', $where_filter );
3488 - $query = new WP_Query( array(
3489 - 'post_type' => 'wpbot_form_entry',
3490 - 'post_status' => 'publish',
3491 - 'posts_per_page' => -1,
3492 - ) );
3493 - remove_filter( 'posts_where', $where_filter );
3494 -
3495 - ob_start();
3496 - if ($query->have_posts()) {
3497 - echo '<table class="wp-list-table widefat fixed striped" style="width: 100%; text-align: left;">';
3498 - echo '<thead><tr><th>Entry</th><th>Data</th><th>Date</th><th>Action</th></tr></thead>';
3499 - echo '<tbody>';
3500 - while ($query->have_posts()) {
3501 - $query->the_post();
3502 - $meta = get_post_meta(get_the_ID());
3503 - echo '<tr>';
3504 - echo '<td><strong>' . esc_html( get_the_title() ) . '</strong></td>';
3505 - echo '<td>';
3506 - foreach ($meta as $key => $values) {
3507 - if (strpos($key, '_') !== 0) { // skip hidden meta
3508 - echo '<strong>' . esc_html($key) . ':</strong> ' . esc_html($values[0]) . '<br>';
3509 - }
3510 - }
3511 - echo '</td>';
3512 - echo '<td>' . esc_html( get_the_date() ) . ' ' . esc_html( get_the_time() ) . '</td>';
3513 - echo '<td><button type="button" class="button qcld-delete-ai-entry" data-id="' . esc_attr(get_the_ID()) . '" style="color: #a00; border-color: #a00;">Delete</button></td>';
3514 - echo '</tr>';
3515 - }
3516 - echo '</tbody></table>';
3517 - wp_reset_postdata();
3518 - } else {
3519 - echo '<p>No entries found for this form.</p>';
3520 - }
3521 - $html = ob_get_clean();
3522 - wp_send_json_success(array('html' => $html));
3523 -}
3524 -
3525 -add_action('wp_ajax_qcld_delete_ai_form_entry', 'qcld_delete_ai_form_entry');
3526 -function qcld_delete_ai_form_entry() {
3527 - check_ajax_referer('wp_chatbot_ai_actions', 'nonce');
3528 - if (!current_user_can('manage_options')) {
3529 - wp_send_json_error('Unauthorized');
3530 - }
3531 -
3532 - $entry_id = isset($_POST['entry_id']) ? intval($_POST['entry_id']) : 0;
3533 - if (empty($entry_id)) {
3534 - wp_send_json_error('No entry ID provided');
3535 - }
3536 -
3537 - if (get_post_type($entry_id) === 'wpbot_form_entry') {
3538 - wp_delete_post($entry_id, true);
3539 - wp_send_json_success('Entry deleted successfully');
3540 - } else {
3541 - wp_send_json_error('Invalid entry');
3542 - }
3543 -}
3544 3168 //Jarvis all option will be delete during uninstlling.
3545 3169 if( !function_exists('qcld_wb_chatboot_delete_all_options') ){
3546 3170 function qcld_wb_chatboot_delete_all_options(){
3547 3171
@@ -3781,9 +3405,8 @@
3781 3405 delete_option('wp_chat_user_font_family');
3782 3406 delete_option('wp_chat_bot_font_family');
3783 3407 delete_option('wp_chatbot_bot_font');
3784 3408 delete_option('wp_chatbot_user_font');
3785 - delete_option('qcld_chatbot_avatar_location');
3786 3409 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
3787 3410 qcld_wb_chatboot_defualt_options();
3788 3411 $html='Reset all options to default successfully.';
3789 3412 wp_send_json($html);
@@ -3789,22 +3412,8 @@
3789 3412 wp_send_json($html);
3790 3413 }
3791 3414 }
3792 3415
3793 -if( !function_exists('wpbot_free_set_content_height_defaults') ){
3794 - function wpbot_free_set_content_height_defaults() {
3795 - $chatbot_content_max_height = get_option( 'chatbot_content_max_height', false );
3796 - if ( $chatbot_content_max_height === false || $chatbot_content_max_height === '' ) {
3797 - update_option( 'chatbot_content_max_height', '80' );
3798 - }
3799 -
3800 - $chatbot_content_max_height_responsive = get_option( 'chatbot_content_max_height_responsive', false );
3801 - if ( $chatbot_content_max_height_responsive === false || $chatbot_content_max_height_responsive === '' ) {
3802 - update_option( 'chatbot_content_max_height_responsive', '90' );
3803 - }
3804 - }
3805 -}
3806 -
3807 3416 if( !function_exists('wpbot_free_qc_upgrade_completed') ){
3808 3417 function wpbot_free_qc_upgrade_completed( $upgrader_object, $options ) {
3809 3418 // The path to our plugin's main file
3810 3419 $our_plugin = plugin_basename( __FILE__ );
@@ -3813,9 +3422,8 @@
3813 3422 // Iterate through the plugins being updated and check if ours is there
3814 3423 foreach( $options['plugins'] as $plugin ) {
3815 3424 if( $plugin == $our_plugin ) {
3816 3425 set_transient( 'qcld_bot_clear_cache', 1, DAY_IN_SECONDS );
3817 - wpbot_free_set_content_height_defaults();
3818 3426 }
3819 3427 }
3820 3428 }
3821 3429 update_option( 'qcld_openai_relevant_post', ['post','page'] );
@@ -3837,17 +3445,9 @@
3837 3445 // require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."qcld-openai-bot.php");
3838 3446
3839 3447 }
3840 3448 }
3841 -if( !function_exists('wpbot_Ai_actions_func') ){
3842 - function wpbot_Ai_actions_func (){
3843 3449
3844 - require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."includes/admin/templates/ai-actions.php");
3845 - // require_once(QCLD_wpCHATBOT_PLUGIN_DIR_PATH."qcld-openai-bot.php");
3846 -
3847 -}
3848 -}
3849 -
3850 3450 /**
3851 3451 *
3852 3452 * Function to load translation files.
3853 3453 *
@@ -3861,9 +3461,9 @@
3861 3461 add_action( 'plugins_loaded', 'wp_chatbot_lang_init');
3862 3462
3863 3463 $wpbot_feedback = new Qcld_Wp_Usage_Feedback(
3864 3464 __FILE__,
3865 - 'plugins@quantumcloud.net',
3465 + 'plugins@quantumcloud.com',
3866 3466 false,
3867 3467 true
3868 3468
3869 3469 );
@@ -3875,10 +3475,10 @@
3875 3475
3876 3476 <div class="wrap qcld-main-wrapper">
3877 3477 <div class="qcld-wp-chatbot-wrap-header">
3878 3478
3879 - <div class="qcld-wp-chatbot-wrap-header-logo"><a href="#" class="qcld-wp-chatbot-wrap-site__logo"><img src="<?php echo esc_url( QCLD_wpCHATBOT_IMG_URL . '/chatbot.png' ); ?>" alt="Dialogflow CX"> WPBot Control Panel </a>
3880 - <p><strong>Core Version:</strong> v<?php echo esc_html( QCLD_wpCHATBOT_VERSION ); ?></p>
3479 + <div class="qcld-wp-chatbot-wrap-header-logo"><a href="#" class="qcld-wp-chatbot-wrap-site__logo"><img style="width:100%" src="<?php echo esc_url( QCLD_wpCHATBOT_IMG_URL . '/chatbot.png' ); ?>" alt="Dialogflow CX"> WPBot Control Panel </a>
3480 + <p><strong>Core Version:</strong> v<?php echo QCLD_wpCHATBOT_VERSION; ?></p>
3881 3481 </div>
3882 3482 <ul class="qcld-wp-chatbot-wrap-version-wrapper">
3883 3483 <li>
3884 3484 <a class="wpchatbot-Upgrade" href="https://www.wpbot.pro/" target="_blank">Upgrade To Pro</a>
@@ -3916,16 +3516,16 @@
3916 3516 </div>
3917 3517 <div class="panel panel-default">
3918 3518 <div class="panel-heading" role="tab" id="headingSix">
3919 3519 <h4 class="panel-title">
3920 - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="false" aria-controls="collapseSix"> <?php esc_html_e('Action Start Menu', 'chatbot'); ?> </a>
3520 + <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="false" aria-controls="collapseSix"> <?php esc_html_e('Start Menu', 'chatbot'); ?> </a>
3921 3521 </h4>
3922 3522 </div>
3923 3523 <div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix">
3924 3524 <div class="panel-body">
3925 - <?php echo esc_html_e('While using a ChatBot, users can get lost or not know how to Interact with the Bot. That is why we have a Action Start Menu to always give the user', 'chatbot'); ?> <b><?php echo esc_html_e('options to do more', 'chatbot'); ?></b>. <?php echo esc_html_e('From ChatBot->Settings->Action Start Menu you can drag Available Menu Items (Intents) to the Active Menu Items area.', 'chatbot'); ?></br></br>
3926 - <?php echo esc_html_e('Besides the built-in Intents, you can also create custom Intents for your Action Start Menu using', 'chatbot'); ?> <b><?php echo esc_html_e('Simple Text Responses', 'chatbot'); ?></b> and <b><?php echo esc_html_e('Conversational form builder', 'chatbot'); ?></b>. <?php echo esc_html_e('You can create almost any kind of response with the combinations of the two.', 'chatbot'); ?></br></br>
3927 - <?php echo esc_html_e('We recommend enabling', 'chatbot'); ?><b><?php echo esc_html_e(' Show Action Start Menu After Greetings ', 'chatbot'); ?></b><?php echo esc_html_e('from ChatBot Pro->Settings->General settings.', 'chatbot'); ?>
3525 + <?php echo esc_html_e('While using a ChatBot, users can get lost or not know how to Interact with the Bot. That is why we have a Start menu to always give the user', 'chatbot'); ?> <b><?php echo esc_html_e('options to do more', 'chatbot'); ?></b>. <?php echo esc_html_e('From ChatBot->Settings->Start Menu you can drag Available Menu Items (Intents) to the Active Menu Items area.', 'chatbot'); ?></br></br>
3526 + <?php echo esc_html_e('Besides the built-in Intents, you can also create custom Intents for your Start Menu using', 'chatbot'); ?> <b><?php echo esc_html_e('Simple Text Responses', 'chatbot'); ?></b> and <b><?php echo esc_html_e('Conversational form builder', 'chatbot'); ?></b>. <?php echo esc_html_e('You can create almost any kind of response with the combinations of the two.', 'chatbot'); ?></br></br>
3527 + <?php echo esc_html_e('We recommend enabling', 'chatbot'); ?><b><?php echo esc_html_e(' Show Start Menu After Greetings ', 'chatbot'); ?></b><?php echo esc_html_e('from ChatBot Pro->Settings->General settings.', 'chatbot'); ?>
3928 3528 </div>
3929 3529 </div>
3930 3530 </div>
3931 3531 <div class="panel panel-default">
@@ -3935,9 +3535,9 @@
3935 3535 </h4>
3936 3536 </div>
3937 3537 <div id="collapseSeven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSeven">
3938 3538 <div class="panel-body">
3939 - <?php echo esc_html_e('Head over to ChatBot Pro->Settings->General and make sure to Enable the Floating Icon. As soon as you do that, the ChatBot can start working for your users. Make sure to drag some items to the Active Menu area under the Action Start Menu.', 'chatbot'); ?></br></br>
3539 + <?php echo esc_html_e('Head over to ChatBot Pro->Settings->General and make sure to Enable the Floating Icon. As soon as you do that, the ChatBot can start working for your users. Make sure to drag some items to the Active Menu area under the Start Menu.', 'chatbot'); ?></br></br>
3940 3540 <?php echo esc_html_e('The ChatBot settings area is full of options. Do not be intimidated by that. You do not need to use all the options – just what you need. Head over to the Settings->', 'chatbot'); ?><b><?php echo esc_html_e('Icons and Themes', 'chatbot'); ?></b> <?php echo esc_html_e('for options to customize your ChatBot. You will also find options to embed the ChatBot on a page, click to chat, FAQ builder etc. under the Setting options.', 'chatbot'); ?>
3941 3541 </div>
3942 3542 </div>
3943 3543 </div>
@@ -4057,9 +3657,9 @@
4057 3657 <div class="to-icon-txt fa-4x-txt ">
4058 3658 <h3>
4059 3659 <span>// </span><?php esc_html_e('Send eMail, Call Me Back &amp; Feedback Collection', 'chatbot'); ?>
4060 3660 </h3>
4061 - <p><?php esc_html_e('Users can send a email to the site admin directly from the Chat window for customer support. The Call Me Back feature lets you get call requests from your customers which will be emailed to you. You can also use WPBot to collect Feedback from your customers regarding anything! You can disable/enable these features from the Action Start Menu.', 'chatbot'); ?></p>
3661 + <p><?php esc_html_e('Users can send a email to the site admin directly from the Chat window for customer support. The Call Me Back feature lets you get call requests from your customers which will be emailed to you. You can also use WPBot to collect Feedback from your customers regarding anything! You can disable/enable these features from the Start Menu.', 'chatbot'); ?></p>
4062 3662 </div>
4063 3663 </div>
4064 3664 <div class="to-icon-box left txt-left">
4065 3665 <div class="to-icon-txt fa-4x-txt ">
@@ -4113,14 +3713,14 @@
4113 3713 </h4>
4114 3714 </div>
4115 3715 <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
4116 3716 <div class="panel-body">
4117 - <p><?php esc_html_e('Extend the Action Start Menu with the', 'chatbot'); ?> <strong><?php esc_html_e('powerful Conversational Forms', 'chatbot'); ?></strong>&nbsp;<?php esc_html_e(' Addon for WPBot. It extends WPBot’s functionality and adds the ability to create', 'chatbot'); ?> <strong><?php esc_html_e('conditional conversations', 'chatbot'); ?></strong> <?php esc_html_e('and/or', 'chatbot'); ?> <strong><?php esc_html_e('forms', 'chatbot'); ?></strong> <?php esc_html_e('for the WPBot. It is a visual,', 'chatbot'); ?> <strong><?php esc_html_e('drag and drop', 'chatbot'); ?></strong><?php esc_html_e(' form builder that is easy to use and very flexible. Supports conditional logic and use of variables to build all types of forms or just', 'chatbot'); ?> <strong><?php esc_html_e('menu driven', 'chatbot'); ?></strong>
3717 + <p><?php esc_html_e('Extend the Start Menu with the', 'chatbot'); ?> <strong><?php esc_html_e('powerful Conversational Forms', 'chatbot'); ?></strong>&nbsp;<?php esc_html_e(' Addon for WPBot. It extends WPBot’s functionality and adds the ability to create', 'chatbot'); ?> <strong><?php esc_html_e('conditional conversations', 'chatbot'); ?></strong> <?php esc_html_e('and/or', 'chatbot'); ?> <strong><?php esc_html_e('forms', 'chatbot'); ?></strong> <?php esc_html_e('for the WPBot. It is a visual,', 'chatbot'); ?> <strong><?php esc_html_e('drag and drop', 'chatbot'); ?></strong><?php esc_html_e(' form builder that is easy to use and very flexible. Supports conditional logic and use of variables to build all types of forms or just', 'chatbot'); ?> <strong><?php esc_html_e('menu driven', 'chatbot'); ?></strong>
4118 3718 <strong><?php esc_html_e('conversations', 'chatbot'); ?> </strong><?php esc_html_e('with if else logic', 'chatbot'); ?> <strong>. </strong><?php esc_html_e('Conversations or forms can be', 'chatbot'); ?> <strong><?php esc_html_e('eMailed', 'chatbot'); ?></strong> <?php esc_html_e('to you and', 'chatbot'); ?> <strong><?php esc_html_e('saved in the database', 'chatbot'); ?></strong>.
4119 3719 </p>
4120 3720 <h4><?php esc_html_e('Conversational Form Builder Free or Pro version works with the WPBot Free or Pro versions.', 'chatbot'); ?></h4>
4121 3721 <a class="FormBuilder" href="https://wordpress.org/plugins/conversational-forms/" target="_blank"><?php esc_html_e('Download Free Version', 'chatbot'); ?></a>
4122 - <a class="FormBuilder" href="https://www.quantumcloud.net/products/conversations-and-form-builder/" target="_blank"><?php esc_html_e('Grab the Pro version', 'chatbot'); ?></a>
3722 + <a class="FormBuilder" href="https://www.quantumcloud.com/products/conversations-and-form-builder/" target="_blank"><?php esc_html_e('Grab the Pro version', 'chatbot'); ?></a>
4123 3723 <h4><?php esc_html_e('What Can You Do with it?', 'chatbot'); ?></h4>
4124 3724 <p><?php esc_html_e('Conversation Forms allows you to create a wide variety of forms, that might include:', 'chatbot'); ?></p>
4125 3725 <ul>
4126 3726 <li><?php esc_html_e('Create menu or button driven conversations', 'chatbot'); ?></li>
@@ -4381,9 +3981,9 @@
4381 3981 </h4>
4382 3982 </div>
4383 3983 <div id="faqcollapsetwelve" class="panel-collapse collapse" role="tabpanel" aria-labelledby="faqtwelve">
4384 3984 <div class="panel-body">
4385 - <?php echo esc_html_e('You can disable predefined intents FAQ, eMail, Call me from WPBot Lite > Settings page`s Action Start Menu Section.', 'chatbot'); ?>
3985 + <?php echo esc_html_e('You can disable predefined intents FAQ, eMail, Call me from WPBot Lite > Settings page`s Start Menu Section.', 'chatbot'); ?>
4386 3986 </div>
4387 3987 </div>
4388 3988 </div>
4389 3989
@@ -4478,17 +4078,17 @@
4478 4078 if(!get_option('qlcd_wp_chatbot_did_you_mean')) {
4479 4079 update_option('qlcd_wp_chatbot_did_you_mean', maybe_serialize(array('Did you mean?')));
4480 4080 }
4481 4081
4482 - $sqlqry = $wpdb->get_results( $wpdb->prepare( "select * from {$table1} where id = %d", 1 ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
4082 + $sqlqry = $wpdb->get_results( $wpdb->prepare( "select * from $table1 where id = %d", 1 ) ); //DB Call OK, No Caching OK
4483 4083 if(empty($sqlqry)){
4484 4084
4485 - $query = 'Sample Question?';
4486 - $response = 'Sample Answer';
4085 + $query = 'What Can WPBot do for you?';
4086 + $response = 'WPBot can converse fluidly with users on website and FB messenger. It can search your website, send/collect eMails, user feedback & phone numbers . You can create Custom Intents from DialogFlow with Rich Messages & Card responses!';
4487 4087
4488 4088 $data = array('query' => $query, 'keyword' => '', 'response'=> $response, 'intent'=> '');
4489 4089 $format = array('%s','%s', '%s', '%s');
4490 - $wpdb->insert($table1,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, PluginCheck.Security.DirectDB.UnescapedDBParameter
4090 + $wpdb->insert($table1,$data,$format); //DB Call OK, No Caching OK
4491 4091 }
4492 4092
4493 4093 update_option('qc_wpb_simple_response_db_upgrade_free2', 'done');
4494 4094
@@ -4534,11 +4134,11 @@
4534 4134 if(isset($_POST['qc_bot_str_id']) && wp_unslash($_POST['qc_bot_str_id'])!=''){
4535 4135 $id = sanitize_text_field(wp_unslash($_POST['qc_bot_str_id']));
4536 4136 $where = array('id'=>$id);
4537 4137 $whereformat = array('%d');
4538 - $wpdb->update( $table, $data, $where, $format, $whereformat ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
4138 + $wpdb->update( $table, $data, $where, $format, $whereformat ); //DB Call OK, No Caching OK
4539 4139 }else{
4540 - $wpdb->insert($table,$data,$format); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
4140 + $wpdb->insert($table,$data,$format); //DB Call OK, No Caching OK
4541 4141 }
4542 4142
4543 4143 qcld_mysql_remove_existing_indexes();
4544 4144
@@ -4544,9 +4144,9 @@
4544 4144
4545 4145 // phpcs:ignore
4546 4146 $wpdb->query("ALTER TABLE $table ADD FULLTEXT(`query`, `keyword`, `response`)");
4547 4147
4548 - wp_safe_redirect(admin_url('admin.php?page=simple-text-response'));exit;
4148 + wp_redirect(admin_url('admin.php?page=simple-text-response'));exit;
4549 4149
4550 4150 }
4551 4151 $table = $wpdb->prefix.'wpbot_response';
4552 4152
@@ -4577,27 +4177,15 @@
4577 4177 }
4578 4178 if(isset($_POST['qc_bot_str_fields']) && !empty($_POST['qc_bot_str_fields'])){
4579 4179 $table = $wpdb->prefix.'wpbot_response';
4580 4180 $fields = rest_sanitize_array(wp_unslash($_POST['qc_bot_str_fields']));
4581 -
4582 - $allowed_fields = array('query', 'keyword', 'response');
4583 - $valid_fields = array();
4584 - if(is_array($fields)){
4585 - foreach($fields as $field){
4586 - if(in_array($field, $allowed_fields)){
4587 - $valid_fields[] = $field;
4588 - }
4589 - }
4590 - }
4591 - $fields = $valid_fields;
4592 -
4593 4181 update_option('qc_bot_str_fields', $fields);
4594 4182 qcld_mysql_remove_existing_indexes();
4595 4183
4596 4184 if($fields && !empty($fields)){
4597 - $safe_fields = array_map(function($f) { return '`' . $f . '`'; }, $fields);
4185 +
4598 4186 // phpcs:ignore
4599 - $wpdb->query("ALTER TABLE $table ADD FULLTEXT(".implode(', ', $safe_fields).")");
4187 + $wpdb->query("ALTER TABLE $table ADD FULLTEXT(".implode(', ', $fields).")");
4600 4188
4601 4189 }
4602 4190 }
4603 4191
@@ -4621,9 +4209,9 @@
4621 4209 if( !function_exists('qcld_wpbot_simple_response_intent') ){
4622 4210 function qcld_wpbot_simple_response_intent(){
4623 4211 global $wpdb;
4624 4212 $table = $wpdb->prefix.'wpbot_response';
4625 - $results = $wpdb->get_results("SELECT `intent` FROM `{$table}` WHERE 1 and `intent` !=''"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
4213 + $results = $wpdb->get_results("SELECT `intent` FROM `$table` WHERE 1 and `intent` !=''"); //DB Call OK, No Caching OK
4626 4214 $response = array();
4627 4215 if(!empty($results)){
4628 4216 foreach($results as $result){
4629 4217 $response[] = $result->intent;
@@ -4636,9 +4224,9 @@
4636 4224 function qcld_mysql_remove_existing_indexes(){
4637 4225 global $wpdb;
4638 4226 $table = $wpdb->prefix.'wpbot_response';
4639 4227
4640 - $results = $wpdb->get_results("SHOW INDEX FROM {$table}"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
4228 + $results = $wpdb->get_results("SHOW INDEX FROM $table"); //DB Call OK, No Caching OK
4641 4229 $indexes = array();
4642 4230 foreach($results as $result){
4643 4231
4644 4232
@@ -4666,4 +4254,6 @@
4666 4254 }
4667 4255 }
4668 4256 }
4669 4257 }
4258 +
4259 +