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

+75 -75
View File
@@ -3,13 +3,13 @@
* 前端页面编辑(后台「扩展&增强 → 系统工具」的 admin_frontend_set)。
*
* 对齐参考主题 zib-frontend-set.php:wp_footer 直出 #modal_admin_set 弹窗
* (bootstrap modal + wp-ajax-submit 走 vendored main.js 的 aksrt_ajax 契约),
* (bootstrap modal + wp-ajax-submit 走 vendored main.js 的 jio_ajax 契约),
* 管理员在前台快速修改当前文章/页面的参数或分类术语的名称与描述。
*
* @package AKSRT
* @package Jio
*/
namespace AKSRT\Frontend;
namespace Jio\Frontend;
defined('ABSPATH') || exit;
@@ -25,10 +25,10 @@ class PageAdminSet {
}
public function init(): void {
add_filter('aksrt_float_right_buttons', [$this, 'float_button'], 10, 2);
add_filter('jio_float_right_buttons', [$this, 'float_button'], 10, 2);
add_action('wp_footer', [$this, 'render_modal'], 10);
add_action('wp_footer', [self::class, 'enqueue_hint_script'], 9);
add_action('wp_ajax_aksrt_frontend_set_save', [$this, 'ajax_save']);
add_action('wp_ajax_jio_frontend_set_save', [$this, 'ajax_save']);
}
/**
@@ -46,7 +46,7 @@ class PageAdminSet {
return;
}
wp_enqueue_script(
'aksrt-front-page-admin-set',
'jio-front-page-admin-set',
get_template_directory_uri() . '/assets/js/front-page-admin-set.js',
['jquery'],
(string) filemtime($path),
@@ -56,10 +56,10 @@ class PageAdminSet {
/** 开启条件:设置开关 + 管理员 + 单页/术语页 + 有效对象(排除投稿与导航页模板)。 */
public static function enabled(): bool {
if (!class_exists('\AKSRT\Settings\ExtensionRuntime') || !is_user_logged_in()) {
if (!class_exists('\Jio\Settings\ExtensionRuntime') || !is_user_logged_in()) {
return false;
}
$settings = \AKSRT\Settings\ExtensionRuntime::get_system_tools_settings();
$settings = \Jio\Settings\ExtensionRuntime::get_system_tools_settings();
if (empty($settings['admin_frontend_set']) || !current_user_can('manage_options')) {
return false;
}
@@ -83,9 +83,9 @@ class PageAdminSet {
}
$button = '<a href="javascript:;" data-toggle="modal" data-target="#modal_admin_set"'
. ' title="' . esc_attr__('设置页面参数', 'aksrt') . '" class="admin-set-page float-btn">'
. ' title="' . esc_attr__('设置页面参数', 'jio') . '" class="admin-set-page float-btn">'
. '<i class="fa fas fa-cog fa-spin" aria-hidden="true"></i>'
. '<div class="abs-right badg c-red px12 admin-set-info" style="width:187px;">' . esc_html__('在此编辑此页面参数', 'aksrt') . '</div></a>';
. '<div class="abs-right badg c-red px12 admin-set-info" style="width:187px;">' . esc_html__('在此编辑此页面参数', 'jio') . '</div></a>';
return (string) $buttons . $button;
}
@@ -120,23 +120,23 @@ class PageAdminSet {
], admin_url('customize.php'));
$header = '<div class="modal-header"><strong class="modal-title">'
. '<i class="fa fas fa-sliders-h mr10" aria-hidden="true"></i>' . esc_html($type_label . __('设置', 'aksrt'))
. '<i class="fa fas fa-sliders-h mr10" aria-hidden="true"></i>' . esc_html($type_label . __('设置', 'jio'))
. '</strong><button class="close" data-dismiss="modal">' . $this->close_icon() . '</button></div>';
$footer = '<div class="modal-footer">'
. '<a target="_blank" title="' . esc_attr__('使用可视化布局配置此页面', 'aksrt') . '" data-toggle="tooltip" href="' . esc_url($widgets_url) . '" class="but c-yellow-2 padding-lg"><i class="fa fas fa-chart-pie" aria-hidden="true"></i>' . esc_html__('模块布局', 'aksrt') . '</a>'
. ($edit_link ? '<a target="_blank" href="' . esc_url($edit_link) . '" class="but c-yellow padding-lg"><i class="fa fab fa-wordpress" aria-hidden="true"></i>' . esc_html__('后台编辑', 'aksrt') . '</a>' : '')
. '<button class="but jb-blue padding-lg wp-ajax-submit"><i class="fa fas fa-check" aria-hidden="true"></i>' . esc_html__('确认修改', 'aksrt') . '</button>'
. '<a target="_blank" title="' . esc_attr__('使用可视化布局配置此页面', 'jio') . '" data-toggle="tooltip" href="' . esc_url($widgets_url) . '" class="but c-yellow-2 padding-lg"><i class="fa fas fa-chart-pie" aria-hidden="true"></i>' . esc_html__('模块布局', 'jio') . '</a>'
. ($edit_link ? '<a target="_blank" href="' . esc_url($edit_link) . '" class="but c-yellow padding-lg"><i class="fa fab fa-wordpress" aria-hidden="true"></i>' . esc_html__('后台编辑', 'jio') . '</a>' : '')
. '<button class="but jb-blue padding-lg wp-ajax-submit"><i class="fa fas fa-check" aria-hidden="true"></i>' . esc_html__('确认修改', 'jio') . '</button>'
. '</div>';
$body = '<div class="modal-body">'
. ($type === 'tax' ? $this->term_inputs($object_id, $taxonomy) : $this->post_inputs($object_id))
. '<input type="hidden" name="action" value="aksrt_frontend_set_save">'
. '<input type="hidden" name="action" value="jio_frontend_set_save">'
. '<input type="hidden" name="type" value="' . esc_attr($type) . '">'
. '<input type="hidden" name="taxonomy" value="' . esc_attr($taxonomy) . '">'
. '<input type="hidden" name="post_type" value="' . esc_attr($post_type) . '">'
. '<input type="hidden" name="id" value="' . esc_attr((string) $object_id) . '">'
. wp_nonce_field('aksrt_frontend_set', '_wpnonce', true, false)
. wp_nonce_field('jio_frontend_set', '_wpnonce', true, false)
. '</div>';
echo '<div class="modal fade" id="modal_admin_set" tabindex="-1" role="dialog" aria-hidden="false" win-ajax-replace="modal_admin_set">'
@@ -150,20 +150,20 @@ class PageAdminSet {
return '<i class="fa fas fa-times" aria-hidden="true"></i>';
}
/** 保存(legacy aksrt_ajax 契约:{msg, reload} / {error, ys, msg})。 */
/** 保存(legacy jio_ajax 契约:{msg, reload} / {error, ys, msg})。 */
public function ajax_save(): void {
check_ajax_referer('aksrt_frontend_set', '_wpnonce');
check_ajax_referer('jio_frontend_set', '_wpnonce');
$settings = class_exists('\AKSRT\Settings\ExtensionRuntime')
? \AKSRT\Settings\ExtensionRuntime::get_system_tools_settings()
$settings = class_exists('\Jio\Settings\ExtensionRuntime')
? \Jio\Settings\ExtensionRuntime::get_system_tools_settings()
: [];
if (empty($settings['admin_frontend_set']) || !current_user_can('manage_options')) {
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('权限不足', 'aksrt')]);
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('权限不足', 'jio')]);
}
$object_id = isset($_POST['id']) ? absint($_POST['id']) : 0;
if (!$object_id) {
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('页面数据出错', 'aksrt')]);
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('页面数据出错', 'jio')]);
}
$type = isset($_POST['type']) ? sanitize_key((string) $_POST['type']) : '';
@@ -172,19 +172,19 @@ class PageAdminSet {
} elseif ($type === 'post') {
$this->save_post($object_id);
} else {
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('页面数据出错', 'aksrt')]);
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('页面数据出错', 'jio')]);
}
wp_send_json(['msg' => __('保存成功,正在刷新页面', 'aksrt'), 'reload' => true]);
wp_send_json(['msg' => __('保存成功,正在刷新页面', 'jio'), 'reload' => true]);
}
private function save_post(int $post_id): void {
$post = get_post($post_id);
if (!$post) {
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('未找到可用post数据', 'aksrt')]);
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('未找到可用post数据', 'jio')]);
}
if (!current_user_can('edit_post', $post_id)) {
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('权限不足', 'aksrt')]);
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('权限不足', 'jio')]);
}
$postarr = ['ID' => $post_id];
@@ -209,10 +209,10 @@ class PageAdminSet {
set_post_format($post_id, $format === 'standard' ? '' : $format);
}
if ($post->post_type === 'post' && class_exists('\AKSRT\Core\PostMetaBox')) {
if ($post->post_type === 'post' && class_exists('\Jio\Core\PostMetaBox')) {
// 保留白名单之外的既有配置键(封面、视频等),仅覆盖弹窗提交的字段。
// 复选框未勾选时浏览器不会提交键名,两个开关必须无条件写入。
$meta = get_post_meta($post_id, \AKSRT\Core\PostMetaBox::META_KEY, true);
$meta = get_post_meta($post_id, \Jio\Core\PostMetaBox::META_KEY, true);
$meta = is_array($meta) ? $meta : [];
$layout = isset($_POST['show_layout']) ? sanitize_key((string) wp_unslash($_POST['show_layout'])) : 'false';
@@ -227,13 +227,13 @@ class PageAdminSet {
$meta['no_article-navs'] = !empty($_POST['no_article-navs']);
$meta['article_maxheight_xz'] = !empty($_POST['article_maxheight_xz']);
update_post_meta($post_id, \AKSRT\Core\PostMetaBox::META_KEY, $meta);
update_post_meta($post_id, \Jio\Core\PostMetaBox::META_KEY, $meta);
if (isset($_POST['views'])) {
update_post_meta($post_id, \AKSRT\Core\DomainModel::POST_VIEW_COUNT_KEY, max(0, (int) $_POST['views']));
update_post_meta($post_id, \Jio\Core\DomainModel::POST_VIEW_COUNT_KEY, max(0, (int) $_POST['views']));
}
if (isset($_POST['like'])) {
update_post_meta($post_id, '_aksrt_like_count', max(0, (int) $_POST['like']));
update_post_meta($post_id, '_jio_like_count', max(0, (int) $_POST['like']));
}
}
@@ -262,10 +262,10 @@ class PageAdminSet {
private function save_term(int $term_id, string $taxonomy = ''): void {
$term = $taxonomy !== '' ? get_term($term_id, $taxonomy) : get_term($term_id);
if (!$term || is_wp_error($term)) {
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('未找到可用term数据', 'aksrt')]);
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('未找到可用term数据', 'jio')]);
}
if (!current_user_can('manage_categories') && !current_user_can('manage_terms')) {
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('权限不足', 'aksrt')]);
wp_send_json(['error' => 1, 'ys' => 'danger', 'msg' => __('权限不足', 'jio')]);
}
$data = [];
@@ -290,26 +290,26 @@ class PageAdminSet {
/** 文章/页面的弹窗字段(对齐参考主题 zib_get_frontend_set_input)。 */
private function post_inputs(int $post_id): string {
$meta = class_exists('\AKSRT\Core\PostMetaBox')
? \AKSRT\Core\PostMetaBox::get_meta($post_id)
$meta = class_exists('\Jio\Core\PostMetaBox')
? \Jio\Core\PostMetaBox::get_meta($post_id)
: [];
$inputs = [];
$inputs[] = [
'name' => __('显示布局', 'aksrt'),
'name' => __('显示布局', 'jio'),
'id' => 'show_layout',
'std' => (string) ($meta['show_layout'] ?? 'false'),
'type' => 'radio',
'options' => [
'false' => __('跟随主题', 'aksrt'),
'no_sidebar' => __('无侧边栏', 'aksrt'),
'sidebar_left' => __('侧边栏靠左', 'aksrt'),
'sidebar_right' => __('侧边栏靠右', 'aksrt'),
'false' => __('跟随主题', 'jio'),
'no_sidebar' => __('无侧边栏', 'jio'),
'sidebar_left' => __('侧边栏靠左', 'jio'),
'sidebar_right' => __('侧边栏靠右', 'jio'),
],
];
$inputs[] = [
'name' => __('标题', 'aksrt'),
'name' => __('标题', 'jio'),
'id' => 'post_title',
'std' => (string) get_the_title($post_id),
'type' => 'text',
@@ -317,78 +317,78 @@ class PageAdminSet {
if (is_single()) {
$inputs[] = [
'name' => __('副标题', 'aksrt'),
'name' => __('副标题', 'jio'),
'id' => 'subtitle',
'std' => (string) ($meta['subtitle'] ?? ''),
'type' => 'text',
];
$inputs[] = [
'name' => __('文章格式', 'aksrt'),
'name' => __('文章格式', 'jio'),
'id' => 'post_format',
'std' => (string) get_post_format($post_id),
'type' => 'select',
'options' => $this->post_format_options(),
];
$inputs[] = [
'name' => __('点赞数', 'aksrt'),
'name' => __('点赞数', 'jio'),
'id' => 'like',
'std' => (int) ($meta['like'] ?? 0),
'type' => 'number',
];
$inputs[] = [
'name' => __('阅读数', 'aksrt'),
'name' => __('阅读数', 'jio'),
'id' => 'views',
'std' => (int) ($meta['views'] ?? 0),
'type' => 'number',
];
$inputs[] = [
'name' => __('目录树', 'aksrt'),
'name' => __('目录树', 'jio'),
'id' => 'no_article-navs',
'std' => !empty($meta['no_article-navs']),
'type' => 'checkbox',
'desc' => __('不显示', 'aksrt'),
'desc' => __('不显示', 'jio'),
];
$inputs[] = [
'name' => __('文章高度', 'aksrt'),
'name' => __('文章高度', 'jio'),
'id' => 'article_maxheight_xz',
'std' => !empty($meta['article_maxheight_xz']),
'type' => 'checkbox',
'desc' => __('限制文章最大高度', 'aksrt'),
'desc' => __('限制文章最大高度', 'jio'),
];
}
$inputs[] = [
'name' => __('评论', 'aksrt'),
'name' => __('评论', 'jio'),
'id' => 'comments_open',
'std' => comments_open($post_id) ? 'open' : '',
'type' => 'radio',
'options' => [
'open' => __('开启', 'aksrt'),
'' => __('关闭', 'aksrt'),
'open' => __('开启', 'jio'),
'' => __('关闭', 'jio'),
],
];
if (is_page()) {
$inputs[] = [
'name' => __('标题样式', 'aksrt'),
'name' => __('标题样式', 'jio'),
'id' => 'page_header_style',
'std' => (string) get_post_meta($post_id, 'page_header_style', true),
'type' => 'radio',
'options' => [
'' => __('跟随主题', 'aksrt'),
'not' => __('不显示', 'aksrt'),
'1' => __('简单样式', 'aksrt'),
'2' => __('卡片样式', 'aksrt'),
'3' => __('封面图样式', 'aksrt'),
'' => __('跟随主题', 'jio'),
'not' => __('不显示', 'jio'),
'1' => __('简单样式', 'jio'),
'2' => __('卡片样式', 'jio'),
'3' => __('封面图样式', 'jio'),
],
];
$inputs[] = [
'name' => __('模块布局', 'aksrt'),
'name' => __('模块布局', 'jio'),
'id' => 'widgets_register',
'type' => 'radio',
'options' => [
'1' => __('开启', 'aksrt'),
'0' => __('关闭', 'aksrt'),
'1' => __('开启', 'jio'),
'0' => __('关闭', 'jio'),
],
'std' => (string) get_post_meta($post_id, 'widgets_register', true),
];
@@ -397,14 +397,14 @@ class PageAdminSet {
'type' => 'checkbox',
'class' => 'compact',
'std' => (array) get_post_meta($post_id, 'widgets_register_container', true),
'name' => __('创建容器位置', 'aksrt'),
'desc' => __('请根据需要合理开启,如果用不到则不要开启', 'aksrt') . '<br>' . __('保存页面后即可进入小工具或模块配置添加模块', 'aksrt') . '<div class="c-yellow">' . __('注意:开启此功能的页面不能太多,太多会影响性能,建议控制在10个以内', 'aksrt') . '</div>',
'name' => __('创建容器位置', 'jio'),
'desc' => __('请根据需要合理开启,如果用不到则不要开启', 'jio') . '<br>' . __('保存页面后即可进入小工具或模块配置添加模块', 'jio') . '<div class="c-yellow">' . __('注意:开启此功能的页面不能太多,太多会影响性能,建议控制在10个以内', 'jio') . '</div>',
'options' => [
'sidebar' => __('侧边栏', 'aksrt'),
'top_fluid' => __('顶部全宽度', 'aksrt'),
'top_content' => __('主内容上面', 'aksrt'),
'bottom_content' => __('主内容下面', 'aksrt'),
'bottom_fluid' => __('底部全宽度', 'aksrt'),
'sidebar' => __('侧边栏', 'jio'),
'top_fluid' => __('顶部全宽度', 'jio'),
'top_content' => __('主内容上面', 'jio'),
'bottom_content' => __('主内容下面', 'jio'),
'bottom_fluid' => __('底部全宽度', 'jio'),
],
];
}
@@ -422,10 +422,10 @@ class PageAdminSet {
*/
private function post_format_options(): array {
return [
'standard' => __('标准', 'aksrt'),
'image' => __('图像', 'aksrt'),
'gallery' => __('画廊', 'aksrt'),
'video' => __('视频', 'aksrt'),
'standard' => __('标准', 'jio'),
'image' => __('图像', 'jio'),
'gallery' => __('画廊', 'jio'),
'video' => __('视频', 'jio'),
];
}
@@ -433,18 +433,18 @@ class PageAdminSet {
private function term_inputs(int $term_id, string $taxonomy): string {
$term = get_term($term_id, $taxonomy);
if (!$term || is_wp_error($term)) {
return '<p class="muted-3-color">' . esc_html__('未找到可用term数据', 'aksrt') . '</p>';
return '<p class="muted-3-color">' . esc_html__('未找到可用term数据', 'jio') . '</p>';
}
return $this->render_inputs([
[
'name' => __('名称', 'aksrt'),
'name' => __('名称', 'jio'),
'id' => 'term_name',
'std' => (string) $term->name,
'type' => 'text',
],
[
'name' => __('描述', 'aksrt'),
'name' => __('描述', 'jio'),
'id' => 'term_description',
'std' => (string) $term->description,
'type' => 'text',