refactor(admin): drop AI connection config page for WP AI Connectors

Remove the "AI 连接配置" page under 扩展&增强 together with the theme's
own OpenAI-compatible provider path. AI generation (SEO, summary, tags)
now runs solely on the WordPress AI Client (wp_ai_client_prompt), with
connections configured through WordPress AI Connectors.

- AI.php keeps only the WP AI Client path: no provider config storage,
  no theme fallback, no rate limiting
- Drop /ai/status, /ai/settings and legacy /ai/seo-suggest routes plus
  their handlers
- Remove dead compat code: AISEO::suggest, AIPrompt::build_seo_prompt
  and the front-submit AI assist flow (its buttons were never rendered
  and its endpoints were never registered)
- Update SEO schema/meta-box guidance that pointed at the deleted page
- Add ai-config-removal contract test and refresh the toast and
  user-features contracts affected by the cleanup
This commit is contained in:
2026-10-13 19:32:34 +08:00
parent bd01199930
commit cdab7a5e5f
18 changed files with 110 additions and 931 deletions
-25
View File
@@ -77,31 +77,6 @@ class AIPrompt {
6. 直接输出描述文本本身,不要任何前缀、引号或解释。';
}
/**
* 兼容旧单 prompt 构建(草稿/无 ID 场景)。
*/
public function build_seo_prompt(string $title, string $content): string {
$title_instruction = $this->get_seo_title_system_instruction();
$kw_instruction = $this->get_seo_keywords_system_instruction();
$desc_instruction = $this->get_seo_description_system_instruction();
return <<<PROMPT
请根据以下文章内容,生成 SEO 优化建议。
文章标题:{$title}
文章内容:
{$content}
请以 JSON 格式返回,包含以下字段:
- suggested_title: {$title_instruction}
- suggested_description: {$desc_instruction}
- suggested_keywords: {$kw_instruction}(以 JSON 数组形式返回)
只返回 JSON,不要其他内容。
PROMPT;
}
public function build_summary_prompt(string $content, int $max_length = 200): string {
$content = mb_substr($content, 0, 3000);
return <<<PROMPT