refactor(assets): vendor 资产迁入标准目录并全仓去除 zibll 标识

- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css,
  js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img,
  fonts→assets/fonts; 删除 assets/vendor
- libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向
- 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入
  路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_*
- 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化
- 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→
  window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel,
  .zib-slider→.aksrt-slider, zib_menu_options meta 键等
- 自有 CSS 改名: legacy-utilities/compat-vars/footer shell
- admin SPA 重建; 契约测试同步(路径/断言/文件更名)
- 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用)

验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过;
契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
This commit is contained in:
kate522 committed 2026-08-22 16:16:30 +08:00
1 parent 4f2391fb64
commit 9375b1c30c
591 files changed
+1690 -11041

No files matched your search

+1 -1
View File
@@ -113,7 +113,7 @@ class Admin {
// Use the same local FA5 pack as the public stack.
wp_enqueue_style(
'aksrt-font-awesome',
get_template_directory_uri() . '/assets/vendor/fontawesome5/css/all.min.css',
get_template_directory_uri() . '/assets/fontawesome5/css/all.min.css',
[],
'5.15.4'
);
+2 -2
View File
@@ -85,7 +85,7 @@ class PayOrders {
? \AKSRT\Core\DomainModel::order_status_labels()
: [];
// Type tabs (zibll order subsubsub parity).
// Type tabs (legacy order subsubsub parity).
$type_tabs = [
'' => __('全部类型', 'aksrt'),
'resource' => __('内容付费', 'aksrt'),
@@ -177,7 +177,7 @@ class PayOrders {
}
echo '</form>';
// Hygiene actions (zibll clear_order / delete).
// Hygiene actions (legacy clear_order / delete).
echo '<p style="margin:8px 0 12px;">';
echo '<form method="post" action="' . esc_url(admin_url('admin-post.php')) . '" style="display:inline;" onsubmit="return confirm(\'' . esc_js(__('将删除 14 天前所有已关闭/已过期订单,不可恢复。确认清理?', 'aksrt')) . '\');">';
echo '<input type="hidden" name="action" value="aksrt_pay_clear_closed_orders" />';
+12 -12
View File
@@ -1,6 +1,6 @@
<?php
/**
* Native WP nav-menu item options using Zibll's zib_menu_options meta contract.
* Native WP nav-menu item options using legacy's aksrt_menu_options meta contract.
*
* @package AKSRT
*/
@@ -41,7 +41,7 @@ class NavMenuOptions {
*/
public static function render_fields($item_id, $item): void {
$item_id = (int) $item_id;
$opts = get_post_meta($item_id, 'zib_menu_options', true);
$opts = get_post_meta($item_id, 'aksrt_menu_options', true);
$opts = is_array($opts) ? $opts : [];
$icon = (string) ($opts['icon'] ?? '');
$badge = (string) ($opts['badge'] ?? '');
@@ -59,7 +59,7 @@ class NavMenuOptions {
<label for="edit-menu-item-aksrt-icon-<?php echo esc_attr((string) $item_id); ?>">
<?php esc_html_e('图标 class(如 fa fas fa-home)', 'aksrt'); ?><br>
<input type="text" id="edit-menu-item-aksrt-icon-<?php echo esc_attr((string) $item_id); ?>"
class="widefat" name="zib_menu_options[<?php echo esc_attr((string) $item_id); ?>][icon]"
class="widefat" name="aksrt_menu_options[<?php echo esc_attr((string) $item_id); ?>][icon]"
value="<?php echo esc_attr($icon); ?>">
</label>
</p>
@@ -67,7 +67,7 @@ class NavMenuOptions {
<label for="edit-menu-item-aksrt-badge-<?php echo esc_attr((string) $item_id); ?>">
<?php esc_html_e('徽章文字', 'aksrt'); ?><br>
<input type="text" id="edit-menu-item-aksrt-badge-<?php echo esc_attr((string) $item_id); ?>"
class="widefat" name="zib_menu_options[<?php echo esc_attr((string) $item_id); ?>][badge]"
class="widefat" name="aksrt_menu_options[<?php echo esc_attr((string) $item_id); ?>][badge]"
value="<?php echo esc_attr($badge); ?>">
</label>
</p>
@@ -75,13 +75,13 @@ class NavMenuOptions {
<label for="edit-menu-item-aksrt-badge-class-<?php echo esc_attr((string) $item_id); ?>">
<?php esc_html_e('徽章 class', 'aksrt'); ?><br>
<input type="text" id="edit-menu-item-aksrt-badge-class-<?php echo esc_attr((string) $item_id); ?>"
class="widefat" name="zib_menu_options[<?php echo esc_attr((string) $item_id); ?>][badge_class]"
class="widefat" name="aksrt_menu_options[<?php echo esc_attr((string) $item_id); ?>][badge_class]"
value="<?php echo esc_attr($badge_class); ?>">
</label>
</p>
<p class="field-aksrt-submenu description description-wide">
<label>
<input type="checkbox" name="zib_menu_options[<?php echo esc_attr((string) $item_id); ?>][submenu_s]" value="1" <?php checked($submenu_s); ?>>
<input type="checkbox" name="aksrt_menu_options[<?php echo esc_attr((string) $item_id); ?>][submenu_s]" value="1" <?php checked($submenu_s); ?>>
<?php esc_html_e('启用高级子菜单(仅一级菜单)', 'aksrt'); ?>
</label>
</p>
@@ -89,7 +89,7 @@ class NavMenuOptions {
<label for="edit-menu-item-aksrt-submenu-type-<?php echo esc_attr((string) $item_id); ?>">
<?php esc_html_e('高级子菜单类型', 'aksrt'); ?><br>
<select id="edit-menu-item-aksrt-submenu-type-<?php echo esc_attr((string) $item_id); ?>"
name="zib_menu_options[<?php echo esc_attr((string) $item_id); ?>][submenu_type]">
name="aksrt_menu_options[<?php echo esc_attr((string) $item_id); ?>][submenu_type]">
<option value="" <?php selected($submenu_type, ''); ?>><?php esc_html_e('无', 'aksrt'); ?></option>
<option value="graphic_card" <?php selected($submenu_type, 'graphic_card'); ?>><?php esc_html_e('图文卡片', 'aksrt'); ?></option>
<option value="multi_column_links" <?php selected($submenu_type, 'multi_column_links'); ?>><?php esc_html_e('多列链接', 'aksrt'); ?></option>
@@ -100,14 +100,14 @@ class NavMenuOptions {
<label for="edit-menu-item-aksrt-graphic-<?php echo esc_attr((string) $item_id); ?>">
<?php esc_html_e('图文卡片 JSON(type=graphic_card)', 'aksrt'); ?><br>
<textarea rows="8" class="widefat code" id="edit-menu-item-aksrt-graphic-<?php echo esc_attr((string) $item_id); ?>"
name="zib_menu_options[<?php echo esc_attr((string) $item_id); ?>][graphic_card_opts_json]"><?php echo esc_textarea((string) $graphic_json); ?></textarea>
name="aksrt_menu_options[<?php echo esc_attr((string) $item_id); ?>][graphic_card_opts_json]"><?php echo esc_textarea((string) $graphic_json); ?></textarea>
</label>
</p>
<p class="field-aksrt-multi description description-wide">
<label for="edit-menu-item-aksrt-multi-<?php echo esc_attr((string) $item_id); ?>">
<?php esc_html_e('多列链接 JSON(type=multi_column_links)', 'aksrt'); ?><br>
<textarea rows="8" class="widefat code" id="edit-menu-item-aksrt-multi-<?php echo esc_attr((string) $item_id); ?>"
name="zib_menu_options[<?php echo esc_attr((string) $item_id); ?>][multi_column_links_opts_json]"><?php echo esc_textarea((string) $multi_json); ?></textarea>
name="aksrt_menu_options[<?php echo esc_attr((string) $item_id); ?>][multi_column_links_opts_json]"><?php echo esc_textarea((string) $multi_json); ?></textarea>
</label>
</p>
<?php
@@ -120,11 +120,11 @@ class NavMenuOptions {
public static function save($menu_id, $menu_item_db_id): void {
$menu_item_db_id = (int) $menu_item_db_id;
// phpcs:ignore WordPress.Security.NonceVerification.Missing
if (empty($_POST['zib_menu_options'][ $menu_item_db_id ]) || !is_array($_POST['zib_menu_options'][ $menu_item_db_id ])) {
if (empty($_POST['aksrt_menu_options'][ $menu_item_db_id ]) || !is_array($_POST['aksrt_menu_options'][ $menu_item_db_id ])) {
return;
}
// phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$raw = wp_unslash($_POST['zib_menu_options'][ $menu_item_db_id ]);
$raw = wp_unslash($_POST['aksrt_menu_options'][ $menu_item_db_id ]);
$clean = [
'icon' => sanitize_text_field((string) ($raw['icon'] ?? '')),
@@ -143,7 +143,7 @@ class NavMenuOptions {
$clean['multi_column_links_opts'] = self::sanitize_multi_opts($multi);
}
update_post_meta($menu_item_db_id, 'zib_menu_options', $clean);
update_post_meta($menu_item_db_id, 'aksrt_menu_options', $clean);
}
/**
+3 -3
View File
@@ -1,6 +1,6 @@
<?php
/**
* Per-page Zibll header slider configuration.
* Per-page legacy header slider configuration.
*
* @package AKSRT
*/
@@ -272,12 +272,12 @@ final class PageConfigMetaBox {
/** @return list<array<string,mixed>> */
private static function slide_defaults(): array {
$base = defined('AKSRT_URI') ? trailingslashit(AKSRT_URI) . 'assets/vendor/zibll/img/' : '';
$base = defined('AKSRT_URI') ? trailingslashit(AKSRT_URI) . 'assets/img/' : '';
$slides = [];
foreach (['slider-bg.jpg', 'user_t.jpg'] as $image) {
$slides[] = [
'background' => $base . $image,
'link' => ['url' => 'https://www.zibll.com/', 'target' => '_blank'],
'link' => ['url' => home_url('/'), 'target' => '_blank'],
'text' => ['desc' => '', 'title' => ''],
'text_align' => 'left-bottom', 'text_parallax' => 30,
'text_size_m' => 20, 'text_size_pc' => 30,
+3 -3
View File
@@ -76,7 +76,7 @@ class GlobalSchema {
['key' => 'seo_description', 'label' => 'SEO描述(description)', 'type' => 'textarea', 'default' => ''],
]],
['key' => 'ai-seo', 'title' => 'AI SEO 提示词', 'fields' => [
['key' => 'ai_seo_title_prompt', 'label' => '标题提示词', 'type' => 'textarea', 'default' => '', 'dependsOn' => ['key' => 'seo_ai_enabled', 'value' => true], 'help' => '留空使用内置 Zibll 风格默认提示词。'],
['key' => 'ai_seo_title_prompt', 'label' => '标题提示词', 'type' => 'textarea', 'default' => '', 'dependsOn' => ['key' => 'seo_ai_enabled', 'value' => true], 'help' => '留空使用内置 原主题风格默认提示词。'],
['key' => 'ai_seo_keywords_prompt', 'label' => '关键词提示词', 'type' => 'textarea', 'default' => '', 'dependsOn' => ['key' => 'seo_ai_enabled', 'value' => true], 'help' => '留空使用内置默认。'],
['key' => 'ai_seo_description_prompt', 'label' => '描述提示词', 'type' => 'textarea', 'default' => '', 'dependsOn' => ['key' => 'seo_ai_enabled', 'value' => true], 'help' => '留空使用内置默认。'],
]],
@@ -471,11 +471,11 @@ class GlobalSchema {
['label' => 'Español', 'value' => 'es'],
['label' => 'Русский', 'value' => 'ru'],
]],
['key' => 'i18n_auto_detect', 'label' => '自动检测浏览器语言', 'type' => 'switch', 'default' => true, 'help' => '基于浏览器 Accept-Language 自动切换(AKSRT 方案,区别于 zibll IP 定位方案)'],
['key' => 'i18n_auto_detect', 'label' => '自动检测浏览器语言', 'type' => 'switch', 'default' => true, 'help' => '基于浏览器 Accept-Language 自动切换(AKSRT 方案,区别于 legacy IP 定位方案)'],
]],
['key' => 'languages', 'title' => '语言管理', 'fields' => [
['key' => 'i18n_available_langs', 'label' => '可用语言列表', 'type' => 'textarea', 'default' => "zh-CN|简体中文\nen|English\nzh-TW|繁體中文\nja|日本語\nko|한국어\nfr|Français\nde|Deutsch\nes|Español\nru|Русский", 'help' => '每行一个语言,格式:代码|名称(9 种内置语言)'],
['key' => 'i18n_nomenclature', 'label' => '自定义术语', 'type' => 'code', 'default' => '', 'help' => 'JSON 格式自定义翻译术语(key => 翻译),对齐 zibll nomenclature'],
['key' => 'i18n_nomenclature', 'label' => '自定义术语', 'type' => 'code', 'default' => '', 'help' => 'JSON 格式自定义翻译术语(key => 翻译),对齐 legacy nomenclature'],
]],
['key' => 'display', 'title' => '展示设置', 'fields' => [
['key' => 'i18n_switcher_position', 'label' => '语言切换器位置', 'type' => 'radio', 'default' => 'footer', 'options' => [
+12 -12
View File
@@ -1,6 +1,6 @@
<?php
/**
* Zibll V9.0 page/display settings contract.
* legacy V9.0 page/display settings contract.
*
* @package AKSRT
*/
@@ -52,7 +52,7 @@ class SchemaPageDisplay {
self::field('nav_scroll_down_hide', '页面向下滚动时隐藏', 'switcher', true, ['dependsOn' => self::enabled('nav_fixed'), 'description' => '下滚动隐藏,上滚动显示。']),
self::field('nav_newposts', 'Add发布按钮', 'switcher', true, ['description' => '顶部导航显示文章投稿按钮。']),
self::field('nav_newposts_radius', '按钮圆角', 'switcher', true, ['dependsOn' => self::enabled('nav_newposts')]),
self::field('nav_newposts_class', '按钮颜色', 'palette', 'jb-blue', ['dependsOn' => self::enabled('nav_newposts'), 'options' => self::zib_palette()]),
self::field('nav_newposts_class', '按钮颜色', 'palette', 'jb-blue', ['dependsOn' => self::enabled('nav_newposts'), 'options' => self::aksrt_palette()]),
self::field('nav_newposts_text', '按钮文案', 'textarea', '<i class="fa fa-fw fa-pencil"></i>发布', ['dependsOn' => self::enabled('nav_newposts'), 'sanitize_type' => 'html', 'rows' => 1]),
]);
}
@@ -74,7 +74,7 @@ class SchemaPageDisplay {
}
private static function footer(): array {
$img = self::asset('assets/vendor/zibll/img/');
$img = self::asset('assets/img/');
return self::section('footer', '底部页脚', [
self::field('footer_theme_custom', '自定义底部页脚颜色', 'switcher', false),
self::field('footer_theme_bg_custom', '底部页脚:背景色', 'color', '', ['dependsOn' => self::enabled('footer_theme_custom')]),
@@ -85,8 +85,8 @@ class SchemaPageDisplay {
self::field('footer_t1_img', '日间模式图片', 'upload', $img . 'logo.png'),
self::field('footer_t1_img_dark', '夜间模式图片', 'upload', $img . 'logo_dark.png'),
self::field('footer_t1_t', '首行文字', 'text', ''),
self::field('fcode_t1_code', '更多内容', 'textarea', 'Zibll 子比主题专为博客、自媒体、资讯类的网站设计开发,简约优雅的设计风格,全面的前端用户功能,简单的模块化配置,欢迎您的体验', ['sanitize_type' => 'html', 'rows' => 3]),
self::field('fcode_t2_code_1', '版块二第一行', 'textarea', '<a href="https://zibll.com">友链申请</a>' . "\n" . '<a href="https://zibll.com">免责声明</a>' . "\n" . '<a href="https://zibll.com">广告合作</a>' . "\n" . '<a href="https://zibll.com">关于我们</a>', ['sanitize_type' => 'html', 'rows' => 4]),
self::field('fcode_t1_code', '更多内容', 'textarea', 'AKSRT 主题专为博客、自媒体、资讯类的网站设计开发,简约优雅的设计风格,全面的前端用户功能,简单的模块化配置,欢迎您的体验', ['sanitize_type' => 'html', 'rows' => 3]),
self::field('fcode_t2_code_1', '版块二第一行', 'textarea', '<a href="#">友链申请</a>' . "\n" . '<a href="#">免责声明</a>' . "\n" . '<a href="#">广告合作</a>' . "\n" . '<a href="#">关于我们</a>', ['sanitize_type' => 'html', 'rows' => 4]),
self::field('fcode_t2_code_2', '版块二第二行', 'textarea', self::copyright_default(), ['sanitize_type' => 'html', 'rows' => 3]),
self::field('footer_contact_m_s', '图标联系方式移动端显示', 'switcher', true),
self::field('footer_contact_wechat_img', '微信二维码', 'upload', $img . 'qrcode.png'),
@@ -120,7 +120,7 @@ class SchemaPageDisplay {
return self::section('category', '分类页面', [
self::field('page_cover_cat_s', '显示封面图', 'switcher', true),
self::field('cat_post_count_s', '显示文章数量', 'switcher', true),
self::field('cat_default_cover', '封面图', 'upload', self::asset('assets/vendor/zibll/img/user_t.jpg'), ['dependsOn' => self::enabled('page_cover_cat_s'), 'help' => '默认封面图,建议尺寸2000x800。']),
self::field('cat_default_cover', '封面图', 'upload', self::asset('assets/img/user_t.jpg'), ['dependsOn' => self::enabled('page_cover_cat_s'), 'help' => '默认封面图,建议尺寸2000x800。']),
self::field('cat_orderby_s', '排序方式按钮', 'switcher', true),
self::field('cat_orderby_option', '排序方式设置', 'fieldset', [], ['dependsOn' => self::enabled('cat_orderby_s'), 'fields' => self::orderby_fields()]),
self::notice('AJAX筛选菜单列表:显示分类、标签菜单,通过 AJAX 获取内容。'),
@@ -135,7 +135,7 @@ class SchemaPageDisplay {
return self::section('tag', '标签页面', [
self::field('tag_post_count_s', '显示文章数量', 'switcher', true),
self::field('page_cover_tag_s', '显示封面图', 'switcher', true),
self::field('tag_default_cover', '封面图', 'upload', self::asset('assets/vendor/zibll/img/user_t.jpg'), ['dependsOn' => self::enabled('page_cover_tag_s'), 'help' => '默认封面图,建议尺寸2000x800。']),
self::field('tag_default_cover', '封面图', 'upload', self::asset('assets/img/user_t.jpg'), ['dependsOn' => self::enabled('page_cover_tag_s'), 'help' => '默认封面图,建议尺寸2000x800。']),
self::field('tag_orderby_s', '排序方式按钮', 'switcher', true),
self::field('tag_orderby_option', '排序方式设置', 'fieldset', [], ['dependsOn' => self::enabled('tag_orderby_s'), 'fields' => self::orderby_fields()]),
self::notice('AJAX筛选菜单列表:显示分类、标签菜单,通过 AJAX 获取内容。'),
@@ -160,7 +160,7 @@ class SchemaPageDisplay {
private static function other(): array {
return self::section('other', '其它页面', [
self::field('page_header_style', '页面标题', 'radio', '', ['options' => self::options(['' => '不显示', '1' => '简单样式', '2' => '卡片样式', '3' => '封面图样式'])]),
self::field('page_header_cover_img', '页面封面图', 'upload', self::asset('assets/vendor/zibll/img/user_t.jpg')),
self::field('page_header_cover_img', '页面封面图', 'upload', self::asset('assets/img/user_t.jpg')),
]);
}
@@ -181,13 +181,13 @@ class SchemaPageDisplay {
}
private static function card_fields(): array {
return [self::field('icon_radius4', '方形图标', 'switcher', false), self::field('cards', '添加卡片', 'group', [], ['button_title' => '添加内容', 'fields' => [self::field('title', '文案标题', 'textarea', '', ['sanitize_type' => 'html']), self::field('desc', '文案简介', 'textarea', '', ['sanitize_type' => 'html']), self::field('icon', '选择图标', 'icon', 'fa fa-magic'), self::field('customize_icon', '自定义图标', 'textarea', '', ['sanitize_type' => 'html']), self::field('icon_class', '图标颜色', 'palette', 'c-yellow', ['options' => self::zib_palette(true)]), self::field('link', '跳转链接', 'link', [])]])];
return [self::field('icon_radius4', '方形图标', 'switcher', false), self::field('cards', '添加卡片', 'group', [], ['button_title' => '添加内容', 'fields' => [self::field('title', '文案标题', 'textarea', '', ['sanitize_type' => 'html']), self::field('desc', '文案简介', 'textarea', '', ['sanitize_type' => 'html']), self::field('icon', '选择图标', 'icon', 'fa fa-magic'), self::field('customize_icon', '自定义图标', 'textarea', '', ['sanitize_type' => 'html']), self::field('icon_class', '图标颜色', 'palette', 'c-yellow', ['options' => self::aksrt_palette(true)]), self::field('link', '跳转链接', 'link', [])]])];
}
private static function orderby_fields(): array { return [self::field('lists', '显示排序方式', 'select', ['modified', 'views', 'like', 'comment_count'], ['multiple' => true, 'sortable' => true, 'options' => self::post_order_options(false)]), self::field('dropdown', '更多排序方式', 'switcher', false)]; }
private static function ajax_fields(string $source): array { return [self::field('lists', '按钮列表', 'async_select', [], ['source' => $source, 'multiple' => true, 'sortable' => true]), self::field('dropdown', '下拉列表', 'switcher', false), self::field('dropdown_lists', '下拉菜单列表', 'async_select', [], ['dependsOn' => self::enabled('dropdown'), 'source' => $source, 'multiple' => true, 'sortable' => true])]; }
private static function footer_image_fields(): array { return [self::field('text', '显示文字', 'text', ''), self::field('image', '显示图片', 'upload', ''), self::field('link', '点击跳转', 'link', [])]; }
private static function header_slider_defaults(): array { $img = self::asset('assets/vendor/zibll/img/'); return [['background' => $img . 'slider-bg.jpg', 'link' => ['url' => 'https://www.zibll.com/', 'target' => '_blank'], 'text' => ['title' => '', 'desc' => ''], 'text_align' => 'left-bottom', 'text_parallax' => 30, 'text_size_m' => 20, 'text_size_pc' => 30], ['background' => $img . 'user_t.jpg', 'link' => ['url' => 'https://www.zibll.com/', 'target' => '_blank'], 'text' => ['title' => '', 'desc' => ''], 'text_align' => 'left-bottom', 'text_parallax' => 30, 'text_size_m' => 20, 'text_size_pc' => 30]]; }
private static function header_slider_defaults(): array { $img = self::asset('assets/img/'); return [['background' => $img . 'slider-bg.jpg', 'link' => ['url' => home_url('/'), 'target' => '_blank'], 'text' => ['title' => '', 'desc' => ''], 'text_align' => 'left-bottom', 'text_parallax' => 30, 'text_size_m' => 20, 'text_size_pc' => 30], ['background' => $img . 'user_t.jpg', 'link' => ['url' => home_url('/'), 'target' => '_blank'], 'text' => ['title' => '', 'desc' => ''], 'text_align' => 'left-bottom', 'text_parallax' => 30, 'text_size_m' => 20, 'text_size_pc' => 30]]; }
private static function slider_options_defaults(): array { return ['direction' => 'horizontal', 'loop' => true, 'button' => true, 'pagination' => true, 'effect' => 'slide', 'scale_height' => false, 'auto_height' => false, 'pc_height' => 550, 'm_height' => 280, 'spacebetween' => 0, 'speed' => 0, 'autoplay' => true, 'interval' => 6]; }
private static function search_defaults(): array { return ['show_keywords' => true, 'popular_limit' => 6, 'show_input_cat' => false, 'in_cat' => '', 'more_cats' => '', 'show_type' => false, 'in_type' => 'post', 'before_html' => '<div class="em16 font-bold mb10">更优雅的Wordpress主题</div>' . "\n" . '<div>这是导航栏幻灯片多功能组件,可在后台进行配置</div>', 'after_html' => '']; }
private static function card_defaults(): array { return ['icon_radius4' => false, 'cards' => [['icon' => 'fa fas fa-gem', 'customize_icon' => '', 'icon_class' => 'c-yellow', 'link' => [], 'title' => '图标卡片', 'desc' => '这是一个图标卡片示例'], ['icon' => 'fa fas fa-star', 'customize_icon' => '', 'icon_class' => 'c-blue-2', 'link' => [], 'title' => '原创作品', 'desc' => '这是一个图标卡片示例'], ['icon' => 'fa fas fa-fire', 'customize_icon' => '', 'icon_class' => 'jb-pink', 'link' => [], 'title' => '灵感来源<badge class="ml6 jb-yellow">NEW</badge>', 'desc' => '这是一个图标卡片示例'], ['icon' => 'fa fas fa-wrench', 'customize_icon' => '', 'icon_class' => 'jb-cyan', 'link' => [], 'title' => '系统工具 <badge class="ml6 jb-blue">GO <span class="fa fa-angle-right em12"></span></badge>', 'desc' => '这是一个图标卡片示例']]]; }
@@ -201,11 +201,11 @@ class SchemaPageDisplay {
private static function options(array $options): array { $out = []; foreach ($options as $value => $label) { $out[] = ['label' => $label, 'value' => (string) $value]; } return $out; }
private static function device_options(): array { return self::options(['pc_s' => 'PC端显示', 'm_s' => '移动端显示']); }
private static function solid_palette(): array { return self::options(['ff648f' => '#ff648f', 'c246f5' => '#c246f5', '469cf5' => '#469cf5', '27bf41' => '#27bf41', 'fd6b4e' => '#fd6b4e', '2d2422' => '#2d2422']); }
private static function zib_palette(bool $transparent = false): array { $colors = $transparent ? ['transparent' => 'rgba(114,114,114,.1)'] : []; $colors += ['c-red' => 'rgba(255,84,115,.4)', 'c-yellow' => 'rgba(255,111,6,.4)', 'c-cyan' => 'rgba(8,196,193,.4)', 'c-blue' => 'rgba(41,151,247,.4)', 'c-blue-2' => 'rgba(77,130,249,.4)', 'c-green' => 'rgba(18,185,40,.4)', 'c-purple' => 'rgba(213,72,245,.4)', 'jb-red' => '#ff5473', 'jb-yellow' => '#ff8a00', 'jb-cyan' => '#08c4c1', 'jb-blue' => '#2997f7', 'jb-green' => '#12b928', 'jb-purple' => '#d548f5', 'jb-pink' => '#ff648f']; return self::options($colors); }
private static function aksrt_palette(bool $transparent = false): array { $colors = $transparent ? ['transparent' => 'rgba(114,114,114,.1)'] : []; $colors += ['c-red' => 'rgba(255,84,115,.4)', 'c-yellow' => 'rgba(255,111,6,.4)', 'c-cyan' => 'rgba(8,196,193,.4)', 'c-blue' => 'rgba(41,151,247,.4)', 'c-blue-2' => 'rgba(77,130,249,.4)', 'c-green' => 'rgba(18,185,40,.4)', 'c-purple' => 'rgba(213,72,245,.4)', 'jb-red' => '#ff5473', 'jb-yellow' => '#ff8a00', 'jb-cyan' => '#08c4c1', 'jb-blue' => '#2997f7', 'jb-green' => '#12b928', 'jb-purple' => '#d548f5', 'jb-pink' => '#ff648f']; return self::options($colors); }
private static function post_order_options(bool $with_default): array { $options = $with_default ? ['' => '保持默认'] : []; $options += ['modified' => '更新', 'date' => '发布', 'views' => '浏览', 'like' => '点赞', 'comment_count' => '评论', 'favorite' => '收藏', 'rand' => '随机']; return self::options($options); }
private static function header_layout_options(): array { $base = self::asset('assets/images/header-layout/'); return [['label' => '布局一', 'value' => '1', 'image' => $base . 'header_layout_1.png'], ['label' => '布局二', 'value' => '2', 'image' => $base . 'header_layout_2.png'], ['label' => '布局三', 'value' => '3', 'image' => $base . 'header_layout_3.png']]; }
private static function mobile_header_layout_options(): array { $base = self::asset('assets/images/header-layout/'); return [['label' => '居中', 'value' => 'center', 'image' => $base . 'mobile_header_layout_center.png'], ['label' => '居左', 'value' => 'left', 'image' => $base . 'mobile_header_layout_left.png']]; }
private static function text_align_options(): array { $base = self::asset('assets/images/slider-align/'); return [['label' => '左下', 'value' => 'left-bottom', 'image' => $base . 'left-bottom.jpg'], ['label' => '左中', 'value' => 'left-conter', 'image' => $base . 'left-conter.jpg'], ['label' => '居中', 'value' => 'conter-conter', 'image' => $base . 'conter-conter.jpg'], ['label' => '中下', 'value' => 'conter-bottom', 'image' => $base . 'conter-bottom.jpg'], ['label' => '右中', 'value' => 'right-conter', 'image' => $base . 'right-conter.jpg'], ['label' => '右下', 'value' => 'right-bottom', 'image' => $base . 'right-bottom.jpg']]; }
private static function asset(string $path): string { return trailingslashit(get_template_directory_uri()) . ltrim($path, '/'); }
private static function copyright_default(): string { return sprintf('Copyright &copy;&nbsp;%s&nbsp;·&nbsp;<a href="%s">%s</a>&nbsp;·&nbsp;由<a target="_blank" href="https://www.zibll.com">zibll主题</a>强力驱动.', date('Y'), home_url(), get_bloginfo('title')); }
private static function copyright_default(): string { return sprintf('Copyright &copy;&nbsp;%s&nbsp;·&nbsp;<a href="%s">%s</a>', date('Y'), home_url(), get_bloginfo('title')); }
}
+2 -2
View File
@@ -545,8 +545,8 @@ class SchemaUsers {
['key' => 'points_transfer_min', 'label' => '最低转账金额', 'type' => 'number', 'default' => 1, 'min' => 1, 'max' => 9999],
]],
['key' => 'deduction', 'title' => '积分抵扣(预留)', 'fields' => [
['key' => 'points_deduction_s', 'label' => '启用积分抵扣', 'type' => 'switch', 'default' => false, 'help' => '对齐 zibll:运行时暂未启用。字段保留供后续接收银台现金单抵扣。'],
['key' => 'points_deduction_rate', 'label' => '积分换算比例', 'type' => 'number', 'default' => 100, 'min' => 1, 'max' => 10000, 'help' => '多少积分抵 1 元(zibll points_deduction_rate)。当前未参与下单。'],
['key' => 'points_deduction_s', 'label' => '启用积分抵扣', 'type' => 'switch', 'default' => false, 'help' => '对齐 legacy:运行时暂未启用。字段保留供后续接收银台现金单抵扣。'],
['key' => 'points_deduction_rate', 'label' => '积分换算比例', 'type' => 'number', 'default' => 100, 'min' => 1, 'max' => 10000, 'help' => '多少积分抵 1 元(legacy points_deduction_rate)。当前未参与下单。'],
['key' => 'points_deduction_max', 'label' => '最大抵扣比例(%)', 'type' => 'number', 'default' => 50, 'min' => 1, 'max' => 100, 'help' => '预留:最多可抵订单金额百分比。当前未参与下单。'],
]],
['key' => 'card_pass', 'title' => '积分卡密兑换', 'fields' => [
+1 -1
View File
@@ -19,7 +19,7 @@ class AIPrompt {
}
/**
* SEO 标题 system instruction(Zibll 默认长提示词)。
* SEO 标题 system instruction(legacy 默认长提示词)。
*/
public function get_seo_title_system_instruction(): string {
$custom = $this->read_custom_prompt('ai_seo_title_prompt');
+1 -1
View File
@@ -30,7 +30,7 @@ class AISEO {
}
/**
* 从已保存实体生成 SEO 三字段(Zibll 形状)。
* 从已保存实体生成 SEO 三字段(legacy 形状)。
*
* @return array{success:bool,data?:array,message?:string}
*/
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* CaiHong / rainbow aggregate OAuth client (zibll clogin parity).
* CaiHong / rainbow aggregate OAuth client (legacy clogin parity).
*
* @package AKSRT
*/
+1 -1
View File
@@ -581,7 +581,7 @@ trait OAuthPart1 {
$user = $this->find_or_create_user($provider, $user_data);
if (is_wp_error($user) && $user->get_error_code() === 'oauth_no_match') {
// Auto-create account for aggregate login when no match (zibll-like).
// Auto-create account for aggregate login when no match (legacy-like).
$login = 'u' . wp_generate_password(10, false, false);
$uid = wp_insert_user([
'user_login' => $login,
+1 -1
View File
@@ -227,7 +227,7 @@ trait ServicePart1b {
/* =================================================================
* 手机号认证(注册 / 登录 / 绑定)
* 对齐 zibll 的 signup_captcha / signin_captcha / bind_phone_captcha
* 对齐 legacy 的 signup_captcha / signin_captcha / bind_phone_captcha
* ================================================================= */
/**
+1 -1
View File
@@ -189,7 +189,7 @@ class Download {
$uid = get_current_user_id();
$cost = aksrt_resource_download_cost($post);
// Daily free-download quota (Zibll).
// Daily free-download quota (legacy).
if ($cost <= 0 && $uid > 0 && function_exists('aksrt_check_free_download_quota')) {
$quota = aksrt_check_free_download_quota($uid, $cost);
if (is_wp_error($quota)) {
+2 -2
View File
@@ -224,7 +224,7 @@ trait PayHelpers {
'payable' => round($payable, 2),
'rebate_price' => round($rebate_price, 2),
],
// zibll: points_deduction runtime hard-off; card_pass not a content payment method.
// legacy: points_deduction runtime hard-off; card_pass not a content payment method.
'points_deduction_allowed' => function_exists('aksrt_is_allow_points_deduction')
? (bool) aksrt_is_allow_points_deduction('content')
: false,
@@ -271,7 +271,7 @@ trait PayHelpers {
? aksrt_get_user_pay_price($post, $user_id)
: ['amount' => 0.0, 'modo' => '0', 'pay_limit' => 0, 'vip_level' => 0, 'is_free' => true, 'base' => 0.0];
// Free daily quota overbuy: override amount, ignore VIP discount (zibll).
// Free daily quota overbuy: override amount, ignore VIP discount (legacy).
if ($price_type === 'download_limit_over') {
$over = max(0.0, (float) ($meta['download_limit_over_price'] ?? 0));
if ($over <= 0) {
+1 -1
View File
@@ -261,7 +261,7 @@ trait PayOrders {
return new \WP_Error('aksrt_wrong_modo', __('该内容仅支持积分支付。', 'aksrt'), ['status' => 400]);
}
// Card pass cannot stack coupon (zibll). Content cashier does not sell via card_pass.
// Card pass cannot stack coupon (legacy). Content cashier does not sell via card_pass.
$payment_method = sanitize_key($payment_method);
if ($payment_method === 'card_pass') {
if (!function_exists('aksrt_is_content_card_pass_pay_allowed') || !aksrt_is_content_card_pass_pay_allowed($post)) {
+1 -1
View File
@@ -121,7 +121,7 @@ trait PayRest {
if ($uid <= 0) {
return new \WP_Error('aksrt_need_login', __('积分支付请先登录。', 'aksrt'), ['status' => 401]);
}
// Points path: ignore coupon (zibll parity).
// Points path: ignore coupon (legacy parity).
return $this->rest_wrap_result($this->create_and_pay_points($post_id, $uid, $price_type));
}
+2 -2
View File
@@ -1,6 +1,6 @@
<?php
/**
* VIP modal view model + card HTML (zibll pay-vip modal / vip-card parity).
* VIP modal view model + card HTML (legacy pay-vip modal / vip-card parity).
*
* @package AKSRT
*/
@@ -143,7 +143,7 @@ trait VipServiceModal {
}
/**
* Mini hover card for header (zibll zibpay_get_vip_card).
* Mini hover card for header (legacy aksrtpay_get_vip_card).
*/
public function render_vip_card(int $level, int $user_id = 0): string {
$level = max(1, min(2, $level));
+2 -2
View File
@@ -12,7 +12,7 @@ trait VipServicePackages {
/**
* Parse per-level product lines (zibll vip_product).
* Parse per-level product lines (legacy vip_product).
*
* Preferred: price|show_price|time|unit|tag|title
* Legacy: price|days|title
@@ -121,7 +121,7 @@ trait VipServicePackages {
/**
* Build upgrade package items (zibll vip_upgrade_product parity).
* Build upgrade package items (legacy vip_upgrade_product parity).
*
* upgrade.product multi-line formats:
* - permanent VIP1: permanent|price|title[|show_price]
+3 -3
View File
@@ -538,7 +538,7 @@ trait VipServicePurchase {
delete_user_meta($user_id, 'aksrt_vip_base_expires');
}
$fulfilled = false;
// unit upgrade: raise level only, keep current expiry (zibll).
// unit upgrade: raise level only, keep current expiry (legacy).
if ($upgrade_mode === 'unit') {
$this->activate_vip($user_id, $level, 0, true);
$fulfilled = (int) get_user_meta($user_id, 'aksrt_vip_level', true) >= $level;
@@ -598,7 +598,7 @@ trait VipServicePurchase {
// Clear expired memory when re-granting.
delete_user_meta($user_id, 'aksrt_vip_level_expired');
// Unit upgrade (zibll): keep vip_exp_date, only raise level.
// Unit upgrade (legacy): keep vip_exp_date, only raise level.
if ($keep_expiry) {
return;
}
@@ -620,7 +620,7 @@ trait VipServicePurchase {
}
/**
* Activate VIP using calendar duration (zibll month/day).
* Activate VIP using calendar duration (legacy month/day).
* time=0 → permanent. Extends from max(now, current_exp).
*/
public function activate_vip_duration(int $user_id, int $level, int $time, string $unit = 'day'): void {
+4 -4
View File
@@ -90,7 +90,7 @@ class Visibility {
(int) $resource_post->ID
);
}
// Guest cookie paid unlock (Zibll pay_no_logged_in).
// Guest cookie paid unlock (legacy pay_no_logged_in).
if (!$has_paid_order && $uid <= 0 && function_exists('aksrt_guest_has_paid_access')) {
$has_paid_order = aksrt_guest_has_paid_access((int) $resource_post->ID);
}
@@ -113,7 +113,7 @@ class Visibility {
}
$state['user_vip_level'] = $user_vip_level;
// Member-only purchase restriction (Zibll pay_limit).
// Member-only purchase restriction (legacy pay_limit).
if ($pay_limit > 0 && $pay_type !== \AKSRT\Core\DomainModel::PAY_TYPE_NO) {
$state['need_vip'] = $uid <= 0 || $user_vip_level < $pay_limit;
$allowed_member = $uid > 0 && $user_vip_level >= $pay_limit;
@@ -158,7 +158,7 @@ class Visibility {
}
if ($pay_type === \AKSRT\Core\DomainModel::PAY_TYPE_DOWNLOAD) {
// Zibll: cash = order unlock; points = one-shot cashier order (not per-download deduct).
// legacy: cash = order unlock; points = one-shot cashier order (not per-download deduct).
$download_cost = 0;
if ($pay_modo === 'points' && $price > 0 && !$has_paid_order) {
$download_cost = (int) ceil($price);
@@ -262,7 +262,7 @@ class Visibility {
]);
}
// Zibll daily free-download quota (only when free / already unlocked).
// legacy daily free-download quota (only when free / already unlocked).
if ($cost <= 0 && function_exists('aksrt_check_free_download_quota')) {
// Provide per-post overbuy price to quota error.
$over_cb = static function ($over, $uid) use ($resource_post) {
+1 -1
View File
@@ -311,7 +311,7 @@ trait DBMigratorPart2 {
) {$charset_collate};";
dbDelta($sql_coupon_usage);
// ── charge_card (zibll-style typed card_pass) ──
// ── charge_card (legacy-style typed card_pass) ──
$sql_charge_card = "CREATE TABLE {$prefix}aksrt_charge_card (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
card VARCHAR(60) NOT NULL DEFAULT '',
+4 -4
View File
@@ -116,7 +116,7 @@ class DomainModel {
public static function default_pay_meta(): array {
return [
'pay_type' => self::PAY_TYPE_NO,
'pay_modo' => '0', // '0' cash | 'points' credits (Zibll)
'pay_modo' => '0', // '0' cash | 'points' credits (legacy)
'price' => 0.0,
'points_price' => 0,
'original_price' => 0.0,
@@ -124,7 +124,7 @@ class DomainModel {
'vip2_price' => 0.0,
'vip1_points' => 0,
'vip2_points' => 0,
'pay_limit' => 0, // 0 all | 1 VIP1+ | 2 VIP2 only (Zibll)
'pay_limit' => 0, // 0 all | 1 VIP1+ | 2 VIP2 only (legacy)
'version' => '',
'size' => '',
'license' => '',
@@ -143,9 +143,9 @@ class DomainModel {
'purchase_limit' => 0,
'free_preview' => '',
'show_sales' => true,
// Zibll: free daily quota overbuy price (cash or points by pay_modo).
// legacy: free daily quota overbuy price (cash or points by pay_modo).
'download_limit_over_price' => 0.0,
// Content cashier: coupon + buyer-facing 推广折扣 (zibll posts_zibpay).
// Content cashier: coupon + buyer-facing 推广折扣 (legacy posts_aksrtpay).
'coupon_s' => false,
'coupon_desc' => '',
'pay_rebate_discount' => 0.0,
+3 -3
View File
@@ -23,13 +23,13 @@ trait FrontSubmitPay {
}
// Only touch pay meta when the form sent pay fields.
$has_pay_payload = isset($data['aksrt_pay']) || isset($data['pay_enabled']) || isset($data['zibpay_s']) || isset($data['pay_type']);
$has_pay_payload = isset($data['aksrt_pay']) || isset($data['pay_enabled']) || isset($data['aksrtpay_s']) || isset($data['pay_type']);
if (!$has_pay_payload) {
return ['success' => true];
}
$raw = is_array($data['aksrt_pay'] ?? null) ? $data['aksrt_pay'] : [];
$enabled = !empty($data['pay_enabled']) || !empty($data['zibpay_s']);
$enabled = !empty($data['pay_enabled']) || !empty($data['aksrtpay_s']);
$existing = function_exists('aksrt_get_pay_meta') ? aksrt_get_pay_meta($post_id) : DomainModel::default_pay_meta();
$meta = is_array($existing) ? $existing : DomainModel::default_pay_meta();
@@ -172,7 +172,7 @@ trait FrontSubmitPay {
if (!is_array($row)) {
continue;
}
// Accept zibll-ish keys + AKSRT keys.
// Accept legacy-ish keys + AKSRT keys.
$url = (string) ($row['url'] ?? $row['link'] ?? '');
$url = esc_url_raw(trim($url));
if ($url === '') {
+4 -4
View File
@@ -27,7 +27,7 @@ class PostMetaBox {
add_action('quick_edit_custom_box', [$this, 'render_quick_edit'], 10, 2);
add_action('bulk_edit_custom_box', [$this, 'render_quick_edit'], 10, 2);
add_action('admin_footer-edit.php', [$this, 'admin_quick_edit_script']);
// Pay-type dropdown on posts list (zibll zibpay_type filter).
// Pay-type dropdown on posts list (legacy aksrtpay_type filter).
add_action('restrict_manage_posts', [$this, 'render_pay_type_filter']);
add_action('pre_get_posts', [$this, 'filter_posts_by_pay_type']);
}
@@ -163,7 +163,7 @@ class PostMetaBox {
<small class="description"><?php esc_html_e('用于列表多图模式,填写附件 ID(逗号分隔)。', 'aksrt'); ?></small>
</p>
<p><strong><?php esc_html_e('侧栏布局(Zibll show_layout)', 'aksrt'); ?></strong></p>
<p><strong><?php esc_html_e('侧栏布局(legacy show_layout)', 'aksrt'); ?></strong></p>
<?php
$show_layout = (string) get_post_meta($post->ID, '_aksrt_show_layout', true);
if (!in_array($show_layout, ['no_sidebar', 'sidebar_left', 'sidebar_right'], true)) {
@@ -351,7 +351,7 @@ class PostMetaBox {
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
if (!current_user_can('edit_post', $post_id)) return;
// Zibll show_layout.
// legacy show_layout.
$show_layout = isset($_POST['aksrt_show_layout']) ? sanitize_key((string) wp_unslash($_POST['aksrt_show_layout'])) : '';
if (!in_array($show_layout, ['no_sidebar', 'sidebar_left', 'sidebar_right'], true)) {
$show_layout = '';
@@ -471,7 +471,7 @@ class PostMetaBox {
}
/**
* Content-pay sales summary for posts list (zibll 销售数据 column parity).
* Content-pay sales summary for posts list (legacy 销售数据 column parity).
*/
private function render_sales_column(int $post_id): void {
if (!function_exists('aksrt_get_pay_meta') || !class_exists('AKSRT\\Core\\DomainModel')) {
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* 文章导航页设置 AJAX(zibll action/post_navs.php parity).
* 文章导航页设置 AJAX(legacy action/post_navs.php parity).
*
* @package AKSRT
*/
+6 -6
View File
@@ -106,7 +106,7 @@ class ResourceMetaBox {
<option value="0" <?php selected((string) ($meta['pay_modo'] ?? '0'), '0'); ?>><?php esc_html_e('现金', 'aksrt'); ?></option>
<option value="points" <?php selected((string) ($meta['pay_modo'] ?? '0'), 'points'); ?>><?php esc_html_e('积分', 'aksrt'); ?></option>
</select>
<p class="aksrt-pmb__hint"><?php esc_html_e('对齐 zibll pay_modo:现金价或积分价结算。', 'aksrt'); ?></p>
<p class="aksrt-pmb__hint"><?php esc_html_e('对齐 legacy pay_modo:现金价或积分价结算。', 'aksrt'); ?></p>
</div>
</div>
@@ -141,7 +141,7 @@ class ResourceMetaBox {
<option value="1" <?php selected((int) ($meta['pay_limit'] ?? 0), 1); ?>><?php esc_html_e('仅 VIP1 及以上', 'aksrt'); ?></option>
<option value="2" <?php selected((int) ($meta['pay_limit'] ?? 0), 2); ?>><?php esc_html_e('仅 VIP2', 'aksrt'); ?></option>
</select>
<p class="aksrt-pmb__hint"><?php esc_html_e('对齐 zibll pay_limit:限制购买人群(会员专属资源)。', 'aksrt'); ?></p>
<p class="aksrt-pmb__hint"><?php esc_html_e('对齐 legacy pay_limit:限制购买人群(会员专属资源)。', 'aksrt'); ?></p>
</div>
</div>
@@ -302,7 +302,7 @@ class ResourceMetaBox {
<label for="aksrt_pay_limit_over_price"><?php esc_html_e('超额下载补价', 'aksrt'); ?></label>
<div>
<input type="number" id="aksrt_pay_limit_over_price" name="aksrt_pay_limit_over_price" value="<?php echo esc_attr((string) ($meta['download_limit_over_price'] ?? 0)); ?>" min="0" step="0.01">
<p class="aksrt-pmb__hint"><?php esc_html_e('免费日限额用尽后允许购买的补价(现金/积分随支付方式)。0 = 不允许超额购买。对齐 zibll download_limit_over_price。', 'aksrt'); ?></p>
<p class="aksrt-pmb__hint"><?php esc_html_e('免费日限额用尽后允许购买的补价(现金/积分随支付方式)。0 = 不允许超额购买。对齐 legacy download_limit_over_price。', 'aksrt'); ?></p>
</div>
</div>
@@ -314,7 +314,7 @@ class ResourceMetaBox {
<label for="aksrt_pay_coupon_s" style="font-weight:400;padding:0;"><?php esc_html_e('允许使用优惠码(全站开关关闭时仍可对本篇启用)', 'aksrt'); ?></label>
</div>
<textarea id="aksrt_pay_coupon_desc" name="aksrt_pay_coupon_desc" style="min-height:60px;" placeholder="<?php esc_attr_e('本篇优惠码说明,可留空', 'aksrt'); ?>"><?php echo esc_textarea((string) ($meta['coupon_desc'] ?? '')); ?></textarea>
<p class="aksrt-pmb__hint"><?php esc_html_e('对齐 zibll coupon_s / coupon_desc。积分支付不使用优惠码。', 'aksrt'); ?></p>
<p class="aksrt-pmb__hint"><?php esc_html_e('对齐 legacy coupon_s / coupon_desc。积分支付不使用优惠码。', 'aksrt'); ?></p>
</div>
</div>
@@ -322,7 +322,7 @@ class ResourceMetaBox {
<label for="aksrt_pay_rebate_discount"><?php esc_html_e('推广优惠金额', 'aksrt'); ?></label>
<div>
<input type="number" id="aksrt_pay_rebate_discount" name="aksrt_pay_rebate_discount" value="<?php echo esc_attr((string) ($meta['pay_rebate_discount'] ?? 0)); ?>" min="0" step="0.01">
<p class="aksrt-pmb__hint"><?php esc_html_e('有有效推荐人且开启推广返佣时,现金购买可先减此金额(买家侧推广折扣,对齐 zibll pay_rebate_discount)。0 = 不启用。', 'aksrt'); ?></p>
<p class="aksrt-pmb__hint"><?php esc_html_e('有有效推荐人且开启推广返佣时,现金购买可先减此金额(买家侧推广折扣,对齐 legacy pay_rebate_discount)。0 = 不启用。', 'aksrt'); ?></p>
</div>
</div>
@@ -535,7 +535,7 @@ class ResourceMetaBox {
update_post_meta($post_id, DomainModel::PAY_META_KEY, $pay_meta);
// 同步标量字段用于查询(模仿 zibll 的 zibpay_type 同步)
// 同步标量字段用于查询(模仿 legacy 的 aksrtpay_type 同步)
update_post_meta($post_id, DomainModel::PAY_TYPE_KEY, (string) $pay_meta['pay_type']);
$query_price = ($pay_meta['pay_modo'] === 'points')
? (float) $pay_meta['points_price']
+15 -15
View File
@@ -13,14 +13,14 @@ trait ScriptsPart1b {
$base_uri = get_template_directory_uri();
$version = AKSRT_VERSION;
$zibll_uri = $base_uri . '/assets/vendor/zibll';
$fa5_uri = $base_uri . '/assets/vendor/fontawesome5';
$runtime_uri = $base_uri . '/assets';
$fa5_uri = $base_uri . '/assets/fontawesome5';
// Zibll's frontend runtime is the single public dependency stack.
// The legacy frontend runtime is the single public dependency stack.
wp_deregister_script('jquery');
wp_register_script(
'jquery',
$zibll_uri . '/js/libs/jquery.min.js',
$runtime_uri . '/js/runtime/libs/jquery.min.js',
[],
'1.9.1',
false
@@ -35,10 +35,10 @@ trait ScriptsPart1b {
false
);
wp_enqueue_style('_bootstrap', $zibll_uri . '/css/bootstrap.min.css', [], '3.4.1');
wp_enqueue_style('_bootstrap', $runtime_uri . '/css/bootstrap.min.css', [], '3.4.1');
wp_enqueue_style('_fontawesome', $fa5_uri . '/css/all.min.css', [], '5.15.4');
wp_enqueue_style('_main', $zibll_uri . '/css/main.min.css', ['_bootstrap', '_fontawesome'], $version);
wp_enqueue_script('bootstrap', $zibll_uri . '/js/libs/bootstrap.min.js', ['jquery'], '3.4.1', true);
wp_enqueue_style('_main', $runtime_uri . '/css/main.min.css', ['_bootstrap', '_fontawesome'], $version);
wp_enqueue_script('bootstrap', $runtime_uri . '/js/runtime/libs/bootstrap.min.js', ['jquery'], '3.4.1', true);
wp_enqueue_style('aksrt-style', get_stylesheet_uri(), ['_main'], $version);
$lazy_animation = class_exists('\AKSRT\Settings\Settings')
@@ -103,7 +103,7 @@ trait ScriptsPart1b {
);
};
// AKSRT domain styles load after Zibll main.css. The old aggregate is
// AKSRT domain styles load after legacy main.css. The old aggregate is
// intentionally not used because it contains the removed navigation CSS.
$enqueue_module('base');
$enqueue_module('header-userbox');
@@ -154,7 +154,7 @@ trait ScriptsPart1b {
);
}
// VIP modal (zibll .pay-vip)
// VIP modal (legacy .pay-vip)
if ($vip_on) {
$vip_css = get_template_directory() . '/assets/css/frontend/vip-modal.css';
if (file_exists($vip_css)) {
@@ -243,7 +243,7 @@ trait ScriptsPart1b {
if ($is_single_post) {
// Prefer discrete enqueues over CSS @import (cache-bust + parallel load).
$single_parts = [
'zibll-utilities',
'legacy-utilities',
'single-post/shell',
'single-post/content',
'single-post/code-blocks',
@@ -269,7 +269,7 @@ trait ScriptsPart1b {
// Keep aggregator handle for any third-party deps that target it.
$enqueue_module('single-post');
$enqueue_module('post-card'); // 相关推荐使用 post-card 局部样式
// Comments pack (zibll 1:1 discrete files).
// Comments pack (legacy 1:1 discrete files).
$comment_parts = ['comments/shell', 'comments/mobile-item'];
$comment_dep = $deps[0] ?? $core_dep;
foreach ($comment_parts as $part) {
@@ -498,8 +498,8 @@ trait ScriptsPart1b {
);
}
// 网址导航页(zibll links.php)
// 文章导航页(zibll postsnavs.php)
// 网址导航页(legacy links.php)
// 文章导航页(legacy postsnavs.php)
if (is_page_template('templates/pages/page-posts-navs.php')) {
$page_navs_js = get_template_directory() . '/assets/js/page-navs.js';
if (file_exists($page_navs_js)) {
@@ -682,7 +682,7 @@ trait ScriptsPart1b {
$enqueue_module('pages');
}
// Resource archives use the canonical Zibll article-card stylesheet.
// Resource archives use the canonical legacy article-card stylesheet.
if ($is_resource_archive || $is_single_resource || ($is_cms_mode && ($is_home_or_archive || $is_static_page) && !$is_fixed_homepage)) {
if (!$is_home_or_archive && !$is_single_post && !$is_static_page) {
$enqueue_module('post-card');
@@ -779,7 +779,7 @@ trait ScriptsPart1b {
);
}
// Badges UI: user center + public profile (zibll medal modal/list).
// Badges UI: user center + public profile (legacy medal modal/list).
if (class_exists('\AKSRT\User\Badges') && \AKSRT\User\Badges::enabled()) {
$is_badge_surface = $is_profile_page
|| is_author()
+12 -12
View File
@@ -32,16 +32,16 @@ trait ScriptsPart1c {
$needs_post_list_media = wp_style_is('aksrt-post-card', 'enqueued');
$zibll_uri = $base_uri . '/assets/vendor/zibll';
$zibll_loader_path = get_template_directory() . '/assets/vendor/zibll/js/loader.js';
$zibll_main_path = get_template_directory() . '/assets/vendor/zibll/js/main.min.js';
$zibll_loader_version = file_exists($zibll_loader_path) ? (string) filemtime($zibll_loader_path) : $version;
$zibll_runtime_version = file_exists($zibll_main_path) ? (string) filemtime($zibll_main_path) : $version;
$runtime_uri = $base_uri . '/assets';
$runtime_loader_path = get_template_directory() . '/assets/js/runtime/loader.js';
$runtime_main_path = get_template_directory() . '/assets/js/runtime/main.min.js';
$runtime_loader_version = file_exists($runtime_loader_path) ? (string) filemtime($runtime_loader_path) : $version;
$runtime_version = file_exists($runtime_main_path) ? (string) filemtime($runtime_main_path) : $version;
wp_enqueue_script(
'loader_js',
$zibll_uri . '/js/loader.js',
$runtime_uri . '/js/runtime/loader.js',
['jquery', 'bootstrap'],
$zibll_loader_version,
$runtime_loader_version,
true
);
wp_localize_script(
@@ -50,8 +50,8 @@ trait ScriptsPart1c {
[
'views' => '',
'www' => home_url('/'),
'uri' => $zibll_uri,
'ver' => $zibll_runtime_version,
'uri' => $runtime_uri,
'ver' => $runtime_version,
'pay_mark' => '¥',
'pay_currency_unit' => __('元', 'aksrt'),
'imgbox' => false,
@@ -108,7 +108,7 @@ trait ScriptsPart1c {
true
);
// AKSRT-only modules register after the Zibll loader; navigation is owned by main.min.js.
// AKSRT-only modules register after the legacy loader; navigation is owned by main.min.js.
wp_enqueue_script(
'aksrt-rehydrate',
$base_uri . '/assets/js/rehydrate.js',
@@ -170,7 +170,7 @@ trait ScriptsPart1c {
'aksrt-core-comments' => 'comments.js',
'aksrt-core-comment-fixed' => 'comment-fixed-input.js',
'aksrt-core-comment-move' => 'comment-move-form.js',
// Shared zibll-parity list/modal engines (before pagination consumers).
// Shared legacy-parity list/modal engines (before pagination consumers).
'aksrt-core-ajax-list' => 'ajax-list.js',
'aksrt-core-modal-telemetry' => 'modal-telemetry.js',
'aksrt-core-request' => 'request.js',
@@ -489,7 +489,7 @@ trait ScriptsPart1c {
}
// Page navigation (TOC highlight, smooth scroll, doc search)
// 评论回复脚本:由 assets/js/core/comment-move-form.js 提供(zibll 同款机制),
// 评论回复脚本:由 assets/js/core/comment-move-form.js 提供(legacy 同款机制),
// 不加载 WP comment-reply,避免两套 moveForm 冲突。
$runtime_routes = $this->resolve_frontend_routes();
+1 -1
View File
@@ -125,7 +125,7 @@ trait ScriptsPart2 {
$classes[] = 'auth-page';
}
// Zibll site-layout-1/2/3 (no sidebar / right / left).
// legacy site-layout-1/2/3 (no sidebar / right / left).
if (function_exists('aksrt_body_layout_classes')) {
foreach (aksrt_body_layout_classes() as $layout_class) {
$classes[] = $layout_class;
+1 -1
View File
@@ -11,7 +11,7 @@ trait SetupPart2 {
/**
* 隐藏默认WordPress菜单项目 + zibll 风格运营菜单分隔线
* 隐藏默认WordPress菜单项目 + 原主题风格运营菜单分隔线
*/
public function hide_default_menus(): void {
// 移除评论默认菜单(已移除该操作以恢复 Comments 菜单)
+2 -2
View File
@@ -29,7 +29,7 @@ class Shortcodes {
add_shortcode('reply', [$this, 'render_reply']);
add_shortcode('vip', [$this, 'render_vip']);
add_shortcode('payshow', [$this, 'render_payshow']);
// Zibll-compatible hidecontent alias (type=payshow|reply|login|vip|password|…)
// legacy-compatible hidecontent alias (type=payshow|reply|login|vip|password|…)
add_shortcode('hidecontent', [$this, 'render_hidecontent']);
add_shortcode('content', [$this, 'render_content_gate']);
// 文章归档 / 个人资料卡 → Templates 模板
@@ -139,7 +139,7 @@ class Shortcodes {
}
/**
* Zibll [hidecontent type="payshow|reply|login|…"]…[/hidecontent]
* legacy [hidecontent type="payshow|reply|login|…"]…[/hidecontent]
*/
public function render_hidecontent(array $atts = [], string $content = ''): string {
$atts = shortcode_atts([
+1 -1
View File
@@ -233,7 +233,7 @@ class Balance {
}
/**
* Whether cash wallet feature is enabled (Zibll pay_balance_s).
* Whether cash wallet feature is enabled (legacy pay_balance_s).
*/
public static function enabled(): bool {
if (!class_exists('\AKSRT\Settings\Settings')) {
+1 -1
View File
@@ -154,7 +154,7 @@ trait BalanceServiceCharge {
if ($line === '') {
continue;
}
// pay|credit|title OR credit|pay|title — Zibll uses price(credit)|pay_price|tag
// pay|credit|title OR credit|pay|title — legacy uses price(credit)|pay_price|tag
// Admin help: 支付金额|到账金额|标题
$parts = array_map('trim', explode('|', $line));
if (count($parts) < 2) {
+5 -5
View File
@@ -156,18 +156,18 @@ class Signin {
}
}
// Keep lightweight meta for header/badge consumers (zibll checkin_all_day).
// Keep lightweight meta for header/badge consumers (legacy checkin_all_day).
update_user_meta($user_id, 'aksrt_signin_' . $today_str, 1);
$all_day = (int) get_user_meta($user_id, 'aksrt_checkin_all_day', true);
if ($all_day <= 0) {
// Fallback to zibll key if migrated users only have that meta.
// Fallback to legacy key if migrated users only have that meta.
$all_day = (int) get_user_meta($user_id, 'checkin_all_day', true);
}
$all_day = $all_day + 1;
update_user_meta($user_id, 'aksrt_checkin_all_day', $all_day);
update_user_meta($user_id, 'checkin_all_day', $all_day); // zibll alias
update_user_meta($user_id, 'checkin_all_day', $all_day); // legacy alias
update_user_meta($user_id, 'aksrt_checkin_continuous_day', $new_streak);
update_user_meta($user_id, 'checkin_continuous_day', $new_streak); // zibll alias
update_user_meta($user_id, 'checkin_continuous_day', $new_streak); // legacy alias
do_action('aksrt_checkin_done', $user_id);
return new \WP_REST_Response([
@@ -246,7 +246,7 @@ class Signin {
}
/**
* zibll checkin_details_modal lite HTML.
* legacy checkin_details_modal lite HTML.
*/
public function render_details_modal_html(int $user_id): string {
$user = get_userdata($user_id);
+3 -3
View File
@@ -238,7 +238,7 @@ class IPGeo {
return $this->empty_result('missing_key', ['provider' => 'qq', 'detail' => 'missing appkey']);
}
// Path used for Tencent signature (zibll parity).
// Path used for Tencent signature (legacy parity).
$path = '/ws/location/v1/ip';
$query = 'ip=' . rawurlencode($ip) . '&key=' . rawurlencode($appkey);
$url = 'https://apis.map.qq.com' . $path . '?' . $query;
@@ -300,7 +300,7 @@ class IPGeo {
]);
}
// Amap sign: md5(sorted query without sig + secret) — zibll uses ip=&key= order.
// Amap sign: md5(sorted query without sig + secret) — legacy uses ip=&key= order.
$base_query = 'ip=' . $ip . '&key=' . $appkey;
$url = 'https://restapi.amap.com/v3/ip?' . $base_query;
if ($secretkey !== '') {
@@ -408,7 +408,7 @@ class IPGeo {
}
}
// Regex fallback (zibll).
// Regex fallback (legacy).
preg_match('/"pro":"(.*?)"/u', $body, $pro);
preg_match('/"city":"(.*?)"/u', $body, $city);
preg_match('/"region":"(.*?)"/u', $body, $region);
+4 -4
View File
@@ -37,7 +37,7 @@ class InlineStyleBuilder {
$dark_hover = $this->adjust_hex_color($dark_primary, -0.12);
$dark_active = $this->adjust_hex_color($dark_primary, -0.22);
// Zibll hard-codes 311px dual-column math; keep runtime width aligned to that
// legacy hard-codes 311px dual-column math; keep runtime width aligned to that
// baseline when settings still hold the old 300 default (or empty).
$sidebar_width = (int) ($sidebar_cfg['width'] ?? 311);
if ($sidebar_width <= 0 || $sidebar_width === 300) {
@@ -50,7 +50,7 @@ class InlineStyleBuilder {
'--content-no-sidebar-max' => $content_no_sidebar_max,
'--container' => $content_width,
'--container-wide' => $container_wide,
'--mian-max-width' => $content_width, // zibll typo token
'--mian-max-width' => $content_width, // legacy typo token
'--sidebar-width' => $sidebar_width . 'px',
'--color-primary' => $primary_color,
'--color-primary-hover' => $primary_hover,
@@ -62,7 +62,7 @@ class InlineStyleBuilder {
'--radius-sm' => $radius_sm . 'px',
'--radius' => $border_radius . 'px',
'--radius-card' => $card_radius . 'px',
// Zibll --main-radius tracks the base radius (8), not the larger card radius.
// legacy --main-radius tracks the base radius (8), not the larger card radius.
'--main-radius' => $border_radius . 'px',
'--radius-btn' => $border_radius . 'px',
'--radius-code' => $border_radius . 'px',
@@ -115,7 +115,7 @@ class InlineStyleBuilder {
echo '<style id="aksrt-post-list-mobile-meta">@media (max-width:640px){.meta-right .meta-' . esc_attr($mobile_meta) . '{display:unset!important}}</style>' . "\n";
}
// Zibll header_theme_custom → --header-bg / --header-color on .header.
// legacy header_theme_custom → --header-bg / --header-color on .header.
if (class_exists('\AKSRT\Settings\Settings')) {
$ht = \AKSRT\Settings\Settings::get_header_theme_config();
if (!empty($ht['custom'])) {
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* Nav walker — zibll senior submenu + meta decorations.
* Nav walker — legacy senior submenu + meta decorations.
*
* @package AKSRT
*/
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* WeChat JS-SDK share signature (zibll ZibWeChatShare parity).
* WeChat JS-SDK share signature (legacy parity).
*
* @package AKSRT
*/
+2 -2
View File
@@ -159,7 +159,7 @@ class ChargeCard {
}
}
// Points card-pass: zibll points_pass_exchange_* (stored in aksrt_settings).
// Points card-pass: legacy points_pass_exchange_* (stored in aksrt_settings).
$credits = ['enabled' => false, 'desc' => '', 'only_password' => true];
$all = class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_all')
? \AKSRT\Settings\Settings::get_all()
@@ -435,7 +435,7 @@ class ChargeCard {
if ($amount <= 0) {
return new \WP_Error('aksrt_card_amount', __('当前卡密可充值金额为0', 'aksrt'), ['status' => 400]);
}
// Cash wallet first (Zibll pay_balance); fall back to points if wallet class missing.
// Cash wallet first (legacy pay_balance); fall back to points if wallet class missing.
if (class_exists('\AKSRT\Credits\Balance')) {
$new = \AKSRT\Credits\Balance::add($user_id, $amount, 'card_pass_balance', [
'type' => 'charge_card',
+1 -1
View File
@@ -45,7 +45,7 @@ class Order {
}
public function create(int $user_id, string $product_type, int $product_id, float $amount, string $currency = 'CNY'): string {
// Guest content orders may use user_id=0 (Zibll pay_no_logged_in).
// Guest content orders may use user_id=0 (legacy pay_no_logged_in).
if ($user_id < 0 || $product_id < 0 || $amount < 0) {
return '';
}
+1 -1
View File
@@ -415,7 +415,7 @@ trait OrderRepositoryCore {
/**
* Delete closed (cancelled/expired) orders older than $days days.
* Mirrors zibll ZibPay::clear_order(14).
* Mirrors the legacy pay module clear_order(14).
*
* @return int Number of rows deleted.
*/
+1 -1
View File
@@ -290,7 +290,7 @@ class Withdrawal {
return new \WP_Error('aksrt_withdraw_update', __('提现状态更新失败', 'aksrt'));
}
// Notify user on terminal status (Zibll withdraw_reply parity).
// Notify user on terminal status (legacy withdraw_reply parity).
if (class_exists('\AKSRT\Messages\Message') && $user_id > 0 && in_array($new_status, [self::STATUS_COMPLETED, self::STATUS_REJECTED], true)) {
$gross = $this->resolve_gross_amount($row, $meta);
$amount_txt = class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($gross) : number_format($gross, 2);
+2 -2
View File
@@ -57,7 +57,7 @@ trait AuthReader {
return get_template_directory_uri() . '/assets/img/' . $filename;
}
/** 获取Logo URL(留空时使用内置默认;zibll别名 logo_src 回退) */
/** 获取Logo URL(留空时使用内置默认;legacy别名 logo_src 回退) */
public static function logo_url(): string {
$url = trim((string) self::get_value('site_logo', ''));
if ($url === '') {
@@ -66,7 +66,7 @@ trait AuthReader {
return $url !== '' ? $url : self::default_asset_url('default-logo.svg');
}
/** 获取暗色模式 Logo URL(留空时跟随浅色模式;zibll别名 logo_src_dark 回退) */
/** 获取暗色模式 Logo URL(留空时跟随浅色模式;legacy别名 logo_src_dark 回退) */
public static function logo_dark_url(): string {
$url = trim((string) self::get_value('site_logo_dark', ''));
if ($url === '') {
+1 -1
View File
@@ -122,7 +122,7 @@ trait CreditsPaymentGroups {
}
/**
* Dual-level VIP settings (Zibll pay_user_vip_1 / pay_user_vip_2).
* Dual-level VIP settings (legacy pay_user_vip_1 / pay_user_vip_2).
*
* @return array<string,mixed>
*/
+2 -2
View File
@@ -93,12 +93,12 @@ trait DisplayPageGroups {
/** @return list<array<string,mixed>> */
private static function header_slider_default_slides(): array {
$base = defined('AKSRT_URI') ? trailingslashit(AKSRT_URI) . 'assets/vendor/zibll/img/' : '';
$base = defined('AKSRT_URI') ? trailingslashit(AKSRT_URI) . 'assets/img/' : '';
$slides = [];
foreach (['slider-bg.jpg', 'user_t.jpg'] as $image) {
$slides[] = [
'background' => $base . $image,
'link' => ['url' => 'https://www.zibll.com/', 'target' => '_blank'],
'link' => ['url' => 'https://www.legacy.com/', 'target' => '_blank'],
'text' => ['desc' => '', 'title' => ''],
'text_align' => 'left-bottom',
'text_parallax' => 30,
+1 -1
View File
@@ -33,7 +33,7 @@ trait DomainGroups {
public static function get_footer_layout_template(): string {
$footer = self::get_footer_settings();
$template = sanitize_key((string) ($footer['layout_template'] ?? 'template_1'));
// Legacy aliases map onto Zibll template_1 shell.
// Legacy aliases map onto legacy template_1 shell.
if (in_array($template, ['default', 'compact', 'centered', 'template_1'], true)) {
return 'template_1';
}
+2 -2
View File
@@ -106,7 +106,7 @@ class HomeCms {
$s = Settings::read_domain('page_display', 'homepage');
$allowed_sorts = self::homepage_allowed_sorts();
// Canonical Zibll-aligned primary list contract.
// Canonical legacy-aligned primary list contract.
$main_list_enabled = !array_key_exists('home_posts_list_s', $s) || !empty($s['home_posts_list_s']);
$sort_bar_enabled = !array_key_exists('home_list1_orderby_s', $s) || !empty($s['home_list1_orderby_s']);
@@ -134,7 +134,7 @@ class HomeCms {
$tabs_raw = isset($s['home_lists']) && is_array($s['home_lists']) ? $s['home_lists'] : [];
$settings = [
// Canonical Zibll keys.
// Canonical legacy keys.
'home_posts_list_s' => $main_list_enabled,
'home_list1_orderby_s' => $sort_bar_enabled,
'home_list1_orderby_option' => ['lists' => $sort_options, 'dropdown' => !empty($orderby_option['dropdown'])],
+5 -5
View File
@@ -18,7 +18,7 @@ class PaymentRuntime {
$settings = Settings::get_all();
$box_position = sanitize_key((string) ($settings['pay_box_position'] ?? 'top'));
// Zibll: box_top | top | bottom | box_bottom
// legacy: box_top | top | bottom | box_bottom
if (!in_array($box_position, ['box_top', 'top', 'bottom', 'box_bottom'], true)) {
$box_position = 'top';
}
@@ -59,7 +59,7 @@ class PaymentRuntime {
}
/**
* Content coupon global switches (zibll coupon_post_s).
* Content coupon global switches (legacy coupon_post_s).
*
* @return array{enabled:bool,desc:string}
*/
@@ -72,7 +72,7 @@ class PaymentRuntime {
}
/**
* Balance recharge settings (Zibll pay_balance_* contract).
* Balance recharge settings (legacy pay_balance_* contract).
*
* @return array<string,mixed>
*/
@@ -138,7 +138,7 @@ class PaymentRuntime {
}
/**
* Dual-level VIP settings (Zibll pay_user_vip_1 / pay_user_vip_2).
* Dual-level VIP settings (legacy pay_user_vip_1 / pay_user_vip_2).
*
* @return array<string,mixed>
*/
@@ -344,7 +344,7 @@ class PaymentRuntime {
}
/**
* Order display / checkout policy (Zibll pay_* + AKSRT order ops).
* Order display / checkout policy (legacy pay_* + AKSRT order ops).
*
* @return array<string,mixed>
*/
+7 -7
View File
@@ -141,7 +141,7 @@ class PostDisplay {
// Canonical render keys (used by aksrt_single_*). Legacy *_s aliases kept for older callers.
$breadcrumbs = !isset($settings['breadcrumbs_single_s']) || !empty($settings['breadcrumbs_single_s']);
$breadcrumbs_home = sanitize_text_field((string) ($settings['breadcrumbs_home_text'] ?? '首页'));
// Zibll breadcrumbs_single_text: true → last crumb is "正文"; false → full title.
// legacy breadcrumbs_single_text: true → last crumb is "正文"; false → full title.
$breadcrumbs_single_text = !isset($settings['breadcrumbs_single_text']) || !empty($settings['breadcrumbs_single_text']);
$prevnext = !isset($settings['post_prevnext_s']) || !empty($settings['post_prevnext_s']);
$authordesc = !isset($settings['post_authordesc_s']) || !empty($settings['post_authordesc_s']);
@@ -227,7 +227,7 @@ class PostDisplay {
// Canonical + legacy share.
'share_enabled' => $share_enabled,
'share_s' => $share_enabled,
// Author card posts (Zibll user_card_box defaults).
// Author card posts (legacy user_card_box defaults).
'author_card_limit' => $author_card_limit,
'author_card_orderby' => $author_card_orderby,
'author_card_style' => $author_card_style,
@@ -240,7 +240,7 @@ class PostDisplay {
'rewards_custom' => !isset($settings['post_rewards_custom']) || !empty($settings['post_rewards_custom']),
'rewards_min' => $rewards_min,
'rewards_max' => $rewards_max,
// Content max height (Zibll article_maxheight_kg / article_maxheight).
// Content max height (legacy article_maxheight_kg / article_maxheight).
'maxheight_enabled' => $maxheight_enabled,
'maxheight' => $maxheight,
'copyright_enabled' => !isset($settings['post_copyright_enabled']) || !empty($settings['post_copyright_enabled']),
@@ -365,7 +365,7 @@ class PostDisplay {
'submit_text' => $submit_text !== '' ? $submit_text : __('提交评论', 'aksrt'),
'box_placeholder' => $box_placeholder !== '' ? $box_placeholder : __('说点什么吧...', 'aksrt'),
'title' => $title !== '' ? $title : __('评论', 'aksrt'),
// Extended zibll-parity settings.
// Extended legacy-parity settings.
'close_comments' => !empty($settings['comment_close_comments']),
'hot_threshold' => max(1, min(999, (int) ($settings['comment_hot_threshold'] ?? 10))),
'quick_s' => !isset($settings['comment_quick_s']) || !empty($settings['comment_quick_s']),
@@ -395,7 +395,7 @@ class PostDisplay {
private static function normalize_comment_city_type(string $type): string {
$type = sanitize_key($type);
// Map legacy zibll pro/city labels.
// Map legacy legacy pro/city labels.
if ($type === 'pro') {
return 'province';
}
@@ -448,7 +448,7 @@ class PostDisplay {
}
/**
* Whether list pagination uses AJAX append (Zibll paging_ajax_s).
* Whether list pagination uses AJAX append (legacy paging_ajax_s).
*
* @param array<string,mixed>|null $settings
*/
@@ -462,7 +462,7 @@ class PostDisplay {
}
/**
* Whether AJAX list paging auto-loads on scroll (Zibll paging_ajax_ias_s).
* Whether AJAX list paging auto-loads on scroll (legacy paging_ajax_ias_s).
*
* @param array<string,mixed>|null $settings
*/
+3 -3
View File
@@ -400,14 +400,14 @@ class Settings {
/** time-auto:对齐 zibll 早晚 8 点自动切换语义。 */
/** time-auto:对齐 legacy 早晚 8 点自动切换语义。 */
public static function time_auto_theme_mode(): string {
return ThemeSearch::time_auto_theme_mode();
}
/** 首屏主题模式:优先消费 zibll 兼容 cookie,回退后台默认值。 */
/** 首屏主题模式:优先消费 legacy 兼容 cookie,回退后台默认值。 */
public static function initial_theme_mode(): string {
return ThemeSearch::initial_theme_mode();
}
@@ -633,7 +633,7 @@ class Settings {
/**
* Zibll 9.0 post-list display settings.
* legacy 9.0 post-list display settings.
*
* @return array<string,mixed>
*/
+4 -4
View File
@@ -71,7 +71,7 @@ class SMS {
return ['success' => false, 'message' => sprintf(__('短信配置不完整,缺少: %s', 'aksrt'), implode(', ', $missing))];
}
// 频率限制:间隔限制(对齐 zibll 60 秒冷却 + 返回剩余时间)
// 频率限制:间隔限制(对齐 legacy 60 秒冷却 + 返回剩余时间)
$rate_limit = max(10, (int) ($config['sms_rate_limit'] ?? 60));
$rate_key = 'aksrt_sms_rate_' . md5($phone);
$rate_set = get_transient($rate_key);
@@ -125,7 +125,7 @@ class SMS {
}
/**
* 验证短信验证码(对齐 zibll:同时校验验证码和目标手机号)
* 验证短信验证码(对齐 legacy:同时校验验证码和目标手机号)
*
* @param string $phone 手机号
* @param string $code 验证码
@@ -191,7 +191,7 @@ class SMS {
}
/* ------------------------------------------------------------------
* 错误频率限制(对齐 zibll 的 error_frequency_limit)
* 错误频率限制(对齐 legacy 的 error_frequency_limit)
* ----------------------------------------------------------------*/
/**
@@ -259,7 +259,7 @@ class SMS {
* ----------------------------------------------------------------*/
/**
* 手机号格式校验(对齐 zibll:支持中国号和国际号)
* 手机号格式校验(对齐 legacy:支持中国号和国际号)
*/
private function validate_phone(string $phone): bool {
$config = $this->get_provider_config();
+2 -2
View File
@@ -47,7 +47,7 @@ class SMSProviderAliyun implements ProviderInterface {
return ['success' => false, 'message' => $result->get_error_message(), 'transport' => 'signed_post'];
}
// 对齐 zibll 成功判断:检查 BizId 或 Code === 'OK'
// 对齐 legacy 成功判断:检查 BizId 或 Code === 'OK'
if (!empty($result['BizId']) || (isset($result['Code']) && $result['Code'] === 'OK')) {
$this->log('sent', $phone, 'OK');
return ['success' => true, 'message' => __('验证码已发送', 'aksrt'), 'transport' => 'signed_post'];
@@ -74,7 +74,7 @@ class SMSProviderAliyun implements ProviderInterface {
/**
* 发送阿里云短信 API 请求(POST 方式)
*
* 对齐 zibll 的 SignatureHelper 实现:
* 对齐 legacy 的 SignatureHelper 实现:
* - POST 到 https://dysmsapi.aliyuncs.com/
* - body 为 Signature=xxx&Key=Value&... 格式
* - 使用 x-sdk-client header
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* Auto-grant medals from catalog thresholds (zibll zib_auto_add_user_medal lite).
* Auto-grant medals from catalog thresholds (legacy lite).
*
* @package AKSRT
*/
+3 -3
View File
@@ -59,7 +59,7 @@ class Badges {
}
/**
* Notify user when a badge is granted (zibll user_add_medal message).
* Notify user when a badge is granted (legacy user_add_medal message).
*/
public function on_badge_granted_notify(int $user_id, string $slug, int $actor = 0): void {
if ($user_id <= 0 || $slug === '') {
@@ -295,7 +295,7 @@ class Badges {
if (in_array($slug, $owned, true)) {
return true;
}
// Newest first (zibll medal ordering); grant time stamped by set_owned.
// Newest first (legacy medal ordering); grant time stamped by set_owned.
self::set_owned($user_id, array_merge([$slug], $owned));
/**
* Fires after a badge is granted.
@@ -402,7 +402,7 @@ class Badges {
'time' => $has && $show_private ? (string) $owned_map[$slug] : '',
'get_type' => sanitize_key((string) ($row['get_type'] ?? 'manually_add')),
];
// Owned first within each category (zibll is-has / no-has order).
// Owned first within each category (legacy is-has / no-has order).
if ($has) {
$has_rows[] = $item;
} else {
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* Frontend ban appeal (zibll user_ban_appeal parity) on Restriction meta.
* Frontend ban appeal (legacy user_ban_appeal parity) on Restriction meta.
*
* @package AKSRT
*/
+1 -1
View File
@@ -66,7 +66,7 @@ final class AssetManager {
private static function enqueue_optional(string $asset): void {
if ($asset === 'swiper') {
// Zibll main.js owns the single Swiper runtime and discovers .new-swiper.
// legacy main.js owns the single Swiper runtime and discovers .new-swiper.
} elseif ($asset === 'dplayer') {
wp_enqueue_script('aksrt-widget-dplayer');
} elseif (in_array($asset, ['hls', 'flv', 'dash'], true)) {
+2 -2
View File
@@ -23,9 +23,9 @@ final class FrontendRenderer {
}
AssetManager::enqueue_for($definition);
$classes = ['aksrt-widget', 'zib-widget-wrap', 'aksrt-widget--' . $definition->slug(), 'aksrt-widget--' . $definition->size()];
$classes = ['aksrt-widget', 'aksrt-panel-wrap', 'aksrt-widget--' . $definition->slug(), 'aksrt-widget--' . $definition->size()];
if ($definition->size() === 'sidebar' && $definition->slug() !== 'user_card') {
$classes[] = 'zib-widget';
$classes[] = 'aksrt-panel';
}
$device_class = WidgetVisibility::device_class($instance);
if ($device_class !== '') {