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
@@ -18,13 +18,13 @@ test('captcha exchange binds provider tokens to scene browser and one-time busin
|
||||
const module = read('inc/modules/captcha.php');
|
||||
const front = read('assets/js/captcha-front.js');
|
||||
assert.match(module, /\/captcha\/exchange/);
|
||||
assert.match(module, /aksrt_captcha_issue_challenge/);
|
||||
assert.match(module, /aksrt_captcha_validate_challenge/);
|
||||
assert.match(module, /aksrt_captcha_issue_proof/);
|
||||
assert.match(module, /aksrt_captcha_consume_proof/);
|
||||
assert.match(module, /jio_captcha_issue_challenge/);
|
||||
assert.match(module, /jio_captcha_validate_challenge/);
|
||||
assert.match(module, /jio_captcha_issue_proof/);
|
||||
assert.match(module, /jio_captcha_consume_proof/);
|
||||
assert.match(module, /browser_hash/);
|
||||
assert.match(front, /exchange_url/);
|
||||
assert.match(front, /aksrt_captcha_proof/);
|
||||
assert.match(front, /jio_captcha_proof/);
|
||||
assert.match(front, /runLocked/);
|
||||
});
|
||||
|
||||
@@ -32,24 +32,24 @@ test('captcha defaults are opt-in and provider metadata is centralized', () => {
|
||||
const module = read('inc/modules/captcha.php');
|
||||
const phpSchema = read('src/Admin/Schema/SchemaPermissions.php');
|
||||
const uiSchema = read('assets/admin/src/schema/sections/permissions/index.js');
|
||||
assert.match(module, /function aksrt_captcha_provider_metadata/);
|
||||
assert.match(module, /function jio_captcha_provider_metadata/);
|
||||
assert.match(module, /'enabled_scenarios'\s*=>\s*\[\]/);
|
||||
assert.match(phpSchema, /'default'\s*=>\s*\[\]/);
|
||||
assert.match(uiSchema, /enabled_scenarios:\s*\[\]/);
|
||||
assert.match(phpSchema, /aksrt_captcha_provider_metadata/);
|
||||
assert.match(phpSchema, /jio_captcha_provider_metadata/);
|
||||
});
|
||||
|
||||
test('captcha verification is fail-closed with a true-or-WP_Error contract', () => {
|
||||
const module = read('inc/modules/captcha.php');
|
||||
assert.match(module, /return aksrt_captcha_error\('aksrt_captcha_config'/);
|
||||
assert.match(module, /return jio_captcha_error\('jio_captcha_config'/);
|
||||
assert.match(module, /@return true\|\\WP_Error/);
|
||||
assert.doesNotMatch(module, /is_wp_error\(\$result\) \? \$result->get_error_message\(\) : true/);
|
||||
});
|
||||
|
||||
test('cloudflare siteverify performs one request and strictly binds action, cdata, and hostname', () => {
|
||||
const module = read('inc/modules/captcha.php');
|
||||
const start = module.indexOf('function aksrt_verify_cloudflare');
|
||||
const end = module.indexOf('function aksrt_verify_geetest', start);
|
||||
const start = module.indexOf('function jio_verify_cloudflare');
|
||||
const end = module.indexOf('function jio_verify_geetest', start);
|
||||
const cloudflare = module.slice(start, end);
|
||||
assert.equal((cloudflare.match(/wp_remote_post\(/g) || []).length, 1);
|
||||
assert.match(cloudflare, /array_key_exists\('action'/);
|
||||
@@ -72,7 +72,7 @@ test('nested captcha secrets are masked, preserved, explicitly clearable, and ex
|
||||
assert.match(provider, /merge_captcha_provider_config/);
|
||||
assert.match(provider, /\$value === '' \|\| \$value === '\*\*\*'/);
|
||||
assert.match(settings, /SCHEMA_MANAGED_STANDALONE_OPTION_KEYS/);
|
||||
assert.match(settings, /'aksrt_captcha_config'/);
|
||||
assert.match(settings, /'jio_captcha_config'/);
|
||||
assert.match(page, /captchaSecretsToClear/);
|
||||
assert.match(page, /clear-secret/);
|
||||
});
|
||||
@@ -82,10 +82,10 @@ test('admin captcha test obtains a frontend token then calls the protected serve
|
||||
const api = read('assets/admin/src/api/modules/schema.js');
|
||||
const page = read('assets/admin/src/pages/SchemaPage.vue');
|
||||
assert.match(controller, /'\/captcha\/test'/);
|
||||
assert.match(controller, /aksrt_verify_captcha_provider/);
|
||||
assert.match(controller, /jio_verify_captcha_provider/);
|
||||
assert.match(api, /testCaptcha\(provider, token\)/);
|
||||
assert.match(page, /submitCaptchaTest/);
|
||||
assert.match(page, /action:\s*'aksrt-admin-test'/);
|
||||
assert.match(page, /action:\s*'jio-admin-test'/);
|
||||
assert.match(page, /cdata:\s*'admin-captcha-test'/);
|
||||
assert.doesNotMatch(page, /配置正确/);
|
||||
});
|
||||
@@ -111,25 +111,25 @@ test('cloud captcha verify requests use a 5s timeout and log raw failures', () =
|
||||
for (const timeout of timeouts) {
|
||||
assert.strictEqual(timeout, 5);
|
||||
}
|
||||
assert.match(module, /error_log\('\[AKSRT Captcha\]/);
|
||||
assert.match(module, /error_log\('\[Jio Captcha\]/);
|
||||
});
|
||||
|
||||
test('business requests consume one-time proofs without a shared download bypass', () => {
|
||||
const module = read('inc/modules/captcha.php');
|
||||
assert.match(module, /aksrt_captcha_consume_proof/);
|
||||
assert.doesNotMatch(module, /aksrt_captcha_pass_ttl|aksrt_captcha_pass_key|aksrt_captcha_pass_/);
|
||||
assert.match(module, /jio_captcha_consume_proof/);
|
||||
assert.doesNotMatch(module, /jio_captcha_pass_ttl|jio_captcha_pass_key|jio_captcha_pass_/);
|
||||
});
|
||||
|
||||
test('cloudflare siteverify stays bound to the aksrt action and scene', () => {
|
||||
test('cloudflare siteverify stays bound to the jio action and scene', () => {
|
||||
const module = read('inc/modules/captcha.php');
|
||||
assert.match(module, /aksrt_verify_cloudflare\(array \$pcfg, array \$post_data, string \$client_ip, string \$scene = ''(?:, string \$action = 'aksrt-verify')?\)/);
|
||||
assert.match(module, /jio_verify_cloudflare\(array \$pcfg, array \$post_data, string \$client_ip, string \$scene = ''(?:, string \$action = 'jio-verify')?\)/);
|
||||
assert.match(module, /action mismatch/);
|
||||
assert.match(module, /cdata mismatch/);
|
||||
});
|
||||
|
||||
test('captcha render is a data-driven mount without inline scripts or stylesheets', () => {
|
||||
const module = read('inc/modules/captcha.php');
|
||||
assert.match(module, /data-aksrt-captcha-config/);
|
||||
assert.match(module, /data-jio-captcha-config/);
|
||||
assert.doesNotMatch(module, /<script|<link rel/);
|
||||
});
|
||||
|
||||
@@ -143,17 +143,17 @@ test('captcha front runtime ships inside the public bundle', () => {
|
||||
assert.match(build, /'assets\/js\/captcha-front\.js'/);
|
||||
assert.match(build, /'assets\/css\/shared\/captcha\.css'/);
|
||||
const front = read('assets/js/captcha-front.js');
|
||||
assert.match(front, /AKSRTCaptcha/);
|
||||
assert.match(front, /data-aksrt-captcha-config/);
|
||||
assert.match(front, /JioCaptcha/);
|
||||
assert.match(front, /data-jio-captcha-config/);
|
||||
assert.match(front, /cdata: C\.scene/, 'turnstile widget must bind cdata to the scene');
|
||||
});
|
||||
|
||||
test('captcha public runtime exposes only the shared API and resolves scoped uid instances', () => {
|
||||
const front = read('assets/js/captcha-front.js');
|
||||
assert.match(front, /window\.AKSRTCaptcha\s*=\s*Object\.freeze\(\{[\s\S]*verify:\s*verify,[\s\S]*collect:\s*collect,[\s\S]*reset:\s*reset,[\s\S]*run:\s*run,[\s\S]*TOKEN_FIELDS:\s*TOKEN_FIELDS/);
|
||||
assert.match(front, /window\.JioCaptcha\s*=\s*Object\.freeze\(\{[\s\S]*verify:\s*verify,[\s\S]*collect:\s*collect,[\s\S]*reset:\s*reset,[\s\S]*run:\s*run,[\s\S]*TOKEN_FIELDS:\s*TOKEN_FIELDS/);
|
||||
assert.match(front, /instances\[instance\.uid\]\s*=\s*instance/);
|
||||
assert.match(front, /function resolve\(scene, scope\)/);
|
||||
assert.doesNotMatch(front, /AKSRTCaptchaState/);
|
||||
assert.doesNotMatch(front, /JioCaptchaState/);
|
||||
assert.doesNotMatch(front, /tencent_sid/);
|
||||
});
|
||||
|
||||
@@ -166,9 +166,9 @@ test('captcha consumers use the shared API and reset every token-bearing request
|
||||
'assets/js/signin.js',
|
||||
'assets/js/front-submit.js',
|
||||
].map(read).join('\n');
|
||||
assert.match(consumers, /AKSRTCaptcha\.run|captcha\.run/);
|
||||
assert.match(consumers, /AKSRTCaptcha\.reset|captcha\.reset|resetCaptcha/);
|
||||
assert.doesNotMatch(consumers, /AKSRTCaptchaState/);
|
||||
assert.match(consumers, /JioCaptcha\.run|captcha\.run/);
|
||||
assert.match(consumers, /JioCaptcha\.reset|captcha\.reset|resetCaptcha/);
|
||||
assert.doesNotMatch(consumers, /JioCaptchaState/);
|
||||
assert.doesNotMatch(consumers, /tencent_sid/);
|
||||
assert.doesNotMatch(read('assets/js/core/comments.js'), /wp-comments-post|performLegacySubmit/);
|
||||
});
|
||||
@@ -177,10 +177,10 @@ test('sign-in waits for main and fails closed when its enabled captcha mount is
|
||||
const signin = read('assets/js/signin.js');
|
||||
const scripts = read('src/Core/ScriptsPart1c.php');
|
||||
assert.match(signin, /tbquire\(\['main'\], boot\)/);
|
||||
assert.match(signin, /var captchaRequired = !!window\.aksrtData\.captchaSignin/);
|
||||
assert.match(signin, /var captchaRequired = !!window\.jioData\.captchaSignin/);
|
||||
assert.match(signin, /captchaRequired && \(!captcha \|\| !mount\)[\s\S]*?return;/);
|
||||
assert.doesNotMatch(signin, /captcha \? captcha\.run\('signin', mount\) : Promise\.resolve\(\{\}\)/);
|
||||
assert.match(scripts, /'captchaSignin'\s*=>\s*function_exists\('aksrt_is_captcha_enabled_for'\)\s*&&\s*aksrt_is_captcha_enabled_for\('signin'\)/);
|
||||
assert.match(scripts, /'captchaSignin'\s*=>\s*function_exists\('jio_is_captcha_enabled_for'\)\s*&&\s*jio_is_captcha_enabled_for\('signin'\)/);
|
||||
});
|
||||
|
||||
test('auth and account security flows consume fresh captcha tickets', () => {
|
||||
|
||||
Reference in new issue
Block a user