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

+23 -23
View File
@@ -1,9 +1,9 @@
<?php
namespace AKSRT\WidgetSystem\Renderers;
namespace Jio\WidgetSystem\Renderers;
use AKSRT\WidgetSystem\PostRenderer;
use AKSRT\WidgetSystem\RendererHelpers;
use Jio\WidgetSystem\PostRenderer;
use Jio\WidgetSystem\RendererHelpers;
defined('ABSPATH') || exit;
@@ -19,7 +19,7 @@ final class ContentRenderer {
case 'post_pay': return self::post_pay($instance);
case 'tab_posts': return self::tab_posts($instance, $context);
case 'posts': return self::posts($instance, $context, 'posts');
case 'hot_posts': return function_exists('aksrt_widget_hot_posts') ? aksrt_widget_hot_posts($instance) : '';
case 'hot_posts': return function_exists('jio_widget_hot_posts') ? jio_widget_hot_posts($instance) : '';
case 'oneline_posts': return self::posts($instance, $context, 'oneline_posts');
}
return '';
@@ -30,8 +30,8 @@ final class ContentRenderer {
$style = $instance['style'];
if ($slug === 'oneline_posts') {
// Reference parity: the swiper row is fully rendered server-side.
$query = \AKSRT\WidgetSystem\PostQuery::build(array_merge($instance, ['paginate' => '']), 1, []);
return \AKSRT\WidgetSystem\PostRenderer::items($query, $instance, 'oneline_posts');
$query = \Jio\WidgetSystem\PostQuery::build(array_merge($instance, ['paginate' => '']), 1, []);
return \Jio\WidgetSystem\PostRenderer::items($query, $instance, 'oneline_posts');
}
$inner = self::ajaxpager($instance, $slug, $widget_id, 1, '');
$html = '<div class="widget-main-post mb20 style-' . esc_attr($style) . '">';
@@ -48,7 +48,7 @@ final class ContentRenderer {
$attrs .= ' data-segment="' . esc_attr($segment) . '"';
}
$lazy = ($instance['load_mode'] ?? '') === 'ajax';
$loader = '<div class="post_ajax_loader' . ($lazy ? ' is-loading' : '') . '" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . self::placeholder($instance) . '</div>';
$loader = '<div class="post_ajax_loader' . ($lazy ? ' is-loading' : '') . '" role="status" aria-label="' . esc_attr__('正在加载', 'jio') . '">' . self::placeholder($instance) . '</div>';
if ($lazy) {
// lazySizes reveals the pager; the widget client owns its request.
return '<div class="widget-ajaxpager lazyload" data-widget-lazy' . $attrs . ' aria-live="polite" aria-busy="true">' . $loader . '</div>';
@@ -65,12 +65,12 @@ final class ContentRenderer {
$count = max(1, (int) ($instance['count'] ?? 6));
if ($style === 'mini') {
$mini_opt = (array) ($instance['mini_opt'] ?? []);
return aksrt_render_placeholder(
return jio_render_placeholder(
in_array('show_thumb', $mini_opt, true) ? 'mini_thumb' : 'mini',
$count
);
}
return aksrt_render_placeholder($style === 'card' ? 'card' : 'list', $count);
return jio_render_placeholder($style === 'card' ? 'card' : 'list', $count);
}
private static function tab_posts(array $instance, array $context): string {
@@ -83,11 +83,11 @@ final class ContentRenderer {
$buttons = '';
$panels = '';
$key = sanitize_html_class($widget_id) ?: 'preview';
$panel_id = 'aksrt-tab-panel-' . $key;
$panel_id = 'jio-tab-panel-' . $key;
$visible_index = 0;
foreach ($tabs as $index => $tab) {
if (!is_array($tab) || trim((string) ($tab['title'] ?? '')) === '') continue;
$tab_id = 'aksrt-tab-' . $key . '-' . $visible_index;
$tab_id = 'jio-tab-' . $key . '-' . $visible_index;
$selected = $visible_index === 0;
$buttons .= '<li class="' . ($selected ? 'active' : '') . '"><a href="#' . esc_attr($panel_id . '-' . $visible_index) . '" role="tab" id="' . esc_attr($tab_id) . '" aria-controls="' . esc_attr($panel_id . '-' . $visible_index) . '" aria-selected="' . ($selected ? 'true' : 'false') . '" tabindex="' . ($selected ? '0' : '-1') . '" data-segment="' . (int) $index . '">' . wp_kses_post((string) $tab['title']) . '</a></li>';
if ($selected) {
@@ -96,7 +96,7 @@ final class ContentRenderer {
// Inactive panes load lazily through the REST client on switch,
// so the pane ships pre-filled with the skeleton. 显隐交给
// .is-loading,内联 display:none 会让 REST 客户端无法展开骨架。
$body = '<div class="widget-ajaxpager" data-widget-items data-widget="tab_posts" data-instance="' . esc_attr($widget_id) . '" data-page="1" data-segment="' . (int) $index . '" aria-live="polite" aria-busy="false"><div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . self::placeholder($instance) . '</div></div>';
$body = '<div class="widget-ajaxpager" data-widget-items data-widget="tab_posts" data-instance="' . esc_attr($widget_id) . '" data-page="1" data-segment="' . (int) $index . '" aria-live="polite" aria-busy="false"><div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'jio') . '">' . self::placeholder($instance) . '</div></div>';
}
$panels .= '<div class="tab-pane fade' . ($selected ? ' active in' : '') . '" id="' . esc_attr($panel_id . '-' . $visible_index) . '" role="tabpanel" aria-labelledby="' . esc_attr($tab_id) . '">' . $body . '</div>';
$visible_index++;
@@ -124,8 +124,8 @@ final class ContentRenderer {
$html = '';
foreach ($terms as $term) {
$count = (int) $term->count;
$name = aksrt_widget_str_cut((string) $term->name, 16);
$description = aksrt_widget_str_cut((string) $term->description, 24);
$name = jio_widget_str_cut((string) $term->name, 16);
$description = jio_widget_str_cut((string) $term->description, 24);
$href = get_term_link($term);
if (is_wp_error($href)) {
continue;
@@ -134,21 +134,21 @@ final class ContentRenderer {
$card = [
'type' => (string) ($instance['type'] ?? 'style-1'),
'class' => 'mb10',
'img' => aksrt_widget_term_cover_url((int) $term->term_id),
'img' => jio_widget_term_cover_url((int) $term->term_id),
'alt' => $name . '-' . $description,
'link' => ['url' => esc_url((string) $href), 'target' => $target_blank],
'text1' => $name,
'text2' => $description,
'text3' => $icon . $count . __('篇文章', 'aksrt'),
'text3' => $icon . $count . __('篇文章', 'jio'),
'height_scale' => (int) ($instance['height_scale'] ?? 60),
'mask_opacity' => (int) ($instance['mask_opacity'] ?? 10),
];
$type = (string) $card['type'];
if ($type === 'style-2' || $type === 'style-4') {
$card['text3'] = '<item data-toggle="tooltip" title="' . esc_attr(sprintf(__('共%d篇文章', 'aksrt'), $count)) . '">' . $icon . $count . '</item>';
$card['text3'] = '<item data-toggle="tooltip" title="' . esc_attr(sprintf(__('共%d篇文章', 'jio'), $count)) . '">' . $icon . $count . '</item>';
} elseif ($type === 'style-3') {
$card['text1'] = $icon . $name;
$card['text3'] = '<i class="fa mr6 fa-file-alt" aria-hidden="true"></i>' . $count . __('篇文章', 'aksrt');
$card['text3'] = '<i class="fa mr6 fa-file-alt" aria-hidden="true"></i>' . $count . __('篇文章', 'jio');
}
$attr = '';
@@ -163,7 +163,7 @@ final class ContentRenderer {
if ($is_row) {
$col_class .= ' ' . $row_class;
}
$html .= '<div class="' . esc_attr(trim($col_class)) . '"' . $attr . '>' . aksrt_graphic_card($card) . '</div>';
$html .= '<div class="' . esc_attr(trim($col_class)) . '"' . $attr . '>' . jio_graphic_card($card) . '</div>';
}
return '<div class="' . ($is_row ? 'mb10' : 'mb20') . '">' . ($is_row ? '<div class="row gutters-5">' : '') . $html . ($is_row ? '</div>' : '') . '</div>';
}
@@ -179,7 +179,7 @@ final class ContentRenderer {
$animation = (string) ($instance['obs_animation'] ?? '');
$html = '';
foreach ($term_ids as $key => $term_id) {
$card = aksrt_widget_term_aggregation([
$card = jio_widget_term_aggregation([
'term_id' => (int) $term_id,
'target_blank' => !empty($instance['target_blank']),
'orderby' => (string) ($instance['orderby'] ?? 'modified'),
@@ -211,14 +211,14 @@ final class ContentRenderer {
private static function post_pay(array $instance): string {
$post = get_post();
if (!$post instanceof \WP_Post || !function_exists('aksrt_get_pay_meta')) {
if (!$post instanceof \WP_Post || !function_exists('jio_get_pay_meta')) {
return '';
}
$meta = aksrt_get_pay_meta($post);
$meta = jio_get_pay_meta($post);
if (($meta['pay_type'] ?? 'no') === 'no') {
return '';
}
return aksrt_get_paywall_html($post, [
return jio_get_paywall_html($post, [
'layout' => 'widget',
'theme' => (string) $instance['theme'],
]);