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

+87 -87
View File
@@ -1,9 +1,9 @@
<?php
/**
* @package AKSRT
* @package Jio
*/
namespace AKSRT\Core;
namespace Jio\Core;
defined('ABSPATH') || exit;
@@ -11,9 +11,9 @@ class SEOMetaBox {
private static $instance = null;
public const META_TITLE = '_aksrt_seo_title';
public const META_KEYWORDS = '_aksrt_seo_keywords';
public const META_DESCRIPTION = '_aksrt_seo_description';
public const META_TITLE = '_jio_seo_title';
public const META_KEYWORDS = '_jio_seo_keywords';
public const META_DESCRIPTION = '_jio_seo_description';
public static function get_instance(): self {
if (null === self::$instance) {
@@ -37,8 +37,8 @@ class SEOMetaBox {
public function register_meta_box(): void {
foreach (['post', 'page'] as $screen) {
add_meta_box(
'aksrt_seo_meta',
__('独立SEO', 'aksrt'),
'jio_seo_meta',
__('独立SEO', 'jio'),
[$this, 'render_meta_box'],
$screen,
'normal',
@@ -48,7 +48,7 @@ class SEOMetaBox {
}
public function render_meta_box(\WP_Post $post): void {
wp_nonce_field('aksrt_seo_meta_save', 'aksrt_seo_meta_nonce');
wp_nonce_field('jio_seo_meta_save', 'jio_seo_meta_nonce');
$title = (string) get_post_meta($post->ID, self::META_TITLE, true);
$keywords = (string) get_post_meta($post->ID, self::META_KEYWORDS, true);
@@ -57,38 +57,38 @@ class SEOMetaBox {
$ai_btn = $this->render_ai_button('post', (int) $post->ID);
$summary_btn = $this->render_summary_button((int) $post->ID);
?>
<div class="aksrt-seo-meta-box">
<div class="notice notice-warning inline"><p><?php esc_html_e('系统默认调用标题、分类标签、描述等自动生成SEO内容,一般无需单独设置SEO内容;如需覆盖,请在下方自定义。', 'aksrt'); ?></p></div>
<div class="aksrt-seo-preview">
<strong><?php esc_html_e('SEO预览', 'aksrt'); ?></strong>
<div class="aksrt-seo-preview__title"><?php echo esc_html($title !== '' ? $title : get_the_title($post)); ?></div>
<div class="aksrt-seo-preview__url"><?php echo esc_html(get_permalink($post)); ?></div>
<div class="aksrt-seo-preview__description"><?php echo esc_html($description !== '' ? $description : wp_trim_words(wp_strip_all_tags((string) $post->post_content), 38, '…')); ?></div>
<div class="jio-seo-meta-box">
<div class="notice notice-warning inline"><p><?php esc_html_e('系统默认调用标题、分类标签、描述等自动生成SEO内容,一般无需单独设置SEO内容;如需覆盖,请在下方自定义。', 'jio'); ?></p></div>
<div class="jio-seo-preview">
<strong><?php esc_html_e('SEO预览', 'jio'); ?></strong>
<div class="jio-seo-preview__title"><?php echo esc_html($title !== '' ? $title : get_the_title($post)); ?></div>
<div class="jio-seo-preview__url"><?php echo esc_html(get_permalink($post)); ?></div>
<div class="jio-seo-preview__description"><?php echo esc_html($description !== '' ? $description : wp_trim_words(wp_strip_all_tags((string) $post->post_content), 38, '…')); ?></div>
</div>
<p>
<label for="aksrt_seo_title"><strong><?php esc_html_e('自定义SEO标题', 'aksrt'); ?></strong></label>
<input type="text" class="widefat" id="aksrt_seo_title" name="aksrt_seo_title" value="<?php echo esc_attr($title); ?>" />
<span class="description"><?php esc_html_e('Title 一般建议15到30个字符', 'aksrt'); ?></span>
<label for="jio_seo_title"><strong><?php esc_html_e('自定义SEO标题', 'jio'); ?></strong></label>
<input type="text" class="widefat" id="jio_seo_title" name="jio_seo_title" value="<?php echo esc_attr($title); ?>" />
<span class="description"><?php esc_html_e('Title 一般建议15到30个字符', 'jio'); ?></span>
</p>
<p>
<label for="aksrt_seo_keywords"><strong><?php esc_html_e('自定义SEO关键词', 'aksrt'); ?></strong></label>
<input type="text" class="widefat" id="aksrt_seo_keywords" name="aksrt_seo_keywords" value="<?php echo esc_attr($keywords); ?>" placeholder="<?php esc_attr_e('多个关键词用英文逗号分隔', 'aksrt'); ?>" />
<span class="description"><?php esc_html_e('Keywords 每个关键词用逗号隔开', 'aksrt'); ?></span>
<label for="jio_seo_keywords"><strong><?php esc_html_e('自定义SEO关键词', 'jio'); ?></strong></label>
<input type="text" class="widefat" id="jio_seo_keywords" name="jio_seo_keywords" value="<?php echo esc_attr($keywords); ?>" placeholder="<?php esc_attr_e('多个关键词用英文逗号分隔', 'jio'); ?>" />
<span class="description"><?php esc_html_e('Keywords 每个关键词用逗号隔开', 'jio'); ?></span>
</p>
<p>
<label for="aksrt_seo_description"><strong><?php esc_html_e('自定义SEO描述', 'aksrt'); ?></strong></label>
<textarea class="widefat" rows="3" id="aksrt_seo_description" name="aksrt_seo_description"><?php echo esc_textarea($description); ?></textarea>
<span class="description"><?php esc_html_e('Description 一般建议50到150个字符', 'aksrt'); ?><?php echo $ai_btn; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<label for="jio_seo_description"><strong><?php esc_html_e('自定义SEO描述', 'jio'); ?></strong></label>
<textarea class="widefat" rows="3" id="jio_seo_description" name="jio_seo_description"><?php echo esc_textarea($description); ?></textarea>
<span class="description"><?php esc_html_e('Description 一般建议50到150个字符', 'jio'); ?><?php echo $ai_btn; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
</p>
<details class="aksrt-seo-advice"><summary><span class="dashicons dashicons-star-filled"></span> <?php esc_html_e('SEO优化建议', 'aksrt'); ?></summary><div>
<p><strong><?php esc_html_e('SEO标题:', 'aksrt'); ?></strong><?php esc_html_e('标题应紧扣主要内容,重要关键词靠前,避免关键词堆砌。', 'aksrt'); ?></p>
<p><strong><?php esc_html_e('SEO关键词:', 'aksrt'); ?></strong><?php esc_html_e('一般建议4到8个,并与网站定位及正文保持一致。', 'aksrt'); ?></p>
<p><strong><?php esc_html_e('SEO描述:', 'aksrt'); ?></strong><?php esc_html_e('使用一段通顺、有吸引力的文字精炼概括页面内容。', 'aksrt'); ?></p>
<p class="description"><?php esc_html_e('优化建议来自互联网,仅供参考。', 'aksrt'); ?></p>
<details class="jio-seo-advice"><summary><span class="dashicons dashicons-star-filled"></span> <?php esc_html_e('SEO优化建议', 'jio'); ?></summary><div>
<p><strong><?php esc_html_e('SEO标题:', 'jio'); ?></strong><?php esc_html_e('标题应紧扣主要内容,重要关键词靠前,避免关键词堆砌。', 'jio'); ?></p>
<p><strong><?php esc_html_e('SEO关键词:', 'jio'); ?></strong><?php esc_html_e('一般建议4到8个,并与网站定位及正文保持一致。', 'jio'); ?></p>
<p><strong><?php esc_html_e('SEO描述:', 'jio'); ?></strong><?php esc_html_e('使用一段通顺、有吸引力的文字精炼概括页面内容。', 'jio'); ?></p>
<p class="description"><?php esc_html_e('优化建议来自互联网,仅供参考。', 'jio'); ?></p>
</div></details>
<?php if ($summary_btn !== '') : ?>
<p class="aksrt-ai-summary-row">
<span class="description"><?php esc_html_e('写作辅助:根据正文生成摘要并填入「摘要」字段(不自动保存)。', 'aksrt'); ?></span>
<p class="jio-ai-summary-row">
<span class="description"><?php esc_html_e('写作辅助:根据正文生成摘要并填入「摘要」字段(不自动保存)。', 'jio'); ?></span>
<?php echo $summary_btn; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</p>
<?php endif; ?>
@@ -97,7 +97,7 @@ class SEOMetaBox {
}
public function save_meta_box(int $post_id, $post = null): void {
if (!isset($_POST['aksrt_seo_meta_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['aksrt_seo_meta_nonce'])), 'aksrt_seo_meta_save')) {
if (!isset($_POST['jio_seo_meta_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['jio_seo_meta_nonce'])), 'jio_seo_meta_save')) {
return;
}
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
@@ -111,9 +111,9 @@ class SEOMetaBox {
}
$map = [
self::META_TITLE => 'aksrt_seo_title',
self::META_KEYWORDS => 'aksrt_seo_keywords',
self::META_DESCRIPTION => 'aksrt_seo_description',
self::META_TITLE => 'jio_seo_title',
self::META_KEYWORDS => 'jio_seo_keywords',
self::META_DESCRIPTION => 'jio_seo_description',
];
foreach ($map as $meta_key => $field) {
@@ -142,22 +142,22 @@ class SEOMetaBox {
$ai_btn = $this->render_ai_button('term', (int) $term->term_id);
?>
<tr class="form-field">
<th scope="row"><label for="aksrt_seo_title"><?php esc_html_e('SEO 标题', 'aksrt'); ?></label></th>
<th scope="row"><label for="jio_seo_title"><?php esc_html_e('SEO 标题', 'jio'); ?></label></th>
<td>
<input type="text" name="aksrt_seo_title" id="aksrt_seo_title" class="aksrt-term-seo-title" value="<?php echo esc_attr($title); ?>" />
<input type="text" name="jio_seo_title" id="jio_seo_title" class="jio-term-seo-title" value="<?php echo esc_attr($title); ?>" />
</td>
</tr>
<tr class="form-field">
<th scope="row"><label for="aksrt_seo_keywords"><?php esc_html_e('SEO 关键词', 'aksrt'); ?></label></th>
<th scope="row"><label for="jio_seo_keywords"><?php esc_html_e('SEO 关键词', 'jio'); ?></label></th>
<td>
<input type="text" name="aksrt_seo_keywords" id="aksrt_seo_keywords" class="aksrt-term-seo-keywords" value="<?php echo esc_attr($keywords); ?>" />
<input type="text" name="jio_seo_keywords" id="jio_seo_keywords" class="jio-term-seo-keywords" value="<?php echo esc_attr($keywords); ?>" />
</td>
</tr>
<tr class="form-field">
<th scope="row"><label for="aksrt_seo_description"><?php esc_html_e('SEO 描述', 'aksrt'); ?></label></th>
<th scope="row"><label for="jio_seo_description"><?php esc_html_e('SEO 描述', 'jio'); ?></label></th>
<td>
<textarea name="aksrt_seo_description" id="aksrt_seo_description" class="aksrt-term-seo-description" rows="4"><?php echo esc_textarea($description); ?></textarea>
<p class="description"><?php esc_html_e('主题默认会自动设置 SEO 内容,如需单独设置请在此输入。', 'aksrt'); ?><?php echo $ai_btn; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<textarea name="jio_seo_description" id="jio_seo_description" class="jio-term-seo-description" rows="4"><?php echo esc_textarea($description); ?></textarea>
<p class="description"><?php esc_html_e('主题默认会自动设置 SEO 内容,如需单独设置请在此输入。', 'jio'); ?><?php echo $ai_btn; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
</td>
</tr>
<?php
@@ -169,9 +169,9 @@ class SEOMetaBox {
}
$map = [
self::META_TITLE => 'aksrt_seo_title',
self::META_KEYWORDS => 'aksrt_seo_keywords',
self::META_DESCRIPTION => 'aksrt_seo_description',
self::META_TITLE => 'jio_seo_title',
self::META_KEYWORDS => 'jio_seo_keywords',
self::META_DESCRIPTION => 'jio_seo_description',
];
foreach ($map as $meta_key => $field) {
@@ -197,24 +197,24 @@ class SEOMetaBox {
return;
}
$path = AKSRT_DIR . '/assets/js/admin-ai-seo.js';
$path = JIO_DIR . '/assets/js/admin-ai-seo.js';
if (!is_file($path)) {
return;
}
wp_enqueue_script(
'aksrt-admin-ai-seo',
AKSRT_URI . '/assets/js/admin-ai-seo.js',
'jio-admin-ai-seo',
JIO_URI . '/assets/js/admin-ai-seo.js',
[],
(string) filemtime($path),
true
);
$ai_available = class_exists('\AKSRT\Ai\AI') && \AKSRT\Ai\AI::get_instance()->is_available();
$seo = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_seo_settings() : [];
$ai_available = class_exists('\Jio\Ai\AI') && \Jio\Ai\AI::get_instance()->is_available();
$seo = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_seo_settings() : [];
wp_localize_script('aksrt-admin-ai-seo', 'aksrtAiSeo', [
'restUrl' => esc_url_raw(rest_url('aksrt/v1')),
wp_localize_script('jio-admin-ai-seo', 'jioAiSeo', [
'restUrl' => esc_url_raw(rest_url('jio/v1')),
'nonce' => wp_create_nonce('wp_rest'),
'ai' => [
'available' => $ai_available,
@@ -222,56 +222,56 @@ class SEOMetaBox {
'write_assist' => $ai_available,
],
'i18n' => [
'generating' => __('生成中…', 'aksrt'),
'generate' => __('AI 生成 SEO', 'aksrt'),
'generateSummary' => __('AI 生成摘要', 'aksrt'),
'success' => __('已填入 SEO 字段,请检查后更新保存', 'aksrt'),
'summarySuccess' => __('已填入摘要字段,请检查后更新保存', 'aksrt'),
'failed' => __('生成失败', 'aksrt'),
'needSave' => __('请先保存后再生成 SEO', 'aksrt'),
'needContent' => __('请先填写正文内容', 'aksrt'),
'notAvailable' => __('AI 未配置或未启用', 'aksrt'),
'noExcerptField' => __('未找到摘要字段,请展开「摘要」面板', 'aksrt'),
'generating' => __('生成中…', 'jio'),
'generate' => __('AI 生成 SEO', 'jio'),
'generateSummary' => __('AI 生成摘要', 'jio'),
'success' => __('已填入 SEO 字段,请检查后更新保存', 'jio'),
'summarySuccess' => __('已填入摘要字段,请检查后更新保存', 'jio'),
'failed' => __('生成失败', 'jio'),
'needSave' => __('请先保存后再生成 SEO', 'jio'),
'needContent' => __('请先填写正文内容', 'jio'),
'notAvailable' => __('AI 未配置或未启用', 'jio'),
'noExcerptField' => __('未找到摘要字段,请展开「摘要」面板', 'jio'),
],
]);
wp_add_inline_style('wp-admin', '
.aksrt-ai-seo-button{display:inline-block;margin-left:8px;vertical-align:middle}
.aksrt-ai-seo-generate,.aksrt-ai-summary-generate{cursor:pointer}
.aksrt-ai-seo-generate.is-loading,.aksrt-ai-summary-generate.is-loading{opacity:.6;pointer-events:none}
.aksrt-ai-seo-msg{display:block;margin-top:6px;font-size:12px}
.aksrt-ai-seo-msg.is-error{color:#b32d2e}
.aksrt-ai-seo-msg.is-ok{color:#007017}
.aksrt-ai-summary-row{margin-top:8px;padding-top:8px;border-top:1px solid #eee}
.aksrt-seo-preview{margin:12px 0;padding:14px;border:1px solid #e5e5e5;border-radius:4px;background:#fff}
.aksrt-seo-preview__title{margin-top:8px;color:#1a0dab;font-size:18px;line-height:1.3}
.aksrt-seo-preview__url{margin:4px 0;color:#188038;font-size:13px;word-break:break-all}
.aksrt-seo-preview__description{color:#4d5156;line-height:1.5}
.aksrt-seo-advice{margin-top:12px;border:1px solid #e5e5e5;border-radius:4px}
.aksrt-seo-advice summary{padding:10px 12px;cursor:pointer;font-weight:600}
.aksrt-seo-advice>div{padding:0 12px 10px}
.jio-ai-seo-button{display:inline-block;margin-left:8px;vertical-align:middle}
.jio-ai-seo-generate,.jio-ai-summary-generate{cursor:pointer}
.jio-ai-seo-generate.is-loading,.jio-ai-summary-generate.is-loading{opacity:.6;pointer-events:none}
.jio-ai-seo-msg{display:block;margin-top:6px;font-size:12px}
.jio-ai-seo-msg.is-error{color:#b32d2e}
.jio-ai-seo-msg.is-ok{color:#007017}
.jio-ai-summary-row{margin-top:8px;padding-top:8px;border-top:1px solid #eee}
.jio-seo-preview{margin:12px 0;padding:14px;border:1px solid #e5e5e5;border-radius:4px;background:#fff}
.jio-seo-preview__title{margin-top:8px;color:#1a0dab;font-size:18px;line-height:1.3}
.jio-seo-preview__url{margin:4px 0;color:#188038;font-size:13px;word-break:break-all}
.jio-seo-preview__description{color:#4d5156;line-height:1.5}
.jio-seo-advice{margin-top:12px;border:1px solid #e5e5e5;border-radius:4px}
.jio-seo-advice summary{padding:10px 12px;cursor:pointer;font-weight:600}
.jio-seo-advice>div{padding:0 12px 10px}
');
}
private function render_ai_button(string $type, int $id): string {
$seo = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_seo_settings() : [];
$seo = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_seo_settings() : [];
if (empty($seo['seo_enabled']) || empty($seo['seo_ai_enabled'])) {
return '';
}
$available = class_exists('\AKSRT\Ai\AI') && \AKSRT\Ai\AI::get_instance()->is_available();
$available = class_exists('\Jio\Ai\AI') && \Jio\Ai\AI::get_instance()->is_available();
$disabled = (!$available || $id <= 0) ? ' disabled' : '';
$title = !$available
? esc_attr__('请先配置 WordPress AI Connectors', 'aksrt')
: ($id <= 0 ? esc_attr__('请先保存后再生成', 'aksrt') : '');
? esc_attr__('请先配置 WordPress AI Connectors', 'jio')
: ($id <= 0 ? esc_attr__('请先保存后再生成', 'jio') : '');
return sprintf(
'<span class="aksrt-ai-seo-button"><button type="button" class="button aksrt-ai-seo-generate"%s data-type="%s" data-id="%d" title="%s">%s</button></span>',
'<span class="jio-ai-seo-button"><button type="button" class="button jio-ai-seo-generate"%s data-type="%s" data-id="%d" title="%s">%s</button></span>',
$disabled,
esc_attr($type),
$id,
$title,
esc_html__('AI 生成 SEO', 'aksrt')
esc_html__('AI 生成 SEO', 'jio')
);
}
@@ -279,22 +279,22 @@ class SEOMetaBox {
* 后台「AI 生成摘要」→ 写入 WP 摘要字段(#excerpt / 块编辑器)。
*/
private function render_summary_button(int $post_id): string {
$available = class_exists('\AKSRT\Ai\AI') && \AKSRT\Ai\AI::get_instance()->is_available();
$available = class_exists('\Jio\Ai\AI') && \Jio\Ai\AI::get_instance()->is_available();
if (!$available) {
return '';
}
$disabled = $post_id <= 0 ? ' disabled' : '';
$title = $post_id <= 0
? esc_attr__('请先保存后再生成', 'aksrt')
: esc_attr__('根据正文生成摘要,填入摘要框', 'aksrt');
? esc_attr__('请先保存后再生成', 'jio')
: esc_attr__('根据正文生成摘要,填入摘要框', 'jio');
return sprintf(
'<span class="aksrt-ai-seo-button"><button type="button" class="button aksrt-ai-summary-generate"%s data-post-id="%d" title="%s">%s</button></span>',
'<span class="jio-ai-seo-button"><button type="button" class="button jio-ai-summary-generate"%s data-post-id="%d" title="%s">%s</button></span>',
$disabled,
$post_id,
$title,
esc_html__('AI 生成摘要', 'aksrt')
esc_html__('AI 生成摘要', 'jio')
);
}
}