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

@@ -4,22 +4,22 @@
*
* Used by layout-2 menu_search AJAX panel and layout 1/3 .navbar-search.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_save_history_search')) :
if (!function_exists('jio_save_history_search')) :
/** Store the legacy history_search cookie (newest first, maximum thirty). */
function aksrt_save_history_search(string $search): void {
function jio_save_history_search(string $search): void {
$search = trim(wp_strip_all_tags($search));
$search_text = aksrt_get_search_keywords_text($search);
$search_text = jio_get_search_keywords_text($search);
if ($search_text === '' || mb_strlen($search_text) >= 30 || headers_sent()) {
return;
}
$history = aksrt_get_search_history_keywords();
$history = jio_get_search_history_keywords();
$history = array_values(array_filter($history, static function (string $item) use ($search_text): bool {
return aksrt_get_search_keywords_text($item) !== $search_text;
return jio_get_search_keywords_text($item) !== $search_text;
}));
array_unshift($history, $search);
$history = array_slice($history, 0, 30);
@@ -35,10 +35,10 @@ if (!function_exists('aksrt_save_history_search')) :
}
endif;
if (!function_exists('aksrt_get_main_search')) :
if (!function_exists('jio_get_main_search')) :
/** legacy main-search defaults backed only by the reference option IDs. */
function aksrt_get_main_search(array $args = [], bool $echo = false) {
$settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
function jio_get_main_search(array $args = [], bool $echo = false) {
$settings = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_all() : [];
$search_cat = !array_key_exists('search_cat', $settings) || !empty($settings['search_cat']);
$search_type = !array_key_exists('search_type', $settings) || !empty($settings['search_type']);
$defaults = [
@@ -53,15 +53,15 @@ if (!function_exists('aksrt_get_main_search')) :
'in_type' => $search_type ? sanitize_key((string) ($settings['search_type_in'] ?? 'post')) : '',
'in_user' => '',
];
return aksrt_get_search_box(wp_parse_args($args, $defaults), $echo);
return jio_get_search_box(wp_parse_args($args, $defaults), $echo);
}
endif;
if (!function_exists('aksrt_get_search_history_keywords')) :
if (!function_exists('jio_get_search_history_keywords')) :
/**
* @return list<string>
*/
function aksrt_get_search_history_keywords(): array {
function jio_get_search_history_keywords(): array {
$raw = isset($_COOKIE['history_search'])
? wp_unslash((string) $_COOKIE['history_search'])
: '';
@@ -77,28 +77,28 @@ if (!function_exists('aksrt_get_search_history_keywords')) :
}
endif;
if (!function_exists('aksrt_get_search_keywords_text')) :
function aksrt_get_search_keywords_text(string $search): string {
if (!function_exists('jio_get_search_keywords_text')) :
function jio_get_search_keywords_text(string $search): string {
$search = str_replace('&amp;type', '&type', $search);
$index = strpos($search, '&type=');
return trim($index === false ? $search : substr($search, 0, $index));
}
endif;
if (!function_exists('aksrt_update_search_keywords')) :
function aksrt_update_search_keywords(string $search): void {
if (!function_exists('jio_update_search_keywords')) :
function jio_update_search_keywords(string $search): void {
$search = trim(wp_strip_all_tags($search));
$text = aksrt_get_search_keywords_text($search);
$text = jio_get_search_keywords_text($search);
if (mb_strlen($text) < 2 || mb_strlen($text) > 8) {
return;
}
if (class_exists('\AKSRT\Settings\Settings') && !\AKSRT\Settings\Settings::hot_search_enabled()) {
if (class_exists('\Jio\Settings\Settings') && !\Jio\Settings\Settings::hot_search_enabled()) {
return;
}
$keywords = get_option('search_keywords', []);
$keywords = is_array($keywords) ? $keywords : [];
$limit = class_exists('\AKSRT\Settings\Settings')
? max(10, min(50, (int) \AKSRT\Settings\Settings::get_value('search_popular_key_num', 20)))
$limit = class_exists('\Jio\Settings\Settings')
? max(10, min(50, (int) \Jio\Settings\Settings::get_value('search_popular_key_num', 20)))
: 20;
$keywords = array_slice($keywords, 0, $limit + 10, true);
$keywords[$search] = isset($keywords[$search]) ? (int) $keywords[$search] + 1 : 1;
@@ -107,14 +107,14 @@ if (!function_exists('aksrt_update_search_keywords')) :
}
endif;
if (!function_exists('aksrt_get_search_keywords_but')) :
if (!function_exists('jio_get_search_keywords_but')) :
/**
* Render keyword chip links.
*
* @param list<string> $keywords
* @param string $type popular|history
*/
function aksrt_get_search_keywords_but(array $keywords, string $type = 'popular', int $limit = 0): string {
function jio_get_search_keywords_but(array $keywords, string $type = 'popular', int $limit = 0): string {
if ($limit > 0) {
$keywords = array_slice($keywords, 0, $limit);
}
@@ -124,7 +124,7 @@ if (!function_exists('aksrt_get_search_keywords_but')) :
if ($kw === '') {
continue;
}
$text = aksrt_get_search_keywords_text($kw);
$text = jio_get_search_keywords_text($kw);
$query = ['s' => $text];
if (preg_match('/&type=([a-z0-9_-]+)/i', $kw, $match)) {
$query['type'] = sanitize_key($match[1]);
@@ -137,7 +137,7 @@ if (!function_exists('aksrt_get_search_keywords_but')) :
}
endif;
if (!function_exists('aksrt_get_search_box')) :
if (!function_exists('jio_get_search_box')) :
/**
* legacy-compatible search box.
*
@@ -145,7 +145,7 @@ if (!function_exists('aksrt_get_search_box')) :
* @param bool $echo
* @return string|void
*/
function aksrt_get_search_box(array $args = [], bool $echo = false) {
function jio_get_search_box(array $args = [], bool $echo = false) {
$defaults = [
's' => '',
'class' => '',
@@ -165,28 +165,28 @@ if (!function_exists('aksrt_get_search_box')) :
];
$args = wp_parse_args($args, $defaults);
if ($args['keywords_title'] === '' && class_exists('\AKSRT\Settings\Settings')
&& method_exists('\AKSRT\Settings\Settings', 'search_popular_title')) {
$args['keywords_title'] = (string) \AKSRT\Settings\Settings::search_popular_title();
if ($args['keywords_title'] === '' && class_exists('\Jio\Settings\Settings')
&& method_exists('\Jio\Settings\Settings', 'search_popular_title')) {
$args['keywords_title'] = (string) \Jio\Settings\Settings::search_popular_title();
}
if ($args['keywords_title'] === '') {
$args['keywords_title'] = __('热门搜索', 'aksrt');
$args['keywords_title'] = __('热门搜索', 'jio');
}
if ($args['placeholder'] === '' && function_exists('aksrt_get_search_placeholder')) {
$args['placeholder'] = aksrt_get_search_placeholder();
if ($args['placeholder'] === '' && function_exists('jio_get_search_placeholder')) {
$args['placeholder'] = jio_get_search_placeholder();
}
if ($args['placeholder'] === '') {
$args['placeholder'] = __('开启精彩搜索', 'aksrt');
$args['placeholder'] = __('开启精彩搜索', 'jio');
}
$args['placeholder'] = esc_attr((string) $args['placeholder']);
$form_html = '';
if (!empty($args['show_form'])) {
$state = function_exists('aksrt_get_search_form_state')
? aksrt_get_search_form_state()
$state = function_exists('jio_get_search_form_state')
? jio_get_search_form_state()
: [
'type' => 'post',
'types' => ['post' => __('文章', 'aksrt')],
'types' => ['post' => __('文章', 'jio')],
'category_id' => 0,
'category_enabled' => false,
'categories' => [],
@@ -198,8 +198,8 @@ if (!function_exists('aksrt_get_search_box')) :
$category_ids = is_array($args['more_cats'])
? $args['more_cats']
: (preg_split('/[,,\s]+/', (string) $args['more_cats']) ?: []);
if ($category_ids && function_exists('aksrt_get_search_categories')) {
$category_terms = aksrt_get_search_categories($category_ids);
if ($category_ids && function_exists('jio_get_search_categories')) {
$category_terms = jio_get_search_categories($category_ids);
}
if ((int) $args['in_cat'] > 0) {
$selected_term = get_term((int) $args['in_cat']);
@@ -215,7 +215,7 @@ if (!function_exists('aksrt_get_search_box')) :
$in_cat_id = (int) $args['in_cat'];
$in_cat_name = $in_cat_id > 0 ? (string) ($selected_term_name ?? '') : '';
$all_cat = '<li data-for="trem" data-value="null"><a href="javascript:;" class="text-ellipsis">'
. esc_html__('全部', 'aksrt') . '</a></li>';
. esc_html__('全部', 'jio') . '</a></li>';
foreach ($category_terms as $cat) {
if (!$cat instanceof WP_Term) {
continue;
@@ -235,7 +235,7 @@ if (!function_exists('aksrt_get_search_box')) :
$all_cat = '<ul class="dropdown-menu cat-drop">' . $all_cat . '</ul>';
$label = $in_cat_name !== ''
? (mb_strlen($in_cat_name) > 6 ? mb_substr($in_cat_name, 0, 6) . '…' : $in_cat_name)
: __('请选择', 'aksrt');
: __('请选择', 'jio');
$input_cat = '<a href="javascript:;" class="padding-h10" data-toggle="dropdown"><span name="trem">'
. esc_html($label) . '</span><i class="fa ml6 fa-sort opacity5" aria-hidden="true"></i></a>';
$input_cat .= $all_cat;
@@ -278,7 +278,7 @@ if (!function_exists('aksrt_get_search_box')) :
$input_html .= '<div class="scale-placeholder' . ($s !== '' ? ' is-focus' : '') . '" default="'
. $args['placeholder'] . '">' . $args['placeholder'] . '</div>';
$input_html .= '<div class="abs-right muted-color"><button type="submit" tabindex="2" class="null" aria-label="'
. esc_attr__('搜索', 'aksrt') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></button></div>';
. esc_attr__('搜索', 'jio') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></button></div>';
$input_html .= '</div>';
$input_html .= '<input type="hidden" name="type" value="' . esc_attr($in_type) . '">';
@@ -301,13 +301,13 @@ if (!function_exists('aksrt_get_search_box')) :
$keywords_html = '';
if (!empty($args['show_keywords'])) {
$show = true;
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'hot_search_enabled')) {
$show = (bool) \AKSRT\Settings\Settings::hot_search_enabled();
if (class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'hot_search_enabled')) {
$show = (bool) \Jio\Settings\Settings::hot_search_enabled();
}
if ($show) {
$keywords = function_exists('aksrt_get_search_hot_keywords') ? aksrt_get_search_hot_keywords() : [];
$keywords = function_exists('jio_get_search_hot_keywords') ? jio_get_search_hot_keywords() : [];
$limit = (int) $args['popular_limit'];
$keyword_link = aksrt_get_search_keywords_but(is_array($keywords) ? $keywords : [], 'popular', $limit);
$keyword_link = jio_get_search_keywords_but(is_array($keywords) ? $keywords : [], 'popular', $limit);
if ($keyword_link !== '') {
$keywords_html = '<div class="search-keywords">'
. '<p class="muted-color"><span>' . esc_html((string) $args['keywords_title']) . '</span></p>'
@@ -321,20 +321,20 @@ if (!function_exists('aksrt_get_search_box')) :
$history_html = '';
if (!empty($args['show_history'])) {
$show_h = true;
if (function_exists('aksrt_search_history_enabled')) {
$show_h = aksrt_search_history_enabled();
} elseif (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'search_history_enabled')) {
$show_h = (bool) \AKSRT\Settings\Settings::search_history_enabled();
if (function_exists('jio_search_history_enabled')) {
$show_h = jio_search_history_enabled();
} elseif (class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'search_history_enabled')) {
$show_h = (bool) \Jio\Settings\Settings::search_history_enabled();
}
if ($show_h) {
$hist = aksrt_get_search_history_keywords();
$keyword_link = aksrt_get_search_keywords_but($hist, 'history');
$hist = jio_get_search_history_keywords();
$keyword_link = jio_get_search_keywords_but($hist, 'history');
if ($keyword_link !== '') {
$history_html = '<div class="search-keywords history-search">';
$history_html .= '<p class="muted-color"><span>' . esc_html__('历史搜索', 'aksrt') . '</span>';
$history_html .= '<p class="muted-color"><span>' . esc_html__('历史搜索', 'jio') . '</span>';
$history_html .= '<a class="pull-right trash-history-search muted-3-color" href="javascript:;" data-cookie-path="'
. esc_attr(COOKIEPATH ?: '/') . '" data-cookie-domain="' . esc_attr(COOKIE_DOMAIN) . '" aria-label="'
. esc_attr__('清空历史', 'aksrt') . '"><i class="fa fas fa-trash-alt em12" aria-hidden="true"></i></a></p>';
. esc_attr__('清空历史', 'jio') . '"><i class="fa fas fa-trash-alt em12" aria-hidden="true"></i></a></p>';
$history_html .= '<div>' . $keyword_link . '</div></div>';
}
}
@@ -344,14 +344,14 @@ if (!function_exists('aksrt_get_search_box')) :
$posts_html = '';
if (!empty($args['show_posts'])) {
$show_p = true;
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'search_posts_enabled')) {
$show_p = (bool) \AKSRT\Settings\Settings::search_posts_enabled();
if (class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'search_posts_enabled')) {
$show_p = (bool) \Jio\Settings\Settings::search_posts_enabled();
}
if ($show_p && function_exists('aksrt_get_search_posts')) {
$slides = aksrt_get_search_posts(6, 'views', true);
if ($show_p && function_exists('jio_get_search_posts')) {
$slides = jio_get_search_posts(6, 'views', true);
if ($slides !== '') {
$posts_html = '<div class="padding-10 relates relates-thumb">';
$posts_html .= '<p class="muted-color">' . esc_html__('热门文章', 'aksrt') . '</p>';
$posts_html .= '<p class="muted-color">' . esc_html__('热门文章', 'jio') . '</p>';
$posts_html .= '<div class="swiper-container swiper-scroll">';
$posts_html .= '<div class="swiper-wrapper">' . $slides . '</div>';
$posts_html .= '<div class="swiper-button-prev"></div><div class="swiper-button-next"></div>';
@@ -375,13 +375,13 @@ if (!function_exists('aksrt_get_search_box')) :
}
endif;
if (!function_exists('aksrt_get_remote_box')) :
if (!function_exists('jio_get_remote_box')) :
/**
* Lazy remote HTML mount (legacy).
*
* @param array<string,mixed> $args
*/
function aksrt_get_remote_box(array $args = []): string {
function jio_get_remote_box(array $args = []): string {
$defaults = [
'type' => 'ias',
'class' => '',
@@ -2,12 +2,12 @@
/**
* Search panel hot posts (legacy parity).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!function_exists('aksrt_get_search_posts')) :
if (!function_exists('jio_get_search_posts')) :
/**
* Build hot-post slides for the search dropdown.
*
@@ -15,7 +15,7 @@ if (!function_exists('aksrt_get_search_posts')) :
* @param string $orderby views|date|modified|…
* @param bool $show_img Use graphic cards (true) or text list (false).
*/
function aksrt_get_search_posts(int $count = 6, string $orderby = 'views', bool $show_img = true): string {
function jio_get_search_posts(int $count = 6, string $orderby = 'views', bool $show_img = true): string {
$count = max(1, min(20, $count));
$args = [
@@ -30,7 +30,7 @@ if (!function_exists('aksrt_get_search_posts')) :
if ($orderby === 'views') {
$args['orderby'] = 'meta_value_num';
$args['meta_key'] = 'aksrt_post_views';
$args['meta_key'] = 'jio_post_views';
$args['order'] = 'DESC';
} else {
$allowed = ['date', 'modified', 'comment_count', 'rand', 'title'];
@@ -56,22 +56,22 @@ if (!function_exists('aksrt_get_search_posts')) :
continue;
}
if ($show_img && function_exists('aksrt_graphic_card')) {
if ($show_img && function_exists('jio_graphic_card')) {
$thumb = get_the_post_thumbnail_url($post_id, 'medium');
if (!$thumb) {
$thumb = get_template_directory_uri() . '/assets/img/placeholder.svg';
}
$views = function_exists('aksrt_get_post_views') ? (int) aksrt_get_post_views($post_id) : 0;
$views_txt = function_exists('aksrt_format_number')
? aksrt_format_number($views)
$views = function_exists('jio_get_post_views') ? (int) jio_get_post_views($post_id) : 0;
$views_txt = function_exists('jio_format_number')
? jio_format_number($views)
: (string) $views;
$time_ago = human_time_diff(get_the_time('U', $post_id), current_time('timestamp'));
$info = '<item>' . esc_html(sprintf(/* translators: %s: relative time */ __('%s前', 'aksrt'), $time_ago))
$info = '<item>' . esc_html(sprintf(/* translators: %s: relative time */ __('%s前', 'jio'), $time_ago))
. '</item><item class="pull-right"><i class="fa fas fa-eye" aria-hidden="true"></i> '
. esc_html((string) $views_txt) . '</item>';
$lists .= '<div class="swiper-slide em09 mr10" style="width:160px;">';
$lists .= aksrt_graphic_card([
$lists .= jio_graphic_card([
'type' => 'style-3',
'class' => '',
'img' => $thumb,