refactor: rename the theme brand and every identifier from AKSRT to Jio

Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.

Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
  cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
  window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)

Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
  so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
  (dropped 3 stale entries, added the 17 missing ones)

Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
  get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
  when it is empty

Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.

Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-01 20:05:04 +08:00
1 parent 5b16bc6e15
commit 35bb96e82f
997 files changed
+28216 -28188

No files matched your search

+30 -30
View File
@@ -42,7 +42,7 @@ namespace {
}
}
namespace AKSRT\Ticket {
namespace Jio\Ticket {
final class TicketSettings {
public static bool $order_link_enabled = false;
public static function order_link_enabled(): bool { return self::$order_link_enabled; }
@@ -131,7 +131,7 @@ namespace AKSRT\Ticket {
}
}
namespace AKSRT\Attachment {
namespace Jio\Attachment {
final class PendingUploads {
public static function claim_urls(array $attachment, int $user_id): void {}
}
@@ -148,45 +148,45 @@ namespace {
}
};
$reset = static function (): void {
\AKSRT\Ticket\TicketRepository::$tickets = [
\Jio\Ticket\TicketRepository::$tickets = [
1 => ['id' => 1, 'status' => 'handling', 'ticket_type_id' => 3, 'admin_id' => 11],
2 => ['id' => 2, 'status' => 'closed', 'ticket_type_id' => 3, 'admin_id' => 11],
3 => ['id' => 3, 'status' => 'handling', 'ticket_type_id' => 3, 'admin_id' => 11],
];
\AKSRT\Ticket\TicketRepository::$creates = [];
\AKSRT\Ticket\TicketRepository::$updates = [];
\AKSRT\Ticket\TicketNotifier::$closed = [];
\AKSRT\Ticket\TicketNotifier::$user_replied = [];
\AKSRT\Ticket\TicketNoteService::$created = [];
\AKSRT\Ticket\TicketSettings::$order_link_enabled = false;
\Jio\Ticket\TicketRepository::$creates = [];
\Jio\Ticket\TicketRepository::$updates = [];
\Jio\Ticket\TicketNotifier::$closed = [];
\Jio\Ticket\TicketNotifier::$user_replied = [];
\Jio\Ticket\TicketNoteService::$created = [];
\Jio\Ticket\TicketSettings::$order_link_enabled = false;
$GLOBALS['ticket_rest_user_can_calls'] = [];
};
$admin = new \AKSRT\Ticket\TicketRestAdmin();
$admin = new \Jio\Ticket\TicketRestAdmin();
$error_code = static fn($value): string => $value instanceof \WP_Error ? $value->code : '';
// Explicit admin_id=0 clears assignment and status updates always touch updated_at.
$reset();
$response = $admin->set_status(new \WP_REST_Request(['id' => 1, 'status' => 'handling', 'admin_id' => 0]));
$saved = \AKSRT\Ticket\TicketRepository::$tickets[1] ?? [];
$saved = \Jio\Ticket\TicketRepository::$tickets[1] ?? [];
$check('解除指派接受 admin_id=0', !\is_wp_error($response) && ($saved['admin_id'] ?? null) === 0);
$check('状态更新写入 updated_at', ($saved['updated_at'] ?? '') === '2026-10-31 12:34:56');
// Invalid department returns an explicit error and performs no write.
$reset();
$response = $admin->set_status(new \WP_REST_Request(['id' => 1, 'status' => 'handling', 'ticket_type_id' => 999]));
$check('非法部门返回明确错误', $error_code($response) === 'aksrt_ticket_type');
$check('非法部门不写入任何字段', \AKSRT\Ticket\TicketRepository::$updates === []);
$check('非法部门返回明确错误', $error_code($response) === 'jio_ticket_type');
$check('非法部门不写入任何字段', \Jio\Ticket\TicketRepository::$updates === []);
// Existing assignees may lose admin capability; retaining the same ID isn't a new assignment.
$reset();
\AKSRT\Ticket\TicketRepository::$tickets[1]['admin_id'] = 12;
\Jio\Ticket\TicketRepository::$tickets[1]['admin_id'] = 12;
$response = $admin->set_status(new \WP_REST_Request([
'id' => 1,
'status' => 'admin_replied',
'ticket_type_id' => 4,
'admin_id' => 12,
]));
$saved = \AKSRT\Ticket\TicketRepository::$tickets[1] ?? [];
$saved = \Jio\Ticket\TicketRepository::$tickets[1] ?? [];
$check('保留已失去管理员权限的原跟进人仍可更新状态和部门', !\is_wp_error($response)
&& ($saved['status'] ?? null) === 'admin_replied'
&& ($saved['ticket_type_id'] ?? null) === 4
@@ -201,8 +201,8 @@ namespace {
'ticket_type_id' => 4,
'admin_id' => 12,
]));
$check('无 manage_options 的用户不能被指派', $error_code($response) === 'aksrt_ticket_admin');
$check('管理员校验失败时部门也不被部分写入', \AKSRT\Ticket\TicketRepository::$updates === []);
$check('无 manage_options 的用户不能被指派', $error_code($response) === 'jio_ticket_admin');
$check('管理员校验失败时部门也不被部分写入', \Jio\Ticket\TicketRepository::$updates === []);
$check('目标管理员必须通过 manage_options 校验', in_array([12, 'manage_options'], $GLOBALS['ticket_rest_user_can_calls'], true));
$reset();
@@ -211,13 +211,13 @@ namespace {
'status' => 'handling',
'admin_id' => 777,
]));
$check('不存在的管理员返回明确错误', $error_code($response) === 'aksrt_ticket_admin');
$check('不存在的管理员返回明确错误', $error_code($response) === 'jio_ticket_admin');
$check('不存在的管理员不会触发写入', \AKSRT\Ticket\TicketRepository::$updates === []);
$check('不存在的管理员不会触发写入', \Jio\Ticket\TicketRepository::$updates === []);
$reset();
\AKSRT\Ticket\TicketRepository::$tickets[1]['admin_id'] = 12;
\Jio\Ticket\TicketRepository::$tickets[1]['admin_id'] = 12;
$response = $admin->set_status(new \WP_REST_Request([
'id' => 1,
'status' => 'handling',
@@ -225,18 +225,18 @@ namespace {
]));
$check('具备 manage_options 的管理员可被指派', !\is_wp_error($response)
&& in_array([11, 'manage_options'], $GLOBALS['ticket_rest_user_can_calls'], true)
&& (\AKSRT\Ticket\TicketRepository::$tickets[1]['admin_id'] ?? null) === 11);
&& (\Jio\Ticket\TicketRepository::$tickets[1]['admin_id'] ?? null) === 11);
// Only the first open -> closed transition sends a close notification.
$reset();
$first_close = $admin->set_status(new \WP_REST_Request(['id' => 3, 'status' => 'closed']));
$second_close = $admin->set_status(new \WP_REST_Request(['id' => 3, 'status' => 'closed']));
$check('首次关闭成功', !\is_wp_error($first_close));
$check('同状态再次提交不重发关闭通知', count(\AKSRT\Ticket\TicketNotifier::$closed) === 1);
$check('同状态再次提交不重发关闭通知', count(\Jio\Ticket\TicketNotifier::$closed) === 1);
// Order association follows the feature switch.
$reset();
\AKSRT\Ticket\TicketSettings::$order_link_enabled = false;
\Jio\Ticket\TicketSettings::$order_link_enabled = false;
$admin->create_ticket(new \WP_REST_Request([
'user_id' => 10,
'title' => '代客提交标题',
@@ -244,9 +244,9 @@ namespace {
'content' => '这是问题描述内容',
'order_number' => 'ORD-1',
]));
$check('关闭订单关联时忽略订单号', (\AKSRT\Ticket\TicketRepository::$creates[0]['order_number'] ?? null) === '');
$check('关闭订单关联时忽略订单号', (\Jio\Ticket\TicketRepository::$creates[0]['order_number'] ?? null) === '');
\AKSRT\Ticket\TicketSettings::$order_link_enabled = true;
\Jio\Ticket\TicketSettings::$order_link_enabled = true;
$admin->create_ticket(new \WP_REST_Request([
'user_id' => 10,
'title' => '代客提交标题',
@@ -254,7 +254,7 @@ namespace {
'content' => '这是问题描述内容',
'order_number' => '<b>ORD-2</b>',
]));
$check('开启订单关联时保存已消毒订单号', (\AKSRT\Ticket\TicketRepository::$creates[1]['order_number'] ?? null) === 'ORD-2');
$check('开启订单关联时保存已消毒订单号', (\Jio\Ticket\TicketRepository::$creates[1]['order_number'] ?? null) === 'ORD-2');
// Internal note writes enforce existence, trim, non-empty and configured maximum length.
$reset();
@@ -262,10 +262,10 @@ namespace {
$empty = $admin->create_note(new \WP_REST_Request(['id' => 1, 'content' => " \n\t "]));
$long = $admin->create_note(new \WP_REST_Request(['id' => 1, 'content' => '123456']));
$valid = $admin->create_note(new \WP_REST_Request(['id' => 1, 'content' => ' memo ']));
$created = \AKSRT\Ticket\TicketNoteService::$created;
$check('备注工单不存在时返回 404', $error_code($missing) === 'aksrt_ticket_missing');
$check('备注拒绝空内容', $error_code($empty) === 'aksrt_ticket_note_content');
$check('备注拒绝超长内容', $error_code($long) === 'aksrt_ticket_note_content');
$created = \Jio\Ticket\TicketNoteService::$created;
$check('备注工单不存在时返回 404', $error_code($missing) === 'jio_ticket_missing');
$check('备注拒绝空内容', $error_code($empty) === 'jio_ticket_note_content');
$check('备注拒绝超长内容', $error_code($long) === 'jio_ticket_note_content');
$check('备注 trim 后保存', !\is_wp_error($valid) && ($created[0]['content'] ?? null) === 'memo');
$check('无效备注未调用创建服务', count($created) === 1);