PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 8.5.0
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v8.5.0
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
chatbot / includes / integration / openai / admin / settings.php

settings.php in WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services 8.5.0, at includes/integration/openai/admin/settings.php

161 lines 13.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div class="row g-0">
2 <div class="col-sm-12">
3 <div class="form-check form-switch my-4">
4 <input class="form-check-input" type="checkbox" <?php
5 if (!defined('ABSPATH')) exit; // Exit if accessed directly
6 echo (get_option( 'ai_enabled') == 1) ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_ai_enabled">
7 <label class="form-check-label" for="is_ai_enabled">
8 <?php esc_html_e( 'Enable OpenAI','chatbot'); ?><span style="color:red"> <?php esc_html_e( '(if you want results from OpenAI only, disable Site Search from Settings->Start Menu)','chatbot'); ?></span>
9 </label>
10 </div>
11 <div class="mb-3">
12 <div class="form-check form-switch my-4">
13 <input class="form-check-input" type="checkbox" <?php echo ( get_option( 'is_stream_enabled', '1' ) == '1' ) ? esc_attr( 'checked', 'chatbot' ) : ''; ?> role="switch" value="" id="is_stream_enabled">
14 <label class="form-check-label" for="is_stream_enabled">
15 <?php esc_html_e( 'Enable Streaming (stream AI responses in real-time as they are generated)', 'chatbot' ); ?>
16 </label>
17 </div>
18 </div>
19 <div class="form-check form-switch my-4">
20 <input class="form-check-input" type="checkbox" <?php echo (get_option('context_awareness_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_context_awareness_enabled">
21 <label class="form-check-label" for="is_context_awareness_enabled">
22 <?php esc_html_e( 'Context awareness','chatbot'); ?>
23 </label>
24
25 </div>
26 <div class="form-check form-switch my-4">
27 <input class="form-check-input" type="checkbox" <?php echo (get_option('page_suggestion_enabled') == '1') ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_page_suggestion_enabled">
28 <label class="form-check-label" for="is_page_suggestion_enabled">
29 <?php esc_html_e( 'Enable WordPress page suggestions with GPT Results (the links are suggested by WordPress and not AI)','chatbot'); ?>
30 </label>
31 </div>
32
33 <!-- POST TYPE -->
34 <div class="form-check form-switch my-4">
35 <label><?php esc_html_e( 'Select POST TYPE(s) to include with search results', 'chatbot' ); ?></label>
36 <div id="wp-chatbot-post-converter">
37 <ul class="checkbox-list">
38 <?php
39 $get_cpt_args = array(
40 'public' => true,
41 );
42 $post_types = get_post_types( $get_cpt_args, 'object' );
43
44 foreach ($post_types as $post_type) {
45 if ($post_type->name != 'attachment') {
46 $is_pro = !in_array($post_type->name, ['post', 'page']);
47 ?>
48 <div class="form-check form-check-inline">
49 <input
50 id="site_search_posttypes_<?php echo esc_html( $post_type->name ); ?>"
51 type="checkbox"
52 name="site_search_posttypes[]"
53 value="<?php echo esc_html( $post_type->name ); ?>"
54 <?php echo (($is_pro) ? 'disabled' : ''); ?>
55
56 <?php echo ((get_option('qcld_openai_relevant_post') != '') && in_array($post_type->name, get_option('qcld_openai_relevant_post'))) ? 'checked' : ''; ?>>
57 <label class="form-check-label <?php echo ($is_pro ? 'pro-locked' : ''); ?>" for="site_search_posttypes_<?php echo esc_html( $post_type->name ); ?>">
58 <?php echo esc_html( $post_type->name ); ?>
59 <?php if ($is_pro) { ?>
60 <span class="pro-badge">PRO</span>
61 <?php } ?>
62 </label>
63 </div>
64 <?php
65 }
66 }
67 ?>
68 </ul>
69 </div>
70 </div>
71
72
73
74 <!-- /POST TYPE -->
75 <div class="mb-3 form-check">
76 <label for="api_key" class="form-label"><?php esc_html_e( 'Api key','chatbot');?></label>
77 <input type="password" class="form-control" id="api_key" name="api_key" placeholder="Api key" value="<?php echo esc_attr(get_option( 'open_ai_api_key')); ?>">
78 <span><?php esc_html_e('Get your API key from','chatbot'); ?> <a href="https://platform.openai.com/settings/organization/api-keys" target="_blank"><?php esc_html_e('HERE','chatbot'); ?></a></span><br>
79 <span style="color:red"><?php esc_html_e('It requires a paid OpenAI API plan', 'chatbot'); ?> </span>
80 </div>
81 <div class="qcld-wpbot-pricing-filter-form-check">
82 </div>
83 <div class="mb-3 form-check">
84 <label for="max_tokens" id="openai_engines" class="form-label"><?php esc_html_e( 'OpenAI Model','chatbot');?></label>
85 <select class="form-select" aria-label="Default select example" name="openai_engines" id="openai_engines">
86 <option value="gpt-5.5" <?php echo ((get_option( 'openai_engines') == 'gpt-5.5') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.5','chatbot');?></option>
87 <option value="gpt-5.4-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-5.4-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.4-Mini','chatbot');?></option>
88 <option value="gpt-5.4-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-5.4-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5.4-Nano','chatbot');?></option>
89 <option value="gpt-5-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-5-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Mini','chatbot');?></option>
90 <option value="gpt-5-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-5-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5-Nano','chatbot');?></option>
91 <option value="gpt-5" <?php echo ((get_option( 'openai_engines') == 'gpt-5') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-5','chatbot');?></option>
92 <option value="gpt-4.1-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1-Mini','chatbot');?></option>
93 <option value="gpt-4.1-nano" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1-nano') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1-Nano','chatbot');?></option>
94 <option value="gpt-4.1" <?php echo ((get_option( 'openai_engines') == 'gpt-4.1') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4.1','chatbot');?></option>
95 <option value="gpt-4o-mini" <?php echo ((get_option( 'openai_engines') == 'gpt-4o-mini') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o-Mini','chatbot');?></option>
96 <option value="gpt-4o" <?php echo ((get_option( 'openai_engines') == 'gpt-4o') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4o','chatbot');?></option>
97 <option value="gpt-4-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-4-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'gpt-4-turbo','chatbot');?></option>
98 <option value="gpt-4" <?php echo ((get_option( 'openai_engines') == 'gpt-4') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-4','chatbot');?></option>
99 <option value="gpt-3.5-turbo" <?php echo ((get_option( 'openai_engines') == 'gpt-3.5-turbo') ? esc_attr('selected') : '') ; ?>><?php esc_html_e( 'GPT-3 turbo','chatbot'); ?></option>
100 </select>
101 </div>
102
103 <div class="mb-3 form-check">
104 <label for="qcld_openai_system_content"><?php esc_attr_e( 'System Command (Use it to Instruct ChatGPT how to behave). You can write a detailed prompt here that includes details about your services, products, and how to contact you or anything relevant to get','chatbot');?> <span class="qcls_openAI_customized"><?php esc_attr_e( 'Customized Results','chatbot');?></span> <?php esc_attr_e( '. Upto 3000 words is fine.','chatbot');?>
105
106 <br><br>
107 <?php esc_attr_e( '**','chatbot');?>
108 <a href="https://wpbot.pro/docs/knowledgebase/how-wpbot-chatbot-free-users-can-get-customized-results-from-the-chatbot-how-to-train-the-chatbot/#customize" class="qcls_openAI_customized_link" target="_blank">
109 <?php esc_attr_e( 'Check this article','chatbot');?>
110 </a>
111
112 <?php esc_attr_e( 'for more details abou how to get Customized Results from OpenAI.','chatbot');?>
113 <br>
114
115 </label>
116 <textarea type="text" class="form-control" id="qcld_openai_system_content" placeholder="<?php echo esc_attr('You are a helpful and intelligent assistant for the website "' . site_url() . '". Use live website data and the provided context to respond accurately and briefly. Stay relevant and do not introduce additional topics.','chatbot'); ?>"><?php echo esc_html( get_option( 'qcld_openai_system_content')); ?></textarea>
117 <label><small><?php esc_html_e("To set the ChatBot's tone and character set a system message according to your need",'chatbot'); ?></small></label></br>
118 <label><small><?php esc_html_e("Example: You are a helpful and intelligent assistant for the website " . site_url() . ". Use live website data and the provided context to respond accurately and briefly. Stay relevant and do not introduce additional topics.",'chatbot'); ?></small></label>
119 </div>
120 <div class="mb-3 form-check">
121 <label for="qcld_openai_append_content"><?php esc_attr_e( 'Prompt to be Appended at the End of the User Query (Optional)','chatbot');?></label>
122 <textarea type="text" class="form-control" id="qcld_openai_append_content" placeholder="<?php echo esc_attr('Content for the response'); ?>"><?php echo esc_html( get_option( 'qcld_openai_append_content')); ?></textarea>
123
124 </div>
125 <div class="alert alert-warning">
126 <p> <?php echo esc_html('Danger Zone (you may not get any responses from AI if the keywords are not set properly. Remove keywords if you face problems )'); ?></p>
127 </div>
128 <div class="mb-3 form-check">
129 <label for="qcld_openai_include_keyword"><?php esc_attr_e( 'Connect to OpenAI only when user query includes one of the following Comma Separated Keywords','chatbot');?></label>
130 <textarea type="text" class="form-control" id="qcld_openai_include_keyword"><?php echo esc_attr( get_option( 'openai_include_keyword')); ?></textarea>
131 </div>
132 <div class="mb-3 form-check">
133 <label for="qcld_openai_exclude_keyword"><?php esc_attr_e( 'Connect to OpenAI only when user query does NOT include one of the following Comma Separated Keywords','chatbot');?></label>
134 <textarea type="text" class="form-control" id="qcld_openai_exclude_keyword"><?php echo esc_attr( get_option( 'openai_exclude_keyword')); ?></textarea>
135 </div>
136 <div class="mb-3">
137 <div class="form-check form-switch my-4">
138 <input class="form-check-input" type="checkbox" <?php echo (get_option( 'qcld_openai_relevant_enabled') == 1) ? esc_attr( 'checked','chatbot') :'';?> role="switch" value="" id="is_relevant_enabled">
139 <label class="form-check-label" for="is_relevant_enabled">
140 <?php esc_html_e( 'Ask OpenAI to reply when question is relevant to above Keywords (Enabling this option will improve accuracy but it will use OpenAI Tokens)','chatbot'); ?>
141 </label>
142 </div>
143 </div>
144
145
146 <div class="mb-3">
147 <a class="btn btn-success" id="save_setting"><?php esc_html_e( 'Save settings','chatbot');?></a>
148 </div>
149 <div class="mb-3 form-check">
150 <a class="btn btn-warning" id="qcld_check_connection"><?php esc_html_e( 'Check Connection ','chatbot');?><i class="dashicons dashicons-image-rotate" id="rotationloader"></i></a> <?php echo esc_html('Save the Settings first and then press the Check Connection button'); ?><br/>
151 <div id="qcld_openAI_trubleshooter"></div>
152 </div>
153 <div class="alert alert-danger">
154 <p> <?php echo esc_html('**If OpenAI is not responding back and the bot is just loading, then likely you hit your OpenAI usage limit. Please pre-purchase credit to use OpenAI API and increase the Usage limit. You can add credits to your API account by visiting the '); ?> <a href="https://platform.openai.com/account/billing"><?php echo esc_html('billing page.'); ?></a></p>
155 <p>
156 <a href="https://wpbot.pro/docs/knowledgebase/how-to-save-money-and-reduce-openai-api-cost-for-your-chatbot/"> <?php echo esc_html('How to reduce cost '); ?></a><?php echo esc_html('and save money on OpenAI API cost for your ChatBot.'); ?>
157 </p>
158 </div>
159 </div>
160 </div>
161