chore(cleanup): 移除用户中心孤儿签到日历渲染器

credits-signin.php 已无任何引用(用户中心视图映射无 signin 项,profile-credits.php 亦不再挂载),整包删除,不保留兼容分支。

其专属 .uc-signin-calendar__title 样式与 public.css / public.min.css 产物同步移除;签到日历仍由 src/Credits/Signin.php 在签到弹窗内输出,enhancements2.js 的日历渲染逻辑保持不变。
This commit is contained in:
2026-09-19 11:46:07 +08:00
parent 32e76b440f
commit b375fcc55c
6 changed files with 6 additions and 63 deletions
-14
View File
@@ -6314,20 +6314,6 @@ body.aksrt-body-scroll .aksrt-show-on-scroll {
border-color: var(--color-primary, var(--color-primary));
}
.uc-signin-calendar__title {
display: flex;
align-items: center;
gap: 6px;
margin: 0 0 10px;
font-size: 14px;
font-weight: 600;
color: var(--color-ink-2);
}
.uc-signin-calendar__title i {
color: var(--color-primary, var(--color-primary));
}
/* ============================================================
* 19. VIP 等级标识
* ============================================================ */
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -390,20 +390,6 @@
border-color: var(--color-primary, var(--color-primary));
}
.uc-signin-calendar__title {
display: flex;
align-items: center;
gap: 6px;
margin: 0 0 10px;
font-size: 14px;
font-weight: 600;
color: var(--color-ink-2);
}
.uc-signin-calendar__title i {
color: var(--color-primary, var(--color-primary));
}
/* ============================================================
* 19. VIP 等级标识
* ============================================================ */
@@ -1,32 +0,0 @@
<?php
/**
* User center credits: sign-in captcha + recent calendar.
*
* Expects extracted $context vars.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$credits_enabled = !empty($credits_enabled);
if (!$credits_enabled) {
return;
}
$signin_dates = [];
if (class_exists('\AKSRT\Credits\Signin')) {
$signin_log = \AKSRT\Credits\Signin::get_instance()->get_recent_signins($user_id, 30);
$signin_dates = array_filter(array_map(static function ($entry) {
return $entry['signin_date'] ?? '';
}, $signin_log));
}
?>
<div class="uc-signin-calendar" style="margin-bottom:16px;">
<h4 class="uc-signin-calendar__title">
<i class="fa fas fa-calendar" aria-hidden="true"></i>
<?php esc_html_e('最近 30 天签到', 'aksrt'); ?>
</h4>
<div data-aksrt-signin-calendar='<?php echo esc_attr(wp_json_encode(array_values($signin_dates))); ?>'></div>
</div>
@@ -460,6 +460,11 @@ test('profile routes load versioned leaf styles and keep dialogs hidden initiall
assert.match(userCenterCreditsCss, /#panel-credits\.dashboard-panel\s*\{[^}]*background:\s*transparent;[^}]*box-shadow:\s*none;/);
assert.match(userCenterCreditsCss, /\.uc-asset-tabs\s*\{[^}]*background:\s*var\(--surface-1,\s*#fff\);[^}]*border:[^;}]+;[^}]*box-shadow:[^;}]+;/);
assert.doesNotMatch(profileCredits, /credits-signin\.php|data-aksrt-signin-calendar/);
// 签到日历只存在于签到弹窗(src/Credits/Signin.php + enhancements2.js),
// 用户中心里的孤儿渲染器已整包移除。
assert.equal(fs.existsSync(path.join(root, 'inc/helpers/user-center-renderers/credits-signin.php')), false);
assert.doesNotMatch(userCenterCreditsCss + read('assets/css/frontend/enhancements/components/custom-amount.css'), /uc-signin-calendar/);
assert.match(read('src/Credits/Signin.php'), /data-aksrt-signin-calendar/);
assert.match(profileOrders, /data-aksrt-orders-filter-panel hidden/);
assert.doesNotMatch(profileOrders, /\$_GET|add_query_arg|name="order_(?:status|type|number|page)"/);
assert.match(profileOrders, /data-aksrt-orders-filter-panel hidden[\s\S]*?aksrt-orders-page__status-filters[\s\S]*?aksrt-orders-page__type-filters/);
@@ -204,7 +204,6 @@ test('balance center actions use direct fixed-id notyf flows', () => {
const header = read('inc/helpers/user-center-renderers/profile-header.php');
const headerUserbox = read('inc/helpers/aksrt-header-userbox.php');
const signinService = read('src/Credits/Signin.php');
const signin = read('inc/helpers/user-center-renderers/credits-signin.php');
const context = read('inc/helpers/aksrt-user-center.php');
const renderers = [
'inc/helpers/user-center-renderers/credits-balance.php',
@@ -256,7 +255,6 @@ test('balance center actions use direct fixed-id notyf flows', () => {
assert.match(headerUserbox, /data-signin-captcha[\s\S]*?aksrt_render_captcha\('signin'\)/);
assert.match(signinService, /aksrt-checkin-modal__btn[^>]+data-signin-btn/);
assert.doesNotMatch(headerUserbox + signinService, /data-aksrt-checkin/);
assert.doesNotMatch(signin, /data-signin-captcha|aksrt_render_captcha/);
assert.match(context, /'signin_enabled'\s*=>\s*\$signin_enabled/);
assert.match(context, /'signin_signed_today'\s*=>\s*\$signin_signed_today/);
assert.match(shell, /\.uc-header__actions\s*\{[^}]*display:\s*flex;[^}]*gap:\s*6px;/s);