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
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Admin;
|
||||
namespace Jio\Admin;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -114,7 +114,7 @@ class GlobalController extends ControllerBase {
|
||||
|
||||
public function rest_handle_cms_features(\WP_REST_Request $request): \WP_REST_Response {
|
||||
if ($request->get_method() === 'GET') {
|
||||
return $this->success(['cms_features' => \AKSRT\Settings\Settings::get_cms_features()]);
|
||||
return $this->success(['cms_features' => \Jio\Settings\Settings::get_cms_features()]);
|
||||
}
|
||||
|
||||
$params = $this->get_json_params($request);
|
||||
@@ -123,27 +123,27 @@ class GlobalController extends ControllerBase {
|
||||
'search_include_resource' => 'bool',
|
||||
];
|
||||
$sanitized = $this->sanitize_fields($params, $allowed);
|
||||
$settings = \AKSRT\Settings\Settings::get_all();
|
||||
$settings = \Jio\Settings\Settings::get_all();
|
||||
$settings['cms_features'] = array_merge(
|
||||
is_array($settings['cms_features'] ?? null) ? $settings['cms_features'] : [],
|
||||
$sanitized
|
||||
);
|
||||
update_option('aksrt_settings', $settings);
|
||||
\AKSRT\Settings\Settings::flush_settings_cache();
|
||||
update_option('jio_settings', $settings);
|
||||
\Jio\Settings\Settings::flush_settings_cache();
|
||||
|
||||
return $this->success(['message' => 'CMS 功能已保存', 'cms_features' => \AKSRT\Settings\Settings::get_cms_features()]);
|
||||
return $this->success(['message' => 'CMS 功能已保存', 'cms_features' => \Jio\Settings\Settings::get_cms_features()]);
|
||||
}
|
||||
|
||||
public function rest_test_mail(\WP_REST_Request $request): \WP_REST_Response {
|
||||
$params = $this->get_json_params($request);
|
||||
$to = sanitize_email($params['to'] ?? '');
|
||||
if (!is_email($to)) {
|
||||
return $this->error(__('请输入有效的邮箱地址', 'aksrt'));
|
||||
return $this->error(__('请输入有效的邮箱地址', 'jio'));
|
||||
}
|
||||
|
||||
$result = \AKSRT\Settings\Mail::send_test_email($to);
|
||||
$result = \Jio\Settings\Mail::send_test_email($to);
|
||||
if (is_wp_error($result)) {
|
||||
return $this->error(__('邮件发送失败,详细原因已写入服务器错误日志', 'aksrt'));
|
||||
return $this->error(__('邮件发送失败,详细原因已写入服务器错误日志', 'jio'));
|
||||
}
|
||||
return $this->success(['message' => '测试邮件已发送']);
|
||||
}
|
||||
@@ -169,12 +169,12 @@ class GlobalController extends ControllerBase {
|
||||
|
||||
public function rest_handle_friend_links(\WP_REST_Request $request): \WP_REST_Response {
|
||||
if ($request->get_method() === 'GET') {
|
||||
$links = aksrt_get_friend_links();
|
||||
$links = jio_get_friend_links();
|
||||
return rest_ensure_response(['code' => 'success', 'data' => $links]);
|
||||
}
|
||||
|
||||
$params = $this->get_json_params($request);
|
||||
$links = get_option('aksrt_friend_links', []);
|
||||
$links = get_option('jio_friend_links', []);
|
||||
$new_link = [
|
||||
'id' => uniqid('fl_'),
|
||||
'name' => sanitize_text_field($params['name'] ?? ''),
|
||||
@@ -188,29 +188,29 @@ class GlobalController extends ControllerBase {
|
||||
usort($links, function ($a, $b) {
|
||||
return ($a['sort_order'] ?? 0) <=> ($b['sort_order'] ?? 0);
|
||||
});
|
||||
update_option('aksrt_friend_links', $links);
|
||||
do_action('aksrt_friend_link_submitted', $new_link);
|
||||
update_option('jio_friend_links', $links);
|
||||
do_action('jio_friend_link_submitted', $new_link);
|
||||
|
||||
return rest_ensure_response(['code' => 'success', 'data' => $new_link, 'message' => __('Friend link added.', 'aksrt')]);
|
||||
return rest_ensure_response(['code' => 'success', 'data' => $new_link, 'message' => __('Friend link added.', 'jio')]);
|
||||
}
|
||||
|
||||
public function rest_delete_friend_link(\WP_REST_Request $request): \WP_REST_Response {
|
||||
$id = $request->get_param('id');
|
||||
$links = get_option('aksrt_friend_links', []);
|
||||
$links = get_option('jio_friend_links', []);
|
||||
$links = array_filter($links, function ($link) use ($id) {
|
||||
return ($link['id'] ?? '') !== $id;
|
||||
});
|
||||
$links = array_values($links);
|
||||
update_option('aksrt_friend_links', $links);
|
||||
return rest_ensure_response(['code' => 'success', 'message' => __('Friend link deleted.', 'aksrt')]);
|
||||
update_option('jio_friend_links', $links);
|
||||
return rest_ensure_response(['code' => 'success', 'message' => __('Friend link deleted.', 'jio')]);
|
||||
}
|
||||
|
||||
public function rest_reorder_friend_links(\WP_REST_Request $request): \WP_REST_Response {
|
||||
$ordered_ids = $request->get_param('ids');
|
||||
if (!is_array($ordered_ids)) {
|
||||
return new \WP_REST_Response(['code' => 'error', 'message' => __('参数错误', 'aksrt')], 400);
|
||||
return new \WP_REST_Response(['code' => 'error', 'message' => __('参数错误', 'jio')], 400);
|
||||
}
|
||||
$links = get_option('aksrt_friend_links', []);
|
||||
$links = get_option('jio_friend_links', []);
|
||||
$order_map = array_flip($ordered_ids);
|
||||
usort($links, function ($a, $b) use ($order_map) {
|
||||
$idx_a = $order_map[($a['id'] ?? '')] ?? 999;
|
||||
@@ -220,14 +220,14 @@ class GlobalController extends ControllerBase {
|
||||
foreach ($links as $index => &$link) {
|
||||
$link['sort_order'] = $index;
|
||||
}
|
||||
update_option('aksrt_friend_links', $links);
|
||||
return rest_ensure_response(['code' => 'success', 'message' => __('Order saved.', 'aksrt')]);
|
||||
update_option('jio_friend_links', $links);
|
||||
return rest_ensure_response(['code' => 'success', 'message' => __('Order saved.', 'jio')]);
|
||||
}
|
||||
|
||||
public function rest_handle_footer_tabbar(\WP_REST_Request $request): \WP_REST_Response {
|
||||
if ($request->get_method() === 'GET') {
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_footer_tabbar_settings()
|
||||
$settings = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::get_footer_tabbar_settings()
|
||||
: ['enabled' => true, 'scroll_hide' => false, 'scroll_down_hide' => true, 'items' => []];
|
||||
return rest_ensure_response(['code' => 'success', 'data' => $settings]);
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class GlobalController extends ControllerBase {
|
||||
if (count($items) > $max_items) {
|
||||
return new \WP_REST_Response([
|
||||
'code' => 'error',
|
||||
'message' => sprintf(__('Footer tabbar supports at most %d items.', 'aksrt'), $max_items),
|
||||
'message' => sprintf(__('Footer tabbar supports at most %d items.', 'jio'), $max_items),
|
||||
], 400);
|
||||
}
|
||||
|
||||
@@ -251,8 +251,8 @@ class GlobalController extends ControllerBase {
|
||||
'icon_size' => max(16, min(32, (int) ($params['icon_size'] ?? 22))),
|
||||
'text_size' => max(8, min(14, (int) ($params['text_size'] ?? 10))),
|
||||
'show_text' => !empty($params['show_text']),
|
||||
'active_color' => \AKSRT\Core\Color::sanitize($params['active_color'] ?? '') ?: '#f04494',
|
||||
'bg_color' => \AKSRT\Core\Color::sanitize($params['bg_color'] ?? '') ?: '',
|
||||
'active_color' => \Jio\Core\Color::sanitize($params['active_color'] ?? '') ?: '#f04494',
|
||||
'bg_color' => \Jio\Core\Color::sanitize($params['bg_color'] ?? '') ?: '',
|
||||
'border' => !empty($params['border']),
|
||||
'shadow' => !empty($params['shadow']),
|
||||
'animation' => !empty($params['animation']),
|
||||
@@ -260,13 +260,13 @@ class GlobalController extends ControllerBase {
|
||||
'badge_dot' => !empty($params['badge_dot']),
|
||||
'items' => $items,
|
||||
];
|
||||
update_option('aksrt_footer_tabbar', $tabbar);
|
||||
update_option('jio_footer_tabbar', $tabbar);
|
||||
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
\AKSRT\Settings\Settings::flush_settings_cache();
|
||||
if (class_exists('\Jio\Settings\Settings')) {
|
||||
\Jio\Settings\Settings::flush_settings_cache();
|
||||
}
|
||||
|
||||
return rest_ensure_response(['code' => 'success', 'message' => __('Footer tabbar settings saved.', 'aksrt')]);
|
||||
return rest_ensure_response(['code' => 'success', 'message' => __('Footer tabbar settings saved.', 'jio')]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user