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
@@ -5,14 +5,14 @@
|
||||
* This is the only header-slider rendering path. It consumes the original
|
||||
* legacy option IDs and the serialized page_config post meta contract.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_header_slider_device_is_visible')) {
|
||||
if (!function_exists('jio_header_slider_device_is_visible')) {
|
||||
/** @param mixed $value */
|
||||
function aksrt_header_slider_device_is_visible($value): bool {
|
||||
function jio_header_slider_device_is_visible($value): bool {
|
||||
$devices = array_map('sanitize_key', (array) $value);
|
||||
return wp_is_mobile()
|
||||
? in_array('m_s', $devices, true)
|
||||
@@ -20,9 +20,9 @@ if (!function_exists('aksrt_header_slider_device_is_visible')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_excluded_page_templates')) {
|
||||
if (!function_exists('jio_header_slide_excluded_page_templates')) {
|
||||
/** @return list<string> */
|
||||
function aksrt_header_slide_excluded_page_templates(): array {
|
||||
function jio_header_slide_excluded_page_templates(): array {
|
||||
return [
|
||||
'templates/pages/page-sign.php',
|
||||
'templates/pages/page-download.php',
|
||||
@@ -31,9 +31,9 @@ if (!function_exists('aksrt_header_slide_excluded_page_templates')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_page_header_slider_config')) {
|
||||
if (!function_exists('jio_get_page_header_slider_config')) {
|
||||
/** @return array<string,mixed> */
|
||||
function aksrt_get_page_header_slider_config(): array {
|
||||
function jio_get_page_header_slider_config(): array {
|
||||
if (!is_page()) {
|
||||
return [];
|
||||
}
|
||||
@@ -43,7 +43,7 @@ if (!function_exists('aksrt_get_page_header_slider_config')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_current_page_type')) {
|
||||
if (!function_exists('jio_header_slide_current_page_type')) {
|
||||
/**
|
||||
* Resolve one mutually exclusive page type for the header component.
|
||||
*
|
||||
@@ -52,17 +52,17 @@ if (!function_exists('aksrt_header_slide_current_page_type')) {
|
||||
* Utility rewrites (go-link confirm) are error / hand-off surfaces and
|
||||
* opt out entirely, like the excluded templates.
|
||||
*/
|
||||
function aksrt_header_slide_current_page_type(): string {
|
||||
if ((string) get_query_var('aksrt_go_redirect') !== '') {
|
||||
function jio_header_slide_current_page_type(): string {
|
||||
if ((string) get_query_var('jio_go_redirect') !== '') {
|
||||
return '';
|
||||
}
|
||||
if ((string) get_query_var('aksrt_message_view') !== '') {
|
||||
if ((string) get_query_var('jio_message_view') !== '') {
|
||||
return 'page';
|
||||
}
|
||||
if (is_author() || (function_exists('aksrt_is_user_home_page') && aksrt_is_user_home_page())) {
|
||||
if (is_author() || (function_exists('jio_is_user_home_page') && jio_is_user_home_page())) {
|
||||
return 'author';
|
||||
}
|
||||
if (function_exists('aksrt_is_user_center_page') && aksrt_is_user_center_page()) {
|
||||
if (function_exists('jio_is_user_center_page') && jio_is_user_center_page()) {
|
||||
return 'user_center';
|
||||
}
|
||||
if (is_front_page()) {
|
||||
@@ -81,7 +81,7 @@ if (!function_exists('aksrt_header_slide_current_page_type')) {
|
||||
return 'search';
|
||||
}
|
||||
if (is_page()) {
|
||||
foreach (aksrt_header_slide_excluded_page_templates() as $template) {
|
||||
foreach (jio_header_slide_excluded_page_templates() as $template) {
|
||||
if (is_page_template($template)) {
|
||||
return '';
|
||||
}
|
||||
@@ -96,18 +96,18 @@ if (!function_exists('aksrt_header_slide_current_page_type')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_matches_query')) {
|
||||
function aksrt_header_slide_matches_query(string $type): bool {
|
||||
if (!function_exists('jio_header_slide_matches_query')) {
|
||||
function jio_header_slide_matches_query(string $type): bool {
|
||||
$type = sanitize_key($type);
|
||||
if ($type === 'user_home') {
|
||||
$type = 'author';
|
||||
}
|
||||
return $type !== '' && $type === aksrt_header_slide_current_page_type();
|
||||
return $type !== '' && $type === jio_header_slide_current_page_type();
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
function aksrt_header_slide_is_show(): bool {
|
||||
if (!function_exists('jio_header_slide_is_show')) {
|
||||
function jio_header_slide_is_show(): bool {
|
||||
global $wp_query;
|
||||
|
||||
if (is_admin() || !($wp_query instanceof WP_Query)) {
|
||||
@@ -119,8 +119,8 @@ if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$settings = class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_slider_settings()
|
||||
$settings = class_exists('\\Jio\\Settings\\Settings')
|
||||
? \Jio\Settings\Settings::get_header_slider_settings()
|
||||
: [];
|
||||
$show_type = sanitize_key((string) ($settings['show_type'] ?? ''));
|
||||
if (($show_type === 'only_pc' && wp_is_mobile()) || ($show_type === 'only_sm' && !wp_is_mobile())) {
|
||||
@@ -129,7 +129,7 @@ if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
|
||||
$matches_global_scope = false;
|
||||
foreach ((array) ($settings['show_on_pages'] ?? []) as $type) {
|
||||
if (aksrt_header_slide_matches_query((string) $type)) {
|
||||
if (jio_header_slide_matches_query((string) $type)) {
|
||||
$matches_global_scope = true;
|
||||
break;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
|
||||
// Per-page data may customize an already-enabled component, but it must
|
||||
// never bypass the global page scope selected in the theme settings.
|
||||
$page_config = aksrt_get_page_header_slider_config();
|
||||
$page_config = jio_get_page_header_slider_config();
|
||||
if ($page_config) {
|
||||
$page_show_type = sanitize_key((string) ($page_config['header_slider_show_type'] ?? ''));
|
||||
return !($page_show_type === 'only_pc' && wp_is_mobile())
|
||||
@@ -151,10 +151,10 @@ if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_header_slider_args')) {
|
||||
if (!function_exists('jio_get_header_slider_args')) {
|
||||
/** @return array<string,mixed> */
|
||||
function aksrt_get_header_slider_args(): array {
|
||||
$page_config = aksrt_get_page_header_slider_config();
|
||||
function jio_get_header_slider_args(): array {
|
||||
$page_config = jio_get_page_header_slider_config();
|
||||
if ($page_config) {
|
||||
return [
|
||||
'header_slider' => (array) ($page_config['header_slider'] ?? []),
|
||||
@@ -168,8 +168,8 @@ if (!function_exists('aksrt_get_header_slider_args')) {
|
||||
];
|
||||
}
|
||||
|
||||
$settings = class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_slider_settings()
|
||||
$settings = class_exists('\\Jio\\Settings\\Settings')
|
||||
? \Jio\Settings\Settings::get_header_slider_settings()
|
||||
: [];
|
||||
return [
|
||||
'header_slider' => (array) ($settings['slides'] ?? []),
|
||||
@@ -184,9 +184,9 @@ if (!function_exists('aksrt_get_header_slider_args')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slider_allowed_html')) {
|
||||
if (!function_exists('jio_header_slider_allowed_html')) {
|
||||
/** @return array<string,array<string,bool>> */
|
||||
function aksrt_header_slider_allowed_html(): array {
|
||||
function jio_header_slider_allowed_html(): array {
|
||||
return [
|
||||
'a' => ['href' => true, 'target' => true, 'rel' => true, 'class' => true],
|
||||
'b' => ['class' => true],
|
||||
@@ -202,21 +202,21 @@ if (!function_exists('aksrt_header_slider_allowed_html')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slider_image')) {
|
||||
if (!function_exists('jio_header_slider_image')) {
|
||||
/** @param string $src @param string $class @param string $alt */
|
||||
function aksrt_header_slider_image(string $src, string $class, string $alt): string {
|
||||
$lazy = function_exists('aksrt_is_lazy') && aksrt_is_lazy('lazy_sider');
|
||||
function jio_header_slider_image(string $src, string $class, string $alt): string {
|
||||
$lazy = function_exists('jio_is_lazy') && jio_is_lazy('lazy_sider');
|
||||
if ($lazy) {
|
||||
$class .= ' swiper-lazy';
|
||||
}
|
||||
$attrs = aksrt_get_lazy_attr('lazy_sider', $src, $class, aksrt_get_lazy_thumb('lg'));
|
||||
$attrs = jio_get_lazy_attr('lazy_sider', $src, $class, jio_get_lazy_thumb('lg'));
|
||||
return '<img' . $attrs . ' alt="' . esc_attr($alt) . '">';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
if (!function_exists('jio_get_header_slider_markup')) {
|
||||
/** @param array<string,mixed> $options */
|
||||
function aksrt_get_header_slider_markup(array $options): string {
|
||||
function jio_get_header_slider_markup(array $options): string {
|
||||
$options = wp_parse_args($options, [
|
||||
'class' => 'slide-index slide-header',
|
||||
'direction' => 'horizontal',
|
||||
@@ -243,10 +243,10 @@ if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
}
|
||||
|
||||
$is_mobile = wp_is_mobile();
|
||||
$lazy = function_exists('aksrt_is_lazy') && aksrt_is_lazy('lazy_sider');
|
||||
$lazy = function_exists('jio_is_lazy') && jio_is_lazy('lazy_sider');
|
||||
$slides_html = '';
|
||||
$slide_count = 0;
|
||||
$allow = aksrt_header_slider_allowed_html();
|
||||
$allow = jio_header_slider_allowed_html();
|
||||
$site_suffix = ' - ' . get_bloginfo('name');
|
||||
|
||||
foreach ((array) $options['slides'] as $slide) {
|
||||
@@ -268,7 +268,7 @@ if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
if ($alt === '') {
|
||||
$alt = trim(wp_strip_all_tags((string) ($link['text'] ?? '')));
|
||||
}
|
||||
$alt = $alt !== '' ? $alt . $site_suffix : __('幻灯片', 'aksrt') . $site_suffix;
|
||||
$alt = $alt !== '' ? $alt . $site_suffix : __('幻灯片', 'jio') . $site_suffix;
|
||||
$slide_class = trim((string) ($slide['class'] ?? ''));
|
||||
$background_html = '';
|
||||
|
||||
@@ -284,11 +284,11 @@ if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
$poster_class = 'absolute dplayer-poster' . (!empty($options['gradient_bg']) ? ' gradient-bg' : '');
|
||||
$poster_attrs = !empty($options['gradient_bg']) ? ' data-opacity="0.2"' : '';
|
||||
$background_html .= '<div class="' . esc_attr($poster_class) . '"' . $poster_attrs . '>'
|
||||
. aksrt_header_slider_image($background, 'no-imgbox radius8', $alt)
|
||||
. jio_header_slider_image($background, 'no-imgbox radius8', $alt)
|
||||
. '<div class="absolute flex jc play-icon"><span class="toggle-radius"><i class="fas fa-play" aria-hidden="true"></i></span></div></div>';
|
||||
}
|
||||
} elseif ($background !== '') {
|
||||
$background_html = aksrt_header_slider_image($background, 'radius8', $alt);
|
||||
$background_html = jio_header_slider_image($background, 'radius8', $alt);
|
||||
}
|
||||
|
||||
if ($background_html === '') {
|
||||
@@ -297,7 +297,7 @@ if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
|
||||
$blur_html = '';
|
||||
if (!empty($options['blur_bg']) && $background !== '') {
|
||||
$blur_html = '<div class="slide-blur-bg">' . aksrt_header_slider_image($background, 'no-imgbox', $alt) . '</div>';
|
||||
$blur_html = '<div class="slide-blur-bg">' . jio_header_slider_image($background, 'no-imgbox', $alt) . '</div>';
|
||||
}
|
||||
|
||||
$layers_html = '';
|
||||
@@ -323,7 +323,7 @@ if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
if ($scale !== 100) {
|
||||
$layer_attrs .= ' data-swiper-parallax-scale="' . esc_attr((string) ($scale / 100)) . '"';
|
||||
}
|
||||
$layers_html .= '<div class="' . esc_attr($layer_class) . '"' . $layer_attrs . '>' . aksrt_header_slider_image((string) $layer['image'], 'radius8', $alt) . '</div>';
|
||||
$layers_html .= '<div class="' . esc_attr($layer_class) . '"' . $layer_attrs . '>' . jio_header_slider_image((string) $layer['image'], 'radius8', $alt) . '</div>';
|
||||
}
|
||||
|
||||
$text_html = '';
|
||||
@@ -397,18 +397,18 @@ if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
$controls .= '<div class="swiper-pagination kaoyou' . esc_attr($pagination_class) . '"></div>';
|
||||
}
|
||||
|
||||
return '<div class="relative aksrt-slider"><div class="new-swiper ' . esc_attr(trim($class)) . '"' . $attrs . ' style="' . esc_attr($style) . '"><div class="swiper-wrapper">'
|
||||
return '<div class="relative jio-slider"><div class="new-swiper ' . esc_attr(trim($class)) . '"' . $attrs . ' style="' . esc_attr($style) . '"><div class="swiper-wrapper">'
|
||||
. $slides_html . '</div>' . $controls . '</div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide')) {
|
||||
function aksrt_header_slide(): void {
|
||||
if (!aksrt_header_slide_is_show()) {
|
||||
if (!function_exists('jio_header_slide')) {
|
||||
function jio_header_slide(): void {
|
||||
if (!jio_header_slide_is_show()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$args = aksrt_get_header_slider_args();
|
||||
$args = jio_get_header_slider_args();
|
||||
$slides = (array) ($args['header_slider'] ?? []);
|
||||
$options = (array) ($args['header_slider_option'] ?? []);
|
||||
if (empty($slides[0])) {
|
||||
@@ -418,7 +418,7 @@ if (!function_exists('aksrt_header_slide')) {
|
||||
$options['class'] = 'slide-index slide-header';
|
||||
|
||||
$search_html = '';
|
||||
if (aksrt_header_slider_device_is_visible($args['header_slider_search_s'] ?? [])) {
|
||||
if (jio_header_slider_device_is_visible($args['header_slider_search_s'] ?? [])) {
|
||||
$search_options = wp_parse_args((array) ($args['header_slider_search_option'] ?? []), [
|
||||
'class' => '', 'show_keywords' => false, 'show_history' => false,
|
||||
'show_posts' => false, 'show_input_cat' => false, 'more_cats' => [],
|
||||
@@ -428,21 +428,21 @@ if (!function_exists('aksrt_header_slide')) {
|
||||
if (wp_is_mobile()) {
|
||||
$search_options['show_keywords'] = false;
|
||||
}
|
||||
$before = $search_options['before_html'] !== '' ? '<div class="header-slider-search-more text-center before">' . wp_kses((string) $search_options['before_html'], aksrt_header_slider_allowed_html()) . '</div>' : '';
|
||||
$after = $search_options['after_html'] !== '' ? '<div class="header-slider-search-more after">' . wp_kses((string) $search_options['after_html'], aksrt_header_slider_allowed_html()) . '</div>' : '';
|
||||
$before = $search_options['before_html'] !== '' ? '<div class="header-slider-search-more text-center before">' . wp_kses((string) $search_options['before_html'], jio_header_slider_allowed_html()) . '</div>' : '';
|
||||
$after = $search_options['after_html'] !== '' ? '<div class="header-slider-search-more after">' . wp_kses((string) $search_options['after_html'], jio_header_slider_allowed_html()) . '</div>' : '';
|
||||
unset($search_options['before_html'], $search_options['after_html']);
|
||||
$box = function_exists('aksrt_get_search_box') ? (string) aksrt_get_search_box($search_options) : '';
|
||||
$box = function_exists('jio_get_search_box') ? (string) jio_get_search_box($search_options) : '';
|
||||
$search_html = '<div class="header-slider-search abs-center">' . $before . $box . $after . '</div>';
|
||||
}
|
||||
|
||||
$cards_html = '';
|
||||
$card_count = 0;
|
||||
if (aksrt_header_slider_device_is_visible($args['header_slider_card_s'] ?? [])) {
|
||||
if (jio_header_slider_device_is_visible($args['header_slider_card_s'] ?? [])) {
|
||||
$card_options = wp_parse_args((array) ($args['header_slider_card_option'] ?? []), [
|
||||
'icon_radius4' => false, 'show_widget_bg' => false, 'cards' => [],
|
||||
]);
|
||||
// legacy (Zibll): with module background the card shrinks to
|
||||
// padding-10 inside a .zib-widget wrapper (.aksrt-panel here); the
|
||||
// padding-10 inside a .zib-widget wrapper (.jio-panel here); the
|
||||
// bg-less variant stretches each card in a .flex1 column.
|
||||
$show_bg = !empty($card_options['show_widget_bg']);
|
||||
$items = '';
|
||||
@@ -450,9 +450,9 @@ if (!function_exists('aksrt_header_slide')) {
|
||||
if (!is_array($card) || (empty($card['icon']) && empty($card['customize_icon']) && empty($card['custom_icon']) && empty($card['icon_image']))) {
|
||||
continue;
|
||||
}
|
||||
$card['class'] = $show_bg ? 'padding-10' : 'aksrt-panel';
|
||||
$card['class'] = $show_bg ? 'padding-10' : 'jio-panel';
|
||||
$card['icon_class'] = trim((string) ($card['icon_class'] ?? '') . (!empty($card_options['icon_radius4']) ? ' radius4' : ''));
|
||||
$inner = function_exists('aksrt_icon_cover_card') ? aksrt_icon_cover_card($card) : '';
|
||||
$inner = function_exists('jio_icon_cover_card') ? jio_icon_cover_card($card) : '';
|
||||
if ($inner === '') {
|
||||
continue;
|
||||
}
|
||||
@@ -461,19 +461,19 @@ if (!function_exists('aksrt_header_slide')) {
|
||||
}
|
||||
if ($items !== '') {
|
||||
$cards_html = '<div class="header-slider-card container">'
|
||||
. ($show_bg ? '<div class="aksrt-panel padding-10">' : '<div class="">')
|
||||
. ($show_bg ? '<div class="jio-panel padding-10">' : '<div class="">')
|
||||
. '<div class="flex jse flex-row gutters-5 flex-col-sm-2">' . $items . '</div></div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
$nav_color = \AKSRT\Core\Color::sanitize((string) ($args['header_slider_nav_color'] ?? ''));
|
||||
$nav_color = \Jio\Core\Color::sanitize((string) ($args['header_slider_nav_color'] ?? ''));
|
||||
if ($nav_color && $nav_color !== '#ffffff') {
|
||||
echo '<style>body.nav-fixed:not(.body-scroll):not(.mobile-navbar-show) .header.show-slide{--header-color:' . esc_html($nav_color) . ';}</style>';
|
||||
}
|
||||
|
||||
$settings = class_exists('\\AKSRT\\Settings\\Settings') ? \AKSRT\Settings\Settings::get_header_slider_settings() : [];
|
||||
$filter_blur = aksrt_header_slider_device_is_visible($settings['filter_blur'] ?? []);
|
||||
$slider_html = aksrt_get_header_slider_markup($options);
|
||||
$settings = class_exists('\\Jio\\Settings\\Settings') ? \Jio\Settings\Settings::get_header_slider_settings() : [];
|
||||
$filter_blur = jio_header_slider_device_is_visible($settings['filter_blur'] ?? []);
|
||||
$slider_html = jio_get_header_slider_markup($options);
|
||||
if ($slider_html === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user