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
-9
View File
@@ -106,11 +106,6 @@ if (file_exists($js)) {
],
'imageUploadMultiple' => $image_upload_multiple,
'ai' => [
'available' => !empty($ctx['ai_available']),
'summary' => !empty($ctx['ai_available']),
'tags' => !empty($ctx['ai_available']),
],
'editor' => [
'canUploadImage' => !empty($ctx['can_upload_img']),
'canUploadVideo' => !empty($ctx['can_upload_video']),
@@ -142,10 +137,6 @@ if (file_exists($js)) {
'submitted' => __('投稿已提交', 'aksrt'),
'error' => __('操作失败,请重试', 'aksrt'),
'confirmDelete' => __('确定要删除这个草稿吗?', 'aksrt'),
'aiGenerating' => __('生成中…', 'aksrt'),
'aiFailed' => __('AI 生成失败', 'aksrt'),
'needContent' => __('请先填写正文内容', 'aksrt'),
'aiFilled' => __('已填入,可继续编辑', 'aksrt'),
'deleting' => __('正在删除草稿…', 'aksrt'),
'deleted' => __('草稿已删除', 'aksrt'),
'uploading' => __('正在上传…', 'aksrt'),
-3
View File
@@ -177,8 +177,6 @@ if ($is_guest) {
$submit_label = __('保存', 'aksrt');
}
$ai_available = class_exists('\AKSRT\Ai\AI') && \AKSRT\Ai\AI::get_instance()->is_available();
return [
'front' => $front,
'user_id' => $user_id,
@@ -207,7 +205,6 @@ return [
'vip' => $vip,
'points_enabled' => $points_enabled,
'submit_label' => $submit_label,
'ai_available' => $ai_available,
'can_pay' => $cap('new_post_pay'),
'can_pay_download' => $cap('new_post_pay_download'),
'can_cover_image' => $cap('new_post_image_cover'),