refactor(settings): collapse get_all to aksrt_settings and drop migration UI

Make aksrt_settings the sole theme settings store for get_all(), remove
aksrt_seo_settings/aksrt_basic_settings merge paths, point global.logo
schema at aksrt_settings, and delete the retired settings migration page,
route, REST endpoint, and related SPA surface.
This commit is contained in:
2026-07-11 16:55:27 +08:00
parent b4da8cc1f4
commit 91b083b2b0
15 changed files with 16 additions and 471 deletions
@@ -71,13 +71,6 @@ class AKSRT_Admin_Import_Export_Controller extends AKSRT_Admin_Controller_Base {
'permission_callback' => [$this, 'check_permission'],
]);
// Migration status
register_rest_route(self::API_NAMESPACE, '/settings/migration-status', [
'methods' => 'GET',
'callback' => [$this, 'rest_migration_status'],
'permission_callback' => [$this, 'check_permission'],
]);
// Schema introspection (for frontend to discover available fields)
register_rest_route(self::API_NAMESPACE, '/settings/schema/(?P<domain>[a-z_]+)', [
'methods' => 'GET',
@@ -401,8 +394,4 @@ class AKSRT_Admin_Import_Export_Controller extends AKSRT_Admin_Controller_Base {
return $this->success(['checks' => $checks]);
}
/**
* Migration status — reports schema version and pending migrations.
*/
}
@@ -3,17 +3,6 @@ defined('ABSPATH') || exit;
trait AKSRT_Admin_Import_Export_Controller_Part_1 {
public function rest_migration_status(WP_REST_Request $request): WP_REST_Response {
// Settings migration UI/runtime has been removed. Keep the route for old SPA chunks
// until the next full admin rebuild, but return an empty retired payload.
return $this->success([
'schema_version' => get_option('aksrt_db_schema_version', '0.0.0'),
'migration_version' => 'retired',
'migration_log' => [],
'retired' => true,
]);
}
/**
* Get the schema definition for a domain (for frontend introspection).
*/
@@ -43,7 +43,7 @@ class AKSRT_Admin_Schema_Global {
'key' => 'logo',
'title' => 'LOGO图像',
'version' => '1.0.0',
'option_key' => 'aksrt_seo_settings',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'logo', 'title' => 'Logo 设置', 'fields' => [
['key' => 'site_logo', 'label' => '站点 Logo', 'type' => 'media', 'default' => ''],
@@ -1,27 +0,0 @@
<?php
/**
* AKSRT_Admin_Schema_Tools_Migration section schema.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
class AKSRT_Admin_Schema_Tools_Migration {
public static function build(): array {
return [
'key' => 'migration',
'title' => '数据迁移',
'version' => '1.0.0',
'option_key' => 'aksrt_settings',
'groups' => [
['key' => 'status', 'title' => '迁移状态', 'fields' => [
['key' => 'current_version', 'label' => '当前版本', 'type' => 'display'],
['key' => 'pending_migrations', 'label' => '待执行迁移', 'type' => 'display'],
['key' => 'run_migration', 'label' => '执行迁移', 'type' => 'button', 'help' => '手动触发数据库迁移'],
]],
],
];
}
}