Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/aimogen-pro/res/aiomatic-realtime-chatbot.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
function aiomatic_realtime_chat_settings_updated($old_value, $value, $option)
3
+
{
4
+
if (array_key_exists('remote_chat', $value) && (!isset($old_value['remote_chat']) || $value['remote_chat'] !== $old_value['remote_chat']))
5
+
{
6
+
$myop = get_option('aiomatic_realtime_chat_page_id', false);
7
+
if($myop !== false)
8
+
{
9
+
if(is_numeric($myop))
10
+
{
11
+
$myop = array($myop);
12
+
}
13
+
$changedone = false;
14
+
foreach($myop as $mind => $marr)
15
+
{
16
+
$tp = get_post($marr);
17
+
if($tp === null)
18
+
{
19
+
unset($myop[$mind]);
20
+
$changedone = true;
21
+
}
22
+
}
23
+
if($changedone == true)
24
+
{
25
+
aiomatic_update_option('aiomatic_realtime_chat_page_id', $myop);
26
+
}
27
+
if (!isset($value['remote_chat']) || trim($value['remote_chat']) != 'on')
28
+
{
29
+
foreach($myop as $mind => $marr)
30
+
{
31
+
wp_delete_post($marr, true);
32
+
delete_option('aiomatic_realtime_chat_page_id');
33
+
}
34
+
}
35
+
}
36
+
}
37
+
else
38
+
{
39
+
if(!isset($value['remote_chat']))
40
+
{
41
+
$myop = get_option('aiomatic_realtime_chat_page_id', false);
42
+
if($myop !== false)
43
+
{
44
+
if(is_numeric($myop))
45
+
{
46
+
$myop = array($myop);
47
+
}
48
+
foreach($myop as $mind => $marr)
49
+
{
50
+
wp_delete_post($marr, true);
51
+
delete_option('aiomatic_realtime_chat_page_id');
52
+
}
53
+
}
54
+
}
55
+
}
56
+
}
57
+
add_action('aiomatic_update_option_aiomatic_Realtime_Chatbot_Settings', 'aiomatic_chat_realtime_settings_updated', 10, 3);
58
+
function aiomatic_realtime_chatbot_panel()
59
+
{
60
+
$aiomatic_Main_Settings = get_option('aiomatic_Main_Settings', false);
61
+
if (!isset($aiomatic_Main_Settings['app_id']) || trim($aiomatic_Main_Settings['app_id']) == '')
62
+
{
63
+
?>
64
+
<h1><?php echo esc_html__("You must add an OpenAI API Key into the plugin's 'Settings' menu before you can use this feature!", 'aiomatic-automatic-ai-content-writer');?></h1>
65
+
<?php
66
+
return;
67
+
}
68
+
if (aiomatic_check_if_azure_or_others($aiomatic_Main_Settings))
69
+
{
70
+
?>
71
+
<h1><?php echo esc_html__("Only OpenAI API is supported for this feature!", 'aiomatic-automatic-ai-content-writer');?></h1>
72
+
<?php
73
+
return;
74
+
}
75
+
$aiomatic_Realtime_Chatbot_Settings = get_option('aiomatic_Realtime_Chatbot_Settings', false);
76
+
if (isset($aiomatic_Realtime_Chatbot_Settings['remote_chat'])) {
77
+
$remote_chat = $aiomatic_Realtime_Chatbot_Settings['remote_chat'];
78
+
} else {
79
+
$remote_chat = '';
80
+
}
81
+
if (isset($aiomatic_Realtime_Chatbot_Settings['allow_chatbot_site'])) {
82
+
$allow_chatbot_site = $aiomatic_Realtime_Chatbot_Settings['allow_chatbot_site'];
83
+
} else {
84
+
$allow_chatbot_site = '';
85
+
}
86
+
?>
87
+
<div class="wp-header-end"></div>
88
+
<div class="wrap gs_popuptype_holder seo_pops">
89
+
<h2 class="cr_center"><?php echo esc_html__("AI Realtime Chat", 'aiomatic-automatic-ai-content-writer');?></h2>
90
+
<nav class="nav-tab-wrapper">
91
+
<a href="#tab-t" class="nav-tab"><?php echo esc_html__("Tutorial", 'aiomatic-automatic-ai-content-writer');?></a>
92
+
<a href="#tab-0" class="nav-tab"><?php echo esc_html__("Custom Realtime Chat Builder", 'aiomatic-automatic-ai-content-writer');?></a>
93
+
<a href="#tab-1" class="nav-tab"><?php echo esc_html__("Remote Chatbot", 'aiomatic-automatic-ai-content-writer');?></a>
94
+
</nav>
95
+
<form autocomplete="off" id="myForm" method="post" action="<?php if(is_multisite() && is_network_admin()){echo '../options.php';}else{echo 'options.php';}?>">
96
+
<div class="cr_autocomplete">
97
+
<input type="password" id="PreventChromeAutocomplete"
98
+
name="PreventChromeAutocomplete" autocomplete="address-level4" />
99
+
</div>
100
+
<?php
101
+
settings_fields('aiomatic_option_group6');
102
+
do_settings_sections('aiomatic_option_group6');
103
+
if (isset($_GET['settings-updated'])) {
104
+
?>
105
+
<div id="message" class="updated">
106
+
<p class="cr_saved_notif"><strong> <?php echo esc_html__('Settings saved.', 'aiomatic-automatic-ai-content-writer');?></strong></p>
107
+
</div>
108
+
<?php
109
+
}
110
+
?>
111
+
<div class="aiomatic_class">
112
+
<div id="tab-t" class="tab-content">
113
+
<br/><h4><?php echo esc_html__("Step 1: Enable the Shortcode and Configure Parameters", 'aiomatic-automatic-ai-content-writer');?></h4>
114
+
<p><?php echo esc_html__("To enable this feature, you need to use the [aimogen-realtime-chat] shortcode. This shortcode provides flexibility with various parameters, allowing you to tailor the chat session to your needs.", 'aiomatic-automatic-ai-content-writer');?></p>
115
+
116
+
<h5><?php echo esc_html__("Basic Shortcode Syntax:", 'aiomatic-automatic-ai-content-writer');?></h5>
117
+
<pre><?php echo esc_html__('[aimogen-realtime-chat]', 'aiomatic-automatic-ai-content-writer');?></pre>
118
+
119
+
<h5><?php echo esc_html__("Available Parameters:", 'aiomatic-automatic-ai-content-writer');?></h5>
120
+
<ul>
121
+
<li><strong><?php echo esc_html__("mode:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Defines the realtime chat form mode. Can be 'toggle' or 'hold'. If toggle mode is used, the user needs to start and stop the recording. If hold mode is used, the user needs to hold the button to talk.", 'aiomatic-automatic-ai-content-writer');?></li>
122
+
<li><strong><?php echo esc_html__("autostart:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Start the session automatically (yes) or wait for the user to initiate (no). Works only in 'toggle' mode.", 'aiomatic-automatic-ai-content-writer');?></li>
123
+
<li><strong><?php echo esc_html__("model:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Specify the AI model to be used for processing the chat.", 'aiomatic-automatic-ai-content-writer');?></li>
124
+
<li><strong><?php echo esc_html__("voice:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the voice option for the session's responses.", 'aiomatic-automatic-ai-content-writer');?></li>
125
+
<li><strong><?php echo esc_html__("temperature:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Adjust the randomness of the AI's responses. Lower values result in more focused answers, while higher values make them more creative.", 'aiomatic-automatic-ai-content-writer');?></li>
126
+
<li><strong><?php echo esc_html__("max_tokens:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Define the maximum token limit for AI responses.", 'aiomatic-automatic-ai-content-writer');?></li>
127
+
<li><strong><?php echo esc_html__("instructions:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Provide specific instructions or context for the AI.", 'aiomatic-automatic-ai-content-writer');?></li>
128
+
<li><strong><?php echo esc_html__("hold_to_record:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Customize the text displayed on the button 'Hold To Record', displayed in 'hold' mode.", 'aiomatic-automatic-ai-content-writer');?></li>
129
+
<li><strong><?php echo esc_html__("start_recording:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Customize the text displayed on the button to start recording, displayed in 'toggle' mode.", 'aiomatic-automatic-ai-content-writer');?></li>
130
+
<li><strong><?php echo esc_html__("stop_recording:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Customize the text displayed on the button to stop recording, displayed in 'toggle' mode.", 'aiomatic-automatic-ai-content-writer');?></li>
131
+
<li><strong><?php echo esc_html__("record_button_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the background color of the recording button.", 'aiomatic-automatic-ai-content-writer');?></li>
132
+
<li><strong><?php echo esc_html__("record_text_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the text color for the recording button.", 'aiomatic-automatic-ai-content-writer');?></li>
133
+
<li><strong><?php echo esc_html__("record_status_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the background color of the status indicator.", 'aiomatic-automatic-ai-content-writer');?></li>
134
+
<li><strong><?php echo esc_html__("record_status_text_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Customize the text color of the status indicator.", 'aiomatic-automatic-ai-content-writer');?></li>
135
+
<li><strong><?php echo esc_html__("chat_container_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Define the background color of the chat container.", 'aiomatic-automatic-ai-content-writer');?></li>
136
+
<li><strong><?php echo esc_html__("show_chat_log:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Select if you want to show a textual chat log in the user interface. (show/hide)", 'aiomatic-automatic-ai-content-writer');?></li>
137
+
<li><strong><?php echo esc_html__("show_user_log:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Select if you want to show a textual chat log in the user interface also for the user's voice input. (show/hide)", 'aiomatic-automatic-ai-content-writer');?></li>
138
+
<li><strong><?php echo esc_html__("chat_log_container_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the color of the chat log container.", 'aiomatic-automatic-ai-content-writer');?></li>
139
+
<li><strong><?php echo esc_html__("ai_bubble_text_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the color of the chat log bubble text for the AI.", 'aiomatic-automatic-ai-content-writer');?></li>
140
+
<li><strong><?php echo esc_html__("ai_bubble_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the color of the chat log bubble for the AI.", 'aiomatic-automatic-ai-content-writer');?></li>
141
+
<li><strong><?php echo esc_html__("user_bubble_text_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the color of the chat log bubble text for the user.", 'aiomatic-automatic-ai-content-writer');?></li>
142
+
<li><strong><?php echo esc_html__("user_bubble_color:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set the color of the chat log bubble for the user.", 'aiomatic-automatic-ai-content-writer');?></li>
143
+
<li><strong><?php echo esc_html__("user_token_cap_per_day:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Set a maximum number of allowed tokens to be used for each user, per day.", 'aiomatic-automatic-ai-content-writer');?></li>
144
+
</ul>
145
+
146
+
<h5><?php echo esc_html__("Example Usage:", 'aiomatic-automatic-ai-content-writer');?></h5>
147
+
<pre><?php echo esc_html__('[aimogen-realtime-chat autostart="no" mode="toggle" model="gpt-realtime" voice="verse" temperature="0.7"]', 'aiomatic-automatic-ai-content-writer');?></pre>
148
+
149
+
<h4><?php echo esc_html__("Step 2: Interact with the Start/Stop Recording Button", 'aiomatic-automatic-ai-content-writer');?></h4>
150
+
<p><?php echo esc_html__("When you include the shortcode on your page or post, it renders a button and status indicator. Here's how the interaction works:", 'aiomatic-automatic-ai-content-writer');?></p>
151
+
152
+
<h5><?php echo esc_html__("Visual Indicators:", 'aiomatic-automatic-ai-content-writer');?></h5>
153
+
<ul>
154
+
<li><strong><?php echo esc_html__("Status Text:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Displays \"Not Recording\" when idle and \"Recording...\" when active.", 'aiomatic-automatic-ai-content-writer');?></li>
155
+
<li><strong><?php echo esc_html__("Button Text:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("Alternates between \"Start Recording\" and \"Stop Recording\" based on the session state.", 'aiomatic-automatic-ai-content-writer');?></li>
156
+
<li><strong><?php echo esc_html__("Processing State:", 'aiomatic-automatic-ai-content-writer');?></strong> <?php echo esc_html__("While the session processes, the button is temporarily disabled and displays a \"Processing...\" message.", 'aiomatic-automatic-ai-content-writer');?></li>
157
+
</ul>
158
+
159
+
<h5><?php echo esc_html__("Customization Options:", 'aiomatic-automatic-ai-content-writer');?></h5>
160
+
<p><?php echo esc_html__("The colors and text displayed during interaction can be customized using shortcode parameters like record_button_color, record_text_color, and others.", 'aiomatic-automatic-ai-content-writer');?></p>
161
+
162
+
<h4><?php echo esc_html__("Step 3: Test the Functionality", 'aiomatic-automatic-ai-content-writer');?></h4>
163
+
<p><?php echo esc_html__("After embedding the shortcode and configuring your parameters, it's time to test the setup:", 'aiomatic-automatic-ai-content-writer');?></p>
164
+
165
+
<ol>
166
+
<li><?php echo esc_html__("Add the shortcode to a page or post.", 'aiomatic-automatic-ai-content-writer');?></li>
167
+
<li><?php echo esc_html__("Visit the page on your website.", 'aiomatic-automatic-ai-content-writer');?></li>
168
+
<li><?php echo esc_html__("Verify the following:", 'aiomatic-automatic-ai-content-writer');?><ul>
169
+
<li><?php echo esc_html__("The session starts and stops correctly when interacting with the button.", 'aiomatic-automatic-ai-content-writer');?></li>
170
+
<li><?php echo esc_html__("Status indicators and button text update dynamically.", 'aiomatic-automatic-ai-content-writer');?></li>
171
+
<li><?php echo esc_html__("The button becomes temporarily disabled while processing.", 'aiomatic-automatic-ai-content-writer');?></li>
172
+
</ul>
173
+
</li>
174
+
</ol>
175
+
176
+
<h4><?php echo esc_html__("Troubleshooting", 'aiomatic-automatic-ai-content-writer');?></h4>
177
+
<p><?php echo esc_html__("If the functionality isn't working as expected, consider the following:", 'aiomatic-automatic-ai-content-writer');?></p>
178
+
<ul>
179
+
<li><?php echo esc_html__("Ensure you've added a valid OpenAI API key in the plugin's settings.", 'aiomatic-automatic-ai-content-writer');?></li>
180
+
<li><?php echo esc_html__("Note that Azure/Claude APIs are currently not supported for this feature.", 'aiomatic-automatic-ai-content-writer');?></li>
181
+
<li><?php echo esc_html__("Double-check your shortcode parameters for accuracy.", 'aiomatic-automatic-ai-content-writer');?></li>
182
+
</ul>
183
+
184
+
<h4><?php echo esc_html__("Advanced Integration Details", 'aiomatic-automatic-ai-content-writer');?></h4>
185
+
<p><?php echo esc_html__("The Realtime Chat shortcode integrates with the Aimogen plugin's settings and validates your API configuration. If the required settings are missing, users will see an error message prompting them to configure their API key.", 'aiomatic-automatic-ai-content-writer');?></p>
186
+
187
+
<h5><?php echo esc_html__("Key Points of the Integration:", 'aiomatic-automatic-ai-content-writer');?></h5>
188
+
<ul>
189
+
<li><?php echo esc_html__("The plugin dynamically injects styles and scripts based on the shortcode's parameters.", 'aiomatic-automatic-ai-content-writer');?></li>
190
+
<li><?php echo esc_html__("Custom CSS rules for button colors, text colors, and container styling are applied inline.", 'aiomatic-automatic-ai-content-writer');?></li>
191
+
<li><?php echo esc_html__("JavaScript handles AJAX requests to maintain a seamless interaction experience.", 'aiomatic-automatic-ai-content-writer');?></li>
192
+
</ul>
193
+
194
+
<h4><?php echo esc_html__("Final Thoughts", 'aiomatic-automatic-ai-content-writer');?></h4>
195
+
<p><?php echo esc_html__("With the Aimogen Realtime Chat functionality, you can elevate user engagement by providing an interactive and responsive AI-driven experience. Configure the shortcode, customize the parameters, and let your users enjoy realtime voice interaction with the chatbot. Happy coding!", 'aiomatic-automatic-ai-content-writer');?></p>
196
+
197
+
<p><?php echo esc_html__("If you encounter any issues or have suggestions for improvements, feel free to reach out. As always, I'm here to make Aimogen the best tool for your WordPress projects!", 'aiomatic-automatic-ai-content-writer');?></p>
198
+
199
+
<?php if(!isset($aiomatic_Main_Settings['hide_videos']) || trim($aiomatic_Main_Settings['hide_videos']) != 'on'){
200
+
?>
201
+
<h3><?php echo esc_html__("Realtime Chat Functionality Tutorial Video", 'aiomatic-automatic-ai-content-writer');?></h3>
202
+
<p class="cr_center"><div class="embedtool"><iframe src="https://www.youtube.com/embed/Zuy6Yd4Ik8o" frameborder="0" allowfullscreen></iframe></div></p>
203
+
<?php
204
+
}
205
+
?>
206
+
</div>
207
+
<div id="tab-0" class="tab-content">
208
+
<table class="widefat">
209
+
<tr><td><h2><?php echo esc_html__("Use the following shortcode to add the customized chatbot to your site:", 'aiomatic-automatic-ai-content-writer');?></h2></td></tr>
210
+
<tr><td colspan="2" class="cr_width_full"><div class="cr_center"><span class="cr_red cr_center cr_width_full cr_margin_block crf_bord" id="customized_chatbot">[aimogen-realtime-chat mode="toggle" model="gpt-realtime" voice="verse" instructions="" show_chat_log="hide" show_user_log="hide" temperature="" max_tokens="4096" autostart="no" hold_to_record="Hold To Record" start_recording="Start Recording" stop_recording="Stop Recording" not_recording="Not Recording" recording="Recording..." record_button_color="#007bff" record_text_color="#ffffff" record_status_color="#f8f9fa" record_status_text_color="#333333" chat_container_color="#e4e8ec" chat_log_container_color="#ffffff" ai_bubble_color="#f5f5f5" ai_bubble_text_color="#000000" user_token_cap_per_day="" user_bubble_color="#0084ff" user_bubble_text_color="#ffffff" enable_god_mode="disabled"]</span><button class="page-title-action aimt-10" id="aiomaticCopyShortcodeText"><?php echo esc_html__("Copy Text", 'aiomatic-automatic-ai-content-writer');?></button></div><br/></td></tr>
211
+
<tr><td colspan="2">
212
+
<hr/></td></tr><tr><td colspan="2">
213
+
<h2><?php echo esc_html__("Chat Backend Options:", 'aiomatic-automatic-ai-content-writer');?></h2>
214
+
</td></tr>
215
+
<tr><td>
216
+
<div>
217
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
218
+
<div class="bws_hidden_help_text cr_min_260px">
219
+
<?php
220
+
echo esc_html__("Set the recording mode for the AI form. You can select between Toggle or Hold. If you select Toggle, the user needs to click the start button to start the recording mode of the form. If you select Hold mode, the user needs to hold the button to keep the recording mode enabled in the form.", 'aiomatic-automatic-ai-content-writer');
221
+
?>
222
+
</div>
223
+
</div>
224
+
<b><?php echo esc_html__("Recording Mode:", 'aiomatic-automatic-ai-content-writer');?></b>
225
+
</div>
226
+
</td><td>
227
+
<div>
228
+
<select id="ai_mode_b" onchange="anythingChanged()">
229
+
<option value="toggle">toggle</option>
230
+
<option value="hold">hold</option>
231
+
</select>
232
+
</div>
233
+
</td></tr>
234
+
<tr><td>
235
+
<div>
236
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
237
+
<div class="bws_hidden_help_text cr_min_260px">
238
+
<?php
239
+
echo esc_html__("Set the AI model which will be used for this shortcode.", 'aiomatic-automatic-ai-content-writer');
240
+
?>
241
+
</div>
242
+
</div>
243
+
<b><?php echo esc_html__("AI Model:", 'aiomatic-automatic-ai-content-writer');?></b>
244
+
</div>
245
+
</td><td>
246
+
<div>
247
+
<select id="ai_model_b" onchange="anythingChanged()">
248
+
<?php
249
+
foreach(AIMOGEN_REALTIME_MODELS as $aimodel){
250
+
echo '<option value="'.esc_attr($aimodel).'">'.esc_html($aimodel).'</option>';
251
+
}
252
+
?>
253
+
</select>
254
+
</div>
255
+
</td></tr>
256
+
<tr><td>
257
+
<div>
258
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
259
+
<div class="bws_hidden_help_text cr_min_260px">
260
+
<?php
261
+
echo esc_html__("Set the AI voice which will be used for this shortcode.", 'aiomatic-automatic-ai-content-writer');
262
+
?>
263
+
</div>
264
+
</div>
265
+
<b><?php echo esc_html__("AI Voice:", 'aiomatic-automatic-ai-content-writer');?></b>
266
+
</div>
267
+
</td><td>
268
+
<div>
269
+
<select id="ai_voice_b" onchange="anythingChanged()">
270
+
<?php
271
+
foreach(AIMOGEN_REALTIME_VOICES as $aivoice){
272
+
echo '<option value="'.esc_attr($aivoice).'">'.esc_html($aivoice).'</option>';
273
+
}
274
+
?>
275
+
</select>
276
+
</div>
277
+
</td></tr>
278
+
<tr><td>
279
+
<div>
280
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
281
+
<div class="bws_hidden_help_text cr_min_260px">
282
+
<?php
283
+
echo esc_html__("Set the initial instructions for the AI chatbot.", 'aiomatic-automatic-ai-content-writer');
284
+
?>
285
+
</div>
286
+
</div>
287
+
<b><?php echo esc_html__("Instructions:", 'aiomatic-automatic-ai-content-writer');?></b>
288
+
</div>
289
+
</td><td>
290
+
<div>
291
+
<textarea rows="2" id="ai_instructions_b" placeholder="Initial AI instuctions" onchange="anythingChanged()"></textarea>
292
+
</div>
293
+
</td></tr>
294
+
<tr><td>
295
+
<div>
296
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
297
+
<div class="bws_hidden_help_text cr_min_260px">
298
+
<?php
299
+
echo esc_html__("Set a temperature for the AI. If you set a higher temperature, the responses of the AI will be more adventurous. A lower temperature will provide more objective answers.", 'aiomatic-automatic-ai-content-writer');
300
+
?>
301
+
</div>
302
+
</div>
303
+
<b><?php echo esc_html__("Temperature:", 'aiomatic-automatic-ai-content-writer');?></b>
304
+
</div>
305
+
</td><td>
306
+
<div>
307
+
<input type="number" min="0" step="0.01" id="ai_temperature_b" max="1.2" class="cr_width_full" onchange="anythingChanged();" value="" placeholder="0.7">
308
+
</div>
309
+
</td></tr>
310
+
<tr><td>
311
+
<div>
312
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
313
+
<div class="bws_hidden_help_text cr_min_260px">
314
+
<?php
315
+
echo esc_html__("Set a maximum token length of the AI responses.", 'aiomatic-automatic-ai-content-writer');
316
+
?>
317
+
</div>
318
+
</div>
319
+
<b><?php echo esc_html__("Max Tokens:", 'aiomatic-automatic-ai-content-writer');?></b>
320
+
</div>
321
+
</td><td>
322
+
<div>
323
+
<input type="number" min="1" step="1" id="max_tokens_b" class="cr_width_full" onchange="anythingChanged();" value="4096" placeholder="4096">
324
+
</div>
325
+
</td></tr>
326
+
<tr><td>
327
+
<div>
328
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
329
+
<div class="bws_hidden_help_text cr_min_260px">
330
+
<?php
331
+
echo esc_html__("Set if you want to autostart recording on page load.", 'aiomatic-automatic-ai-content-writer');
332
+
?>
333
+
</div>
334
+
</div>
335
+
<b><?php echo esc_html__("Autostart Recording:", 'aiomatic-automatic-ai-content-writer');?></b>
336
+
</div>
337
+
</td><td>
338
+
<div>
339
+
<select id="autostart_b" onchange="anythingChanged()">
340
+
<option value="no">no</option>
341
+
<option value="yes">yes</option>
342
+
</select>
343
+
</div>
344
+
</td></tr>
345
+
<tr><td>
346
+
<div>
347
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
348
+
<div class="bws_hidden_help_text cr_min_260px">
349
+
<?php
350
+
echo esc_html__("Set if you want to show chat text logs.", 'aiomatic-automatic-ai-content-writer');
351
+
?>
352
+
</div>
353
+
</div>
354
+
<b><?php echo esc_html__("Show Chat Text Logs:", 'aiomatic-automatic-ai-content-writer');?></b>
355
+
</div>
356
+
</td><td>
357
+
<div>
358
+
<select id="show_logs_b" onchange="anythingChanged()">
359
+
<option value="hide">hide</option>
360
+
<option value="show">show</option>
361
+
</select>
362
+
</div>
363
+
</td></tr>
364
+
<tr><td>
365
+
<div>
366
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
367
+
<div class="bws_hidden_help_text cr_min_260px">
368
+
<?php
369
+
echo esc_html__("Set if you want to show chat text logs.", 'aiomatic-automatic-ai-content-writer');
370
+
?>
371
+
</div>
372
+
</div>
373
+
<b><?php echo esc_html__("Transcribe Also User Voice Input To Text:", 'aiomatic-automatic-ai-content-writer');?></b>
374
+
</div>
375
+
</td><td>
376
+
<div>
377
+
<select id="show_user_log_b" onchange="anythingChanged()">
378
+
<option value="hide">hide</option>
379
+
<option value="show">show</option>
380
+
</select>
381
+
</div>
382
+
</td></tr>
383
+
<tr><td>
384
+
<div>
385
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
386
+
<div class="bws_hidden_help_text cr_min_260px">
387
+
<?php
388
+
echo esc_html__("Select if you want to enable/disable the chatbot Extensions feature. This can be used to enable a series of extensions, like social posting, email sending, Amazon product details scraping, website or RSS feed scraping, God Mode, which will allow ultimate control of your WordPress site, allowing it to call functions from WordPress directly. Using this feature, you will be able to create posts directly from the chatbot, assign taxonomies, images and many more! Warning! This is a BETA feature, use it with caution. This will apply only if regular AI models are used (not AI Assistants - for these, the God Mode needs to be enabled from Assistant editing menu). Also, God Mode will work only for logged in administrator privileged users.", 'aiomatic-automatic-ai-content-writer');
389
+
?>
390
+
</div>
391
+
</div>
392
+
<b><?php echo esc_html__("Enable Chatbot Extensions:", 'aiomatic-automatic-ai-content-writer');?></b>
393
+
</div>
394
+
</td><td>
395
+
<div>
396
+
<select multiple id="enable_god_mode_b" class="resize_vertical" onchange="anythingChanged();" >
397
+
<?php
398
+
echo '<option selected value="disabled">Disabled</option>';
399
+
echo '<option value="god_mode_ai">\'AI Generate Reasoning\' Extension</option>';
400
+
echo '<option value="god_mode_enable_chart">\'AI Charts\' Extension</option>';
401
+
echo '<option value="god_mode_enable_end">\'End Conversation\' Extension</option>';
402
+
echo '<option value="god_mode_enable_dalle">\'Dall-E Image\' Extension</option>';
403
+
echo '<option value="god_mode_enable_midjourney">\'Midjourney Image\' Extension</option>';
404
+
echo '<option value="god_mode_enable_replicate">\'Replicate Image\' Extension</option>';
405
+
echo '<option value="god_mode_enable_ideogram">\'Ideogram Image\' Extension</option>';
406
+
echo '<option value="god_mode_enable_google_image">\'Google Image\' Extension</option>';
407
+
echo '<option value="god_mode_enable_stable">\'Stable Diffusion Image\' Extension</option>';
408
+
echo '<option value="god_mode_enable_stable_video">\'Stable Diffusion Video\' Extension</option>';
409
+
echo '<option value="god_mode_enable_amazon">\'Amazon Product Listing\' Extension</option>';
410
+
echo '<option value="god_mode_enable_amazon_details">\'Amazon Product Details\' Extension</option>';
411
+
echo '<option value="god_mode_enable_booking">\'The Booking Calendar Integration\' Extension</option>';
412
+
echo '<option value="god_mode_enable_scraper">\'Website Scraper\' Extension</option>';
413
+
echo '<option value="god_mode_enable_rss">\'RSS Feed Parser\' Extension</option>';
414
+
echo '<option value="god_mode_enable_google">\'Google SERP Parser\' Extension</option>';
415
+
echo '<option value="god_mode_enable_youtube_captions">\'YouTube Video Captions\' Extension</option>';
416
+
echo '<option value="god_mode_enable_royalty">\'Royalty Free Image Search\' Extension</option>';
417
+
echo '<option value="god_mode_lead_capture">\'Lead Capture\' Extension</option>';
418
+
echo '<option value="god_mode_enable_youtube">\'YouTube Video Search\' Extension</option>';
419
+
echo '<option value="god_mode_enable_email">\'Email Sending\' Extension</option>';
420
+
echo '<option value="god_mode_enable_webhook">\'Webhook Calling\' Extension</option>';
421
+
echo '<option value="god_mode_enable_omniblock">\'OmniBlock Rule Trigger\' Extension</option>';
422
+
echo '<option value="god_mode_enable_database">\'Database Query\' Extension (WordPress Database Access)</option>';
423
+
echo '<option value="god_mode_enable_wp">\'God Mode\' Extension (WordPress Function Calling)</option>';
424
+
if(!function_exists('is_plugin_active'))
425
+
{
426
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
427
+
}
428
+
$no_pl = '';
429
+
if (!is_plugin_active('aiomatic-extension-toubiz-api/aiomatic-extension-toubiz-api.php'))
430
+
{
431
+
$no_pl = ' disabled';
432
+
}
433
+
echo '<option value="god_mode_enable_toubiz"' . esc_html($no_pl) . '>\'Toubiz API Integration\' Extension</option>';
434
+
$no_pl = '';
435
+
if (!is_plugin_active('fbomatic-facebook-post-generator/fbomatic-facebook-post-generator.php'))
436
+
{
437
+
$no_pl = ' disabled';
438
+
}
439
+
echo '<option value="god_mode_enable_facebook_post"' . esc_html($no_pl) . '>\'Facebook Posting\' Extension</option>';
440
+
$no_pl = '';
441
+
if (!is_plugin_active('twitomatic-twitter-post-generator/twitomatic-twitter-post-generator.php'))
442
+
{
443
+
$no_pl = ' disabled';
444
+
}
445
+
echo '<option value="god_mode_enable_twitter_post"' . esc_html($no_pl) . '>\'Twitter (X) Posting\' Extension</option>';
446
+
$no_pl = '';
447
+
if (!is_plugin_active('threadsomatic-threads-auto-poster/threadsomatic-threads-auto-poster.php'))
448
+
{
449
+
$no_pl = ' disabled';
450
+
}
451
+
echo '<option value="god_mode_enable_threads_post"' . esc_html($no_pl) . '>\'Threads Posting\' Extension</option>';
452
+
$no_pl = '';
453
+
if (!is_plugin_active('instamatic-instagram-post-generator/instamatic-instagram-post-generator.php'))
454
+
{
455
+
$no_pl = ' disabled';
456
+
}
457
+
echo '<option value="god_mode_enable_instagram_post"' . esc_html($no_pl) . '>\'Instagram Posting\' Extension</option>';
458
+
$no_pl = '';
459
+
if (!is_plugin_active('pinterestomatic-pinterest-post-generator/pinterestomatic-pinterest-post-generator.php'))
460
+
{
461
+
$no_pl = ' disabled';
462
+
}
463
+
echo '<option value="god_mode_enable_pinterest_post"' . esc_html($no_pl) . '>\'Pinterest Posting\' Extension</option>';
464
+
$no_pl = '';
465
+
if (!is_plugin_active('businessomatic-google-my-business-post-generator/businessomatic-google-my-business-post-generator.php'))
466
+
{
467
+
$no_pl = ' disabled';
468
+
}
469
+
echo '<option value="god_mode_enable_google_post"' . esc_html($no_pl) . '>\'Google My Business Posting\' Extension</option>';
470
+
$no_pl = '';
471
+
if (!is_plugin_active('youtubomatic-youtube-post-generator/youtubomatic-youtube-post-generator.php'))
472
+
{
473
+
$no_pl = ' disabled';
474
+
}
475
+
echo '<option value="god_mode_enable_youtube_post"' . esc_html($no_pl) . '>\'YouTube Community Posting\' Extension</option>';
476
+
$no_pl = '';
477
+
if (!is_plugin_active('redditomatic-reddit-post-generator/redditomatic-reddit-post-generator.php'))
478
+
{
479
+
$no_pl = ' disabled';
480
+
}
481
+
echo '<option value="god_mode_enable_reddit_post"' . esc_html($no_pl) . '>\'Reddit Posting\' Extension</option>';
482
+
$no_pl = '';
483
+
if (!is_plugin_active('linkedinomatic-linkedin-post-generator/linkedinomatic-linkedin-post-generator.php'))
484
+
{
485
+
$no_pl = ' disabled';
486
+
}
487
+
echo '<option value="god_mode_enable_linkedin_post"' . esc_html($no_pl) . '>\'LinkedIn Posting\' Extension</option>';
488
+
?>
489
+
</select>
490
+
</div>
491
+
</td></tr>
492
+
<tr><td colspan="2">
493
+
<h2><?php echo esc_html__("Chat Interface Options:", 'aiomatic-automatic-ai-content-writer');?></h2>
494
+
</td></tr>
495
+
<tr><td>
496
+
<div>
497
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
498
+
<div class="bws_hidden_help_text cr_min_260px">
499
+
<?php
500
+
echo esc_html__("Set the text of the hold to record button. The default is: Hold To Record", 'aiomatic-automatic-ai-content-writer');
501
+
?>
502
+
</div>
503
+
</div>
504
+
<b><?php echo esc_html__("'Hold To Record' Button Text:", 'aiomatic-automatic-ai-content-writer');?></b>
505
+
</div>
506
+
</td><td>
507
+
<div>
508
+
<textarea rows="1" id="hold_to_record_b" placeholder="Hold To Record" onchange="anythingChanged()"><?php
509
+
echo esc_html__('Hold To Record', 'aiomatic-automatic-ai-content-writer');
510
+
?></textarea>
511
+
</div>
512
+
</td></tr>
513
+
<tr><td>
514
+
<div>
515
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
516
+
<div class="bws_hidden_help_text cr_min_260px">
517
+
<?php
518
+
echo esc_html__("Set the text of the start recording button. The default is: Start Recording", 'aiomatic-automatic-ai-content-writer');
519
+
?>
520
+
</div>
521
+
</div>
522
+
<b><?php echo esc_html__("'Start Recording' Button Text:", 'aiomatic-automatic-ai-content-writer');?></b>
523
+
</div>
524
+
</td><td>
525
+
<div>
526
+
<textarea rows="1" id="start_recording_b" placeholder="Start Recording" onchange="anythingChanged()"><?php
527
+
echo esc_html__('Start Recording', 'aiomatic-automatic-ai-content-writer');
528
+
?></textarea>
529
+
</div>
530
+
</td></tr>
531
+
<tr><td>
532
+
<div>
533
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
534
+
<div class="bws_hidden_help_text cr_min_260px">
535
+
<?php
536
+
echo esc_html__("Set the text of the stop recording button. The default is: Stop Recording", 'aiomatic-automatic-ai-content-writer');
537
+
?>
538
+
</div>
539
+
</div>
540
+
<b><?php echo esc_html__("'Stop Recording' Button Text:", 'aiomatic-automatic-ai-content-writer');?></b>
541
+
</div>
542
+
</td><td>
543
+
<div>
544
+
<textarea rows="1" id="stop_recording_b" placeholder="Stop Recording" onchange="anythingChanged()"><?php
545
+
echo esc_html__('Stop Recording', 'aiomatic-automatic-ai-content-writer');
546
+
?></textarea>
547
+
</div>
548
+
</td></tr>
549
+
<tr><td>
550
+
<div>
551
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
552
+
<div class="bws_hidden_help_text cr_min_260px">
553
+
<?php
554
+
echo esc_html__("Set the text of the Not Recording text. The default is: Not Recording", 'aiomatic-automatic-ai-content-writer');
555
+
?>
556
+
</div>
557
+
</div>
558
+
<b><?php echo esc_html__("Not Recording Text:", 'aiomatic-automatic-ai-content-writer');?></b>
559
+
</div>
560
+
</td><td>
561
+
<div>
562
+
<textarea rows="1" id="not_recording_b" placeholder="Not Recording" onchange="anythingChanged()"><?php
563
+
echo esc_html__('Not Recording', 'aiomatic-automatic-ai-content-writer');
564
+
?></textarea>
565
+
</div>
566
+
</td></tr>
567
+
<tr><td>
568
+
<div>
569
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
570
+
<div class="bws_hidden_help_text cr_min_260px">
571
+
<?php
572
+
echo esc_html__("Set the text of the Recording... text. The default is: Recording...", 'aiomatic-automatic-ai-content-writer');
573
+
?>
574
+
</div>
575
+
</div>
576
+
<b><?php echo esc_html__("Recording Text:", 'aiomatic-automatic-ai-content-writer');?></b>
577
+
</div>
578
+
</td><td>
579
+
<div>
580
+
<textarea rows="1" id="recording_b" placeholder="Recording..." onchange="anythingChanged()"><?php
581
+
echo esc_html__('Recording...', 'aiomatic-automatic-ai-content-writer');
582
+
?></textarea>
583
+
</div>
584
+
</td></tr>
585
+
<tr><td>
586
+
<div>
587
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
588
+
<div class="bws_hidden_help_text cr_min_260px">
589
+
<?php
590
+
echo esc_html__("Select the background color of the start recording button. Default is #007bff", 'aiomatic-automatic-ai-content-writer');
591
+
?>
592
+
</div>
593
+
</div>
594
+
<b><?php echo esc_html__("Start Recording Button Color:", 'aiomatic-automatic-ai-content-writer');?></b>
595
+
</div>
596
+
</td><td>
597
+
<div>
598
+
<input type="color" id="record_button_color_b" value="#007bff" onchange="anythingChanged()">
599
+
</div>
600
+
</td></tr><tr><td>
601
+
<div>
602
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
603
+
<div class="bws_hidden_help_text cr_min_260px">
604
+
<?php
605
+
echo esc_html__("Select the text color of the start recording button. Default is #ffffff", 'aiomatic-automatic-ai-content-writer');
606
+
?>
607
+
</div>
608
+
</div>
609
+
<b><?php echo esc_html__("Start Recording Button Text Color:", 'aiomatic-automatic-ai-content-writer');?></b>
610
+
</div>
611
+
</td><td>
612
+
<div>
613
+
<input type="color" id="record_text_color_b" value="#ffffff" onchange="anythingChanged()">
614
+
</div>
615
+
</td></tr>
616
+
<tr><td>
617
+
<div>
618
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
619
+
<div class="bws_hidden_help_text cr_min_260px">
620
+
<?php
621
+
echo esc_html__("Select the background color of the recording status text. Default is #f8f9fa", 'aiomatic-automatic-ai-content-writer');
622
+
?>
623
+
</div>
624
+
</div>
625
+
<b><?php echo esc_html__("Recording Status Background Color:", 'aiomatic-automatic-ai-content-writer');?></b>
626
+
</div>
627
+
</td><td>
628
+
<div>
629
+
<input type="color" id="record_status_color_b" value="#f8f9fa" onchange="anythingChanged()">
630
+
</div>
631
+
</td></tr><tr><td>
632
+
<div>
633
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
634
+
<div class="bws_hidden_help_text cr_min_260px">
635
+
<?php
636
+
echo esc_html__("Select the text color of the recording status text. Default is #333333", 'aiomatic-automatic-ai-content-writer');
637
+
?>
638
+
</div>
639
+
</div>
640
+
<b><?php echo esc_html__("Recording Status Text Color:", 'aiomatic-automatic-ai-content-writer');?></b>
641
+
</div>
642
+
</td><td>
643
+
<div>
644
+
<input type="color" id="record_status_text_color_b" value="#333333" onchange="anythingChanged()">
645
+
</div>
646
+
</td></tr>
647
+
<tr><td>
648
+
<div>
649
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
650
+
<div class="bws_hidden_help_text cr_min_260px">
651
+
<?php
652
+
echo esc_html__("Select the background color of the recording chat container. Default is #e4e8ec", 'aiomatic-automatic-ai-content-writer');
653
+
?>
654
+
</div>
655
+
</div>
656
+
<b><?php echo esc_html__("Chat Container Background Color:", 'aiomatic-automatic-ai-content-writer');?></b>
657
+
</div>
658
+
</td><td>
659
+
<div>
660
+
<input type="color" id="chat_container_color_b" value="#e4e8ec" onchange="anythingChanged()">
661
+
</div>
662
+
</td></tr>
663
+
<tr><td>
664
+
<div>
665
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
666
+
<div class="bws_hidden_help_text cr_min_260px">
667
+
<?php
668
+
echo esc_html__("Select the background color of the recording chat log container. Default is #ffffff", 'aiomatic-automatic-ai-content-writer');
669
+
?>
670
+
</div>
671
+
</div>
672
+
<b><?php echo esc_html__("Chat Log Container Background Color:", 'aiomatic-automatic-ai-content-writer');?></b>
673
+
</div>
674
+
</td><td>
675
+
<div>
676
+
<input type="color" id="chat_log_container_color_b" value="#ffffff" onchange="anythingChanged()">
677
+
</div>
678
+
</td></tr>
679
+
<tr><td>
680
+
<div>
681
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
682
+
<div class="bws_hidden_help_text cr_min_260px">
683
+
<?php
684
+
echo esc_html__("Select the background color of the recording chat log container AI baloon. Default is #f5f5f5", 'aiomatic-automatic-ai-content-writer');
685
+
?>
686
+
</div>
687
+
</div>
688
+
<b><?php echo esc_html__("Chat Log Container AI Baloon Color:", 'aiomatic-automatic-ai-content-writer');?></b>
689
+
</div>
690
+
</td><td>
691
+
<div>
692
+
<input type="color" id="ai_bubble_color_b" value="#f5f5f5" onchange="anythingChanged()">
693
+
</div>
694
+
</td></tr>
695
+
<tr><td>
696
+
<div>
697
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
698
+
<div class="bws_hidden_help_text cr_min_260px">
699
+
<?php
700
+
echo esc_html__("Select the background color of the recording chat log container AI baloon text. Default is #000000", 'aiomatic-automatic-ai-content-writer');
701
+
?>
702
+
</div>
703
+
</div>
704
+
<b><?php echo esc_html__("Chat Log Container AI Baloon Text Color:", 'aiomatic-automatic-ai-content-writer');?></b>
705
+
</div>
706
+
</td><td>
707
+
<div>
708
+
<input type="color" id="ai_bubble_text_color_b" value="#000000" onchange="anythingChanged()">
709
+
</div>
710
+
</td></tr>
711
+
<tr><td>
712
+
<div>
713
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
714
+
<div class="bws_hidden_help_text cr_min_260px">
715
+
<?php
716
+
echo esc_html__("Select the background color of the recording chat log container User baloon. Default is #0084ff", 'aiomatic-automatic-ai-content-writer');
717
+
?>
718
+
</div>
719
+
</div>
720
+
<b><?php echo esc_html__("Chat Log Container User Baloon Color:", 'aiomatic-automatic-ai-content-writer');?></b>
721
+
</div>
722
+
</td><td>
723
+
<div>
724
+
<input type="color" id="user_bubble_color_b" value="#0084ff" onchange="anythingChanged()">
725
+
</div>
726
+
</td></tr>
727
+
<tr><td>
728
+
<div>
729
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
730
+
<div class="bws_hidden_help_text cr_min_260px">
731
+
<?php
732
+
echo esc_html__("Select the background color of the recording chat log container User baloon text. Default is #ffffff", 'aiomatic-automatic-ai-content-writer');
733
+
?>
734
+
</div>
735
+
</div>
736
+
<b><?php echo esc_html__("Chat Log Container User Baloon Text Color:", 'aiomatic-automatic-ai-content-writer');?></b>
737
+
</div>
738
+
</td><td>
739
+
<div>
740
+
<input type="color" id="user_bubble_text_color_b" value="#ffffff" onchange="anythingChanged()">
741
+
</div>
742
+
</td></tr>
743
+
<tr><td>
744
+
<div>
745
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
746
+
<div class="bws_hidden_help_text cr_min_260px">
747
+
<?php
748
+
echo esc_html__("Select a maximum number of tokens users are allowed to use in this specific chatbot, each day.", 'aiomatic-automatic-ai-content-writer');
749
+
?>
750
+
</div>
751
+
</div>
752
+
<b><?php echo esc_html__("User Token Cap Per Day:", 'aiomatic-automatic-ai-content-writer');?></b>
753
+
</div>
754
+
</td><td>
755
+
<div>
756
+
<input type="number" min="1" step="1" id="user_token_cap_per_day_b" value="" placeholder="Max token count" onchange="anythingChanged()">
757
+
</div>
758
+
</td></tr>
759
+
</table>
760
+
</div>
761
+
<div id="tab-1" class="tab-content">
762
+
<h2><?php echo esc_html__("AI Chatbot Embedding On Remote Sites Settings:", 'aiomatic-automatic-ai-content-writer');?></h2>
763
+
<table class="wp-list-table widefat fixed striped table-view-list posts">
764
+
<tr><td>
765
+
<div>
766
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
767
+
<div class="bws_hidden_help_text cr_min_260px">
768
+
<?php
769
+
echo esc_html__("Select if you want to enable embedding of the chatbot on remote websites, using iframes. If you deactivate remote chatbots, all created remote chatbot instances will be also deleted.", 'aiomatic-automatic-ai-content-writer');
770
+
?>
771
+
</div>
772
+
</div>
773
+
<b><?php echo esc_html__("Enable Chatbot Embedding On Remote Sites:", 'aiomatic-automatic-ai-content-writer');?></b>
774
+
</div>
775
+
</td><td>
776
+
<div>
777
+
<input type="checkbox" id="remote_chat" name="aiomatic_Realtime_Chatbot_Settings[remote_chat]"<?php
778
+
if ($remote_chat == 'on')
779
+
{
780
+
echo ' checked ';
781
+
}
782
+
?>>
783
+
</div>
784
+
</td></tr>
785
+
<tr><td>
786
+
<div>
787
+
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
788
+
<div class="bws_hidden_help_text cr_min_260px">
789
+
<?php
790
+
echo sprintf(
791
+
esc_html__(
792
+
'Set a list of domains (separated by commas), which will be allowed to display the chatbot on their site. To allow all sites to add this chatbot, leave this field blank. Example usage: %s',
793
+
'aiomatic-automatic-ai-content-writer'
794
+
),
795
+
'https://www.example.org'
796
+
);
797
+
?>
798
+
</div>
799
+
</div>
800
+
<b><?php echo esc_html__("Domain List Allowed To Embed Chatbots:", 'aiomatic-automatic-ai-content-writer');?></b>
801
+
</div>
802
+
</td><td>
803
+
<div>
804
+
<textarea rows="1" id="allow_chatbot_site" placeholder="https://www.example.org" name="aiomatic_Realtime_Chatbot_Settings[allow_chatbot_site]"><?php
805
+
echo esc_textarea($allow_chatbot_site);
806
+
?></textarea>
807
+
</div>
808
+
</td></tr>
809
+
<?php
810
+
if ($remote_chat == 'on')
811
+
{
812
+
$myop = get_option('aiomatic_realtime_chat_page_id', false);
813
+
if($myop !== false)
814
+
{
815
+
if(is_numeric($myop))
816
+
{
817
+
$myop = array($myop);
818
+
}
819
+
?>
820
+
<tr>
821
+
<td colspan="2">
822
+
<b><?php echo esc_html__("You can use these HTML codes to embed the chatbot on other websites:", 'aiomatic-automatic-ai-content-writer');?></b>
823
+
</td>
824
+
</tr>
825
+
<?php
826
+
$changedone = false;
827
+
if(count($myop) == 0)
828
+
{
829
+
?>
830
+
<tr>
831
+
<td colspan="2">
832
+
<b><?php echo esc_html__("No remote chatbot instances created. Click the button from below to create a new instance!", 'aiomatic-automatic-ai-content-writer');?></b>
833
+
</td>
834
+
</tr>
835
+
<?php
836
+
}
837
+
foreach($myop as $zind => $myopthis)
838
+
{
839
+
if(get_permalink($myopthis) === false)
840
+
{
841
+
unset($myop[$zind]);
842
+
$changedone = true;
843
+
continue;
844
+
}
845
+
?>
846
+
<tr>
847
+
<td colspan="2">
848
+
<hr/>
849
+
</td>
850
+
</tr>
851
+
<tr>
852
+
<td colspan="2">
853
+
<b><?php echo esc_html__("Embed HTML Code:", 'aiomatic-automatic-ai-content-writer');?></b><br/>
854
+
<span class="cr_red">
855
+
<?php
856
+
echo esc_html('<iframe src="' . get_permalink($myopthis) . '" width="600" height="800" frameborder="0" scrolling="no">' . esc_html__("Your browser does not support iframes.", 'aiomatic-automatic-ai-content-writer') . '</iframe>');
857
+
?>
858
+
</span>
859
+
<p><?php
860
+
echo sprintf( wp_kses( __( "<a href='%s' class='button' target='_blank'>Edit</a>", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'data-id' => array(), 'class' => array(), 'href' => array(), 'target' => array() ) ) ), esc_url(get_edit_post_link($myopthis)));
861
+
?> <?php
862
+
echo sprintf( wp_kses( __( "<a href='#' data-id='" . esc_attr($myopthis) . "' class='aiomatic_delete_remote_chatbot button'>Delete</a>", 'aiomatic-automatic-ai-content-writer'), array( 'a' => array( 'data-id' => array(), 'class' => array(), 'href' => array(), 'target' => array() ) ) ), esc_url(get_edit_post_link($myopthis)));
863
+
?></p>
864
+
</td>
865
+
</tr>
866
+
<?php
867
+
}
868
+
if($changedone == true)
869
+
{
870
+
aiomatic_update_option('aiomatic_realtime_chat_page_id', $myop);
871
+
}
872
+
}
873
+
else
874
+
{
875
+
?>
876
+
<tr>
877
+
<td colspan="2">
878
+
<b><?php echo esc_html__("No remote chatbot instances created. Click the button from below to create a new instance.", 'aiomatic-automatic-ai-content-writer');?></b>
879
+
</td>
880
+
</tr>
881
+
<?php
882
+
}
883
+
?>
884
+
<tr>
885
+
<td colspan="2">
886
+
<hr/>
887
+
</td>
888
+
</tr>
889
+
<tr>
890
+
<td colspan="2">
891
+
<button id="aiomatic_add_remote_chatbot" class="button"><?php echo esc_html__("Add A New Remote Chatbot", 'aiomatic-automatic-ai-content-writer');?></button>
892
+
</td>
893
+
</tr>
894
+
<?php
895
+
}
896
+
?>
897
+
</table>
898
+
</div>
899
+
</div>
900
+
<div><p class="crsubmit"><input type="submit" name="btnSubmit" id="btnSubmit" class="button button-primary" value="<?php echo esc_html__("Save Settings", 'aiomatic-automatic-ai-content-writer');?>"/></p></div>
901
+
</form>
902
+
</div>
903
+
<hr/>
904
+
905
+
<div class="wrap">
906
+
<h2 class="cr_center"><?php echo esc_html__("Realtime Chat Preview", 'aiomatic-automatic-ai-content-writer');?></h2>
907
+
<?php
908
+
$preview_settings = array();
909
+
echo aiomatic_realtime_chat_shortcode($preview_settings);
910
+
?>
911
+
</div>
912
+
<hr/>
913
+
<?php
914
+
}
915
+
?>