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
@@ -2,14 +2,14 @@
|
||||
/**
|
||||
* legacy 9.0 article-list configuration and image resolution.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_renderer_defaults')) {
|
||||
if (!function_exists('jio_renderer_defaults')) {
|
||||
/** @return array<string,mixed> */
|
||||
function aksrt_renderer_defaults(): array {
|
||||
function jio_renderer_defaults(): array {
|
||||
return [
|
||||
'type' => 'auto',
|
||||
'no_author' => false,
|
||||
@@ -30,21 +30,21 @@ if (!function_exists('aksrt_renderer_defaults')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_config')) {
|
||||
if (!function_exists('jio_renderer_config')) {
|
||||
/**
|
||||
* Resolve the one canonical legacy list/card decision matrix.
|
||||
*
|
||||
* @param array<string,mixed> $args Caller arguments.
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
function aksrt_renderer_config(array $args = []): array {
|
||||
function jio_renderer_config(array $args = []): array {
|
||||
$has_no_margin = array_key_exists('no_margin', $args);
|
||||
$args = wp_parse_args($args, aksrt_renderer_defaults());
|
||||
$list = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_post_list_style_settings()
|
||||
$args = wp_parse_args($args, jio_renderer_defaults());
|
||||
$list = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::get_post_list_style_settings()
|
||||
: [];
|
||||
$thumb = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_post_thumb_settings()
|
||||
$thumb = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::get_post_thumb_settings()
|
||||
: [];
|
||||
|
||||
$list_type = sanitize_key((string) ($list['list_type'] ?? 'thumb'));
|
||||
@@ -86,12 +86,12 @@ if (!function_exists('aksrt_renderer_config')) {
|
||||
$args['badge_types'] = (array) ($list['list_badge_show'] ?? ['pay', 'cat', 'tag']);
|
||||
$args['mult_thumb_cat'] = (array) ($list['mult_thumb_cat'] ?? []);
|
||||
$args['thumb'] = $thumb;
|
||||
$args['allow_conditional_layout'] = aksrt_is_show_sidebar() || wp_is_mobile();
|
||||
$page = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_post_page_settings()
|
||||
$args['allow_conditional_layout'] = jio_is_show_sidebar() || wp_is_mobile();
|
||||
$page = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::get_post_page_settings()
|
||||
: [];
|
||||
$comments = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_comment_display_settings()
|
||||
$comments = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::get_comment_display_settings()
|
||||
: [];
|
||||
$args['show_like'] = !array_key_exists('like_enabled', $page) || !empty($page['like_enabled']);
|
||||
$args['close_comments'] = !empty($comments['close_comments']);
|
||||
@@ -100,8 +100,8 @@ if (!function_exists('aksrt_renderer_config')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_highlight_text')) {
|
||||
function aksrt_renderer_highlight_text(string $text, string $query): string {
|
||||
if (!function_exists('jio_renderer_highlight_text')) {
|
||||
function jio_renderer_highlight_text(string $text, string $query): string {
|
||||
$text = wp_strip_all_tags($text);
|
||||
$query = trim($query);
|
||||
if ($query === '' || $text === '') {
|
||||
@@ -125,9 +125,9 @@ if (!function_exists('aksrt_renderer_highlight_text')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_title_markup')) {
|
||||
function aksrt_renderer_title_markup(array $data, array $cfg): string {
|
||||
$title = aksrt_renderer_highlight_text((string) $data['title'], (string) ($cfg['highlight_query'] ?? ''));
|
||||
if (!function_exists('jio_renderer_title_markup')) {
|
||||
function jio_renderer_title_markup(array $data, array $cfg): string {
|
||||
$title = jio_renderer_highlight_text((string) $data['title'], (string) ($cfg['highlight_query'] ?? ''));
|
||||
if ((string) ($data['subtitle'] ?? '') !== '') {
|
||||
$title .= '<span class="focus-color"> ' . esc_html((string) $data['subtitle']) . '</span>';
|
||||
}
|
||||
@@ -135,21 +135,21 @@ if (!function_exists('aksrt_renderer_title_markup')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_excerpt_markup')) {
|
||||
function aksrt_renderer_excerpt_markup(array $data, array $cfg): string {
|
||||
return aksrt_renderer_highlight_text((string) $data['excerpt'], (string) ($cfg['highlight_query'] ?? ''));
|
||||
if (!function_exists('jio_renderer_excerpt_markup')) {
|
||||
function jio_renderer_excerpt_markup(array $data, array $cfg): string {
|
||||
return jio_renderer_highlight_text((string) $data['excerpt'], (string) ($cfg['highlight_query'] ?? ''));
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_curated_images')) {
|
||||
if (!function_exists('jio_renderer_curated_images')) {
|
||||
/** @return string[] */
|
||||
function aksrt_renderer_curated_images(int $post_id, string $size): array {
|
||||
$raw = class_exists('\AKSRT\Core\PostMetaBox')
|
||||
? (string) \AKSRT\Core\PostMetaBox::get_meta_value($post_id, 'featured_slide', '')
|
||||
function jio_renderer_curated_images(int $post_id, string $size): array {
|
||||
$raw = class_exists('\Jio\Core\PostMetaBox')
|
||||
? (string) \Jio\Core\PostMetaBox::get_meta_value($post_id, 'featured_slide', '')
|
||||
: '';
|
||||
$images = [];
|
||||
foreach (array_filter(preg_split('/[\s,]+/', $raw) ?: []) as $token) {
|
||||
$image = aksrt_renderer_sized_image((string) $token, $size);
|
||||
$image = jio_renderer_sized_image((string) $token, $size);
|
||||
if ($image !== '') {
|
||||
$images[] = $image;
|
||||
}
|
||||
@@ -158,8 +158,8 @@ if (!function_exists('aksrt_renderer_curated_images')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_sized_image')) {
|
||||
function aksrt_renderer_sized_image(string $image, string $size): string {
|
||||
if (!function_exists('jio_renderer_sized_image')) {
|
||||
function jio_renderer_sized_image(string $image, string $size): string {
|
||||
$image = trim($image);
|
||||
if ($image === '') {
|
||||
return '';
|
||||
@@ -184,16 +184,16 @@ if (!function_exists('aksrt_renderer_sized_image')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_content_images')) {
|
||||
if (!function_exists('jio_renderer_content_images')) {
|
||||
/** @return string[] */
|
||||
function aksrt_renderer_content_images(int $post_id, string $size): array {
|
||||
function jio_renderer_content_images(int $post_id, string $size): array {
|
||||
$content = strip_shortcodes((string) get_post_field('post_content', $post_id, 'raw'));
|
||||
if ($content === '' || !preg_match_all('/<img.*?(?: |\t|\r|\n)?src=[\'\"]?(.+?)[\'\"]?(?:(?: |\t|\r|\n)+.*?)?>/sim', $content, $matches)) {
|
||||
return [];
|
||||
}
|
||||
$images = [];
|
||||
foreach ((array) ($matches[1] ?? []) as $image) {
|
||||
$sized = aksrt_renderer_sized_image((string) $image, $size);
|
||||
$sized = jio_renderer_sized_image((string) $image, $size);
|
||||
if ($sized !== '') {
|
||||
$images[] = $sized;
|
||||
}
|
||||
@@ -202,55 +202,55 @@ if (!function_exists('aksrt_renderer_content_images')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_category_image')) {
|
||||
function aksrt_renderer_category_image(int $post_id, string $size): string {
|
||||
if (!function_exists('jio_renderer_category_image')) {
|
||||
function jio_renderer_category_image(int $post_id, string $size): string {
|
||||
foreach ((array) get_the_category($post_id) as $category) {
|
||||
$attachment_id = (int) get_term_meta((int) $category->term_id, 'aksrt_category_cover_id', true);
|
||||
$attachment_id = (int) get_term_meta((int) $category->term_id, 'jio_category_cover_id', true);
|
||||
if ($attachment_id > 0) {
|
||||
return aksrt_renderer_sized_image((string) $attachment_id, $size);
|
||||
return jio_renderer_sized_image((string) $attachment_id, $size);
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_spare_image')) {
|
||||
function aksrt_renderer_spare_image(array $thumb): string {
|
||||
if (!function_exists('jio_renderer_spare_image')) {
|
||||
function jio_renderer_spare_image(array $thumb): string {
|
||||
$images = array_values(array_filter((array) ($thumb['spare_thumbnail'] ?? [])));
|
||||
return $images ? (string) $images[array_rand($images)] : '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_renderer_resolve_images')) {
|
||||
if (!function_exists('jio_renderer_resolve_images')) {
|
||||
/** @return array{primary:string,gallery:string[],slides:string[],has_real:bool,is_slide:bool,video_url:string} */
|
||||
function aksrt_renderer_resolve_images(int $post_id, array $cfg): array {
|
||||
function jio_renderer_resolve_images(int $post_id, array $cfg): array {
|
||||
$thumb = (array) ($cfg['thumb'] ?? []);
|
||||
$size = (string) ($thumb['thumb_postfirstimg_size'] ?? 'medium');
|
||||
$slides = aksrt_renderer_curated_images($post_id, $size);
|
||||
$gallery = aksrt_renderer_content_images($post_id, $size);
|
||||
$video_url = class_exists('\AKSRT\Core\PostMetaBox')
|
||||
? esc_url_raw((string) \AKSRT\Core\PostMetaBox::get_meta_value($post_id, 'featured_video', ''))
|
||||
$slides = jio_renderer_curated_images($post_id, $size);
|
||||
$gallery = jio_renderer_content_images($post_id, $size);
|
||||
$video_url = class_exists('\Jio\Core\PostMetaBox')
|
||||
? esc_url_raw((string) \Jio\Core\PostMetaBox::get_meta_value($post_id, 'featured_video', ''))
|
||||
: '';
|
||||
|
||||
$thumbnail_id = (int) get_post_thumbnail_id($post_id);
|
||||
$primary = $thumbnail_id > 0 ? aksrt_renderer_sized_image((string) $thumbnail_id, $size) : '';
|
||||
$primary = $thumbnail_id > 0 ? jio_renderer_sized_image((string) $thumbnail_id, $size) : '';
|
||||
if ($primary === '') {
|
||||
$primary = class_exists('\AKSRT\Core\PostMetaBox')
|
||||
? esc_url_raw((string) \AKSRT\Core\PostMetaBox::get_meta_value($post_id, 'thumbnail_url', ''))
|
||||
$primary = class_exists('\Jio\Core\PostMetaBox')
|
||||
? esc_url_raw((string) \Jio\Core\PostMetaBox::get_meta_value($post_id, 'thumbnail_url', ''))
|
||||
: '';
|
||||
}
|
||||
if ($primary === '' && !empty($thumb['thumb_postfirstimg_s']) && !empty($gallery[0])) {
|
||||
$primary = (string) $gallery[0];
|
||||
}
|
||||
if ($primary === '' && !empty($thumb['thumb_catimg_s'])) {
|
||||
$primary = aksrt_renderer_category_image($post_id, $size);
|
||||
$primary = jio_renderer_category_image($post_id, $size);
|
||||
}
|
||||
$has_real = $primary !== '';
|
||||
if ($primary === '') {
|
||||
$primary = aksrt_renderer_spare_image($thumb);
|
||||
$primary = jio_renderer_spare_image($thumb);
|
||||
}
|
||||
if ($primary === '') {
|
||||
$primary = (string) aksrt_get_lazy_thumb();
|
||||
$primary = (string) jio_get_lazy_thumb();
|
||||
}
|
||||
|
||||
return [
|
||||
|
||||
Reference in new issue
Block a user