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
@@ -9,7 +9,7 @@ const read = file => fs.readFileSync(path.join(root, file), 'utf8')
|
||||
const list = read('src/Admin/Native/PostListEnhance.php')
|
||||
const fields = read('src/Admin/Native/PostListEditFields.php')
|
||||
const domain = read('src/Core/DomainModel.php')
|
||||
const pay = read('inc/helpers/aksrt-pay.php')
|
||||
const pay = read('inc/helpers/jio-pay.php')
|
||||
const metabox = read('src/Core/PostMetaBox.php')
|
||||
const resourceBox = read('src/Core/ResourceMetaBox.php')
|
||||
|
||||
@@ -19,7 +19,7 @@ test('quick and bulk edit boxes hook the post list with no topics column', () =>
|
||||
assert.match(list, /bulk_edit_custom_box/)
|
||||
assert.match(list, /COLUMN_STATS/)
|
||||
// 代码里不得再出现专题分类法列(类文档块的说明除外,只看 namespace 之后的部分)。
|
||||
const code = list.slice(list.indexOf('namespace AKSRT'))
|
||||
const code = list.slice(list.indexOf('namespace Jio'))
|
||||
assert.doesNotMatch(code, /taxonomy-topics/)
|
||||
assert.doesNotMatch(code, /topics/)
|
||||
})
|
||||
@@ -37,9 +37,9 @@ test('every quick-edit field group is rendered', () => {
|
||||
assert.match(fields, /function pay\(string \$currency\): array/)
|
||||
})
|
||||
|
||||
test('quick-edit inputs are namespaced under aksrt_bulk_edit', () => {
|
||||
// 字段名统一 aksrt_bulk_edit[{id}][{field}],避免与 WP 原生数据冲突。
|
||||
assert.match(list, /aksrt_bulk_edit\[' \. \$id \. '\]\[' \. \$field\['id'\] \. '\]/)
|
||||
test('quick-edit inputs are namespaced under jio_bulk_edit', () => {
|
||||
// 字段名统一 jio_bulk_edit[{id}][{field}],避免与 WP 原生数据冲突。
|
||||
assert.match(list, /jio_bulk_edit\[' \. \$id \. '\]\[' \. \$field\['id'\] \. '\]/)
|
||||
// number 类型带运算子字段。
|
||||
assert.match(list, /\[operation\]/)
|
||||
assert.match(list, /\[val\]/)
|
||||
@@ -63,7 +63,7 @@ test('field-group descriptions are emitted as pre-escaped HTML', () => {
|
||||
assert.doesNotMatch(list, /esc_html\(\$desc\)/)
|
||||
// 两个调用点都必须自带转义/HTML 包裹,不能传裸翻译串。
|
||||
assert.match(list, /'<div class="c-yellow">' \. esc_html__\('批量设置付费参数/)
|
||||
assert.match(list, /'<div class="px12 aksrt-bulk-edit-desc">' \. esc_html__\('让文章实现更加精细化/)
|
||||
assert.match(list, /'<div class="px12 jio-bulk-edit-desc">' \. esc_html__\('让文章实现更加精细化/)
|
||||
// 仍来自设置项的字段标题必须保持转义。
|
||||
assert.match(list, /esc_html\(\$title_html\)/)
|
||||
})
|
||||
@@ -84,7 +84,7 @@ test('interaction quick-edit fields write to the keys the theme reads', () => {
|
||||
assert.match(fields, /'views'/)
|
||||
assert.match(fields, /'like'/)
|
||||
assert.match(metabox, /DomainModel::POST_VIEW_COUNT_KEY, max\(0, \(int\) \(\$raw\['views'\]/)
|
||||
assert.match(metabox, /'_aksrt_like_count', max\(0, \(int\) \(\$raw\['like'\]/)
|
||||
assert.match(metabox, /'_jio_like_count', max\(0, \(int\) \(\$raw\['like'\]/)
|
||||
// 保存侧按这两个键分流到统计 meta。
|
||||
assert.match(list, /stats_meta_key/)
|
||||
})
|
||||
@@ -97,14 +97,14 @@ test('article config quick-edit fields match the extension meta box keys', () =>
|
||||
|
||||
// 布局取值白名单:metabox 的 sanitize 是裸数组,快捷编辑提供同四值的单选。
|
||||
assert.match(metabox, /\['false', 'no_sidebar', 'sidebar_left', 'sidebar_right'\]/)
|
||||
assert.match(fields, /'false'\s+=> __\('跟随主题', 'aksrt'\)/)
|
||||
assert.match(fields, /'no_sidebar'\s+=> __\('无侧边栏', 'aksrt'\)/)
|
||||
assert.match(fields, /'sidebar_left'\s+=> __\('侧边栏靠左', 'aksrt'\)/)
|
||||
assert.match(fields, /'sidebar_right'\s+=> __\('侧边栏靠右', 'aksrt'\)/)
|
||||
assert.match(fields, /'false'\s+=> __\('跟随主题', 'jio'\)/)
|
||||
assert.match(fields, /'no_sidebar'\s+=> __\('无侧边栏', 'jio'\)/)
|
||||
assert.match(fields, /'sidebar_left'\s+=> __\('侧边栏靠左', 'jio'\)/)
|
||||
assert.match(fields, /'sidebar_right'\s+=> __\('侧边栏靠右', 'jio'\)/)
|
||||
// 保存侧再用同一份白名单收敛,避免快捷编辑写入未知布局。
|
||||
assert.match(list, /\['false', 'no_sidebar', 'sidebar_left', 'sidebar_right'\]/)
|
||||
|
||||
// 落到 aksrt_post_meta 这个共享 bag 上,与 metabox 同一键(self::META_KEY)。
|
||||
// 落到 jio_post_meta 这个共享 bag 上,与 metabox 同一键(self::META_KEY)。
|
||||
assert.match(metabox, /post_meta/)
|
||||
assert.match(list, /PostMetaBox::META_KEY/)
|
||||
})
|
||||
@@ -133,16 +133,16 @@ test('pay quick-edit save sanitizes through the shared sanitizer', () => {
|
||||
assert.match(persist, /self::PAY_TYPE_KEY/)
|
||||
assert.match(persist, /self::PAY_PRICE_KEY/)
|
||||
assert.match(persist, /self::RESOURCE_MARKER_KEY/)
|
||||
// _aksrt_pay_modo / _aksrt_pay_limit 没有任何读取方,已删除,不得再写。
|
||||
assert.doesNotMatch(list, /'_aksrt_pay_modo'|'_aksrt_pay_limit'/)
|
||||
assert.doesNotMatch(resourceBox, /'_aksrt_pay_modo'|'_aksrt_pay_limit'/)
|
||||
// _jio_pay_modo / _jio_pay_limit 没有任何读取方,已删除,不得再写。
|
||||
assert.doesNotMatch(list, /'_jio_pay_modo'|'_jio_pay_limit'/)
|
||||
assert.doesNotMatch(resourceBox, /'_jio_pay_modo'|'_jio_pay_limit'/)
|
||||
})
|
||||
|
||||
test('pay prices go through the ledger, not raw floats', () => {
|
||||
// 金额字段运算在「分」上进行,避免浮点误差。
|
||||
assert.match(list, /balance_minor|price_to_minor/)
|
||||
assert.match(list, /decimal_from_minor/)
|
||||
assert.match(list, /\$pay_meta\[\$field_id\] = \\AKSRT\\Ledger\\AssetAmount::decimal_from_minor/)
|
||||
assert.match(list, /\$pay_meta\[\$field_id\] = \\Jio\\Ledger\\AssetAmount::decimal_from_minor/)
|
||||
})
|
||||
|
||||
test('quick-edit save ignores invalid operations and clamps negatives', () => {
|
||||
@@ -162,8 +162,8 @@ test('custom filter quick-edit fields reuse the settings dimensions', () => {
|
||||
// 高级筛选项从同一份设置里动态生成,键名前缀与 metabox 保存一致。
|
||||
assert.match(list, /get_post_filter_settings/)
|
||||
assert.match(list, /custom_filter/)
|
||||
assert.match(list, /'_aksrt_cf_' \. \$field_id/)
|
||||
assert.match(metabox, /'_aksrt_cf_' \. \$key/)
|
||||
assert.match(list, /'_jio_cf_' \. \$field_id/)
|
||||
assert.match(metabox, /'_jio_cf_' \. \$key/)
|
||||
})
|
||||
|
||||
test('quick-edit save is guarded by screen, autosave, revision and capability', () => {
|
||||
@@ -191,19 +191,19 @@ test('the old inline column code was fully migrated', () => {
|
||||
assert.doesNotMatch(hooks, /manage_post_posts_columns/)
|
||||
assert.doesNotMatch(hooks, /manage_post_posts_custom_column/)
|
||||
assert.doesNotMatch(hooks, /manage_edit-post_sortable_columns/)
|
||||
assert.doesNotMatch(hooks, /aksrt_enqueue_fontawesome/)
|
||||
assert.doesNotMatch(hooks, /aksrt_stats/)
|
||||
assert.doesNotMatch(hooks, /jio_enqueue_fontawesome/)
|
||||
assert.doesNotMatch(hooks, /jio_stats/)
|
||||
})
|
||||
|
||||
test('the dead tab-pane and modal css blocks are removed', () => {
|
||||
// 这些选择器无任何引用,已确认删除;文件仍保留 quick-edit 需要的轮子类。
|
||||
const css = read('assets/css/admin-main.css')
|
||||
assert.doesNotMatch(css, /aksrt-tab-pane/)
|
||||
assert.doesNotMatch(css, /\.aksrt-modal\b/)
|
||||
assert.doesNotMatch(css, /\.aksrt-modal-backdrop\b/)
|
||||
assert.doesNotMatch(css, /jio-tab-pane/)
|
||||
assert.doesNotMatch(css, /\.jio-modal\b/)
|
||||
assert.doesNotMatch(css, /\.jio-modal-backdrop\b/)
|
||||
// 快捷编辑卡片与依赖样式仍在。
|
||||
assert.match(css, /\.aksrt-bulk-edit-box/)
|
||||
assert.match(css, /\.aksrt-bulk-edit-desc/)
|
||||
assert.match(css, /\.jio-bulk-edit-box/)
|
||||
assert.match(css, /\.jio-bulk-edit-desc/)
|
||||
assert.match(css, /\.flex\s*\{/)
|
||||
})
|
||||
|
||||
@@ -211,6 +211,6 @@ test('the quick-edit dependency script exists and toggles by data-dependency', (
|
||||
assert.ok(fs.existsSync(path.join(root, 'assets/js/admin-post-list.js')))
|
||||
const js = read('assets/js/admin-post-list.js')
|
||||
assert.match(js, /data-dependency/)
|
||||
assert.match(js, /aksrt_bulk_edit\[pay\]/)
|
||||
assert.match(js, /jio_bulk_edit\[pay\]/)
|
||||
assert.match(js, /inline-edit-row/)
|
||||
})
|
||||
Reference in new issue
Block a user