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
@@ -35,16 +35,16 @@ const source = {
|
||||
|
||||
test('default pending filters, keyword, status views, list and pagination share one card', () => {
|
||||
const { html } = harness();
|
||||
const cardStart = html.indexOf('class="aksrt-native-card aksrt-native-card--flush aksrt-verify-list-card"');
|
||||
const dialogStart = html.indexOf('<dialog id="aksrt-verify-dialog"');
|
||||
const cardStart = html.indexOf('class="jio-native-card jio-native-card--flush jio-verify-list-card"');
|
||||
const dialogStart = html.indexOf('<dialog id="jio-verify-dialog"');
|
||||
const cardEnd = html.lastIndexOf('</section>', dialogStart);
|
||||
assert.ok(cardStart >= 0 && cardEnd > cardStart, 'verification list card wraps its content');
|
||||
const card = html.slice(cardStart, cardEnd + '</section>'.length);
|
||||
assert.equal((html.match(/aksrt-verify-list-card/g) || []).length, 1);
|
||||
for (const marker of ['class="subsubsub"', 'class="aksrt-native-filters"', 'aksrt-verify-table', 'class="tablenav bottom"']) {
|
||||
assert.equal((html.match(/jio-verify-list-card/g) || []).length, 1);
|
||||
for (const marker of ['class="subsubsub"', 'class="jio-native-filters"', 'jio-verify-table', 'class="tablenav bottom"']) {
|
||||
assert.ok(card.includes(marker), `${marker} should remain inside the list card`);
|
||||
}
|
||||
assert.match(card, /<table class="widefat fixed striped aksrt-verify-table">/);
|
||||
assert.match(card, /<table class="widefat fixed striped jio-verify-table">/);
|
||||
assert.doesNotMatch(card, /class="wp-list-table/);
|
||||
assert.match(card, /name="status" value="pending"/);
|
||||
assert.match(card, /name="keyword" value="search alert\(1\) &_%"/);
|
||||
@@ -52,7 +52,7 @@ test('default pending filters, keyword, status views, list and pagination share
|
||||
assert.match(card, /class="current" aria-current="page">待审核/);
|
||||
assert.match(card, /第 3 页,共 <span class="total-pages">3<\/span> 页/);
|
||||
assert.match(card, /name="paged" value="3"/);
|
||||
assert.doesNotMatch(card, /class="aksrt-verify-filter-summary"/);
|
||||
assert.doesNotMatch(card, /class="jio-verify-filter-summary"/);
|
||||
});
|
||||
|
||||
test('rendered user/application data is escaped and row review forms exist only in inert templates', () => {
|
||||
@@ -63,35 +63,35 @@ test('rendered user/application data is escaped and row review forms exist only
|
||||
assert.match(html, /Reviewer <img src=x onerror=alert\(2\)>/);
|
||||
assert.doesNotMatch(html, /<script>|<svg\b|<img[^>]*onerror=/i);
|
||||
const outsideTemplates = html.replace(/<template\b[^>]*>[\s\S]*?<\/template>/g, '');
|
||||
assert.doesNotMatch(outsideTemplates, /<form\b[^>]*data-aksrt-verify-review/);
|
||||
assert.equal((html.match(/data-aksrt-verify-review/g) || []).length, 1);
|
||||
assert.equal((html.match(/data-aksrt-verify-delete-form/g) || []).length, 2);
|
||||
assert.match(html, /data-aksrt-verify-view="301"/);
|
||||
assert.match(html, /data-aksrt-verify-view="302"/);
|
||||
assert.doesNotMatch(outsideTemplates, /<form\b[^>]*data-jio-verify-review/);
|
||||
assert.equal((html.match(/data-jio-verify-review/g) || []).length, 1);
|
||||
assert.equal((html.match(/data-jio-verify-delete-form/g) || []).length, 2);
|
||||
assert.match(html, /data-jio-verify-view="301"/);
|
||||
assert.match(html, /data-jio-verify-view="302"/);
|
||||
});
|
||||
|
||||
test('detail and delete templates bind UUID nonces, and processed records are read-only', () => {
|
||||
const { html } = harness();
|
||||
const pending = template(html, 'aksrt-verify-detail-301');
|
||||
const pendingDelete = template(html, 'aksrt-verify-delete-301');
|
||||
const approved = template(html, 'aksrt-verify-detail-302');
|
||||
const approvedDelete = template(html, 'aksrt-verify-delete-302');
|
||||
const pending = template(html, 'jio-verify-detail-301');
|
||||
const pendingDelete = template(html, 'jio-verify-delete-301');
|
||||
const approved = template(html, 'jio-verify-detail-302');
|
||||
const approvedDelete = template(html, 'jio-verify-delete-302');
|
||||
assert.match(pending, /name="application_uuid" value="uuid-pending-301"/);
|
||||
assert.match(pending, /name="_wpnonce" value="nonce:aksrt_users_review_verify_uuid-pending-301"/);
|
||||
assert.match(pendingDelete, /name="_wpnonce" value="nonce:aksrt_users_delete_verify_uuid-pending-301"/);
|
||||
assert.match(approvedDelete, /name="_wpnonce" value="nonce:aksrt_users_delete_verify_uuid-approved-302"/);
|
||||
assert.doesNotMatch(approved, /<form\b|data-aksrt-verify-review/);
|
||||
assert.match(pending, /name="_wpnonce" value="nonce:jio_users_review_verify_uuid-pending-301"/);
|
||||
assert.match(pendingDelete, /name="_wpnonce" value="nonce:jio_users_delete_verify_uuid-pending-301"/);
|
||||
assert.match(approvedDelete, /name="_wpnonce" value="nonce:jio_users_delete_verify_uuid-approved-302"/);
|
||||
assert.doesNotMatch(approved, /<form\b|data-jio-verify-review/);
|
||||
assert.match(approved, /Reviewed safely/);
|
||||
assert.match(approved, /2026-10-30 12:45/);
|
||||
assert.doesNotMatch(pending + pendingDelete + approvedDelete, /aksrt_users_(?:review|delete)_verify_41/);
|
||||
assert.doesNotMatch(pending + pendingDelete + approvedDelete, /jio_users_(?:review|delete)_verify_41/);
|
||||
});
|
||||
|
||||
test('review UI exposes both decisions, conditional approval profile fields, and mandatory rejection note metadata', () => {
|
||||
const { html } = harness();
|
||||
const pending = template(html, 'aksrt-verify-detail-301');
|
||||
const pending = template(html, 'jio-verify-detail-301');
|
||||
assert.match(pending, /name="status" value="verified" required/);
|
||||
assert.match(pending, /name="status" value="rejected" required/);
|
||||
assert.match(pending, /data-aksrt-verify-profile hidden disabled/);
|
||||
assert.match(pending, /data-jio-verify-profile hidden disabled/);
|
||||
assert.match(pending, /name="name" maxlength="64"[^>]*required/);
|
||||
assert.match(pending, /<textarea name="description" rows="3">/);
|
||||
assert.match(pending, /name="note" rows="3"[^>]*data-required-error="请填写拒绝原因"/);
|
||||
@@ -100,15 +100,15 @@ test('review UI exposes both decisions, conditional approval profile fields, and
|
||||
|
||||
test('proof links are private admin-post URLs protected by per-attachment nonces', () => {
|
||||
const { html } = harness();
|
||||
const pending = template(html, 'aksrt-verify-detail-301');
|
||||
const pending = template(html, 'jio-verify-detail-301');
|
||||
const link = pending.match(/<a href="([^"]+)" target="_blank" rel="noopener noreferrer"><img/);
|
||||
assert.ok(link, 'evidence is displayed through a controlled link');
|
||||
const url = new URL(link[1].replaceAll('&', '&'));
|
||||
assert.equal(url.origin, 'https://example.test');
|
||||
assert.equal(url.pathname, '/wp-admin/admin-post.php');
|
||||
assert.equal(url.searchParams.get('action'), 'aksrt_verify_evidence');
|
||||
assert.equal(url.searchParams.get('action'), 'jio_verify_evidence');
|
||||
assert.equal(url.searchParams.get('attachment'), '1001');
|
||||
assert.equal(url.searchParams.get('_wpnonce'), 'nonce:aksrt_verify_evidence_1001');
|
||||
assert.equal(url.searchParams.get('_wpnonce'), 'nonce:jio_verify_evidence_1001');
|
||||
assert.doesNotMatch(link[1], /uploads|wp-content/i);
|
||||
});
|
||||
|
||||
@@ -141,7 +141,7 @@ test('review handler checks permission and UUID nonce, sanitizes payload, and pr
|
||||
const data = harness();
|
||||
assert.equal(data.permission_denied, true);
|
||||
assert.equal(data.bad_nonce_rejected, true);
|
||||
assert.deepEqual(data.review_nonce_calls[0], ['aksrt_users_review_verify_review-uuid-401', '_wpnonce']);
|
||||
assert.deepEqual(data.review_nonce_calls[0], ['jio_users_review_verify_review-uuid-401', '_wpnonce']);
|
||||
assert.deepEqual(data.review_call, {
|
||||
user_id: 41,
|
||||
application_uuid: 'review-uuid-401',
|
||||
@@ -159,45 +159,45 @@ test('review handler checks permission and UUID nonce, sanitizes payload, and pr
|
||||
profile_fields: { name: 'Safe name', description: 'Safe description' },
|
||||
});
|
||||
assert.deepEqual(data.review_redirect, {
|
||||
page: 'aksrt_user_auth',
|
||||
aksrt_users_msg: 'verify_updated',
|
||||
page: 'jio_user_auth',
|
||||
jio_users_msg: 'verify_updated',
|
||||
status: 'approved',
|
||||
keyword: 'review search & phrase',
|
||||
paged: '4',
|
||||
});
|
||||
assert.deepEqual(data.review_error_redirect, {
|
||||
page: 'aksrt_user_auth',
|
||||
aksrt_users_msg: 'verify_failed',
|
||||
page: 'jio_user_auth',
|
||||
jio_users_msg: 'verify_failed',
|
||||
status: 'rejected',
|
||||
keyword: 'keep this',
|
||||
paged: '2',
|
||||
aksrt_verify_error: '<script>review unavailable</script>',
|
||||
jio_verify_error: '<script>review unavailable</script>',
|
||||
});
|
||||
});
|
||||
|
||||
test('delete handler cleans attachments and events only after successful delete, without revoking auth projection', () => {
|
||||
const data = harness();
|
||||
assert.deepEqual(data.delete_success_redirect, {
|
||||
page: 'aksrt_user_auth',
|
||||
aksrt_users_msg: 'verify_deleted',
|
||||
page: 'jio_user_auth',
|
||||
jio_users_msg: 'verify_deleted',
|
||||
status: 'rejected',
|
||||
keyword: 'delete search',
|
||||
paged: '6',
|
||||
});
|
||||
assert.deepEqual(data.delete_success_calls, [
|
||||
{ table: 'wp_aksrt_identity_application', data: { id: 501, type: 'general', channel: 'manual' }, format: ['%d', '%s', '%s'] },
|
||||
{ table: 'wp_aksrt_identity_event', data: { application_id: 501 }, format: ['%d'] },
|
||||
{ table: 'wp_jio_identity_application', data: { id: 501, type: 'general', channel: 'manual' }, format: ['%d', '%s', '%s'] },
|
||||
{ table: 'wp_jio_identity_event', data: { application_id: 501 }, format: ['%d'] },
|
||||
]);
|
||||
assert.deepEqual(data.delete_success_attachments, [[1001, true], [1002, true]]);
|
||||
assert.deepEqual(data.delete_auth_projection, { auth: 1, auth_info: { name: 'Already verified', desc: 'kept' } });
|
||||
assert.deepEqual(data.delete_user_meta_calls, []);
|
||||
assert.deepEqual(data.delete_failure_redirect, {
|
||||
page: 'aksrt_user_auth',
|
||||
aksrt_users_msg: 'verify_failed',
|
||||
page: 'jio_user_auth',
|
||||
jio_users_msg: 'verify_failed',
|
||||
status: 'pending',
|
||||
keyword: 'delete failure',
|
||||
paged: '1',
|
||||
aksrt_verify_error: '认证记录删除失败',
|
||||
jio_verify_error: '认证记录删除失败',
|
||||
});
|
||||
assert.equal(data.delete_failure_calls.length, 1, 'event rows are untouched after repository deletion fails');
|
||||
assert.match(data.delete_failure_calls[0].table, /identity_application/);
|
||||
@@ -223,12 +223,12 @@ test('event cleanup failure reports partial deletion instead of a false success'
|
||||
const data = harness();
|
||||
assert.equal(data.delete_event_failure_calls.length, 2);
|
||||
assert.deepEqual(data.delete_event_failure_redirect, {
|
||||
page: 'aksrt_user_auth',
|
||||
aksrt_users_msg: 'verify_failed',
|
||||
page: 'jio_user_auth',
|
||||
jio_users_msg: 'verify_failed',
|
||||
status: 'rejected',
|
||||
keyword: 'delete search',
|
||||
paged: '6',
|
||||
aksrt_verify_error: '认证申请记录已删除,但审核事件清理失败。',
|
||||
jio_verify_error: '认证申请记录已删除,但审核事件清理失败。',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -237,12 +237,12 @@ test('assets are restricted to the authentication submenu and the stylesheet fol
|
||||
assert.deepEqual(data.wrong_hook_assets, []);
|
||||
assert.equal(data.auth_page_assets.length, 2);
|
||||
assert.deepEqual(data.auth_page_assets[0].slice(0, 4), [
|
||||
'style', 'aksrt-admin-user-auth', 'https://example.test/theme/assets/css/admin/user-auth.css', ['aksrt-admin-native-ui'],
|
||||
'style', 'jio-admin-user-auth', 'https://example.test/theme/assets/css/admin/user-auth.css', ['jio-admin-native-ui'],
|
||||
]);
|
||||
assert.deepEqual(data.auth_page_assets[1].slice(0, 4), [
|
||||
'script', 'aksrt-admin-user-auth', 'https://example.test/theme/assets/js/admin-user-auth.js', [],
|
||||
'script', 'jio-admin-user-auth', 'https://example.test/theme/assets/js/admin-user-auth.js', [],
|
||||
]);
|
||||
assert.match(source.verify(), /if \(\$hook !== 'users_page_aksrt_user_auth'\) return/);
|
||||
assert.match(source.verify(), /if \(\$hook !== 'users_page_jio_user_auth'\) return/);
|
||||
assert.match(source.menus(), /add_action\('admin_enqueue_scripts', \[\$this, 'enqueue_verify_assets'\]\)/);
|
||||
});
|
||||
|
||||
@@ -254,7 +254,7 @@ test('the real AuthApply contract requires valid review data and a compare-and-s
|
||||
assert.match(auth, /\(int\) \$application\['user_id'\] !== \$user_id/);
|
||||
assert.match(auth, /\(string\) \$application\['status'\] !== 'manual_pending'/);
|
||||
assert.match(auth, /\$repo->transition\(\(int\) \$application\['id'\], 'manual_pending', \$status/);
|
||||
assert.match(auth, /if \(!\$updated\) \{\s*return new \\WP_Error\('aksrt_auth_conflict'/);
|
||||
assert.match(auth, /if \(!\$updated\) \{\s*return new \\WP_Error\('jio_auth_conflict'/);
|
||||
assert.match(repository, /\['id' => \$id, 'type' => 'general', 'channel' => 'manual', 'status' => \$expected\]/);
|
||||
});
|
||||
|
||||
@@ -262,10 +262,10 @@ test('review and deletion nonces use application UUIDs only, while failure notic
|
||||
const verify = source.verify();
|
||||
const dialogs = source.dialogs();
|
||||
const menus = source.menus();
|
||||
assert.match(verify, /check_admin_referer\('aksrt_users_review_verify_' \. \$uuid\)/);
|
||||
assert.match(verify, /check_admin_referer\('aksrt_users_delete_verify_' \. \$uuid\)/);
|
||||
assert.doesNotMatch(verify, /check_admin_referer\('aksrt_users_(?:review|delete)_verify_' \. \$user_id\)/);
|
||||
assert.match(verify, /check_admin_referer\('jio_users_review_verify_' \. \$uuid\)/);
|
||||
assert.match(verify, /check_admin_referer\('jio_users_delete_verify_' \. \$uuid\)/);
|
||||
assert.doesNotMatch(verify, /check_admin_referer\('jio_users_(?:review|delete)_verify_' \. \$user_id\)/);
|
||||
assert.match(dialogs, /wp_nonce_field\(\$action \. '_' \. \(string\) \$row\['application_uuid'\]\)/);
|
||||
assert.match(menus, /sanitize_text_field\(\(string\) wp_unslash\(\$_GET\['aksrt_verify_error'\]\)\)/);
|
||||
assert.match(menus, /sanitize_text_field\(\(string\) wp_unslash\(\$_GET\['jio_verify_error'\]\)\)/);
|
||||
assert.match(menus, /esc_html\(\$message\)/);
|
||||
});
|
||||
Reference in new issue
Block a user