Privacy > * Policy Guide: what the chat stores about visitors, who it's sent to, and * for how long. Written from the current settings, so it names the site's * own AI providers and chat retention period. */ class RSVL_Privacy_Admin { public static function register(): void { add_action('admin_init', [self::class, 'add_policy_content']); } public static function add_policy_content(): void { wp_add_privacy_policy_content('Resolver - AI Chatbot', self::policy_content()); } /** The suggested text, as the Policy Guide shows it. */ private static function policy_content(): string { $paragraphs = [ __('When you use the chatbot on this site, we store your messages and the chatbot\'s replies, the page you started the chat on, when each message was sent, and any rating you give a reply. We don\'t collect your name or email address unless you type them into a message.', 'resolver-ai-chatbot'), ]; $chat = self::provider_name('chat_provider'); $embed = self::provider_name('embedding_provider'); if ('' !== $chat) { /* translators: %s: the AI service that writes the chatbot's replies, e.g. "OpenAI". */ $paragraphs[] = sprintf(__('Messages you write to the chatbot are sent to %s to generate the chatbot\'s replies.', 'resolver-ai-chatbot'), $chat); } if ('' !== $embed && $embed !== $chat) { /* translators: %s: the AI service used to search the site's content, e.g. "Google Gemini". */ $paragraphs[] = sprintf(__('To find the parts of this site that answer them, your messages are also sent to %s.', 'resolver-ai-chatbot'), $embed); } $paragraphs[] = __('To prevent abuse, your IP address is used to limit how many messages can be sent each minute. It\'s kept only as a one-way hash, for up to a minute, and isn\'t stored with your chat.', 'resolver-ai-chatbot'); $paragraphs[] = __('Your browser keeps an ID for your chat in its local storage, so the conversation continues as you move between pages. It stops being used 24 hours after your last message.', 'resolver-ai-chatbot'); $days = (int) resolver_get_setting('chat_retention_days'); $paragraphs[] = $days > 0 /* translators: %s: number of days. */ ? sprintf(_n('Chats are deleted %s day after their last message.', 'Chats are deleted %s days after their last message.', $days, 'resolver-ai-chatbot'), number_format_i18n($days)) : __('Chats are kept until the site administrator deletes them.', 'resolver-ai-chatbot'); $html = '
' . esc_html__('Resolver stores each conversation in the WordPress database, and sends every visitor message to AI services that write the chatbot replies. The text below adapts to your current settings, so please fully configure Resolver before copying the suggested policy text below.', 'resolver-ai-chatbot') . '
'; foreach ($paragraphs as $i => $paragraph) { $label = 0 === $i ? '' . esc_html__('Suggested text:', 'resolver-ai-chatbot') . ' ' : ''; $html .= '' . $label . esc_html($paragraph) . '
'; } return $html; } /** The name of the AI service a provider setting names, or '' when none is chosen. */ private static function provider_name(string $setting): string { $provider = RSVL_Provider::get_provider((string) resolver_get_setting($setting)); return $provider ? $provider->get_name() : ''; } }