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
@@ -27,16 +27,16 @@ const runtimeFiles = [
|
||||
test('front submit owns the typed media REST routes and media trait wiring', () => {
|
||||
assert.match(frontSubmit, /use FrontSubmitMedia\s*;/);
|
||||
assert.match(frontSubmit, /add_action\('rest_api_init', \[\$this, 'register_rest_routes'\]\)/);
|
||||
assert.doesNotMatch(frontSubmit, /add_action\('aksrt_new_(?:add|edit)_posts', \[\$this, 'sync_post_attachments'\]\)/);
|
||||
assert.doesNotMatch(frontSubmit, /add_action\('jio_new_(?:add|edit)_posts', \[\$this, 'sync_post_attachments'\]\)/);
|
||||
assert.match(saveTrait, /\$this->sync_post_attachments\(\$post\);\s*if \(!\$pay_result\['success'\]\)/);
|
||||
|
||||
assert.match(frontSubmit, /register_rest_route\('aksrt\/v1', '\/front-submit\/media\/\(\?P<type>image\|video\|file\)'/);
|
||||
assert.match(frontSubmit, /register_rest_route\('jio\/v1', '\/front-submit\/media\/\(\?P<type>image\|video\|file\)'/);
|
||||
assert.match(frontSubmit, /'methods'\s*=>\s*\\WP_REST_Server::READABLE/);
|
||||
assert.match(frontSubmit, /'callback'\s*=>\s*\[\$this, 'rest_list_attachments'\]/);
|
||||
assert.match(frontSubmit, /'post_id'\s*=>\s*\[/);
|
||||
assert.match(frontSubmit, /'permission_callback'\s*=>\s*\[\$this, 'can_list_attachments'\]/);
|
||||
|
||||
assert.match(frontSubmit, /register_rest_route\('aksrt\/v1', '\/front-submit\/upload\/\(\?P<kind>image\|video\|resource\)'/);
|
||||
assert.match(frontSubmit, /register_rest_route\('jio\/v1', '\/front-submit\/upload\/\(\?P<kind>image\|video\|resource\)'/);
|
||||
assert.match(frontSubmit, /'methods'\s*=>\s*'POST'/);
|
||||
assert.match(frontSubmit, /'callback'\s*=>\s*\[\$this, 'rest_upload_attachment'\]/);
|
||||
assert.match(frontSubmit, /'permission_callback'\s*=>\s*\[\$this, 'can_upload_attachment'\]/);
|
||||
@@ -76,8 +76,8 @@ test('front submit media responses and uploads use the attachment contract', ()
|
||||
assert.match(mediaTrait, /'filesizeInBytes'\s*=>/);
|
||||
|
||||
assert.match(frontSubmit, /\$files\['file'\]/);
|
||||
assert.match(frontSubmit, /media_handle_upload\('aksrt_front_submit_file'/);
|
||||
assert.match(frontSubmit, /update_post_meta\(\$attachment_id, '_aksrt_front_submit_media', \$kind\)/);
|
||||
assert.match(frontSubmit, /media_handle_upload\('jio_front_submit_file'/);
|
||||
assert.match(frontSubmit, /update_post_meta\(\$attachment_id, '_jio_front_submit_media', \$kind\)/);
|
||||
assert.match(frontSubmit, /\$attachment\['success'\]\s*=\s*true/);
|
||||
assert.match(editor, /body\.append\('file', file\)/);
|
||||
assert.match(editor, /method:\s*'POST'/);
|
||||
@@ -90,29 +90,29 @@ test('saved submission media sync enforces ownership and cleans stale parent/met
|
||||
assert.match(mediaTrait, /\(int\) \$attachment->post_author !== \$user_id/);
|
||||
assert.match(mediaTrait, /\['inherit', 'private'\]/);
|
||||
assert.match(mediaTrait, /\(int\) \$attachment->post_parent !== 0/);
|
||||
assert.match(mediaTrait, /'meta_key'\s*=>\s*'_aksrt_front_submit_media'/);
|
||||
assert.match(mediaTrait, /delete_post_meta\(\$attachment_id, '_aksrt_front_submit_media'\)/);
|
||||
assert.match(mediaTrait, /update_post_meta\(\$attachment_id, '_aksrt_front_submit_media', \$kind\)/);
|
||||
assert.match(mediaTrait, /'meta_key'\s*=>\s*'_jio_front_submit_media'/);
|
||||
assert.match(mediaTrait, /delete_post_meta\(\$attachment_id, '_jio_front_submit_media'\)/);
|
||||
assert.match(mediaTrait, /update_post_meta\(\$attachment_id, '_jio_front_submit_media', \$kind\)/);
|
||||
assert.match(mediaTrait, /featured_video_attachment_id/);
|
||||
assert.match(mediaTrait, /data-aksrt-file-id/);
|
||||
assert.match(mediaTrait, /data-jio-file-id/);
|
||||
assert.match(mediaTrait, /\['post_parent'\s*=>\s*\$post_id\]/);
|
||||
});
|
||||
|
||||
test('submit page configures media URLs, REST nonce, and the three media copy groups without mini-upload', () => {
|
||||
assert.match(page, /'restNonce'\s*=>\s*wp_create_nonce\('wp_rest'\)/);
|
||||
assert.match(page, /'mediaUrl'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media'\)\)/);
|
||||
assert.match(page, /'image'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media\/image'\)\)\]/);
|
||||
assert.match(page, /'video'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media\/video'\)\)\]/);
|
||||
assert.match(page, /'file'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('aksrt\/v1\/front-submit\/media\/file'\)\)\]/);
|
||||
assert.match(page, /'mediaUrl'\s*=>\s*esc_url_raw\(rest_url\('jio\/v1\/front-submit\/media'\)\)/);
|
||||
assert.match(page, /'image'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('jio\/v1\/front-submit\/media\/image'\)\)\]/);
|
||||
assert.match(page, /'video'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('jio\/v1\/front-submit\/media\/video'\)\)\]/);
|
||||
assert.match(page, /'file'\s*=>\s*\['url'\s*=>\s*esc_url_raw\(rest_url\('jio\/v1\/front-submit\/media\/file'\)\)\]/);
|
||||
for (const copy of ['mineImage', 'mineVideo', 'mineFile', 'uploadImage', 'uploadVideo', 'uploadFile']) {
|
||||
assert.match(page, new RegExp(`['"]${copy}['"]`), `missing copy ${copy}`);
|
||||
}
|
||||
assert.doesNotMatch(page, /aksrt-mini-upload/);
|
||||
assert.doesNotMatch(page, /jio-mini-upload/);
|
||||
assert.equal(fs.existsSync(path.join(root, 'assets/js/mini-upload.js')), false, 'mini-upload.js must stay removed');
|
||||
});
|
||||
|
||||
test('shared submit media picker exposes mine search paging selection and nonce-backed upload', () => {
|
||||
assert.match(editor, /window\.AksrtSubmitMedia\s*=\s*\{\s*open:/);
|
||||
assert.match(editor, /window\.JioSubmitMedia\s*=\s*\{\s*open:/);
|
||||
assert.match(editor, /data-editor-media-tab="mine"/);
|
||||
assert.match(editor, /data-editor-media-search/);
|
||||
assert.match(editor, /state\.search\.length >= 2/);
|
||||
@@ -126,13 +126,13 @@ test('shared submit media picker exposes mine search paging selection and nonce-
|
||||
assert.match(editor, /if \(!multiple\) maxItems = 1/);
|
||||
assert.match(editor, /state\.selected\.length >= maxItems/);
|
||||
assert.match(editor, /headers:\s*\{\s*'X-WP-Nonce': cfg\.restNonce \|\| ''\s*\}/);
|
||||
assert.match(editor, /data-aksrt-file-id/);
|
||||
assert.match(editor, /data-jio-file-id/);
|
||||
assert.doesNotMatch(editor, /data-download-file/);
|
||||
assert.match(submit, /data-aksrt-submit-ready/);
|
||||
assert.match(submit, /data-jio-submit-ready/);
|
||||
});
|
||||
|
||||
test('paid downloads and featured covers use the shared picker and attachment IDs', () => {
|
||||
assert.match(payDownload, /window\.AksrtSubmitMedia\.open\(/);
|
||||
assert.match(payDownload, /window\.JioSubmitMedia\.open\(/);
|
||||
assert.match(payDownload, /type:\s*'file'/);
|
||||
assert.match(payDownload, /item\.attachment_id \|\| item\.id/);
|
||||
assert.match(payDownload, /data-pay-resource-field="attachment_id"/);
|
||||
@@ -140,7 +140,7 @@ test('paid downloads and featured covers use the shared picker and attachment ID
|
||||
assert.match(domainModel, /max\(0, \(int\) \$row\['attachment_id'\]\)/);
|
||||
|
||||
assert.match(submit, /openMediaPicker:\s*function \(options\)/);
|
||||
assert.match(submit, /window\.AksrtSubmitMedia\.open\(options\)/);
|
||||
assert.match(submit, /window\.JioSubmitMedia\.open\(options\)/);
|
||||
assert.match(submit, /type:\s*'image'/);
|
||||
assert.match(submit, /type:\s*'video'/);
|
||||
assert.match(submit, /item\.attachment_id \|\| item\.id/);
|
||||
|
||||
Reference in new issue
Block a user