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,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace AKSRT\Settings {
|
||||
namespace Jio\Settings {
|
||||
final class Settings {
|
||||
public static bool $closed = false;
|
||||
public static bool $registration = true;
|
||||
@@ -17,7 +17,7 @@ namespace AKSRT\Settings {
|
||||
}
|
||||
}
|
||||
|
||||
namespace AKSRT\Auth {
|
||||
namespace Jio\Auth {
|
||||
final class OAuth {
|
||||
public static function get_instance(): self {
|
||||
return new self();
|
||||
@@ -67,7 +67,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['aksrt_user_card_state'] = [
|
||||
$GLOBALS['jio_user_card_state'] = [
|
||||
'current_user_id' => 0,
|
||||
'post' => null,
|
||||
];
|
||||
@@ -82,86 +82,86 @@ namespace {
|
||||
function sanitize_html_class($value): string { return preg_replace('/[^A-Za-z0-9_-]/', '', (string) $value) ?? ''; }
|
||||
function wp_parse_args($args, array $defaults = []): array { return array_merge($defaults, is_array($args) ? $args : []); }
|
||||
function get_option($name, $default = false) { unset($name); return $default; }
|
||||
function get_current_user_id(): int { return (int) $GLOBALS['aksrt_user_card_state']['current_user_id']; }
|
||||
function get_current_user_id(): int { return (int) $GLOBALS['jio_user_card_state']['current_user_id']; }
|
||||
function get_userdata($user_id): ?WP_User {
|
||||
$user_id = (int) $user_id;
|
||||
return $user_id > 0 ? new WP_User($user_id, 'User ' . $user_id) : null;
|
||||
}
|
||||
function get_post(): ?WP_Post { return $GLOBALS['aksrt_user_card_state']['post']; }
|
||||
function get_post(): ?WP_Post { return $GLOBALS['jio_user_card_state']['post']; }
|
||||
|
||||
function aksrt_get_user_cover_url(int $user_id): string {
|
||||
function jio_get_user_cover_url(int $user_id): string {
|
||||
return $user_id > 0 ? 'https://example.test/cover-' . $user_id . '.jpg' : 'https://example.test/default-cover.jpg';
|
||||
}
|
||||
function aksrt_get_lazy_thumb(): string { return 'https://example.test/lazy.svg'; }
|
||||
function aksrt_get_lazy_attr(string $type, string $url, string $class, string $placeholder = ''): string {
|
||||
function jio_get_lazy_thumb(): string { return 'https://example.test/lazy.svg'; }
|
||||
function jio_get_lazy_attr(string $type, string $url, string $class, string $placeholder = ''): string {
|
||||
return ' class="' . esc_attr($class) . '" data-lazy-type="' . esc_attr($type) . '" src="' . esc_url($placeholder ?: $url) . '" data-src="' . esc_url($url) . '"';
|
||||
}
|
||||
function aksrt_get_default_avatar_url(): string { return 'https://example.test/default-avatar.png'; }
|
||||
function aksrt_get_avatar_html($subject, int $size, array $attrs = []): string {
|
||||
function jio_get_default_avatar_url(): string { return 'https://example.test/default-avatar.png'; }
|
||||
function jio_get_avatar_html($subject, int $size, array $attrs = []): string {
|
||||
unset($subject);
|
||||
return '<img class="' . esc_attr((string) ($attrs['class'] ?? 'avatar')) . '" alt="' . esc_attr((string) ($attrs['alt'] ?? '')) . '" width="' . $size . '" height="' . $size . '">';
|
||||
}
|
||||
function aksrt_get_avatar_box($user_id, string $class, bool $link = true, bool $vip = true): string {
|
||||
function jio_get_avatar_box($user_id, string $class, bool $link = true, bool $vip = true): string {
|
||||
$inner = '<span class="' . esc_attr($class) . '"><img class="avatar"></span>';
|
||||
return $link ? '<a href="https://example.test/user/' . (int) $user_id . '">' . $inner . '</a>' : $inner;
|
||||
}
|
||||
function aksrt_get_user_name(array $args): string {
|
||||
function jio_get_user_name(array $args): string {
|
||||
return '<name class="' . esc_attr((string) ($args['class'] ?? '')) . '"><a class="display-name">User ' . (int) ($args['id'] ?? 0) . '</a></name>';
|
||||
}
|
||||
function aksrt_get_user_badges(int $user_id): string { return '<span class="badg">' . $user_id . '</span>'; }
|
||||
function aksrt_get_user_description(int $user_id): string { return 'Description ' . $user_id; }
|
||||
function aksrt_header_user_checkin_btn(int $user_id, string $class): string {
|
||||
function jio_get_user_badges(int $user_id): string { return '<span class="badg">' . $user_id . '</span>'; }
|
||||
function jio_get_user_description(int $user_id): string { return 'Description ' . $user_id; }
|
||||
function jio_header_user_checkin_btn(int $user_id, string $class): string {
|
||||
unset($user_id);
|
||||
return '<a class="' . esc_attr($class) . '" href="javascript:;">签到</a>';
|
||||
}
|
||||
function aksrt_render_user_card_posts(array $args): string {
|
||||
function jio_render_user_card_posts(array $args): string {
|
||||
return '<div data-post-type="' . esc_attr((string) ($args['post_type'] ?? '')) . '" data-post-style="' . esc_attr((string) ($args['post_style'] ?? '')) . '"></div>';
|
||||
}
|
||||
function aksrt_get_new_post_url(): string { return 'https://example.test/new-post'; }
|
||||
function aksrt_get_user_home_url($user_id): string { return 'https://example.test/user/' . (int) $user_id; }
|
||||
function aksrt_get_user_center_url(): string { return 'https://example.test/user-center'; }
|
||||
function aksrt_renderer_svg_icon(string $name): string { return '<svg data-icon="' . esc_attr($name) . '"></svg>'; }
|
||||
function jio_get_new_post_url(): string { return 'https://example.test/new-post'; }
|
||||
function jio_get_user_home_url($user_id): string { return 'https://example.test/user/' . (int) $user_id; }
|
||||
function jio_get_user_center_url(): string { return 'https://example.test/user-center'; }
|
||||
function jio_renderer_svg_icon(string $name): string { return '<svg data-icon="' . esc_attr($name) . '"></svg>'; }
|
||||
|
||||
require dirname(__DIR__, 2) . '/src/WidgetSystem/Renderers/UserRenderer.php';
|
||||
|
||||
function aksrt_render_user_widget_state(string $slug, array $instance): string {
|
||||
return \AKSRT\WidgetSystem\Renderers\UserRenderer::render($slug, $instance);
|
||||
function jio_render_user_widget_state(string $slug, array $instance): string {
|
||||
return \Jio\WidgetSystem\Renderers\UserRenderer::render($slug, $instance);
|
||||
}
|
||||
|
||||
\AKSRT\Settings\Settings::$closed = false;
|
||||
\AKSRT\Settings\Settings::$registration = true;
|
||||
$GLOBALS['aksrt_user_card_state']['current_user_id'] = 0;
|
||||
$guest = aksrt_render_user_widget_state('user_card', [
|
||||
\Jio\Settings\Settings::$closed = false;
|
||||
\Jio\Settings\Settings::$registration = true;
|
||||
$GLOBALS['jio_user_card_state']['current_user_id'] = 0;
|
||||
$guest = jio_render_user_widget_state('user_card', [
|
||||
'show_img_bg' => true,
|
||||
'loged_title' => 'HI!请登录',
|
||||
]);
|
||||
|
||||
\AKSRT\Settings\Settings::$registration = false;
|
||||
$guest_no_registration = aksrt_render_user_widget_state('user_card', [
|
||||
\Jio\Settings\Settings::$registration = false;
|
||||
$guest_no_registration = jio_render_user_widget_state('user_card', [
|
||||
'show_img_bg' => true,
|
||||
'loged_title' => 'HI!请登录',
|
||||
]);
|
||||
|
||||
\AKSRT\Settings\Settings::$closed = true;
|
||||
$closed = aksrt_render_user_widget_state('user_card', []);
|
||||
\Jio\Settings\Settings::$closed = true;
|
||||
$closed = jio_render_user_widget_state('user_card', []);
|
||||
|
||||
\AKSRT\Settings\Settings::$closed = false;
|
||||
\AKSRT\Settings\Settings::$registration = true;
|
||||
$GLOBALS['aksrt_user_card_state']['current_user_id'] = 7;
|
||||
$logged = aksrt_render_user_widget_state('user_card', [
|
||||
\Jio\Settings\Settings::$closed = false;
|
||||
\Jio\Settings\Settings::$registration = true;
|
||||
$GLOBALS['jio_user_card_state']['current_user_id'] = 7;
|
||||
$logged = jio_render_user_widget_state('user_card', [
|
||||
'show_img_bg' => true,
|
||||
'show_button' => false,
|
||||
]);
|
||||
|
||||
$logged_buttons = aksrt_render_user_widget_state('user_card', [
|
||||
$logged_buttons = jio_render_user_widget_state('user_card', [
|
||||
'show_img_bg' => false,
|
||||
'button_1_text' => '发布文章',
|
||||
'button_2_text' => '用户中心',
|
||||
]);
|
||||
|
||||
$GLOBALS['aksrt_user_card_state']['current_user_id'] = 2;
|
||||
$GLOBALS['aksrt_user_card_state']['post'] = new WP_Post(33, 9);
|
||||
$author = aksrt_render_user_widget_state('author_card', [
|
||||
$GLOBALS['jio_user_card_state']['current_user_id'] = 2;
|
||||
$GLOBALS['jio_user_card_state']['post'] = new WP_Post(33, 9);
|
||||
$author = jio_render_user_widget_state('author_card', [
|
||||
'show_img_bg' => true,
|
||||
'show_posts' => true,
|
||||
'post_style' => 'card',
|
||||
|
||||
Reference in new issue
Block a user