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\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -11,7 +11,7 @@ class ThemeSearch {
|
||||
|
||||
public static function search_placeholder(): string {
|
||||
$placeholder = trim((string) Settings::get_value('search_placeholder', ''));
|
||||
return $placeholder !== '' ? $placeholder : __('开启精彩搜索', 'aksrt');
|
||||
return $placeholder !== '' ? $placeholder : __('开启精彩搜索', 'jio');
|
||||
}
|
||||
|
||||
public static function search_history_enabled(): bool {
|
||||
@@ -49,7 +49,7 @@ class ThemeSearch {
|
||||
|
||||
public static function search_popular_title(): string {
|
||||
$title = trim((string) Settings::get_value('search_popular_title', ''));
|
||||
return $title !== '' ? $title : __('热门搜索', 'aksrt');
|
||||
return $title !== '' ? $title : __('热门搜索', 'jio');
|
||||
}
|
||||
|
||||
public static function search_popular_sticky(): array {
|
||||
@@ -130,7 +130,7 @@ class ThemeSearch {
|
||||
$enabled = !empty($s['search_ms_s']);
|
||||
$api_url = esc_url_raw(trim((string) ($opt['api_url'] ?? 'http://127.0.0.1:7700')));
|
||||
$api_key = sanitize_text_field((string) ($opt['api_key'] ?? ''));
|
||||
$index_prefix = sanitize_key((string) ($opt['index_prefix'] ?? 'aksrt'));
|
||||
$index_prefix = sanitize_key((string) ($opt['index_prefix'] ?? 'jio'));
|
||||
$synonyms_raw = $opt['synonyms'] ?? [];
|
||||
$synonyms = [];
|
||||
foreach ((array) $synonyms_raw as $row) {
|
||||
@@ -148,9 +148,9 @@ class ThemeSearch {
|
||||
'enabled' => $enabled,
|
||||
'api_url' => $api_url,
|
||||
'api_key' => $api_key,
|
||||
'index_prefix' => $index_prefix !== '' ? $index_prefix : 'aksrt',
|
||||
'index_prefix' => $index_prefix !== '' ? $index_prefix : 'jio',
|
||||
'synonyms' => $synonyms,
|
||||
'index_name' => ($index_prefix !== '' ? $index_prefix : 'aksrt') . '_posts',
|
||||
'index_name' => ($index_prefix !== '' ? $index_prefix : 'jio') . '_posts',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -183,9 +183,9 @@ class ThemeSearch {
|
||||
if ($key === 'title') $parts[] = $wpdb->prepare("{$wpdb->posts}.post_title LIKE %s", $like);
|
||||
elseif ($key === 'content') $parts[] = $wpdb->prepare("{$wpdb->posts}.post_content LIKE %s", $like);
|
||||
elseif ($key === 'excerpt') $parts[] = $wpdb->prepare("{$wpdb->posts}.post_excerpt LIKE %s", $like);
|
||||
elseif (in_array($key, $taxonomies, true)) $parts[] = $wpdb->prepare('(aksrt_search_tt.taxonomy = %s AND aksrt_search_terms.name LIKE %s)', $key, $like);
|
||||
elseif ($key === 'coment') $parts[] = $wpdb->prepare('aksrt_search_comments.comment_content LIKE %s', $like);
|
||||
elseif ($key === 'user') $parts[] = $wpdb->prepare('(aksrt_search_users.user_nicename LIKE %s OR aksrt_search_users.display_name LIKE %s)', $like, $like);
|
||||
elseif (in_array($key, $taxonomies, true)) $parts[] = $wpdb->prepare('(jio_search_tt.taxonomy = %s AND jio_search_terms.name LIKE %s)', $key, $like);
|
||||
elseif ($key === 'coment') $parts[] = $wpdb->prepare('jio_search_comments.comment_content LIKE %s', $like);
|
||||
elseif ($key === 'user') $parts[] = $wpdb->prepare('(jio_search_users.user_nicename LIKE %s OR jio_search_users.display_name LIKE %s)', $like, $like);
|
||||
}
|
||||
if ($parts) {
|
||||
$groups[] = '(' . implode(' OR ', $parts) . ')';
|
||||
@@ -207,15 +207,15 @@ class ThemeSearch {
|
||||
global $wpdb;
|
||||
$keys = self::search_custom_key();
|
||||
if (in_array('coment', $keys, true)) {
|
||||
$join .= " LEFT JOIN {$wpdb->comments} AS aksrt_search_comments ON ({$wpdb->posts}.ID = aksrt_search_comments.comment_post_ID)";
|
||||
$join .= " LEFT JOIN {$wpdb->comments} AS jio_search_comments ON ({$wpdb->posts}.ID = jio_search_comments.comment_post_ID)";
|
||||
}
|
||||
if (in_array('user', $keys, true)) {
|
||||
$join .= " LEFT JOIN {$wpdb->users} AS aksrt_search_users ON ({$wpdb->posts}.post_author = aksrt_search_users.ID)";
|
||||
$join .= " LEFT JOIN {$wpdb->users} AS jio_search_users ON ({$wpdb->posts}.post_author = jio_search_users.ID)";
|
||||
}
|
||||
if (array_intersect(['post_tag', 'category'], $keys)) {
|
||||
$join .= " LEFT JOIN {$wpdb->term_relationships} AS aksrt_search_tr ON ({$wpdb->posts}.ID = aksrt_search_tr.object_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->term_taxonomy} AS aksrt_search_tt ON (aksrt_search_tr.term_taxonomy_id = aksrt_search_tt.term_taxonomy_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->terms} AS aksrt_search_terms ON (aksrt_search_tt.term_id = aksrt_search_terms.term_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->term_relationships} AS jio_search_tr ON ({$wpdb->posts}.ID = jio_search_tr.object_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->term_taxonomy} AS jio_search_tt ON (jio_search_tr.term_taxonomy_id = jio_search_tt.term_taxonomy_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->terms} AS jio_search_terms ON (jio_search_tt.term_id = jio_search_terms.term_id)";
|
||||
}
|
||||
return $join;
|
||||
}
|
||||
@@ -279,10 +279,10 @@ class ThemeSearch {
|
||||
|
||||
$orderby = isset($_REQUEST['orderby']) ? sanitize_key((string) wp_unslash($_REQUEST['orderby'])) : '';
|
||||
$meta_keys = [
|
||||
'views' => 'aksrt_post_views',
|
||||
'like' => '_aksrt_like_count',
|
||||
'favorite' => '_aksrt_favorite_count',
|
||||
'sales_volume' => '_aksrt_sales_volume',
|
||||
'views' => 'jio_post_views',
|
||||
'like' => '_jio_like_count',
|
||||
'favorite' => '_jio_favorite_count',
|
||||
'sales_volume' => '_jio_sales_volume',
|
||||
];
|
||||
if (isset($meta_keys[$orderby])) {
|
||||
$query->set('meta_key', $meta_keys[$orderby]);
|
||||
@@ -390,7 +390,7 @@ class ThemeSearch {
|
||||
|
||||
/** 全局主题色:theme_skin_custom 优先,清空时使用 theme_skin 预置色(对齐参考主题 zib_head_css)。 */
|
||||
public static function theme_color(): string {
|
||||
$custom = \AKSRT\Core\Color::sanitize(Settings::get_value('theme_skin_custom', ''));
|
||||
$custom = \Jio\Core\Color::sanitize(Settings::get_value('theme_skin_custom', ''));
|
||||
if ($custom !== '') {
|
||||
return $custom;
|
||||
}
|
||||
@@ -400,7 +400,7 @@ class ThemeSearch {
|
||||
|
||||
/** 夜间模式主题色;未设置返回空串,夜间沿用全局主题色。 */
|
||||
public static function dark_theme_color(): string {
|
||||
return \AKSRT\Core\Color::sanitize(Settings::get_value('dark_theme_skin_custom', ''));
|
||||
return \Jio\Core\Color::sanitize(Settings::get_value('dark_theme_skin_custom', ''));
|
||||
}
|
||||
|
||||
public static function get_theme_mode_button_positions(): array {
|
||||
@@ -426,7 +426,7 @@ class ThemeSearch {
|
||||
if (!is_array($bg)) {
|
||||
return '';
|
||||
}
|
||||
$color = \AKSRT\Core\Color::sanitize($bg['color'] ?? '');
|
||||
$color = \Jio\Core\Color::sanitize($bg['color'] ?? '');
|
||||
$image = esc_url_raw(trim((string) ($bg['image'] ?? '')));
|
||||
if ($color === '' && $image === '') {
|
||||
return '';
|
||||
|
||||
Reference in new issue
Block a user