Plugin Directory

Changeset 3478922


Ignore:
Timestamp:
03/10/2026 09:21:40 AM (3 weeks ago)
Author:
quantumcloud
Message:

Added tutorial link
Improved security

Location:
chatbot
Files:
388 added
6 edited

Legend:

Unmodified
Added
Removed
  • chatbot/trunk/admin_ui.php

    r3473385 r3478922  
    24822482                          $placeholderPrivatekey = '{
    24832483                              "type": "service_account",
    2484                               "project_id": "PLACEYOUROWNID",
    2485                               "private_key_id": "31e300128..........c48",
    2486                               "private_key": "-----BEGIN PRIVATE KEY-----\nTHIS IS A DEMO PRIVATE KEY to SHOW HOW IT SHOULD LOOK. Replace with ACTUAL KEY.+OdT09MGEdAjlgSF2HMDA3fl8Ey4dmTxRfAN9No6G3Ugs3BrpZHfY\nSviWzS4JQ0GkCubcJc0DzJ8AqG6xX7E3SfKpdtKEn1eYV7sfQL3C2lm2lTj6nWdt\nxrkhJVHn61kxfPAWChnkdPa5EbMNFnV5mN5rhwaOxR+tEjW9nWBjVFG0NMnOMWF4\nsu6QJVjQMtI99jPBCid1r4XV/sPABSXh8dscWdMinGhZfuCjF4sOGHUUaw+VDGb6\nZpPOh65nw5fsdOHETsb4BN/LW72Khux+870Ig4jkuLIN3PnSF9QfwO8U2qTG5sZK\nn5nxhT9zAgMBAAECggEAX1NSWRGnrcVsu6n1jn9xUpzvxyy+CJe1Z1DvHo1tmHNS\n0Q8OI/Y........THIS IS A DEMO PRIVATE KEY to SHOW HOW IT SHOULD LOOK. Replace with your own key......................................paqQKBgQCJ\nvNCZIHpLGVqwiw4SVYgZW2i+VsZ78sOw0SuuhjZNmOlGjpalbQCjKs9l5dSz5t5D\nVleJVyriFaXyvVty/iF6orqTgv0EhcLO2RI9KSrTpbOXcIkgeunAhRM3oloxSndt\n98H3f1xRvTLIm1enERLkOyGHmm7nWFV0BQWD+CxeCwKBgDtBGn+uBgNgZjSaLnkJ\noemAoIBN6aD4+QWduPldRgTilH6ABQ26SL+t4sa9jbAtkMuD/hWOMLBqmz98tfCC\ndy6cPghea+b0S7lj/wmUaDA1Vmz7luCLm+lO+fe3K6WIlEhAP/9MXVH90Sj6CllF\nAn4stWzIKHrRKA3lIvgJv+9W\n-----END PRIVATE KEY-----\n",
    2487                               "client_email": "[email protected]",
    2488                               "client_id": "1026.....032997",
     2484                              "project_id": "YOUR_PROJECT_ID",
     2485                              "private_key_id": "YOUR_PRIVATE_KEY_ID",
     2486                              "private_key": "-----BEGIN PRIVATE KEY-----\nYOUR_PRIVATE_KEY\n-----END PRIVATE KEY-----\n",
     2487                              "client_email": "YOUR_CLIENT_EMAIL",
     2488                              "client_id": "YOUR_CLIENT_ID",
    24892489                              "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    24902490                              "token_uri": "https://oauth2.googleapis.com/token",
    24912491                              "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    2492                               "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/dialogflow-evysjn%40wpbotpro.iam.gserviceaccount.com"
     2492                              "client_x509_cert_url": "YOUR_CLIENT_X509_CERT_URL"
    24932493                          }';
    24942494
  • chatbot/trunk/includes/admin/templates/rag.php

    r3475311 r3478922  
    6969        ============================ -->
    7070            <div class="wrap my-4">
    71                 <p style="color: red"> <b><?php esc_html_e('Please connect to an AI service like OpenAI or Gemini before embedding.', 'wpbot'); ?></b></p>
     71                <p style="color: red"> <b><?php esc_html_e('Please connect to an AI service like OpenAI or Gemini before embedding.', 'wpbot'); ?></b><b><a href="https://wpbot.pro/docs/knowledgebase/how-to-use-an-embedded-vector-database-and-rag-to-get-customized-responses-from-ai/"><?php esc_html_e('Check this Tutorial for more details.', 'wpbot'); ?></a></b></p>
    7272                <form method="post" id="rag_embed_form">
    7373                    <input type="hidden" name="embed_all_sources" value="1">
     
    7575                </form>
    7676
    77                 <?php if (isset($_POST['embed_all_sources'])): ?>
    78                     <h3>Embedding started...</h3>
    79                     <?php Qcld_Bot_Rag::instance()->wp_rag_embed_all_sources(); ?>
    80                 <?php endif; ?>
     77                <?php
     78                    if (isset($_POST['embed_all_sources'])):
     79                        if( ( get_option( 'ai_enabled') == 1  && get_option('open_ai_api_key') ) || ( get_option('qcld_gemini_enabled') == 1 && get_option('qcld_gemini_api_key') ) || ( get_option('qcld_openrouter_enabled') == 1 && get_option('qcld_openrouter_api_key') ) ){
     80                ?>
     81                        <h3>Embedding started...</h3>
     82                        <?php  Qcld_Bot_Rag::instance()->wp_rag_embed_all_sources(); ?>
     83                 <?php    }else{ ?>
     84                    <Script>
     85                    swal.fire('', 'Please connect to an AI service like OpenAI or Gemini with API key before embedding.', 'warning');
     86                    </Script>
     87                <?php
     88                    }
     89                endif;
     90                ?>
    8191            </div>
    8292                <!-- ===========================
  • chatbot/trunk/includes/integration/openai/qcld-bot-openai.php

    r3468374 r3478922  
    770770        public function rag_settings_option_callback()
    771771        {
    772             $rag_embed_pages = sanitize_text_field($_POST['rag_embed_pages'] ?? 0);
    773             $rag_embed_posts = sanitize_text_field($_POST['rag_embed_posts'] ?? 0);
    774             $rag_embed_str = sanitize_text_field($_POST['rag_embed_str'] ?? 0);
    775             $rag_auto_sync_enabled = sanitize_text_field($_POST['rag_auto_sync_enabled'] ?? 0);
    776          
    777             $rag_embed_cpts = isset($_POST['rag_embed_cpts']) ? $_POST['rag_embed_cpts'] : [];
    778             if(is_array($rag_embed_cpts)){
    779                 $rag_embed_cpts = array_map('sanitize_text_field', $rag_embed_cpts);
    780             }
    781 
    782             if (isset($_POST['is_page_rag_enabled'])) {
    783                 $is_rag_enabled = sanitize_text_field($_POST['is_page_rag_enabled']);
    784                 update_option('is_page_rag_enabled', $is_rag_enabled);
    785                 if($is_rag_enabled == 1){
    786                     update_option('is_asst_enabled', 0);
    787                 }
    788             }
    789 
    790             update_option('rag_embed_pages', $rag_embed_pages);
    791             update_option('rag_embed_str', $rag_embed_str);
    792             update_option('rag_embed_posts', $rag_embed_posts);
    793             update_option('rag_auto_sync_enabled', $rag_auto_sync_enabled);
    794             update_option('rag_embed_cpts', $rag_embed_cpts);
    795 
    796             echo json_encode(array('status' => 'success'));
    797             wp_die();
     772            if( (get_option('is_page_rag_enabled') == '1' && get_option('open_ai_api_key')) || (get_option('qcld_gemini_rag_enabled') == '1' && get_option('qcld_gemini_api_key'))){
     773
     774           
     775                $rag_embed_pages = sanitize_text_field($_POST['rag_embed_pages'] ?? 0);
     776                $rag_embed_posts = sanitize_text_field($_POST['rag_embed_posts'] ?? 0);
     777                $rag_embed_str = sanitize_text_field($_POST['rag_embed_str'] ?? 0);
     778                $rag_auto_sync_enabled = sanitize_text_field($_POST['rag_auto_sync_enabled'] ?? 0);
     779           
     780                $rag_embed_cpts = isset($_POST['rag_embed_cpts']) ? $_POST['rag_embed_cpts'] : [];
     781                if(is_array($rag_embed_cpts)){
     782                    $rag_embed_cpts = array_map('sanitize_text_field', $rag_embed_cpts);
     783                }
     784
     785                if (isset($_POST['is_page_rag_enabled'])) {
     786                    $is_rag_enabled = sanitize_text_field($_POST['is_page_rag_enabled']);
     787                    update_option('is_page_rag_enabled', $is_rag_enabled);
     788                    if($is_rag_enabled == 1){
     789                        update_option('is_asst_enabled', 0);
     790                    }
     791                }
     792
     793                update_option('rag_embed_pages', $rag_embed_pages);
     794                update_option('rag_embed_str', $rag_embed_str);
     795                update_option('rag_embed_posts', $rag_embed_posts);
     796                update_option('rag_auto_sync_enabled', $rag_auto_sync_enabled);
     797                update_option('rag_embed_cpts', $rag_embed_cpts);
     798
     799                echo json_encode(array('status' => 'success'));
     800                wp_die();
     801            }else{
     802                if( !get_option('open_ai_api_key') || !get_option('qcld_gemini_api_key') ){
     803                    wp_send_json_success(array('status' => 'error', 'message' => esc_html__('RAG cannot be enabled without an API key.', 'chatbot')));
     804                }else if( get_option('is_page_rag_enabled') != '1' && get_option('qcld_gemini_rag_enabled') != '1' ){
     805                    wp_send_json_success(array('status' => 'error', 'message' => esc_html__('Please enable RAG in settings to save RAG related options.', 'chatbot')));
     806                }
     807                wp_die();
     808            }
    798809        }
    799810        public function qcld_update_settings_option_callback(){
  • chatbot/trunk/js/qcld-wp-chatbot-admin.js

    r3468374 r3478922  
    14751475                    url: qcld_gemini_admin_data.ajax_url,
    14761476                    type: 'POST',
    1477                     data: ({ 
     1477                    data: ({
    14781478                        action: 'qcld_rag_settings_option',
    14791479                        nonce: qcld_gemini_admin_data.ajax_nonce,
     
    14851485                    }),
    14861486                    success: function (data) {
     1487                        console.log(data);
    14871488                        btn.text('Embedding...');
    14881489                        $('#rag_embed_form').submit();
  • chatbot/trunk/qcld-wpwbot.php

    r3475311 r3478922  
    55 * Description: ChatBot is a native WordPress ChatBot plugin to provide live chat support and lead generation
    66 * Donate link: https://www.wpbot.pro/
    7  * Version: 7.8.6
     7 * Version: 7.8.7
    88 * @author    QuantumCloud
    99 * Author: ChatBot for WordPress - WPBot
     
    4242
    4343if ( ! defined( 'QCLD_wpCHATBOT_VERSION' ) ) {
    44     define('QCLD_wpCHATBOT_VERSION', '7.8.6');
     44    define('QCLD_wpCHATBOT_VERSION', '7.8.7');
    4545}
    4646if ( ! defined( 'QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION' ) ) {
  • chatbot/trunk/readme.txt

    r3475311 r3478922  
    55Requires at least: 4.6
    66Tested up to: 6.9
    7 Stable tag: 7.8.6
     7Stable tag: 7.8.7
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    360360== Changelog ==
    361361
     362= 7.8.7 =
     363# added a tutorial link
     364# Improved security
     365
    362366= 7.8.6 =
    363367# added a notice for RAG
Note: See TracChangeset for help on using the changeset viewer.