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
@@ -19,10 +19,10 @@ set_error_handler(static function (int $severity, string $message, string $file,
|
||||
throw new ErrorException($message, 0, $severity, $file, $line);
|
||||
});
|
||||
|
||||
$GLOBALS['aksrt_test_state'] = [];
|
||||
$GLOBALS['jio_test_state'] = [];
|
||||
|
||||
function aksrt_test_reset_state(): void {
|
||||
$GLOBALS['aksrt_test_state'] = [
|
||||
function jio_test_reset_state(): void {
|
||||
$GLOBALS['jio_test_state'] = [
|
||||
'options' => [],
|
||||
'sidebars' => [],
|
||||
'routes' => [],
|
||||
@@ -37,7 +37,7 @@ function aksrt_test_reset_state(): void {
|
||||
$GLOBALS['wp_registered_sidebars'] = [];
|
||||
}
|
||||
|
||||
aksrt_test_reset_state();
|
||||
jio_test_reset_state();
|
||||
|
||||
class WP_Error {
|
||||
public function __construct(private string $code = '', private string $message = '', private array $data = []) {}
|
||||
@@ -81,7 +81,7 @@ class WP_Query {
|
||||
public int $max_num_pages = 1;
|
||||
public int $found_posts = 0;
|
||||
public function __construct(array $args = []) {
|
||||
$GLOBALS['aksrt_test_state']['query_args'][] = $args;
|
||||
$GLOBALS['jio_test_state']['query_args'][] = $args;
|
||||
}
|
||||
public function have_posts(): bool { return false; }
|
||||
public function the_post(): void {}
|
||||
@@ -147,40 +147,40 @@ function wp_trim_words($text, int $count = 55): string {
|
||||
return implode(' ', array_slice($words, 0, $count));
|
||||
}
|
||||
|
||||
function get_option(string $name, $default = false) { return $GLOBALS['aksrt_test_state']['options'][$name] ?? $default; }
|
||||
function update_option(string $name, $value): bool { $GLOBALS['aksrt_test_state']['options'][$name] = $value; return true; }
|
||||
function wp_get_sidebars_widgets(): array { return $GLOBALS['aksrt_test_state']['sidebars']; }
|
||||
function wp_set_sidebars_widgets(array $sidebars): void { $GLOBALS['aksrt_test_state']['sidebars'] = $sidebars; }
|
||||
function get_option(string $name, $default = false) { return $GLOBALS['jio_test_state']['options'][$name] ?? $default; }
|
||||
function update_option(string $name, $value): bool { $GLOBALS['jio_test_state']['options'][$name] = $value; return true; }
|
||||
function wp_get_sidebars_widgets(): array { return $GLOBALS['jio_test_state']['sidebars']; }
|
||||
function wp_set_sidebars_widgets(array $sidebars): void { $GLOBALS['jio_test_state']['sidebars'] = $sidebars; }
|
||||
function register_rest_route(string $namespace, string $route, array $args): bool {
|
||||
$GLOBALS['aksrt_test_state']['routes'][$namespace . $route] = $args;
|
||||
$GLOBALS['jio_test_state']['routes'][$namespace . $route] = $args;
|
||||
return true;
|
||||
}
|
||||
function rest_ensure_response($data): WP_REST_Response { return $data instanceof WP_REST_Response ? $data : new WP_REST_Response($data); }
|
||||
function is_wp_error($value): bool { return $value instanceof WP_Error; }
|
||||
function is_singular(): bool { return (bool) $GLOBALS['aksrt_test_state']['singular']; }
|
||||
function get_queried_object_id(): int { return (int) $GLOBALS['aksrt_test_state']['current_id']; }
|
||||
function is_singular(): bool { return (bool) $GLOBALS['jio_test_state']['singular']; }
|
||||
function get_queried_object_id(): int { return (int) $GLOBALS['jio_test_state']['current_id']; }
|
||||
function get_post($post = null) {
|
||||
if ($post instanceof WP_Post) return $post;
|
||||
return $GLOBALS['aksrt_test_state']['current_post'];
|
||||
return $GLOBALS['jio_test_state']['current_post'];
|
||||
}
|
||||
function aksrt_get_widget_null(string $message): string { return '<div class="aksrt-widget__empty" role="status">' . esc_html($message) . '</div>'; }
|
||||
function aksrt_get_pay_meta($post = null): array { unset($post); return $GLOBALS['aksrt_test_state']['pay_meta']; }
|
||||
function aksrt_has_paid_access($post = null): bool { unset($post); return (bool) $GLOBALS['aksrt_test_state']['paid_access']; }
|
||||
function aksrt_get_paywall_html(WP_Post $post, array|bool $options = false): string {
|
||||
function jio_get_widget_null(string $message): string { return '<div class="jio-widget__empty" role="status">' . esc_html($message) . '</div>'; }
|
||||
function jio_get_pay_meta($post = null): array { unset($post); return $GLOBALS['jio_test_state']['pay_meta']; }
|
||||
function jio_has_paid_access($post = null): bool { unset($post); return (bool) $GLOBALS['jio_test_state']['paid_access']; }
|
||||
function jio_get_paywall_html(WP_Post $post, array|bool $options = false): string {
|
||||
unset($post, $options);
|
||||
$meta = $GLOBALS['aksrt_test_state']['pay_meta'];
|
||||
$meta = $GLOBALS['jio_test_state']['pay_meta'];
|
||||
if ((string) ($meta['pay_type'] ?? 'no') === 'no') {
|
||||
return '';
|
||||
}
|
||||
if ((bool) $GLOBALS['aksrt_test_state']['paid_access']) {
|
||||
if ((bool) $GLOBALS['jio_test_state']['paid_access']) {
|
||||
return '<div data-test-paywall="unlocked">内容已解锁</div>';
|
||||
}
|
||||
$state = $GLOBALS['aksrt_test_state']['logged_in'] ? 'member-locked' : 'guest-locked';
|
||||
$state = $GLOBALS['jio_test_state']['logged_in'] ? 'member-locked' : 'guest-locked';
|
||||
return '<div data-test-paywall="' . $state . '">PAYWALL</div>';
|
||||
}
|
||||
function aksrt_get_pay_attributes_html($post, string $class): string { unset($post); return '<ul class="' . esc_attr($class) . '"></ul>'; }
|
||||
function aksrt_get_demo_link_html($post, string $class): string { unset($post); return '<a class="' . esc_attr($class) . '">DEMO</a>'; }
|
||||
function is_user_logged_in(): bool { return (bool) $GLOBALS['aksrt_test_state']['logged_in']; }
|
||||
function jio_get_pay_attributes_html($post, string $class): string { unset($post); return '<ul class="' . esc_attr($class) . '"></ul>'; }
|
||||
function jio_get_demo_link_html($post, string $class): string { unset($post); return '<a class="' . esc_attr($class) . '">DEMO</a>'; }
|
||||
function is_user_logged_in(): bool { return (bool) $GLOBALS['jio_test_state']['logged_in']; }
|
||||
function wp_parse_args($args, array $defaults = []): array {
|
||||
return array_merge($defaults, is_array($args) ? $args : []);
|
||||
}
|
||||
@@ -191,20 +191,20 @@ function wp_kses(string $value, array $allowed_html = [], array $allowed_protoco
|
||||
// 桩环境信任来源:生产侧的 wp_kses 白名单允许 div/badge 等组合卡标记。
|
||||
return (string) $value;
|
||||
}
|
||||
function aksrt_is_lazy(string $key, bool $default = false): bool { unset($key, $default); return true; }
|
||||
function aksrt_get_lazy_thumb(string $size = ''): string {
|
||||
function jio_is_lazy(string $key, bool $default = false): bool { unset($key, $default); return true; }
|
||||
function jio_get_lazy_thumb(string $size = ''): string {
|
||||
return 'https://example.test/thumbnail' . ($size !== '' ? '-' . sanitize_key($size) : '') . '.svg';
|
||||
}
|
||||
function aksrt_get_lazy_attr(string $key, string $src, string $class = '', string $lazy_src = ''): string {
|
||||
function jio_get_lazy_attr(string $key, string $src, string $class = '', string $lazy_src = ''): string {
|
||||
unset($key);
|
||||
$class = trim($class);
|
||||
if ($src === '') {
|
||||
return ' class="' . esc_attr($class) . '" src=""';
|
||||
}
|
||||
$lazy_src = $lazy_src !== '' ? $lazy_src : aksrt_get_lazy_thumb();
|
||||
$lazy_src = $lazy_src !== '' ? $lazy_src : jio_get_lazy_thumb();
|
||||
return ' class="lazyload ' . esc_attr($class) . '" src="' . esc_url($lazy_src) . '" data-src="' . esc_url($src) . '"';
|
||||
}
|
||||
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/aksrt-icons.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/aksrt-graphic-card.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/jio-icons.php';
|
||||
require dirname(__DIR__, 2) . '/inc/helpers/jio-graphic-card.php';
|
||||
require dirname(__DIR__, 2) . '/vendor/autoload.php';
|
||||
Reference in new issue
Block a user