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>
61 lines
3.4 KiB
JavaScript
61 lines
3.4 KiB
JavaScript
const test = require('node:test')
|
|
const assert = require('node:assert/strict')
|
|
const fs = require('node:fs')
|
|
const path = require('node:path')
|
|
|
|
const root = path.resolve(__dirname, '../..')
|
|
const core = require(path.join(root, 'assets/widgets/admin-core.js'))
|
|
const admin = fs.readFileSync(path.join(root, 'assets/widgets/admin.js'), 'utf8')
|
|
const wie = fs.readFileSync(path.join(root, 'assets/widgets/admin-transfer.js'), 'utf8')
|
|
const controller =fs.readFileSync(path.join(root, 'src/WidgetSystem/AdminFormController.php'), 'utf8')
|
|
const transfer = fs.readFileSync(path.join(root, 'src/WidgetSystem/TransferController.php'), 'utf8')
|
|
const renderer = fs.readFileSync(path.join(root, 'src/WidgetSystem/FormRenderer.php'), 'utf8')
|
|
const styles = fs.readFileSync(path.join(root, 'assets/widgets/admin.css'), 'utf8')
|
|
|
|
test('lazy widget forms resolve assigned instances across core and customizer markup', () => {
|
|
assert.equal(core.resolveWidgetNumber('widget-jio_widget_posts[12][title]', 'widget-jio_widget_posts-12', '__i__'), '12')
|
|
assert.equal(core.resolveWidgetNumber('', 'widget-jio_widget_posts-8', '__i__'), '8')
|
|
assert.equal(core.resolveWidgetNumber('', '', '4'), '4')
|
|
assert.equal(core.resolveWidgetNumber('', '', '__i__'), '')
|
|
assert.equal(core.resolveWidgetNumber('', 'widget-jio_widget_posts-0', ''), '')
|
|
assert.match(admin, /customize-control-widget_form \.jio-widget-form-lazy/)
|
|
})
|
|
|
|
test('lazy form AJAX failures remain retryable and instance filters match WordPress widget forms', () => {
|
|
assert.match(admin, /data\('loading', false\)/)
|
|
assert.match(controller, /apply_filters\('widget_form_callback', \$instance, \$widget\)/)
|
|
})
|
|
|
|
test('sidebar toolbars drive reference-style AJAX export, import and template modals', () => {
|
|
assert.match(wie, /widgets-holder-wrap:not\(#available-widgets\)/)
|
|
assert.match(wie, /control-section-sidebar/)
|
|
assert.match(wie, /data-jio-wie-action/)
|
|
assert.match(wie, /data-sidebar-id/)
|
|
assert.match(wie, /jio-wie-btn-delete/)
|
|
assert.match(wie, /nonce: config\.transferNonce/)
|
|
for (const action of ['export_sidebar', 'import_sidebar', 'list_templates', 'import_template']) {
|
|
assert.match(wie, new RegExp(`jio_widgets_${action}`))
|
|
assert.match(transfer, new RegExp(`wp_ajax_jio_widgets_${action}`))
|
|
}
|
|
assert.match(transfer, /check_ajax_referer\(self::NONCE, 'nonce'\)/)
|
|
assert.match(transfer, /edit_theme_options/)
|
|
assert.doesNotMatch(transfer, /jio_widgets_template_preview|admin_post_|admin_notices/)
|
|
assert.doesNotMatch(admin, /data-jio-transfer-action|jio-widget-customizer-remove|jio-widget-form-lazy__load/)
|
|
assert.match(styles, /\.jio-wie-modal__dialog/)
|
|
})
|
|
|
|
test('widget fields follow the current CSF compact palette and cloneable group patterns', () => {
|
|
assert.match(renderer, /jio-widget-palette-choice/)
|
|
assert.match(renderer, /<details class="jio-widget-repeater__row"/)
|
|
assert.match(renderer, /data-min-items=/)
|
|
assert.match(admin, /function updateRepeaterControls/)
|
|
assert.match(styles, /\.jio-widget-choices--palette/)
|
|
assert.match(styles, /\.jio-widget-repeater__bar/)
|
|
assert.match(styles, /\.customize-control-widget_form \.jio-widget-field__label/)
|
|
assert.match(admin, /if \(!response\?\.success \|\| !response\.data\?\.html\) \{/)
|
|
assert.match(admin, /t-notice/)
|
|
assert.match(styles, /\.jio-widget-field\.is-compact/)
|
|
assert.match(admin, /responseJSON\?\.data\?\.message/)
|
|
assert.doesNotMatch(admin, /if \(!response\?\.success\) throw new Error/)
|
|
})
|