' . esc_html($notices[$code][0]) . '
' . esc_html__('No privacy policy page is published.', 'aiwend') . ' ' . esc_html__('Visitors see how a message is used next to the form, but no link to a privacy policy, because none is set. Choose or write a policy page so the form can link to it.', 'aiwend'); if (current_user_can('manage_privacy_options')) { echo ' ' . esc_html__('Open Settings > Privacy', 'aiwend') . ''; } echo '
' . esc_html(sprintf(__('%1$d unread. Messages are deleted automatically after %2$d days.', 'aiwend'), array_sum($unread), $days)) . ' ' . esc_html__('Change this', 'aiwend') . '
'; if ($forms === []) { echo '' . esc_html__('You have not created a form yet.', 'aiwend') . ' ' . esc_html__('Create a form', 'aiwend') . '
'; } echo ''; $rows = $store->recent($site, $formFilter, $now, self::PAGE_SIZE + 1, ($paged - 1) * self::PAGE_SIZE); $more = count($rows) > self::PAGE_SIZE; $rows = array_slice($rows, 0, self::PAGE_SIZE); if ($rows === []) { echo '' . esc_html__('No messages.', 'aiwend') . '
'; if ($paged > 1) { echo '' . esc_html__('Newer', 'aiwend') . ' '; } if ($more) { echo '' . esc_html__('Older', 'aiwend') . ''; } echo '
'; } private function detail(int $id): void { $site = get_current_blog_id(); $now = $this->plugin->clock->now(); $store = AiFormsConfig::store($this->plugin); $r = $store->find($site, $id, $now); if ($r === null) { echo '' . esc_html__('That message does not exist or has expired.', 'aiwend') . ' ' . esc_html__('Back to the inbox', 'aiwend') . '
' . esc_html__('Back to the inbox', 'aiwend') . '
' . esc_html__('AI-generated, not reviewed.', 'aiwend') . ' ' . esc_html__('It can be wrong or invent details. It is never sent to the visitor by Aiwend.', 'aiwend') . '
' . esc_html((string) $r['summary']) . '
'; echo '' . esc_html((string) $r['category']) . '
'; echo '' . esc_html(sprintf( /* translators: %s: model name */ __('Model: %s', 'aiwend'), (string) $r['analysis_model'] )) . '
'; } elseif ($state === SubmissionStore::RUNNING) { echo '' . esc_html__('An analysis is running. Reload in a minute.', 'aiwend') . '
' . esc_html__('An earlier attempt may have reached the provider and been billed, but its result is unknown. It is not retried automatically.', 'aiwend') . ' ' . esc_html__('Check the Usage page', 'aiwend') . '
' . esc_html__('The last attempt failed. The message is still saved.', 'aiwend') . '
'; } $site = get_current_blog_id(); $choices = $this->choices(); $balance = $this->plugin->ledger->balance($site, 'site'); if ($this->plugin->ledger->isHalted()) { echo '' . esc_html__('AI spending is paused, so nothing can be analysed. You can still read and delete messages.', 'aiwend') . '
' . esc_html__('There is no AI connection ready to use. You can still read and delete messages.', 'aiwend') . ' ' . esc_html__('Add or check a connection', 'aiwend') . '
' . esc_html__('No usage limit is set, so nothing can be analysed yet.', 'aiwend') . ' ' . esc_html__('Set a limit', 'aiwend') . '
' . esc_html__('Only the topic and the message text shown above are sent to the AI connection you choose. The name, email address and other messages are not sent. The message text can still contain personal or sensitive details, so do not analyse it unless you are allowed to share it with that provider. In the simulated demo nothing leaves this site. A real request uses your provider account and counts against your usage limit.', 'aiwend') . '
'; echo ''; } private function formsView(): void { $forms = AiFormsConfig::forms(); $active = count(array_filter($forms, static fn(array $f): bool => $f['active'])); echo '' . esc_html(sprintf( /* translators: 1: active forms, 2: maximum active forms */ __('%1$d of %2$d active forms. Put a form on a page with its shortcode. The fields are fixed: name (optional), email, topic (optional list) and message.', 'aiwend'), $active, FormDefinitions::MAX_ACTIVE )) . '
'; foreach ($forms as $f) { $this->formEditor($f); } $this->formEditor(null); echo '' . esc_html__('Shortcode:', 'aiwend') . ' [aiwend_form id="' . (int) $id . '"]