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

+29 -29
View File
@@ -2,16 +2,16 @@
/**
* Exercise report submission, storage, notifications, and admin filtering without WordPress.
*
* @package AKSRT
* @package Jio
*/
namespace AKSRT\Core {
namespace Jio\Core {
final class DBMigrator {
public static function table(string $name): string { return 'wp_aksrt_' . $name; }
public static function table(string $name): string { return 'wp_jio_' . $name; }
}
}
namespace AKSRT\Settings {
namespace Jio\Settings {
final class Settings {
public static array $values = [];
public static function get_all(): array { return self::$values; }
@@ -22,24 +22,24 @@ namespace AKSRT\Settings {
}
}
namespace AKSRT\Messages {
namespace Jio\Messages {
final class Message {
public static function get_instance(): self { return new self(); }
public function send(int $user_id, string $type, string $content, array $args = []): void {
$GLOBALS['aksrt_test_messages'][] = compact('user_id', 'type', 'content', 'args');
$GLOBALS['jio_test_messages'][] = compact('user_id', 'type', 'content', 'args');
}
}
}
namespace AKSRT\Attachment {
namespace Jio\Attachment {
final class PendingUploads {
public static function claim_text(string $text, int $user_id): void {
$GLOBALS['aksrt_test_claims'][] = [$text, $user_id];
$GLOBALS['jio_test_claims'][] = [$text, $user_id];
}
}
}
namespace AKSRT\User {
namespace Jio\User {
final class Restriction {
public const TYPE_WARN = 'warn';
public const TYPE_MUTE = 'mute';
@@ -193,7 +193,7 @@ namespace {
}
final class ReportFixtureController {
use \AKSRT\Admin\UserControllerReportOperations;
use \Jio\Admin\UserControllerReportOperations;
protected function success($data = [], int $status = 200): WP_REST_Response {
return new WP_REST_Response(array_merge(['success' => true], $data), $status);
@@ -226,7 +226,7 @@ namespace {
function wp_kses_post($value): string { return strip_tags((string) $value); }
function current_time(string $type): string { unset($type); return '2026-10-30 12:00:00'; }
function wp_json_encode($value): string { return json_encode($value, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) ?: '[]'; }
function get_current_user_id(): int { return (int) ($GLOBALS['aksrt_test_user_id'] ?? 0); }
function get_current_user_id(): int { return (int) ($GLOBALS['jio_test_user_id'] ?? 0); }
function get_userdata(int $user_id) { return $user_id > 0 ? new WP_User($user_id, 'Reporter ' . $user_id) : false; }
function get_users(array $args = []): array { unset($args); return [901]; }
function admin_url(string $path = ''): string { return 'https://example.test/wp-admin/' . ltrim($path, '/'); }
@@ -234,8 +234,8 @@ namespace {
function get_the_title($post): string { return 'Article #' . (is_object($post) ? $post->ID : (int) $post); }
function get_permalink($post): string { return 'https://example.test/post/' . (is_object($post) ? $post->ID : (int) $post); }
function do_action(string $hook, ...$args): void {
if ($hook === 'aksrt_report_submitted') {
$GLOBALS['aksrt_test_actions'][] = $args;
if ($hook === 'jio_report_submitted') {
$GLOBALS['jio_test_actions'][] = $args;
}
}
if (!function_exists('mb_substr')) {
@@ -246,12 +246,12 @@ namespace {
function reset_report_fixture(array $preset_names = ['垃圾信息', '人身攻击']): void {
$GLOBALS['wpdb'] = new TestWpdb();
$GLOBALS['aksrt_test_user_id'] = 42;
$GLOBALS['aksrt_test_actions'] = [];
$GLOBALS['aksrt_test_messages'] = [];
$GLOBALS['aksrt_test_claims'] = [];
\AKSRT\User\Restriction::$calls = [];
\AKSRT\Settings\Settings::$values = [
$GLOBALS['jio_test_user_id'] = 42;
$GLOBALS['jio_test_actions'] = [];
$GLOBALS['jio_test_messages'] = [];
$GLOBALS['jio_test_claims'] = [];
\Jio\User\Restriction::$calls = [];
\Jio\Settings\Settings::$values = [
'ban_preset_reason' => array_map(static fn (string $name): array => ['t' => $name], $preset_names),
'user_report_img_s' => true,
];
@@ -268,16 +268,16 @@ namespace {
'status' => $response->get_status(),
'rows' => $wpdb->rows,
'insert_calls' => $wpdb->insert_calls,
'actions' => $GLOBALS['aksrt_test_actions'],
'messages' => $GLOBALS['aksrt_test_messages'],
'claims' => $GLOBALS['aksrt_test_claims'],
'actions' => $GLOBALS['jio_test_actions'],
'messages' => $GLOBALS['jio_test_messages'],
'claims' => $GLOBALS['jio_test_claims'],
];
}
$results = [];
reset_report_fixture(['垃圾信息', '人身攻击']);
$results['runtime_reasons'] = \AKSRT\Settings\UserRuntime::ban_settings()['reasons'];
$results['runtime_reasons'] = \Jio\Settings\UserRuntime::ban_settings()['reasons'];
reset_report_fixture();
$results['preset_with_evidence'] = snapshot_response(submit_report_case([
@@ -349,7 +349,7 @@ namespace {
]));
reset_report_fixture();
$GLOBALS['aksrt_test_user_id'] = 0;
$GLOBALS['jio_test_user_id'] = 0;
$results['unauthenticated'] = snapshot_response(submit_report_case([
'target_type' => 'post', 'target_id' => 5, 'category' => '垃圾信息', 'reason' => '',
]));
@@ -400,7 +400,7 @@ namespace {
];
reset_report_fixture();
$service_id = \AKSRT\Messages\ReportCenter::get_instance()->submit(42, 'post', 6, '详情', '');
$service_id = \Jio\Messages\ReportCenter::get_instance()->submit(42, 'post', 6, '详情', '');
$results['service_blank_category'] = [
'id' => $service_id,
'rows' => $GLOBALS['wpdb']->rows,
@@ -415,9 +415,9 @@ namespace {
'target_type' => 'post', 'target_id' => 62, 'category' => '待删除的分类', 'reason' => '',
]);
$admin_controller = new ReportFixtureController();
\AKSRT\Settings\Settings::$values['ban_preset_reason'] = [['t' => '当前新分类']];
\Jio\Settings\Settings::$values['ban_preset_reason'] = [['t' => '当前新分类']];
$changed_list = $admin_controller->get_report_list(new WP_REST_Request())->get_data()['data'] ?? [];
\AKSRT\Settings\Settings::$values['ban_preset_reason'] = [];
\Jio\Settings\Settings::$values['ban_preset_reason'] = [];
$removed_list = $admin_controller->get_report_list(new WP_REST_Request())->get_data()['data'] ?? [];
$first_detail = $admin_controller->get_report_detail(new WP_REST_Request(['id' => 1]))->get_data()['data']['report'] ?? [];
$second_detail = $admin_controller->get_report_detail(new WP_REST_Request(['id' => 2]))->get_data()['data']['report'] ?? [];
@@ -444,7 +444,7 @@ namespace {
$preset_row = $GLOBALS['wpdb']->rows[0];
$results['process_preset_only'] = [
'success' => !empty($preset_process->get_data()['success']),
'restriction' => \AKSRT\User\Restriction::$calls[0] ?? [],
'restriction' => \Jio\User\Restriction::$calls[0] ?? [],
'report_reason' => $preset_row['reason'],
'report_category' => $preset_row['category'],
];
@@ -462,7 +462,7 @@ namespace {
$other_row = $GLOBALS['wpdb']->rows[0];
$results['process_other_with_details'] = [
'success' => !empty($other_process->get_data()['success']),
'restriction' => \AKSRT\User\Restriction::$calls[0] ?? [],
'restriction' => \Jio\User\Restriction::$calls[0] ?? [],
'report_reason' => $other_row['reason'],
'report_category' => $other_row['category'],
];