| @@ -3,13 +3,13 @@ | ||
| 3 | 3 | * Plugin Name: AI ChatBot - WPBot |
| 4 | 4 | * Plugin URI: https://www.wpbot.pro/ |
| 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.2 | |
| 7 | + * Version: 8.8.1 | |
| 8 | 8 | * @author QuantumCloud |
| 9 | 9 | * Author: ChatBot for WordPress - WPBot |
| 10 | 10 | * Author URI: https://www.wpbot.pro/ |
| 11 | - * Requires at least: 4.6 | |
| 11 | + * Requires at least: 5.5 | |
| 12 | 12 | * Tested up to: 7.1 |
| 13 | 13 | * Text Domain: chatbot |
| 14 | 14 | * Domain Path: /languages |
| 15 | 15 | * License: GPL2 |
| @@ -47,9 +47,9 @@ | ||
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if ( ! defined( 'QCLD_wpCHATBOT_VERSION' ) ) { |
| 51 | - define('QCLD_wpCHATBOT_VERSION', '8.8.0'); | |
| 51 | + define('QCLD_wpCHATBOT_VERSION', '8.8.1'); | |
| 52 | 52 | } |
| 53 | 53 | if ( ! defined( 'QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION' ) ) { |
| 54 | 54 | define('QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION', 2.2); |
| 55 | 55 | } |
| @@ -107,8 +107,13 @@ | ||
| 107 | 107 | // Built-in Chat Sessions & Analytics module. |
| 108 | 108 | // Defers to the Pro addon automatically when it's active. |
| 109 | 109 | require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/chat-sessions/wpbot-chat-sessions.php' ); |
| 110 | 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 | + | |
| 111 | 116 | /** |
| 112 | 117 | * Main Class. |
| 113 | 118 | */ |
| 114 | 119 | |
| @@ -199,16 +204,15 @@ | ||
| 199 | 204 | $this->qcld_register_ai_form_cpt(); |
| 200 | 205 | global $wpdb; |
| 201 | 206 | if( is_admin() ){ |
| 202 | 207 | |
| 203 | - $connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); | |
| 204 | - if($connection === false){ | |
| 208 | + $content = $wpdb->db_server_info(); | |
| 209 | + if ( empty( $content ) ) { | |
| 205 | 210 | return; |
| 206 | 211 | } |
| 207 | - $content = $connection->server_info; | |
| 208 | - | |
| 209 | - $mysql_server_info = $wpdb->db_server_info(); | |
| 210 | 212 | |
| 213 | + $mysql_server_info = $content; | |
| 214 | + | |
| 211 | 215 | // Check for the MariaDB. |
| 212 | 216 | $is_mariadb = false; |
| 213 | 217 | if ( ! empty( $mysql_server_info ) && strpos( strtolower( $mysql_server_info ), 'maria' ) !== false ) { |
| 214 | 218 | $is_mariadb = true; |
| @@ -233,9 +237,8 @@ | ||
| 233 | 237 | } |
| 234 | 238 | |
| 235 | 239 | } |
| 236 | 240 | |
| 237 | - $connection->close(); | |
| 238 | 241 | } |
| 239 | 242 | } |
| 240 | 243 | |
| 241 | 244 | public function mysql_version_notice(){ |
| @@ -264,8 +267,17 @@ | ||
| 264 | 267 | |
| 265 | 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') ); |
| 266 | 269 | add_submenu_page( 'wpbot-panel', esc_html('AI Settings'), esc_html('AI Settings'), 'manage_options','wpbot_openAi', 'wpbot_openAi_setting_func' ); |
| 267 | 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 | + | |
| 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 | + } | |
| 279 | + | |
| 268 | 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') ); |
| 269 | 281 | add_action( "load-$hook", [ $this, 'screen_option' ] ); |
| 270 | 282 | |
| 271 | 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') ); |
| @@ -646,8 +658,9 @@ | ||
| 646 | 658 | 'is_stream_enabled' => ( get_option('is_stream_enabled', '1') == '1' ? '1' : '0' ), |
| 647 | 659 | 'qcld_openai_append_content' => get_option('qcld_openai_append_content'), |
| 648 | 660 | 'openrouter_enabled' => (get_option('qcld_openrouter_enabled')=='1'? get_option('qcld_openrouter_enabled') : '0'), |
| 649 | 661 | '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'), | |
| 650 | 663 | 'grok_enabled' => (get_option('qcld_grok_enabled')=='1'? get_option('qcld_grok_enabled') : '0'), |
| 651 | 664 | 'qcld_gemini_prepend_content' => get_option('qcld_gemini_prepend_content'), |
| 652 | 665 | 'qcld_gemini_append_content' => get_option('qcld_gemini_append_content'), |
| 653 | 666 | 'qcld_openrouter_append_content' => get_option('qcld_openrouter_append_content'), |
| @@ -3465,25 +3478,21 @@ | ||
| 3465 | 3478 | wp_send_json_error('No title provided'); |
| 3466 | 3479 | } |
| 3467 | 3480 | |
| 3468 | 3481 | global $wpdb; |
| 3469 | - $post_ids = $wpdb->get_col( $wpdb->prepare( | |
| 3470 | - "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'wpbot_form_entry' AND post_status = 'publish' AND post_title LIKE %s", | |
| 3471 | - $wpdb->esc_like( $form_title . ' - ' ) . '%' | |
| 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, | |
| 3472 | 3492 | ) ); |
| 3493 | + remove_filter( 'posts_where', $where_filter ); | |
| 3473 | 3494 | |
| 3474 | - if ( empty($post_ids) ) { | |
| 3475 | - $post_ids = array(0); | |
| 3476 | - } | |
| 3477 | - | |
| 3478 | - $args = array( | |
| 3479 | - 'post_type' => 'wpbot_form_entry', | |
| 3480 | - 'post_status' => 'publish', | |
| 3481 | - 'posts_per_page' => -1, | |
| 3482 | - 'post__in' => $post_ids | |
| 3483 | - ); | |
| 3484 | - $query = new WP_Query($args); | |
| 3485 | - | |
| 3486 | 3495 | ob_start(); |
| 3487 | 3496 | if ($query->have_posts()) { |
| 3488 | 3497 | echo '<table class="wp-list-table widefat fixed striped" style="width: 100%; text-align: left;">'; |
| 3489 | 3498 | echo '<thead><tr><th>Entry</th><th>Data</th><th>Date</th><th>Action</th></tr></thead>'; |
| @@ -3491,9 +3500,9 @@ | ||
| 3491 | 3500 | while ($query->have_posts()) { |
| 3492 | 3501 | $query->the_post(); |
| 3493 | 3502 | $meta = get_post_meta(get_the_ID()); |
| 3494 | 3503 | echo '<tr>'; |
| 3495 | - echo '<td><strong>' . get_the_title() . '</strong></td>'; | |
| 3504 | + echo '<td><strong>' . esc_html( get_the_title() ) . '</strong></td>'; | |
| 3496 | 3505 | echo '<td>'; |
| 3497 | 3506 | foreach ($meta as $key => $values) { |
| 3498 | 3507 | if (strpos($key, '_') !== 0) { // skip hidden meta |
| 3499 | 3508 | echo '<strong>' . esc_html($key) . ':</strong> ' . esc_html($values[0]) . '<br>'; |
| @@ -3499,9 +3508,9 @@ | ||
| 3499 | 3508 | echo '<strong>' . esc_html($key) . ':</strong> ' . esc_html($values[0]) . '<br>'; |
| 3500 | 3509 | } |
| 3501 | 3510 | } |
| 3502 | 3511 | echo '</td>'; |
| 3503 | - echo '<td>' . get_the_date() . ' ' . get_the_time() . '</td>'; | |
| 3512 | + echo '<td>' . esc_html( get_the_date() ) . ' ' . esc_html( get_the_time() ) . '</td>'; | |
| 3504 | 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>'; |
| 3505 | 3514 | echo '</tr>'; |
| 3506 | 3515 | } |
| 3507 | 3516 | echo '</tbody></table>'; |
| @@ -3852,9 +3861,9 @@ | ||
| 3852 | 3861 | add_action( 'plugins_loaded', 'wp_chatbot_lang_init'); |
| 3853 | 3862 | |
| 3854 | 3863 | $wpbot_feedback = new Qcld_Wp_Usage_Feedback( |
| 3855 | 3864 | __FILE__, |
| 3856 | - '[email protected]', | |
| 3865 | + '[email protected]', | |
| 3857 | 3866 | false, |
| 3858 | 3867 | true |
| 3859 | 3868 | |
| 3860 | 3869 | ); |
| @@ -4109,9 +4118,9 @@ | ||
| 4109 | 4118 | <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>. |
| 4110 | 4119 | </p> |
| 4111 | 4120 | <h4><?php esc_html_e('Conversational Form Builder Free or Pro version works with the WPBot Free or Pro versions.', 'chatbot'); ?></h4> |
| 4112 | 4121 | <a class="FormBuilder" href="https://wordpress.org/plugins/conversational-forms/" target="_blank"><?php esc_html_e('Download Free Version', 'chatbot'); ?></a> |
| 4113 | - <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> | |
| 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> | |
| 4114 | 4123 | <h4><?php esc_html_e('What Can You Do with it?', 'chatbot'); ?></h4> |
| 4115 | 4124 | <p><?php esc_html_e('Conversation Forms allows you to create a wide variety of forms, that might include:', 'chatbot'); ?></p> |
| 4116 | 4125 | <ul> |
| 4117 | 4126 | <li><?php esc_html_e('Create menu or button driven conversations', 'chatbot'); ?></li> |