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:
1 parent
5b16bc6e15
commit
35bb96e82f
997 files changed
+28216
-28188
No files matched your search
@@ -6,7 +6,7 @@
|
||||
* 2) SPA 页面已注册(/users/ticket 可达),承载 schema 表单 + 三块字典 CRUD;
|
||||
* 3) 运行时 TicketSettings 缺键回退 schema 默认,数值边界被夹取;
|
||||
* 4) 前台入口三处均已注册:Center.php 面板定义 + sidebar-nav.php 侧栏项 +
|
||||
* aksrt-user-center.php 的 built_in_tabs 与 view map。
|
||||
* jio-user-center.php 的 built_in_tabs 与 view map。
|
||||
*/
|
||||
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -111,7 +111,7 @@ test('ticket schema is registered under users', () => {
|
||||
assert.ok(composeAt < sectionsEnd, 'ticket section must be INSIDE the sections array');
|
||||
const ticket = read('src/Admin/Schema/Users/SchemaUsersTicket.php');
|
||||
assert.ok(ticket.includes("'key' => 'ticket'"), 'PHP section key missing');
|
||||
assert.ok(ticket.includes("'option_key' => 'aksrt_settings'"), 'PHP option key missing');
|
||||
assert.ok(ticket.includes("'option_key' => 'jio_settings'"), 'PHP option key missing');
|
||||
});
|
||||
|
||||
test('TicketSettings falls back to schema defaults and clamps numerics', () => {
|
||||
@@ -146,41 +146,41 @@ test('TicketSettings falls back to schema defaults and clamps numerics', () => {
|
||||
test('ticket panel is registered across the user-center wiring', () => {
|
||||
const center = read('src/User/Center.php');
|
||||
assert.ok(center.includes("'tickets' => ["), 'panel definition missing');
|
||||
assert.ok(center.includes("'label' => __('工单中心', 'aksrt')"), 'panel label missing');
|
||||
assert.ok(center.includes("'label' => __('工单中心', 'jio')"), 'panel label missing');
|
||||
assert.match(center, /'tickets'\s*=>\s*\[[\s\S]*?'priority' => 49/, 'panel priority should sit next to orders (48)');
|
||||
// 开关关闭时整块移除。
|
||||
assert.match(center, /\$ticket_on = class_exists\('\\AKSRT\\Ticket\\TicketSettings'\)/);
|
||||
assert.match(center, /\$ticket_on = class_exists\('\\Jio\\Ticket\\TicketSettings'\)/);
|
||||
assert.match(center, /if \(!\$ticket_on\) \{\s*\n\s*\$order = array_values\(array_filter\(\$order, static fn\(string \$key\): bool => \$key !== 'tickets'\)\);/);
|
||||
assert.match(center, /if \(\$key === 'tickets' && !\$ticket_on\) \{\s*\n\s*continue;/);
|
||||
|
||||
const sidebar = read('inc/helpers/user-center-renderers/sidebar-nav.php');
|
||||
assert.ok(sidebar.includes("'label' => __('工单中心', 'aksrt')"), 'sidebar label missing');
|
||||
assert.ok(sidebar.includes("'label' => __('工单中心', 'jio')"), 'sidebar label missing');
|
||||
assert.ok(sidebar.includes("'icon' => 'comment-color'"), 'sidebar icon should use the built-in comment sprite');
|
||||
assert.ok(sidebar.includes("'tab' => 'tickets'"), 'sidebar tab key missing');
|
||||
|
||||
const helper = read('inc/helpers/aksrt-user-center.php');
|
||||
const helper = read('inc/helpers/jio-user-center.php');
|
||||
assert.ok(helper.includes("'tickets'"), 'built_in_tabs missing tickets');
|
||||
assert.match(helper, /'tickets'\s*=> 'tickets',/, 'view map missing tickets => tickets');
|
||||
|
||||
const renderer = read('inc/helpers/user-center-renderers/profile-tickets.php');
|
||||
assert.ok(renderer.includes('data-aksrt-ticket-center'), 'panel root hook missing');
|
||||
assert.ok(renderer.includes('data-aksrt-ticket-create'), 'create button hook missing');
|
||||
assert.ok(renderer.includes("aksrt_render_captcha('ticket_create')"), 'create captcha mount missing');
|
||||
assert.ok(renderer.includes("aksrt_render_captcha('ticket_reply')"), 'reply captcha mount missing');
|
||||
assert.ok(renderer.includes('data-jio-ticket-center'), 'panel root hook missing');
|
||||
assert.ok(renderer.includes('data-jio-ticket-create'), 'create button hook missing');
|
||||
assert.ok(renderer.includes("jio_render_captcha('ticket_create')"), 'create captcha mount missing');
|
||||
assert.ok(renderer.includes("jio_render_captcha('ticket_reply')"), 'reply captcha mount missing');
|
||||
});
|
||||
|
||||
test('ticket frontend assets are enqueued only when the panel exists', () => {
|
||||
const scripts = read('src/Core/ScriptsPart1b.php');
|
||||
assert.match(scripts, /\$has_tickets_panel = false;/, 'panel flag not initialised');
|
||||
assert.match(scripts, /\$has_tickets_panel = isset\(\$dashboard_tabs\['tickets'\]\);/, 'panel flag not derived');
|
||||
assert.ok(scripts.includes("'aksrt-tickets'"), 'ticket CSS handle missing');
|
||||
assert.ok(scripts.includes("'aksrt-ticket-center'"), 'ticket JS handle missing');
|
||||
assert.ok(scripts.includes("'jio-tickets'"), 'ticket CSS handle missing');
|
||||
assert.ok(scripts.includes("'jio-ticket-center'"), 'ticket JS handle missing');
|
||||
assert.ok(scripts.includes('/assets/js/ticket-center.js'), 'ticket JS path missing');
|
||||
assert.ok(scripts.includes('/assets/css/routes/tickets.css'), 'ticket CSS path missing');
|
||||
// 两个入队都必须在 $has_tickets_panel 条件内。
|
||||
const cssIndex = scripts.indexOf("'aksrt-tickets'");
|
||||
const jsIndex = scripts.indexOf("'aksrt-ticket-center'");
|
||||
assert.ok(scripts.lastIndexOf('if ($has_tickets_panel) {', cssIndex) > scripts.indexOf("'aksrt-orders'"),
|
||||
const cssIndex = scripts.indexOf("'jio-tickets'");
|
||||
const jsIndex = scripts.indexOf("'jio-ticket-center'");
|
||||
assert.ok(scripts.lastIndexOf('if ($has_tickets_panel) {', cssIndex) > scripts.indexOf("'jio-orders'"),
|
||||
'ticket CSS must be gated on its own panel flag');
|
||||
assert.ok(jsIndex > cssIndex, 'ticket JS should be enqueued alongside its CSS');
|
||||
|
||||
|
||||
Reference in new issue
Block a user