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
@@ -22,27 +22,27 @@ test('universal icon picker ships catalog data for the bundled FA5 fonts', () =>
|
||||
|
||||
test('icon catalog REST route is registered with permission + sprite single source', () => {
|
||||
const admin = read('src/Admin/Admin.php');
|
||||
assert.match(admin, /\AKSRT\\Icons\\IconController::class/);
|
||||
assert.match(admin, /\Jio\\Icons\\IconController::class/);
|
||||
const controller = read('src/Icons/IconController.php');
|
||||
assert.match(controller, /\/icons\/catalog/);
|
||||
assert.match(controller, /permission_callback.*check_permission/s);
|
||||
const catalog = read('src/Icons/IconCatalog.php');
|
||||
assert.match(catalog, /svg-icon\.js/);
|
||||
assert.match(catalog, /aksrt_svgs/);
|
||||
assert.match(catalog, /jio_svgs/);
|
||||
assert.match(catalog, /fa5-icons\.php/);
|
||||
});
|
||||
|
||||
test('widget and nav-menu icon fields render the shared picker', () => {
|
||||
const formRenderer = read('src/WidgetSystem/FormRenderer.php');
|
||||
assert.match(formRenderer, /case 'icon':\s*\n\s*echo aksrt_icon_picker_field\(\$field_name, \$field_id, \(string\) \$value\);/);
|
||||
assert.doesNotMatch(formRenderer, /aksrt-widget-icon/);
|
||||
assert.match(formRenderer, /case 'icon':\s*\n\s*echo jio_icon_picker_field\(\$field_name, \$field_id, \(string\) \$value\);/);
|
||||
assert.doesNotMatch(formRenderer, /jio-widget-icon/);
|
||||
const adminForm = read('src/WidgetSystem/AdminFormController.php');
|
||||
assert.match(adminForm, /aksrt_icon_picker_assets\(/);
|
||||
assert.match(adminForm, /jio_icon_picker_assets\(/);
|
||||
const navMenu = read('src/Admin/NavMenuOptions.php');
|
||||
assert.match(navMenu, /aksrt_icon_picker_field\(/);
|
||||
assert.match(navMenu, /aksrt_sanitize_icon_value\(\(string\) \(\$raw\['icon'\] \?\? ''\)\)/);
|
||||
const helper = read('inc/helpers/aksrt-icon-picker.php');
|
||||
for (const token of ['function aksrt_icon_picker_assets', 'function aksrt_icon_picker_field', 'id="aksrt-modal-icon"', 'aksrt-icon-picker__value']) {
|
||||
assert.match(navMenu, /jio_icon_picker_field\(/);
|
||||
assert.match(navMenu, /jio_sanitize_icon_value\(\(string\) \(\$raw\['icon'\] \?\? ''\)\)/);
|
||||
const helper = read('inc/helpers/jio-icon-picker.php');
|
||||
for (const token of ['function jio_icon_picker_assets', 'function jio_icon_picker_field', 'id="jio-modal-icon"', 'jio-icon-picker__value']) {
|
||||
assert.match(helper, new RegExp(token));
|
||||
}
|
||||
assert.match(helper, /assets\/js\/runtime\/svg-icon\.js/, 'admin previews reuse the frontend sprite');
|
||||
@@ -50,7 +50,7 @@ test('widget and nav-menu icon fields render the shared picker', () => {
|
||||
|
||||
test('picker JS composes the three value formats and loads the REST catalog', () => {
|
||||
const js = read('assets/js/admin-icon-picker.js');
|
||||
for (const token of ['X-WP-Nonce', 'customsvg-', 'zibsvg-', '`fa ${group.id} fa-${name}`', 'data-aksrt-icon-picker', 'aksrt-icon-picker__value']) {
|
||||
for (const token of ['X-WP-Nonce', 'customsvg-', 'zibsvg-', '`fa ${group.id} fa-${name}`', 'data-jio-icon-picker', 'jio-icon-picker__value']) {
|
||||
assert.match(js, new RegExp(token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
|
||||
}
|
||||
assert.match(js, /DOMParser/, 'custom SVG is sanitized client side');
|
||||
@@ -59,39 +59,39 @@ test('picker JS composes the three value formats and loads the REST catalog', ()
|
||||
// Tab/search switching toggles the [hidden] attribute; without this guard
|
||||
// the explicit display rules on grids/items override it and every group
|
||||
// stays visible, so the tab bar appears dead.
|
||||
assert.match(read(cssPath), /#aksrt-modal-icon \[hidden]\s*\{\s*display:\s*none\s*!important/);
|
||||
assert.match(read(cssPath), /#jio-modal-icon \[hidden]\s*\{\s*display:\s*none\s*!important/);
|
||||
});
|
||||
|
||||
test('icon values sanitize through the SVG-aware helper on every save path', () => {
|
||||
const iconsHelper = read('inc/helpers/aksrt-icons.php');
|
||||
assert.match(iconsHelper, /function aksrt_sanitize_icon_value/);
|
||||
assert.match(iconsHelper, /function aksrt_icon_markup/);
|
||||
assert.match(iconsHelper, /function aksrt_enqueue_fontawesome/);
|
||||
const iconsHelper = read('inc/helpers/jio-icons.php');
|
||||
assert.match(iconsHelper, /function jio_sanitize_icon_value/);
|
||||
assert.match(iconsHelper, /function jio_icon_markup/);
|
||||
assert.match(iconsHelper, /function jio_enqueue_fontawesome/);
|
||||
assert.match(iconsHelper, /str_starts_with\(\$value, 'customsvg-'\)/);
|
||||
const schemaProvider = read('src/Admin/SchemaProvider.php');
|
||||
assert.match(schemaProvider, /'icon'\s+=>\s+'icon'/);
|
||||
assert.match(schemaProvider, /case 'icon':\s*\n\s*return function_exists\('aksrt_sanitize_icon_value'\)/);
|
||||
assert.match(schemaProvider, /case 'icon':\s*\n\s*return function_exists\('jio_sanitize_icon_value'\)/);
|
||||
const fieldSchema = read('src/WidgetSystem/FieldSchema.php');
|
||||
assert.match(fieldSchema, /case 'icon':\s*\n\s*return function_exists\('aksrt_sanitize_icon_value'\)/);
|
||||
assert.match(fieldSchema, /case 'icon':\s*\n\s*return function_exists\('jio_sanitize_icon_value'\)/);
|
||||
});
|
||||
|
||||
test('FA5 loads under a single canonical handle everywhere', () => {
|
||||
const picker = read('inc/helpers/aksrt-icon-picker.php');
|
||||
const picker = read('inc/helpers/jio-icon-picker.php');
|
||||
const admin = read('src/Admin/Admin.php');
|
||||
// 文章列表(edit.php)的 FA 入队随列增强迁到了 PostListEnhance。
|
||||
const postList = read('src/Admin/Native/PostListEnhance.php');
|
||||
const part1b = read('src/Core/ScriptsPart1b.php');
|
||||
assert.match(picker, /aksrt_enqueue_fontawesome\(\)/);
|
||||
assert.match(admin, /aksrt_enqueue_fontawesome\(\)/);
|
||||
assert.match(postList, /aksrt_enqueue_fontawesome\(\)/);
|
||||
assert.match(part1b, /aksrt_enqueue_fontawesome\(\['bootstrap'\]\)/);
|
||||
assert.match(part1b, /\['aksrt-font-awesome'\]/, 'public main css depends on the canonical handle');
|
||||
assert.match(picker, /jio_enqueue_fontawesome\(\)/);
|
||||
assert.match(admin, /jio_enqueue_fontawesome\(\)/);
|
||||
assert.match(postList, /jio_enqueue_fontawesome\(\)/);
|
||||
assert.match(part1b, /jio_enqueue_fontawesome\(\['bootstrap'\]\)/);
|
||||
assert.match(part1b, /\['jio-font-awesome'\]/, 'public main css depends on the canonical handle');
|
||||
for (const file of [picker, admin, postList, part1b]) {
|
||||
assert.doesNotMatch(file, /wp_enqueue_style\(\s*'aksrt-font-awesome'/, 'no duplicate FA registrations');
|
||||
assert.doesNotMatch(file, /wp_enqueue_style\(\s*'jio-font-awesome'/, 'no duplicate FA registrations');
|
||||
}
|
||||
// core-hooks.php 不该再自己注册或重复入队 FA。
|
||||
assert.doesNotMatch(read('inc/core-hooks.php'), /aksrt_enqueue_fontawesome|wp_enqueue_style\(\s*'aksrt-font-awesome'/);
|
||||
for (const file of ['inc/helpers/aksrt-widgets-markup.php', 'src/WidgetSystem/Renderers/ContentRenderer.php']) {
|
||||
assert.doesNotMatch(read('inc/core-hooks.php'), /jio_enqueue_fontawesome|wp_enqueue_style\(\s*'jio-font-awesome'/);
|
||||
for (const file of ['inc/helpers/jio-widgets-markup.php', 'src/WidgetSystem/Renderers/ContentRenderer.php']) {
|
||||
const source = read(file);
|
||||
assert.doesNotMatch(source, /fa-clock-o|fa-folder-open-o|fa-file-text-o/, `${file} uses FA5 names`);
|
||||
}
|
||||
@@ -119,13 +119,13 @@ test('custom settings pages and standalone save paths speak the three icon forma
|
||||
assert.match(read('assets/admin/src/components/floating/FloatMoreButtonsEditor.vue'), /import IconValue from '@\/components\/form\/IconValue\.vue'/);
|
||||
// Their REST save paths keep customsvg markup intact.
|
||||
const controller = read('src/Admin/GlobalControllerPart1.php');
|
||||
assert.match(controller, /aksrt_sanitize_icon_value\(/);
|
||||
assert.match(controller, /jio_sanitize_icon_value\(/);
|
||||
assert.doesNotMatch(controller, /preg_match\('\/\^fa\\s\+/, 'no FA-only regex gate on icon fields');
|
||||
assert.match(read('src/Settings/FloatButtons.php'), /aksrt_sanitize_icon_value\(/);
|
||||
assert.match(read('src/Settings/FloatButtons.php'), /jio_sanitize_icon_value\(/);
|
||||
// Frontend consumers render every format.
|
||||
const footer = read('footer.php');
|
||||
assert.match(footer, /aksrt_icon_markup\(\(string\) \$tab_icon\)/);
|
||||
assert.match(read('inc/helpers/aksrt-float-buttons.php'), /aksrt_icon_markup\(\(string\) \(\$opt\['icon'\]/);
|
||||
assert.match(footer, /jio_icon_markup\(\(string\) \$tab_icon\)/);
|
||||
assert.match(read('inc/helpers/jio-float-buttons.php'), /jio_icon_markup\(\(string\) \(\$opt\['icon'\]/);
|
||||
// The popover tabs must wrap instead of overflowing the panel.
|
||||
assert.match(read('assets/admin/src/components/form/FaIconPicker.vue'), /flex-wrap: wrap/);
|
||||
});
|
||||
@@ -133,12 +133,12 @@ test('custom settings pages and standalone save paths speak the three icon forma
|
||||
test('nav menu icons render every format without legacy fa-prefix mangling', () => {
|
||||
const helper = read('inc/helpers/menu-decoration.php');
|
||||
assert.match(helper, /str_starts_with\(\$icon_class, 'zibsvg-'\)/);
|
||||
assert.match(helper, /aksrt_icon_markup\(\$icon_class, 'icon mr3 menu-item-icon'\)/);
|
||||
assert.match(helper, /jio_icon_markup\(\$icon_class, 'icon mr3 menu-item-icon'\)/);
|
||||
assert.doesNotMatch(helper, /'<i class="' \. esc_attr\(\$icon_class\)/, 'no raw i-tag bypassing the unified helper');
|
||||
});
|
||||
|
||||
test('icon markup upgrades legacy FA4 values to FA5 and never emits the FA4 form', () => {
|
||||
const helper = read('inc/helpers/aksrt-icons.php');
|
||||
const helper = read('inc/helpers/jio-icons.php');
|
||||
// Bare glyph, legacy double-fa value and style-only value all normalize to FA5 solid.
|
||||
assert.match(helper, /preg_match\('\/\^fa\\s\+fa-\/i', \$value\)/, 'legacy double-fa value is detected');
|
||||
assert.match(helper, /preg_replace\('\/\^fa\\s\+\/i', 'fa fas ', \$value, 1\)/, 'legacy double-fa value upgrades to FA5');
|
||||
@@ -156,7 +156,7 @@ test('brand icons render despite the zibll-legacy fa-fab double prefix', () => {
|
||||
}
|
||||
assert.match(read('assets/css/main.min.css'), rule, 'minified main css carries the fix');
|
||||
// Empty sprite entries surface as blank picker items — none may ship.
|
||||
assert.doesNotMatch(read('assets/js/runtime/svg-icon.js'), /aksrt_svgs\['[a-zA-Z0-9_]+'\]\s*=\s*'';/);
|
||||
assert.doesNotMatch(read('assets/js/runtime/svg-icon.js'), /jio_svgs\['[a-zA-Z0-9_]+'\]\s*=\s*'';/);
|
||||
});
|
||||
|
||||
test('icon assets are consolidated and dead icon assets are gone', () => {
|
||||
|
||||
Reference in new issue
Block a user