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

@@ -7,8 +7,8 @@ const root = path.resolve(__dirname, '../..')
const read = file => fs.readFileSync(path.join(root, file), 'utf8')
const list = read('src/Admin/Native/PostListEnhance.php')
const tags = read('inc/helpers/aksrt-frontend-tags.php')
const pay = read('inc/helpers/aksrt-pay.php')
const tags = read('inc/helpers/jio-frontend-tags.php')
const pay = read('inc/helpers/jio-pay.php')
test('admin post list has the interaction stats column', () => {
assert.match(list, /manage_post_posts_columns/)
@@ -20,7 +20,7 @@ test('admin post list has the interaction stats column', () => {
test('admin post list has the sales data column with a sortable header', () => {
// 表头「销售数据」必须是可点击排序链接,排序键为 sales_volume。
assert.match(list, /销售数据/)
assert.match(list, /'aksrt_sales'/)
assert.match(list, /'jio_sales'/)
assert.match(list, /orderby.*sales_volume/)
// 排序靠表头 label 里的链接 + pre_get_posts 落地,不注册 sortable_columns:
@@ -38,25 +38,25 @@ test('sales column renders pay type, price and both sales counts', () => {
assert.match(list, /pay_type_labels\(\)/)
assert.match(list, /真实销量/)
assert.match(list, /get_content_sales_map/)
// 第一行取自 _aksrt_pay,第二行的销量取自 _aksrt_sales_volume。
assert.match(list, /aksrt_get_pay_meta/)
// 第一行取自 _jio_pay,第二行的销量取自 _jio_sales_volume。
assert.match(list, /jio_get_pay_meta/)
assert.match(list, /DomainModel::RESOURCE_SALES_VOLUME_KEY/)
// 真实销量链接必须跳到订单页(aksrt_orders)并按商品 ID 过滤。
assert.match(list, /'aksrt_orders'/)
// 真实销量链接必须跳到订单页(jio_orders)并按商品 ID 过滤。
assert.match(list, /'jio_orders'/)
assert.match(list, /'product_id'/)
})
test('interaction counts are read from the keys the theme actually writes', () => {
// 计数一律落在这几个 meta key 上:aksrt_post_views / _aksrt_like_count /
// _aksrt_favorite_count。列回调只能用同一套键,否则全列恒为 0。
// 计数一律落在这几个 meta key 上:jio_post_views / _jio_like_count /
// _jio_favorite_count。列回调只能用同一套键,否则全列恒为 0。
// 互动数据不做下载量统计,因此不再读取任何 download 键。
assert.match(tags, /'_aksrt_like_count'/)
assert.match(tags, /'_aksrt_favorite_count'/)
assert.match(tags, /'aksrt_post_views'/)
assert.match(tags, /'_jio_like_count'/)
assert.match(tags, /'_jio_favorite_count'/)
assert.match(tags, /'jio_post_views'/)
assert.match(list, /aksrt_get_post_views\(\$post_id\)/)
assert.match(list, /aksrt_get_post_likes\(\$post_id\)/)
assert.match(list, /aksrt_get_post_favorites\(\$post_id\)/)
assert.match(list, /jio_get_post_views\(\$post_id\)/)
assert.match(list, /jio_get_post_likes\(\$post_id\)/)
assert.match(list, /jio_get_post_favorites\(\$post_id\)/)
// 不得再直接读这些不存在的键。
const column = list.slice(list.indexOf('private function render_stats_column'), list.indexOf('private function render_sales_column'))
@@ -71,17 +71,17 @@ test('interaction counts are read from the keys the theme actually writes', () =
assert.doesNotMatch(column, /下载/)
})
test('admin stats column shares the aksrt_format_number abbreviation', () => {
test('admin stats column shares the jio_format_number abbreviation', () => {
// 后台列与前台必须同一套缩写口径(≥10000 → 1.2W+,≥1000 → 1.5K)。
assert.match(list, /aksrt_format_number\(\$n\)/)
assert.match(list, /jio_format_number\(\$n\)/)
const column = list.slice(list.indexOf('private function render_stats_column'), list.indexOf('private function render_sales_column'))
assert.doesNotMatch(column, /'万'/)
})
test('sortable meta maps the public orderby keys to the stored keys', () => {
assert.match(list, /'views'\s*=>\s*\\AKSRT\\Core\\DomainModel::POST_VIEW_COUNT_KEY/)
assert.match(list, /'like'\s*=>\s*'_aksrt_like_count'/)
assert.match(list, /'favorite'\s*=>\s*'_aksrt_favorite_count'/)
assert.match(list, /'views'\s*=>\s*\\Jio\\Core\\DomainModel::POST_VIEW_COUNT_KEY/)
assert.match(list, /'like'\s*=>\s*'_jio_like_count'/)
assert.match(list, /'favorite'\s*=>\s*'_jio_favorite_count'/)
// meta_key 必须是真实存储键,而不是用户可见的排序键。
assert.match(list, /\$query->set\('meta_key', \$this->stats_meta_key\(\$orderby\)\)/)
// 互动数据不统计下载量,排序映射里也不得再出现该维度。
@@ -90,21 +90,21 @@ test('sortable meta maps the public orderby keys to the stored keys', () => {
test('every counter meta key the admin column renders has a writer', () => {
// 逐键核对:列里展示的每项计数都必须在某个 helper 里真正被写入过。
// _aksrt_sales_volume 的写入方是付费订单流水(PayOrders),不在这份清单里,
// _jio_sales_volume 的写入方是付费订单流水(PayOrders),不在这份清单里,
// 由下一个用例单独覆盖。
const sources = [
'src/Admin/Native/PostListEnhance.php',
'inc/helpers/aksrt-frontend-tags.php',
'inc/helpers/jio-frontend-tags.php',
'src/Core/PostMetaBox.php',
'src/Frontend/PageAdminSet.php',
].map(read).join('\n')
for (const key of ['aksrt_post_views', '_aksrt_like_count', '_aksrt_favorite_count']) {
for (const key of ['jio_post_views', '_jio_like_count', '_jio_favorite_count']) {
assert.ok(sources.includes(`'${key}'`), `${key} is written somewhere`)
}
// 资源帖的浏览有独立键,aksrt_get_post_views() 取两者较大值。
assert.match(tags, /_aksrt_res_view_count/)
assert.match(read('inc/helpers/aksrt-resource.php'), /RESOURCE_VIEW_COUNT_KEY|_aksrt_res_view_count/)
// 资源帖的浏览有独立键,jio_get_post_views() 取两者较大值。
assert.match(tags, /_jio_res_view_count/)
assert.match(read('inc/helpers/jio-resource.php'), /RESOURCE_VIEW_COUNT_KEY|_jio_res_view_count/)
// 互动数据不统计下载量:列里不得再出现下载键的读取或回退逻辑。
assert.doesNotMatch(list, /RESOURCE_DOWNLOAD_COUNT_KEY/)
@@ -112,14 +112,14 @@ test('every counter meta key the admin column renders has a writer', () => {
})
test('sales volume is written by the order pipeline', () => {
// _aksrt_sales_volume 的写入方在付费助手与订单处理器里,列本身只读。
assert.match(pay, /aksrt_bump_content_sales_volume/)
// _jio_sales_volume 的写入方在付费助手与订单处理器里,列本身只读。
assert.match(pay, /jio_bump_content_sales_volume/)
assert.match(pay, /RESOURCE_SALES_VOLUME_KEY/)
assert.match(read('src/Content/PayOrders.php'), /aksrt_bump_content_sales_volume/)
assert.match(read('src/Content/PayOrders.php'), /jio_bump_content_sales_volume/)
})
test('admin column icons stay behind the Font Awesome enqueue on edit.php', () => {
assert.match(list, /admin_enqueue_scripts[\s\S]*?edit\.php[\s\S]*?aksrt_enqueue_fontawesome\(\)/)
assert.match(list, /admin_enqueue_scripts[\s\S]*?edit\.php[\s\S]*?jio_enqueue_fontawesome\(\)/)
for (const klass of ['fa-eye', 'fa-thumbs-up', 'fa-star']) {
assert.match(list, new RegExp(klass))
}
@@ -131,7 +131,7 @@ test('the old closure-based column implementation is gone from core-hooks', () =
const hooks = read('inc/core-hooks.php')
assert.doesNotMatch(hooks, /manage_post_posts_columns/)
assert.doesNotMatch(hooks, /manage_post_posts_custom_column/)
assert.doesNotMatch(hooks, /aksrt_stats/)
assert.doesNotMatch(hooks, /jio_stats/)
})
test('PostListEnhance is wired up from functions.php', () => {