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
@@ -8,42 +8,42 @@ const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
|
||||
|
||||
test('badges use server-rendered admin-ajax modal actions only', () => {
|
||||
const badges = read('src/User/Badges.php');
|
||||
const identity = read('inc/helpers/aksrt-identity.php');
|
||||
const identity = read('inc/helpers/jio-identity.php');
|
||||
const scripts = read('src/Core/ScriptsPart1b.php');
|
||||
|
||||
for (const action of [
|
||||
'aksrt_user_medal_info_modal',
|
||||
'aksrt_single_medal_info_modal',
|
||||
'aksrt_user_medal_manually_add_modal',
|
||||
'aksrt_user_medal_wear',
|
||||
'aksrt_user_medal_manually_add',
|
||||
'aksrt_user_medal_manually_remove',
|
||||
'jio_user_medal_info_modal',
|
||||
'jio_single_medal_info_modal',
|
||||
'jio_user_medal_manually_add_modal',
|
||||
'jio_user_medal_wear',
|
||||
'jio_user_medal_manually_add',
|
||||
'jio_user_medal_manually_remove',
|
||||
]) {
|
||||
assert.match(badges, new RegExp(`wp_ajax_${action}`));
|
||||
}
|
||||
assert.match(badges, /wp_ajax_nopriv_aksrt_user_medal_info_modal/);
|
||||
assert.match(badges, /wp_ajax_nopriv_aksrt_single_medal_info_modal/);
|
||||
assert.match(identity, /data-aksrt-modal-cache="false"/);
|
||||
assert.match(identity, /data-aksrt-modal-loading="spinner"/);
|
||||
assert.match(identity, /data-aksrt-modal-swipe-close="true"/);
|
||||
assert.match(badges, /wp_ajax_nopriv_jio_user_medal_info_modal/);
|
||||
assert.match(badges, /wp_ajax_nopriv_jio_single_medal_info_modal/);
|
||||
assert.match(identity, /data-jio-modal-cache="false"/);
|
||||
assert.match(identity, /data-jio-modal-loading="spinner"/);
|
||||
assert.match(identity, /data-jio-modal-swipe-close="true"/);
|
||||
assert.match(identity, /admin-ajax\.php/);
|
||||
assert.match(identity, /aksrt-badge-modal--overview/);
|
||||
assert.match(identity, /aksrt-badge-modal--grant/);
|
||||
assert.match(badges, /aksrt-badge-modal--single/);
|
||||
assert.match(badges, /data-aksrt-modal-loading="spinner"/);
|
||||
assert.match(badges, /data-aksrt-modal-swipe-close="true"/);
|
||||
assert.doesNotMatch(identity, /data-aksrt-modal-class="full-sm"/);
|
||||
assert.doesNotMatch(badges, /data-aksrt-modal-class="modal-mini"/);
|
||||
assert.match(identity, /jio-badge-modal--overview/);
|
||||
assert.match(identity, /jio-badge-modal--grant/);
|
||||
assert.match(badges, /jio-badge-modal--single/);
|
||||
assert.match(badges, /data-jio-modal-loading="spinner"/);
|
||||
assert.match(badges, /data-jio-modal-swipe-close="true"/);
|
||||
assert.doesNotMatch(identity, /data-jio-modal-class="full-sm"/);
|
||||
assert.doesNotMatch(badges, /data-jio-modal-class="modal-mini"/);
|
||||
assert.match(scripts, /user-badge-actions\.js/);
|
||||
assert.doesNotMatch(scripts, /user-badges\.js/);
|
||||
assert.doesNotMatch(badges, /register_rest_route|rest_wear|rest_list|rest_grant|rest_revoke/);
|
||||
assert.doesNotMatch(identity, /data-aksrt-badges-open|data-aksrt-badges-can-wear/);
|
||||
assert.doesNotMatch(identity, /data-jio-badges-open|data-jio-badges-can-wear/);
|
||||
});
|
||||
|
||||
test('badge mutations enforce the public nonce, login, ownership, and manual grant rules', () => {
|
||||
const badges = read('src/User/Badges.php');
|
||||
|
||||
assert.match(badges, /ajax_nonce\(\): string \{ return 'aksrt_public_nonce'; \}/);
|
||||
assert.match(badges, /ajax_nonce\(\): string \{ return 'jio_public_nonce'; \}/);
|
||||
assert.match(badges, /wp_verify_nonce\(\$nonce, self::ajax_nonce\(\)\)/);
|
||||
assert.match(badges, /if \(!is_user_logged_in\(\)\) self::ajax_error/);
|
||||
assert.match(badges, /if \(\$operation !== 'wear' && !self::can_manually_set\(\)\)/);
|
||||
@@ -56,13 +56,13 @@ test('badge mutations enforce the public nonce, login, ownership, and manual gra
|
||||
test('badge actions close their HTML dialog without reloading the page', () => {
|
||||
const actions = read('assets/js/user-badge-actions.js');
|
||||
|
||||
assert.match(actions, /aksrt_user_medal_wear/);
|
||||
assert.match(actions, /aksrt_user_medal_manually_add/);
|
||||
assert.match(actions, /aksrt_user_medal_manually_remove/);
|
||||
assert.match(actions, /AksrtModalRuntime\.close\('badge-action'\)/);
|
||||
assert.match(actions, /jio_user_medal_wear/);
|
||||
assert.match(actions, /jio_user_medal_manually_add/);
|
||||
assert.match(actions, /jio_user_medal_manually_remove/);
|
||||
assert.match(actions, /JioModalRuntime\.close\('badge-action'\)/);
|
||||
assert.match(actions, /getActive\(\) === modal/);
|
||||
assert.doesNotMatch(actions, /window\.location\.reload|setTimeout/);
|
||||
assert.doesNotMatch(actions, /AksrtRequest|fetchJson|restUrl/);
|
||||
assert.doesNotMatch(actions, /JioRequest|fetchJson|restUrl/);
|
||||
});
|
||||
|
||||
test('the retired badge rollout and JSON modal CSS are absent', () => {
|
||||
|
||||
Reference in new issue
Block a user