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
@@ -20,14 +20,14 @@ function walk(dir, exts, out = []) {
|
||||
return out;
|
||||
}
|
||||
|
||||
test('n-color-picker is used only inside the shared AksColorPicker', () => {
|
||||
test('n-color-picker is used only inside the shared JioColorPicker', () => {
|
||||
const offenders = walk('assets/admin/src', ['.vue', '.js'])
|
||||
.filter((file) => /n-color-picker|NColorPicker/.test(read(file)))
|
||||
.map((file) => file.replace(/\\/g, '/'));
|
||||
assert.deepEqual(offenders, ['assets/admin/src/components/form/AksColorPicker.vue']);
|
||||
assert.deepEqual(offenders, ['assets/admin/src/components/form/JioColorPicker.vue']);
|
||||
});
|
||||
|
||||
test('PHP color sanitizing goes through AKSRT\\Core\\Color only', () => {
|
||||
test('PHP color sanitizing goes through Jio\\Core\\Color only', () => {
|
||||
const offenders = [...walk('src', ['.php']), ...walk('inc', ['.php'])]
|
||||
.filter((file) => /sanitize_hex_color\(|rgba\?\\\(/.test(read(file)))
|
||||
.map((file) => file.replace(/\\/g, '/'))
|
||||
@@ -38,15 +38,15 @@ test('PHP color sanitizing goes through AKSRT\\Core\\Color only', () => {
|
||||
test('schema color fields sanitize via Color with showAlpha opt-in', () => {
|
||||
const provider = read('src/Admin/SchemaProvider.php');
|
||||
assert.match(provider, /'color'\s*=>\s*'color'/);
|
||||
assert.match(provider, /case 'color_alpha':\s*return \\AKSRT\\Core\\Color::sanitize\(\$value, true\)/);
|
||||
assert.match(provider, /case 'color_alpha':\s*return \\Jio\\Core\\Color::sanitize\(\$value, true\)/);
|
||||
assert.match(provider, /showAlpha/);
|
||||
const field = read('assets/admin/src/components/form/AksField.vue');
|
||||
assert.match(field, /<AksColorPicker[\s\S]*?:alpha="!!schema\.showAlpha"/);
|
||||
const field = read('assets/admin/src/components/form/JioField.vue');
|
||||
assert.match(field, /<JioColorPicker[\s\S]*?:alpha="!!schema\.showAlpha"/);
|
||||
});
|
||||
|
||||
test('dead composite branches are gone', () => {
|
||||
const composite = read('assets/admin/src/components/form/AksCompositeField.vue');
|
||||
assert.doesNotMatch(composite, /'dimensions'|'spacing'|'background'|AksMediaField/);
|
||||
const composite = read('assets/admin/src/components/form/JioCompositeField.vue');
|
||||
assert.doesNotMatch(composite, /'dimensions'|'spacing'|'background'|JioMediaField/);
|
||||
assert.doesNotMatch(read('assets/js/gutenberg-blocks.js'), /ColorPicker/);
|
||||
});
|
||||
|
||||
@@ -61,7 +61,7 @@ test('JS normalizeColor mirrors PHP Color::sanitize', async () => {
|
||||
['red', true], ['', true], [' #FFF ', false],
|
||||
];
|
||||
const php = `require 'src/Core/Color.php';`
|
||||
+ `foreach (json_decode($argv[1], true) as [$v, $a]) { echo AKSRT\\Core\\Color::sanitize($v, $a), "\\n"; }`;
|
||||
+ `foreach (json_decode($argv[1], true) as [$v, $a]) { echo Jio\\Core\\Color::sanitize($v, $a), "\\n"; }`;
|
||||
const out = execFileSync('php', ['-d', 'display_errors=1', '-r', `define('ABSPATH', '/');${php}`, JSON.stringify(cases)], {
|
||||
cwd: root,
|
||||
encoding: 'utf8',
|
||||
@@ -71,17 +71,17 @@ test('JS normalizeColor mirrors PHP Color::sanitize', async () => {
|
||||
|
||||
test('widget background color input is wpColorPicker-enhanced like top-level color fields', () => {
|
||||
const renderer = read('src/WidgetSystem/FormRenderer.php');
|
||||
assert.match(renderer, /\$key \. '\[color\]'[^\n]+'widefat aksrt-widget-color'\)/);
|
||||
assert.match(renderer, /\$key \. '\[color\]'[^\n]+'widefat jio-widget-color'\)/);
|
||||
assert.match(renderer, /class="' \. esc_attr\(\$class\) \. '"/);
|
||||
assert.match(read('assets/widgets/admin.js'), /\.aksrt-widget-color'\)\.wpColorPicker\(\)/);
|
||||
assert.match(read('assets/widgets/admin.js'), /\.jio-widget-color'\)\.wpColorPicker\(\)/);
|
||||
});
|
||||
|
||||
test('page config nav color uses wpColorPicker instead of native input[type=color]', () => {
|
||||
const metaBox = read('src/Admin/PageConfigMetaBox.php');
|
||||
assert.doesNotMatch(metaBox, /type="color"/);
|
||||
assert.match(metaBox, /class="aksrt-page-config-color" type="text" name="page_config\[header_slider_nav_color\]"/);
|
||||
assert.match(metaBox, /class="jio-page-config-color" type="text" name="page_config\[header_slider_nav_color\]"/);
|
||||
assert.match(metaBox, /wp_enqueue_script\('wp-color-picker'\)/);
|
||||
assert.match(metaBox, /\.aksrt-page-config-color'\)\.wpColorPicker\(\)/);
|
||||
assert.match(metaBox, /\.jio-page-config-color'\)\.wpColorPicker\(\)/);
|
||||
assert.match(metaBox, /Color::sanitize\(\(string\) \(\$raw\['header_slider_nav_color'\]/);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user