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
@@ -56,8 +56,8 @@ test('system tools settings are consumed at runtime and initialized on boot', ()
|
||||
assert.match(runtime, /public static function get_system_tools_settings\(\): array/);
|
||||
assert.match(runtime, /'newfilename_type'\s+=> \$rename_type/);
|
||||
assert.match(runtime, /'split_minimum_size'\s+=> max\(4, min\(100, \(int\) \(\$settings\['split_minimum_size'\] \?\? 20\)\)\)/);
|
||||
assert.match(bootstrap, /\\AKSRT\\Extensions\\SystemTools::get_instance\(\)->init\(\)/);
|
||||
assert.match(bootstrap, /\\AKSRT\\Frontend\\PageAdminSet::get_instance\(\)->init\(\)/);
|
||||
assert.match(bootstrap, /\\Jio\\Extensions\\SystemTools::get_instance\(\)->init\(\)/);
|
||||
assert.match(bootstrap, /\\Jio\\Frontend\\PageAdminSet::get_instance\(\)->init\(\)/);
|
||||
});
|
||||
|
||||
test('system tools switches wire the reference theme hook suite', () => {
|
||||
@@ -121,14 +121,14 @@ test('split upload ships a full chunk protocol: routes, merge pipeline, and clie
|
||||
assert.match(chunk, /const CHUNK_SIZE_BYTES = 2 \* 1048576;/);
|
||||
assert.match(chunk, /md5\(get_current_blog_id\(\) \. '\|' \. get_current_user_id\(\) \. '\|' \. \$name\)/);
|
||||
assert.match(chunk, /\$this->persist_uploaded_file\(\$params\['kind'\], \[/);
|
||||
assert.match(chunk, /apply_filters\('aksrt_temp_dir', WP_CONTENT_DIR \. '\/aksrt-temp'\)/);
|
||||
assert.match(chunk, /apply_filters\('jio_temp_dir', WP_CONTENT_DIR \. '\/jio-temp'\)/);
|
||||
assert.match(chunk, /\$this->chunk_temp_cleanup\(\$temp_dir\)/);
|
||||
|
||||
// Whole-file upload and chunk merge share one persistence pipeline; merged
|
||||
// files are not HTTP uploads, so the pipeline must use the sideload action.
|
||||
assert.match(frontSubmit, /return \$this->persist_uploaded_file\(\$kind, \$file, false\);/);
|
||||
assert.match(frontSubmit, /'action' => 'wp_handle_sideload'/);
|
||||
assert.match(frontSubmit, /media_handle_upload\('aksrt_front_submit_file', 0, \[\], \$overrides\)/);
|
||||
assert.match(frontSubmit, /media_handle_upload\('jio_front_submit_file', 0, \[\], \$overrides\)/);
|
||||
|
||||
// Client uploader picks the chunked path past the threshold and resumes from status.
|
||||
assert.match(editorJs, /function uploadInChunks\(file, type\)/);
|
||||
@@ -139,7 +139,7 @@ test('split upload ships a full chunk protocol: routes, merge pipeline, and clie
|
||||
assert.match(editorJs, /chunkUrl\('upload-merge'\)/);
|
||||
assert.match(editorJs, /'\/front-submit\/' \+ action \+ '\/' \+ uploadKey/);
|
||||
|
||||
// Config flows from the settings page into aksrtSubmitData.
|
||||
// Config flows from the settings page into jioSubmitData.
|
||||
assert.match(submitPage, /'splitUpload' => \[/);
|
||||
assert.match(submitPage, /'enabled' => !empty\(\$system_tools\['split_upload_s'\]\)/);
|
||||
assert.match(submitPage, /'minSize' => \(int\) \(\$system_tools\['split_minimum_size'\] \?\? 20\)/);
|
||||
@@ -152,11 +152,11 @@ test('split upload ships a full chunk protocol: routes, merge pipeline, and clie
|
||||
|
||||
test('frontend page edit ships gate, footer modal, and legacy ajax-save contract', () => {
|
||||
const pageAdminSet = read('src/Frontend/PageAdminSet.php');
|
||||
const floatButtons = read('inc/helpers/aksrt-float-buttons.php');
|
||||
const floatButtons = read('inc/helpers/jio-float-buttons.php');
|
||||
const bootstrap = read('functions.php');
|
||||
const mainJs = read('assets/js/runtime/main.js');
|
||||
|
||||
assert.match(bootstrap, /\\AKSRT\\Frontend\\PageAdminSet::get_instance\(\)->init\(\)/);
|
||||
assert.match(bootstrap, /\\Jio\\Frontend\\PageAdminSet::get_instance\(\)->init\(\)/);
|
||||
assert.match(pageAdminSet, /public static function enabled\(\): bool/);
|
||||
assert.match(pageAdminSet, /empty\(\$settings\['admin_frontend_set'\]/);
|
||||
assert.match(pageAdminSet, /current_user_can\('manage_options'\)/);
|
||||
@@ -164,15 +164,15 @@ test('frontend page edit ships gate, footer modal, and legacy ajax-save contract
|
||||
assert.match(pageAdminSet, /is_page_template\('templates\/pages\/page-posts-navs\.php'\)/);
|
||||
|
||||
// Reference parity: the gear float button opens the footer-rendered bootstrap modal.
|
||||
assert.match(floatButtons, /apply_filters\('aksrt_float_right_buttons', \$btn, \$is_mobile\)/);
|
||||
assert.match(pageAdminSet, /add_filter\('aksrt_float_right_buttons', \[\$this, 'float_button'\], 10, 2\)/);
|
||||
assert.match(floatButtons, /apply_filters\('jio_float_right_buttons', \$btn, \$is_mobile\)/);
|
||||
assert.match(pageAdminSet, /add_filter\('jio_float_right_buttons', \[\$this, 'float_button'\], 10, 2\)/);
|
||||
assert.match(pageAdminSet, /add_action\('wp_footer', \[\$this, 'render_modal'\], 10\)/);
|
||||
assert.match(pageAdminSet, /data-toggle="modal" data-target="#modal_admin_set"/);
|
||||
assert.match(pageAdminSet, /class="modal fade" id="modal_admin_set" tabindex="-1" role="dialog" aria-hidden="false" win-ajax-replace="modal_admin_set"/);
|
||||
assert.match(pageAdminSet, /class="modal-content page-set-modal"/);
|
||||
assert.match(pageAdminSet, /wp_nonce_field\('aksrt_frontend_set', '_wpnonce', true, false\)/);
|
||||
assert.match(pageAdminSet, /wp_nonce_field\('jio_frontend_set', '_wpnonce', true, false\)/);
|
||||
// Reference hidden inputs: type + taxonomy + post_type + id travel with the submit.
|
||||
assert.match(pageAdminSet, /name="action" value="aksrt_frontend_set_save"/);
|
||||
assert.match(pageAdminSet, /name="action" value="jio_frontend_set_save"/);
|
||||
assert.match(pageAdminSet, /name="type" value="' . esc_attr\(\$type\)/);
|
||||
assert.match(pageAdminSet, /name="taxonomy" value="' . esc_attr\(\$taxonomy\)/);
|
||||
assert.match(pageAdminSet, /name="post_type" value="' . esc_attr\(\$post_type\)/);
|
||||
@@ -181,25 +181,25 @@ test('frontend page edit ships gate, footer modal, and legacy ajax-save contract
|
||||
assert.match(pageAdminSet, /'autofocus' => \['panel' => 'widgets'\]/);
|
||||
|
||||
// Modal footer mirrors the reference: 模块布局 / 后台编辑 / 确认修改 (wp-ajax-submit).
|
||||
assert.match(pageAdminSet, /esc_html__\('模块布局', 'aksrt'\)/);
|
||||
assert.match(pageAdminSet, /esc_html__\('后台编辑', 'aksrt'\)/);
|
||||
assert.match(pageAdminSet, /esc_html__\('确认修改', 'aksrt'\)/);
|
||||
assert.match(pageAdminSet, /esc_html__\('模块布局', 'jio'\)/);
|
||||
assert.match(pageAdminSet, /esc_html__\('后台编辑', 'jio'\)/);
|
||||
assert.match(pageAdminSet, /esc_html__\('确认修改', 'jio'\)/);
|
||||
assert.match(pageAdminSet, /class="but c-yellow-2 padding-lg"/);
|
||||
assert.match(pageAdminSet, /class="but c-yellow padding-lg"/);
|
||||
assert.match(pageAdminSet, /class="but jb-blue padding-lg wp-ajax-submit"/);
|
||||
|
||||
// Fields replicate the reference input construct and map to AKSRT's post meta.
|
||||
// Fields replicate the reference input construct and map to Jio's post meta.
|
||||
assert.match(pageAdminSet, /private function render_inputs\(array \$inputs\): string/);
|
||||
assert.match(pageAdminSet, /class="heading col-xs-3 text-right"/);
|
||||
assert.match(pageAdminSet, /class="option col-xs-8"/);
|
||||
assert.match(pageAdminSet, /\\AKSRT\\Core\\PostMetaBox::META_KEY/);
|
||||
assert.match(pageAdminSet, /\\AKSRT\\Core\\DomainModel::POST_VIEW_COUNT_KEY/);
|
||||
assert.match(pageAdminSet, /update_post_meta\(\$post_id, '_aksrt_like_count', max\(0, \(int\) \$_POST\['like'\]\)\)/);
|
||||
assert.match(pageAdminSet, /\\Jio\\Core\\PostMetaBox::META_KEY/);
|
||||
assert.match(pageAdminSet, /\\Jio\\Core\\DomainModel::POST_VIEW_COUNT_KEY/);
|
||||
assert.match(pageAdminSet, /update_post_meta\(\$post_id, '_jio_like_count', max\(0, \(int\) \$_POST\['like'\]\)\)/);
|
||||
assert.match(pageAdminSet, /wp_update_term\(\$term_id, \(string\) \$term->taxonomy, \$data\)/);
|
||||
assert.match(pageAdminSet, /set_post_format\(\$post_id, \$format === 'standard' \? '' : \$format\)/);
|
||||
// 文章格式 mirrors the reference's fixed four-option list, not the theme's
|
||||
// wider add_theme_support('post-formats') registration.
|
||||
assert.match(pageAdminSet, /return \[\s*'standard' => __\('标准', 'aksrt'\),\s*'image' => __\('图像', 'aksrt'\),\s*'gallery' => __\('画廊', 'aksrt'\),\s*'video' => __\('视频', 'aksrt'\),\s*\];/s);
|
||||
assert.match(pageAdminSet, /return \[\s*'standard' => __\('标准', 'jio'\),\s*'image' => __\('图像', 'jio'\),\s*'gallery' => __\('画廊', 'jio'\),\s*'video' => __\('视频', 'jio'\),\s*\];/s);
|
||||
assert.doesNotMatch(pageAdminSet, /get_theme_support\('post-formats'\)\s*\?/);
|
||||
assert.doesNotMatch(pageAdminSet, /get_post_format_string\(/);
|
||||
// Page branch: 标题样式 + 模块布局(widgets_register) + 容器位置.
|
||||
@@ -213,10 +213,10 @@ test('frontend page edit ships gate, footer modal, and legacy ajax-save contract
|
||||
// The geometry mirrors the reference construct (row + heading + option, \n separators).
|
||||
assert.match(pageAdminSet, /'<div class="mb10 row' \. esc_attr\(\$class\) \. '">' \. "\\n"/);
|
||||
|
||||
// Save runs under the vendored main.js aksrt_ajax contract ({msg,reload}).
|
||||
assert.match(pageAdminSet, /add_action\('wp_ajax_aksrt_frontend_set_save', \[\$this, 'ajax_save'\]\)/);
|
||||
assert.match(pageAdminSet, /check_ajax_referer\('aksrt_frontend_set', '_wpnonce'\)/);
|
||||
assert.match(pageAdminSet, /wp_send_json\(\['msg' => __\('保存成功,正在刷新页面', 'aksrt'\), 'reload' => true\]\)/);
|
||||
// Save runs under the vendored main.js jio_ajax contract ({msg,reload}).
|
||||
assert.match(pageAdminSet, /add_action\('wp_ajax_jio_frontend_set_save', \[\$this, 'ajax_save'\]\)/);
|
||||
assert.match(pageAdminSet, /check_ajax_referer\('jio_frontend_set', '_wpnonce'\)/);
|
||||
assert.match(pageAdminSet, /wp_send_json\(\['msg' => __\('保存成功,正在刷新页面', 'jio'\), 'reload' => true\]\)/);
|
||||
assert.match(mainJs, /jQuery\.fn\.serializeObject = function/);
|
||||
assert.match(mainJs, /if \(n\.reload\) \{/);
|
||||
// The dedicated fetch-submit client is gone: vendored main.js owns the flow.
|
||||
@@ -230,7 +230,7 @@ test('frontend page edit icons follow the FA5 convention and the hint bar fades
|
||||
const publicCss = read('assets/css/build/public.css');
|
||||
const publicMinCss = read('assets/css/build/public.min.css');
|
||||
|
||||
// Site-wide icon convention is aksrt_icon_markup()'s normalized `fa fas fa-*`:
|
||||
// Site-wide icon convention is jio_icon_markup()'s normalized `fa fas fa-*`:
|
||||
// the gear, the modal header, both footer links and the submit button.
|
||||
// FA5 renames the reference's FA4 glyphs (sliders→sliders-h, pie-chart→chart-pie).
|
||||
assert.match(pageAdminSet, /<i class="fa fas fa-cog fa-spin" aria-hidden="true"><\/i>/);
|
||||
@@ -256,14 +256,14 @@ test('frontend page edit icons follow the FA5 convention and the hint bar fades
|
||||
|
||||
// The transient label fades 2s after load over 1s (reference js/page-edit.js).
|
||||
assert.match(pageAdminSet, /add_action\('wp_footer', \[self::class, 'enqueue_hint_script'\], 9\)/);
|
||||
assert.match(pageAdminSet, /wp_enqueue_script\(\s*'aksrt-front-page-admin-set',\s*get_template_directory_uri\(\) \. '\/assets\/js\/front-page-admin-set\.js',\s*\['jquery'\],\s*\(string\) filemtime\(\$path\),\s*true\s*\)/s);
|
||||
assert.match(pageAdminSet, /wp_enqueue_script\(\s*'jio-front-page-admin-set',\s*get_template_directory_uri\(\) \. '\/assets\/js\/front-page-admin-set\.js',\s*\['jquery'\],\s*\(string\) filemtime\(\$path\),\s*true\s*\)/s);
|
||||
assert.match(hintJs, /setTimeout\(function \(\) \{/, 'the fade is delayed like the reference');
|
||||
assert.match(hintJs, /hint\.style\.transition = 'opacity 1s'/);
|
||||
assert.match(hintJs, /hint\.style\.opacity = '0'/);
|
||||
assert.match(hintJs, /querySelector\('\.admin-set-page \.admin-set-info'\)/);
|
||||
|
||||
// Label geometry: reference .abs-right is top:50% + right:.7em + translateY(-50%).
|
||||
// AKSRT's legacy .abs-right is top:0/right:0, so the float bar restores it.
|
||||
// Jio's legacy .abs-right is top:0/right:0, so the float bar restores it.
|
||||
// The minified bundle has no space before the brace, so keep it optional.
|
||||
const labelRule = /\.float-right \.admin-set-page \.admin-set-info\s*\{[^}]*\}/s;
|
||||
assert.match(floatingCss, labelRule);
|
||||
@@ -306,16 +306,16 @@ test('float toolbar config reaches the tinymce plugin with reference-context but
|
||||
assert.match(editorJs, /if \(editorCfg\.floatToolbar\) \{\s*\n\s*registerFloatToolbar\(editor\);/);
|
||||
assert.match(editorJs, /editor\.on\('wptoolbar', function \(event\)/);
|
||||
assert.match(editorJs, /editor\.wp\._createToolbar\(bars\)/);
|
||||
assert.match(editorJs, /editor\.addButton\('aksrt_h2'/);
|
||||
assert.match(editorJs, /editor\.addButton\('aksrt_h3'/);
|
||||
assert.match(editorJs, /editor\.addButton\('aksrt_remove'/);
|
||||
assert.match(editorJs, /editor\.addButton\('jio_h2'/);
|
||||
assert.match(editorJs, /editor\.addButton\('jio_h3'/);
|
||||
assert.match(editorJs, /editor\.addButton\('jio_remove'/);
|
||||
assert.match(editorJs, /function floatToolbarButtons\(editor, event\)/);
|
||||
assert.match(schema, /'mce_float_toolbar', 'label' => '经典编辑器增强浮动工具栏', 'type' => 'checkbox'/);
|
||||
// The editor template still wires the plugin into wp_editor.
|
||||
assert.match(editorTemplate, /aksrt_editor_tools/);
|
||||
assert.match(editorTemplate, /jio_editor_tools/);
|
||||
});
|
||||
|
||||
test('countdown display switch gates aksrt_time_ago with the custom format fallback', () => {
|
||||
test('countdown display switch gates jio_time_ago with the custom format fallback', () => {
|
||||
const helper = read('inc/helpers/template-tags/search-meta.php');
|
||||
const coreHooks = read('inc/core-hooks.php');
|
||||
|
||||
|
||||
Reference in new issue
Block a user