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:
kate522andClaude Opus 5 committed 2026-11-01 20:05:04 +08:00
1 parent 5b16bc6e15
commit 35bb96e82f
997 files changed
+28216 -28188

No files matched your search

+41 -41
View File
@@ -6,31 +6,31 @@ declare(strict_types=1);
namespace {
define('ABSPATH', __DIR__ . '/');
$GLOBALS['aksrt_system_settings'] = [];
$GLOBALS['aksrt_system_added'] = [];
$GLOBALS['aksrt_system_removed'] = [];
$GLOBALS['jio_system_settings'] = [];
$GLOBALS['jio_system_added'] = [];
$GLOBALS['jio_system_removed'] = [];
function __(string $text, string $domain = ''): string { return $text; }
function sanitize_key(string $key): string { return preg_replace('/[^a-z0-9_\-]/', '', strtolower($key)) ?? ''; }
function is_super_admin(): bool { return (bool) $GLOBALS['aksrt_system_is_super_admin']; }
function is_super_admin(): bool { return (bool) $GLOBALS['jio_system_is_super_admin']; }
function current_time(string $type): string { return date('Y-m-d H:i:s'); }
function add_filter(string $hook, $callback, int $priority = 10, int $args = 1): void {
$GLOBALS['aksrt_system_added'][] = ['filter', $hook, $callback, $priority];
$GLOBALS['jio_system_added'][] = ['filter', $hook, $callback, $priority];
}
function add_action(string $hook, $callback, int $priority = 10, int $args = 1): void {
$GLOBALS['aksrt_system_added'][] = ['action', $hook, $callback, $priority];
$GLOBALS['jio_system_added'][] = ['action', $hook, $callback, $priority];
}
function remove_filter(string $hook, $callback, int $priority = 10): void {
$GLOBALS['aksrt_system_removed'][] = ['filter', $hook, $callback, $priority];
$GLOBALS['jio_system_removed'][] = ['filter', $hook, $callback, $priority];
}
function remove_action(string $hook, $callback, int $priority = 10): void {
$GLOBALS['aksrt_system_removed'][] = ['action', $hook, $callback, $priority];
$GLOBALS['jio_system_removed'][] = ['action', $hook, $callback, $priority];
}
function wp_deregister_style(string $handle): void {}
function wp_register_style(string $handle, $src): void {}
function wp_enqueue_style(string $handle, $src = ''): void {}
function remove_image_size(string $name): void {
$GLOBALS['aksrt_system_added'][] = ['remove_image_size', $name, null, 10];
$GLOBALS['jio_system_added'][] = ['remove_image_size', $name, null, 10];
}
function system_tools_check(bool $condition, string $message): void {
@@ -38,14 +38,14 @@ namespace {
}
function system_tools_added(string $type, string $hook): bool {
foreach ($GLOBALS['aksrt_system_added'] as $row) {
foreach ($GLOBALS['jio_system_added'] as $row) {
if ($row[0] === $type && $row[1] === $hook) return true;
}
return false;
}
function system_tools_removed(string $type, string $hook, string $needle = ''): bool {
foreach ($GLOBALS['aksrt_system_removed'] as $row) {
foreach ($GLOBALS['jio_system_removed'] as $row) {
if ($row[0] !== $type || $row[1] !== $hook) continue;
if ($needle === '') return true;
if (is_array($row[2])) {
@@ -65,8 +65,8 @@ namespace {
}
function system_tools_reset(): void {
$GLOBALS['aksrt_system_added'] = [];
$GLOBALS['aksrt_system_removed'] = [];
$GLOBALS['jio_system_added'] = [];
$GLOBALS['jio_system_removed'] = [];
}
require dirname(__DIR__, 2) . '/src/Settings/ExtensionRuntime.php';
@@ -80,13 +80,13 @@ namespace {
require dirname(__DIR__, 2) . '/inc/helpers/template-tags/search-meta.php';
}
namespace AKSRT\Settings {
namespace Jio\Settings {
final class Settings {
public static function get_all(): array { return $GLOBALS['aksrt_system_settings']; }
public static function get_all(): array { return $GLOBALS['jio_system_settings']; }
}
}
namespace AKSRT\SystemToolsHarness {
namespace Jio\SystemToolsHarness {
final class WpEmbedStub {
public function autoembed($content) { return $content; }
public function maybe_run_ajax_cache(): void {}
@@ -94,13 +94,13 @@ namespace AKSRT\SystemToolsHarness {
}
namespace {
use AKSRT\Admin\Schema\SchemaExtensions;
use AKSRT\Admin\Schema\SchemaExtensionsSystem;
use AKSRT\Extensions\SystemTools;
use AKSRT\Settings\ExtensionRuntime;
use Jio\Admin\Schema\SchemaExtensions;
use Jio\Admin\Schema\SchemaExtensionsSystem;
use Jio\Extensions\SystemTools;
use Jio\Settings\ExtensionRuntime;
$GLOBALS['aksrt_system_is_super_admin'] = false;
$GLOBALS['wp_embed'] = new \AKSRT\SystemToolsHarness\WpEmbedStub();
$GLOBALS['jio_system_is_super_admin'] = false;
$GLOBALS['wp_embed'] = new \Jio\SystemToolsHarness\WpEmbedStub();
// 1) Defaults match the reference theme's 系统工具 defaults.
$defaults = ExtensionRuntime::get_system_tools_settings();
@@ -130,7 +130,7 @@ namespace {
}
// 2) Stored values sanitize: rename type whitelist, switch coercion, passthrough format.
$GLOBALS['aksrt_system_settings'] = [
$GLOBALS['jio_system_settings'] = [
'newfilename_type' => 'bogus',
'newfilename' => 1,
'time_ago_s' => 0,
@@ -149,18 +149,18 @@ namespace {
system_tools_check($clean['mce_float_toolbar'] === ['m_s'], 'float toolbar scenes should whitelist and dedupe');
// 2b) Unsaved float toolbar key keeps the both-scenes default; explicit empty stays empty.
$GLOBALS['aksrt_system_settings'] = ['hide_admin_bar' => 0];
$GLOBALS['jio_system_settings'] = ['hide_admin_bar' => 0];
$clean = ExtensionRuntime::get_system_tools_settings();
system_tools_check($clean['mce_float_toolbar'] === ['pc_s', 'm_s'], 'float toolbar should default to pc+mobile');
system_tools_check($clean['hide_admin_bar'] === false, 'stored falsy value should not fall back to default');
$GLOBALS['aksrt_system_settings'] = ['mce_float_toolbar' => []];
$GLOBALS['jio_system_settings'] = ['mce_float_toolbar' => []];
$clean = ExtensionRuntime::get_system_tools_settings();
system_tools_check($clean['mce_float_toolbar'] === [], 'explicitly empty float toolbar should stay empty');
// 3) Hook wiring with every switch enabled.
$GLOBALS['aksrt_system_settings'] = array_fill_keys(array_keys($expected), true);
$GLOBALS['aksrt_system_settings']['time_format'] = 'n月j日 H:i';
$GLOBALS['aksrt_system_is_super_admin'] = false;
$GLOBALS['jio_system_settings'] = array_fill_keys(array_keys($expected), true);
$GLOBALS['jio_system_settings']['time_format'] = 'n月j日 H:i';
$GLOBALS['jio_system_is_super_admin'] = false;
system_tools_reset();
SystemTools::get_instance()->init();
@@ -181,8 +181,8 @@ namespace {
system_tools_check(system_tools_removed('action', 'init', 'wp_schedule_update_checks'), 'update cron schedule should be removed');
// 4) hide_admin_bar off keeps the admin bar for super admins.
$GLOBALS['aksrt_system_settings']['hide_admin_bar'] = false;
$GLOBALS['aksrt_system_is_super_admin'] = true;
$GLOBALS['jio_system_settings']['hide_admin_bar'] = false;
$GLOBALS['jio_system_is_super_admin'] = true;
system_tools_reset();
SystemTools::get_instance()->init();
system_tools_check(!system_tools_added('filter', 'show_admin_bar'), 'super admin should keep the admin bar when hide_admin_bar is off');
@@ -225,10 +225,10 @@ namespace {
system_tools_check($passed === 'passthrough', 'update checks should pass through the blocker');
// 8) Large thumbnail pruning removes the reference theme's size list.
$GLOBALS['aksrt_system_added'] = [];
$GLOBALS['jio_system_added'] = [];
$tools->disable_large_thumbnail();
$sizes_filter = null;
foreach ($GLOBALS['aksrt_system_added'] as $row) {
foreach ($GLOBALS['jio_system_added'] as $row) {
if ($row[0] === 'filter' && $row[1] === 'intermediate_image_sizes') {
$sizes_filter = $row[2];
}
@@ -252,17 +252,17 @@ namespace {
$client_defaults = array_keys($expected);
system_tools_check(count(SchemaExtensionsSystem::build()['groups']) === 3, 'system schema should keep three groups');
// 10) aksrt_time_ago honors the 倒计时显示 switch and custom format.
// 10) jio_time_ago honors the 倒计时显示 switch and custom format.
$past = date('Y-m-d H:i:s', strtotime('-3 days'));
$GLOBALS['aksrt_system_settings'] = [];
system_tools_check(strpos(aksrt_time_ago($past), '天前') !== false, 'relative time should be used by default');
$GLOBALS['aksrt_system_settings'] = ['time_ago_s' => 0, 'time_format' => 'Y年n月j日'];
$GLOBALS['jio_system_settings'] = [];
system_tools_check(strpos(jio_time_ago($past), '天前') !== false, 'relative time should be used by default');
$GLOBALS['jio_system_settings'] = ['time_ago_s' => 0, 'time_format' => 'Y年n月j日'];
$stamp = strtotime('-3 days');
system_tools_check(aksrt_time_ago(date('Y-m-d H:i:s', $stamp)) === date('Y年n月j日', $stamp), 'custom time format should apply when countdown display is off');
$GLOBALS['aksrt_system_settings'] = ['time_ago_s' => 0, 'time_format' => ''];
system_tools_check(strpos(aksrt_time_ago($past), '天前') !== false, 'empty custom format should fall back to relative time');
$GLOBALS['aksrt_system_settings'] = ['time_ago_s' => 1];
system_tools_check(strpos(aksrt_time_ago($past), '天前') !== false, 'countdown display should stay relative when enabled');
system_tools_check(jio_time_ago(date('Y-m-d H:i:s', $stamp)) === date('Y年n月j日', $stamp), 'custom time format should apply when countdown display is off');
$GLOBALS['jio_system_settings'] = ['time_ago_s' => 0, 'time_format' => ''];
system_tools_check(strpos(jio_time_ago($past), '天前') !== false, 'empty custom format should fall back to relative time');
$GLOBALS['jio_system_settings'] = ['time_ago_s' => 1];
system_tools_check(strpos(jio_time_ago($past), '天前') !== false, 'countdown display should stay relative when enabled');
echo "System tools harness passed\n";
}