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
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* Render the private badge modal templates against a small WordPress fixture.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings {
|
||||
namespace Jio\Settings {
|
||||
final class Settings {
|
||||
public static array $settings = [];
|
||||
|
||||
@@ -17,29 +17,29 @@ namespace AKSRT\Settings {
|
||||
|
||||
namespace {
|
||||
define('ABSPATH', __DIR__ . '/');
|
||||
$GLOBALS['aksrt_test_current_user'] = 1;
|
||||
$GLOBALS['aksrt_test_meta'] = [
|
||||
$GLOBALS['jio_test_current_user'] = 1;
|
||||
$GLOBALS['jio_test_meta'] = [
|
||||
1 => [
|
||||
'aksrt_user_badges' => [
|
||||
'jio_user_badges' => [
|
||||
'manual-owned' => '2026-01-02 03:04:05',
|
||||
'auto-owned' => '2026-02-03 04:05:06',
|
||||
],
|
||||
'aksrt_wear_badge' => 'manual-owned',
|
||||
'jio_wear_badge' => 'manual-owned',
|
||||
],
|
||||
2 => [
|
||||
'aksrt_user_badges' => [
|
||||
'jio_user_badges' => [
|
||||
'manual-owned' => '2026-03-04 05:06:07',
|
||||
'auto-owned' => '2026-04-05 06:07:08',
|
||||
],
|
||||
'aksrt_wear_badge' => 'auto-owned',
|
||||
'jio_wear_badge' => 'auto-owned',
|
||||
],
|
||||
];
|
||||
$GLOBALS['aksrt_test_users'] = [
|
||||
$GLOBALS['jio_test_users'] = [
|
||||
1 => (object) ['ID' => 1, 'display_name' => 'Self <script>alert(1)</script>'],
|
||||
2 => (object) ['ID' => 2, 'display_name' => 'Other <img src=x onerror=alert(1)>'],
|
||||
9 => (object) ['ID' => 9, 'display_name' => 'Admin'],
|
||||
];
|
||||
$GLOBALS['aksrt_test_null_calls'] = [];
|
||||
$GLOBALS['jio_test_null_calls'] = [];
|
||||
|
||||
function sanitize_key($value): string { return strtolower(preg_replace('/[^a-z0-9_\-]/', '', (string) $value)); }
|
||||
function esc_html($value): string { return htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); }
|
||||
@@ -53,26 +53,26 @@ namespace {
|
||||
function absint($value): int { return abs((int) $value); }
|
||||
function admin_url($path = ''): string { return 'https://example.test/wp-admin/' . ltrim($path, '/'); }
|
||||
function add_query_arg($args, $url): string { return $url . '?' . http_build_query($args); }
|
||||
function get_current_user_id(): int { return (int) $GLOBALS['aksrt_test_current_user']; }
|
||||
function get_userdata($user_id) { return $GLOBALS['aksrt_test_users'][(int) $user_id] ?? false; }
|
||||
function get_current_user_id(): int { return (int) $GLOBALS['jio_test_current_user']; }
|
||||
function get_userdata($user_id) { return $GLOBALS['jio_test_users'][(int) $user_id] ?? false; }
|
||||
function get_the_author_meta($field, $user_id) { $user = get_userdata($user_id); return $user ? ($user->{$field} ?? '') : ''; }
|
||||
function get_user_meta($user_id, $key, $single = false) { return $GLOBALS['aksrt_test_meta'][(int) $user_id][$key] ?? ''; }
|
||||
function get_user_meta($user_id, $key, $single = false) { return $GLOBALS['jio_test_meta'][(int) $user_id][$key] ?? ''; }
|
||||
function user_can($user_id, $capability): bool { return (int) $user_id === 9 && $capability === 'manage_options'; }
|
||||
function aksrt_get_avatar_html($subject, $size = 96, $attrs = []): string {
|
||||
function jio_get_avatar_html($subject, $size = 96, $attrs = []): string {
|
||||
return '<img class="' . esc_attr($attrs['class'] ?? 'avatar-img') . '" width="' . (int) $size . '" height="' . (int) $size . '" src="avatar-' . (int) $subject . '.png" alt="">';
|
||||
}
|
||||
function aksrt_get_avatar_box($subject, string $class = 'avatar-img', bool $link = true, bool $vip = true): string {
|
||||
function jio_get_avatar_box($subject, string $class = 'avatar-img', bool $link = true, bool $vip = true): string {
|
||||
return '<span class="' . esc_attr($class) . '"><img class="avatar" width="38" height="38" src="avatar-' . (int) $subject . '.png" alt=""></span>';
|
||||
}
|
||||
function get_theme_file_uri($path = ''): string { return 'https://example.test/theme' . $path; }
|
||||
function aksrt_get_null($text = null, $margin = 60, $img = 'null.svg', $class = '', $width = 280, $height = 0): string {
|
||||
$GLOBALS['aksrt_test_null_calls'][] = [$text, $margin, $img];
|
||||
return '<div class="aksrt-test-null" data-margin="' . (int) $margin . '" data-image="' . esc_attr($img) . '">' . esc_html($text) . '</div>';
|
||||
function jio_get_null($text = null, $margin = 60, $img = 'null.svg', $class = '', $width = 280, $height = 0): string {
|
||||
$GLOBALS['jio_test_null_calls'][] = [$text, $margin, $img];
|
||||
return '<div class="jio-test-null" data-margin="' . (int) $margin . '" data-image="' . esc_attr($img) . '">' . esc_html($text) . '</div>';
|
||||
}
|
||||
|
||||
require dirname(__DIR__, 2) . '/src/User/Badges.php';
|
||||
|
||||
\AKSRT\Settings\Settings::$settings = [
|
||||
\Jio\Settings\Settings::$settings = [
|
||||
'medal' => [
|
||||
'enabled' => true,
|
||||
'public_display' => true,
|
||||
@@ -97,24 +97,24 @@ namespace {
|
||||
];
|
||||
|
||||
function render_private(string $method, array $args): string {
|
||||
$reflection = new \ReflectionMethod(\AKSRT\User\Badges::class, $method);
|
||||
$reflection = new \ReflectionMethod(\Jio\User\Badges::class, $method);
|
||||
return (string) $reflection->invokeArgs(null, $args);
|
||||
}
|
||||
|
||||
function reset_badge_caches(): void {
|
||||
\AKSRT\User\Badges::invalidate_cache();
|
||||
$property = new \ReflectionProperty(\AKSRT\User\Badges::class, 'dictionary_cache');
|
||||
\Jio\User\Badges::invalidate_cache();
|
||||
$property = new \ReflectionProperty(\Jio\User\Badges::class, 'dictionary_cache');
|
||||
$property->setValue(null, null);
|
||||
}
|
||||
|
||||
function render_case(int $viewer, string $template, int $user_id, string $slug = ''): array {
|
||||
$GLOBALS['aksrt_test_current_user'] = $viewer;
|
||||
$GLOBALS['jio_test_current_user'] = $viewer;
|
||||
reset_badge_caches();
|
||||
$args = $template === 'single' ? [$user_id, $slug] : [$user_id];
|
||||
if ($template === 'grant') $args = [$user_id];
|
||||
return [
|
||||
'html' => render_private($template === 'grant' ? 'modal_grant_html' : ($template === 'single' ? 'modal_single_html' : 'modal_info_html'), $args),
|
||||
'null_calls' => $GLOBALS['aksrt_test_null_calls'],
|
||||
'null_calls' => $GLOBALS['jio_test_null_calls'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -132,6 +132,6 @@ namespace {
|
||||
'grant_admin' => render_case(9, 'grant', 2),
|
||||
];
|
||||
$output['illustrated_empty'] = render_case(1, 'single', 1, 'missing');
|
||||
$output['null_calls'] = $GLOBALS['aksrt_test_null_calls'];
|
||||
$output['null_calls'] = $GLOBALS['jio_test_null_calls'];
|
||||
echo json_encode($output, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR);
|
||||
}
|
||||
Reference in new issue
Block a user