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,10 +2,10 @@
|
||||
/**
|
||||
* VIP modal view model + card HTML (legacy pay-vip modal / vip-card parity).
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Content;
|
||||
namespace Jio\Content;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -33,8 +33,8 @@ trait VipServiceModal {
|
||||
continue;
|
||||
}
|
||||
$equity = (string) ($levels[$level]['equity'] ?? '');
|
||||
$equity = function_exists('aksrt_format_vip_equity_html')
|
||||
? (string) aksrt_format_vip_equity_html($equity)
|
||||
$equity = function_exists('jio_format_vip_equity_html')
|
||||
? (string) jio_format_vip_equity_html($equity)
|
||||
: wp_kses_post($equity);
|
||||
$level_view[] = [
|
||||
'level' => $level,
|
||||
@@ -136,7 +136,7 @@ trait VipServiceModal {
|
||||
'levels' => $level_view,
|
||||
'payment_methods' => $methods,
|
||||
'card_pass' => $card_pass,
|
||||
'currency_mark' => (string) (\AKSRT\Settings\Settings::get_payment_gateway_settings()['currency']['mark'] ?? '¥'),
|
||||
'currency_mark' => (string) (\Jio\Settings\Settings::get_payment_gateway_settings()['currency']['mark'] ?? '¥'),
|
||||
'allowed_actions' => [
|
||||
'purchase' => $package_ids !== [] && $methods !== [],
|
||||
'renew' => $has_renew && $methods !== [],
|
||||
@@ -164,23 +164,23 @@ trait VipServiceModal {
|
||||
* 与余额充值/购买积分弹窗同构(静止态由 vip-modal.css 显式隐藏,打开态由
|
||||
* pay-vip.js 的自包含开关以内联 display:flex 驱动)。
|
||||
*
|
||||
* 入口有两处(均带 data-aksrt-vip-points-open,pay-vip.js 文档级委托开合):
|
||||
* 入口有两处(均带 data-jio-vip-points-open,pay-vip.js 文档级委托开合):
|
||||
* 会员购买弹窗内的「积分兑换会员」按钮,以及 /user/vip/ 档位购买卡下方的
|
||||
* 入口横条(aksrt_get_vip_points_exchange_entry_html)。.pay-vip 触发点
|
||||
* 全站可见,因此由 aksrt_render_vip_points_exchange_modal() 在 wp_footer
|
||||
* 入口横条(jio_get_vip_points_exchange_entry_html)。.pay-vip 触发点
|
||||
* 全站可见,因此由 jio_render_vip_points_exchange_modal() 在 wp_footer
|
||||
* 全局输出一次。
|
||||
*
|
||||
* @return string 空串表示积分兑换不可用(不输出弹窗壳)。
|
||||
*/
|
||||
public function get_points_exchange_modal_html(int $user_id = 0): string {
|
||||
$user_id = max(0, $user_id);
|
||||
if ($user_id <= 0 || !class_exists('\AKSRT\Settings\Settings')) {
|
||||
if ($user_id <= 0 || !class_exists('\Jio\Settings\Settings')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// 先做零成本门控,避免每次页面渲染都去查积分余额。
|
||||
$vip = $this->get_vip_settings_context();
|
||||
if (empty($vip['enabled']) || empty($vip['points_exchange']['enabled']) || !\AKSRT\Settings\Settings::credits_enabled()) {
|
||||
if (empty($vip['enabled']) || empty($vip['points_exchange']['enabled']) || !\Jio\Settings\Settings::credits_enabled()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -193,9 +193,9 @@ trait VipServiceModal {
|
||||
|
||||
$levels = is_array($vip['levels'] ?? null) ? $vip['levels'] : [];
|
||||
$user_points = max(0, (int) ($catalog['user_points'] ?? 0));
|
||||
$currency = (string) ($catalog['currency_name'] ?? __('积分', 'aksrt'));
|
||||
$points_center_url = function_exists('aksrt_get_user_center_tab_url')
|
||||
? aksrt_get_user_center_tab_url('credits')
|
||||
$currency = (string) ($catalog['currency_name'] ?? __('积分', 'jio'));
|
||||
$points_center_url = function_exists('jio_get_user_center_tab_url')
|
||||
? jio_get_user_center_tab_url('credits')
|
||||
: home_url('/');
|
||||
|
||||
// 会员卡片(参考主题 data-for/data-value 选中模型;data-value 为本主题的套餐 ID)。
|
||||
@@ -220,8 +220,8 @@ trait VipServiceModal {
|
||||
$pkg_time = max(0, (int) ($package['time'] ?? 0));
|
||||
$pkg_unit = ((string) ($package['unit'] ?? 'day')) === 'month' ? 'month' : 'day';
|
||||
$duration = ($is_permanent || $pkg_time <= 0)
|
||||
? esc_html__('永久', 'aksrt')
|
||||
: (string) $pkg_time . '<span class="px12">' . esc_html($pkg_unit === 'month' ? __('个月', 'aksrt') : __('天', 'aksrt')) . '</span>';
|
||||
? esc_html__('永久', 'jio')
|
||||
: (string) $pkg_time . '<span class="px12">' . esc_html($pkg_unit === 'month' ? __('个月', 'jio') : __('天', 'jio')) . '</span>';
|
||||
$level_name = (string) ($levels[$level]['name_html'] ?? $levels[$level]['name'] ?? ('VIP' . $level));
|
||||
|
||||
$cards .= '<div class="vip-card vip-theme' . $level . ($index === 0 ? ' active' : '') . ' " data-for="product_id" data-value="' . $package_id . '">'
|
||||
@@ -243,7 +243,7 @@ trait VipServiceModal {
|
||||
$desc = $desc_text !== ''
|
||||
// 管理员编辑的富文本说明:保存端已 wp_kses_post,这里同级别输出
|
||||
// (参考主题 zibpay_get_vip_points_exchange_modal 原样拼接)。
|
||||
? '<div class="muted-box muted-2-color padding-10 em09 mt20 aksrt-vip-points-desc">' . wp_kses_post($desc_text) . '</div>'
|
||||
? '<div class="muted-box muted-2-color padding-10 em09 mt20 jio-vip-points-desc">' . wp_kses_post($desc_text) . '</div>'
|
||||
: '';
|
||||
|
||||
// 最低价套餐仍超出用户积分 → 参考主题的 badg c-red btn-block 提示。
|
||||
@@ -251,41 +251,41 @@ trait VipServiceModal {
|
||||
// 此处按其原意取真实比较,保证提示分支可达。)
|
||||
if ($min_points > $user_points) {
|
||||
$form = '<div class="mt20"><div class="badg c-red btn-block">'
|
||||
. esc_html(sprintf(__('%s不足,暂时无法兑换', 'aksrt'), $currency))
|
||||
. esc_html(sprintf(__('%s不足,暂时无法兑换', 'jio'), $currency))
|
||||
. '</div></div>';
|
||||
} else {
|
||||
$form = '<div class="mt20">'
|
||||
. '<input type="hidden" name="product_id" value="' . $first_package_id . '">'
|
||||
. '<input type="hidden" name="order_type" value="4">'
|
||||
. '<input type="hidden" name="action" value="points_initiate_pay">'
|
||||
. '<button type="submit" class="mt6 but jb-yellow btn-block radius padding-lg" data-aksrt-vip-points-submit>'
|
||||
. '<i class="fa fas fa-check" aria-hidden="true"></i>' . esc_html__('立即兑换', 'aksrt')
|
||||
. '<button type="submit" class="mt6 but jb-yellow btn-block radius padding-lg" data-jio-vip-points-submit>'
|
||||
. '<i class="fa fas fa-check" aria-hidden="true"></i>' . esc_html__('立即兑换', 'jio')
|
||||
. '</button></div>';
|
||||
}
|
||||
|
||||
$header = '<div class="mb10 touch">'
|
||||
. '<button type="button" class="close" data-dismiss="modal" aria-label="' . esc_attr__('关闭', 'aksrt') . '">'
|
||||
. '<button type="button" class="close" data-dismiss="modal" aria-label="' . esc_attr__('关闭', 'jio') . '">'
|
||||
. '<svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button>'
|
||||
. '<b class="modal-title flex ac"><span class="mr6 em14">'
|
||||
. '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-vip_1"></use></svg></span>'
|
||||
. esc_html(sprintf(__('%s兑换会员', 'aksrt'), $currency)) . '</b></div>';
|
||||
. esc_html(sprintf(__('%s兑换会员', 'jio'), $currency)) . '</b></div>';
|
||||
|
||||
$user_box = '<div class="muted-box padding-h10 mb20">'
|
||||
. '<a rel="nofollow" class="flex jsb ac" href="' . esc_url($points_center_url) . '">'
|
||||
. '<span class="muted-2-color">'
|
||||
. '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-points"></use></svg> '
|
||||
. esc_html(sprintf(__('我的%s', 'aksrt'), $currency)) . '</span>'
|
||||
. esc_html(sprintf(__('我的%s', 'jio'), $currency)) . '</span>'
|
||||
. '<span class="font-bold ml6 em14"><span class="c-green mr10">' . $user_points . '</span>'
|
||||
. '<i class="fa fas fa-angle-right" aria-hidden="true"></i></span></a></div>';
|
||||
|
||||
$lists = '<div class="muted-2-color mb6 em09">' . esc_html__('请选择需兑换的会员', 'aksrt') . '</div>'
|
||||
$lists = '<div class="muted-2-color mb6 em09">' . esc_html__('请选择需兑换的会员', 'jio') . '</div>'
|
||||
. '<div class="flex hh exchange-card-box">' . $cards . '</div>';
|
||||
|
||||
return '<div class="modal flex jc fade" id="aksrt-vip-points-modal" tabindex="-1" role="dialog" aria-hidden="false" data-aksrt-vip-points-modal>'
|
||||
return '<div class="modal flex jc fade" id="jio-vip-points-modal" tabindex="-1" role="dialog" aria-hidden="false" data-jio-vip-points-modal>'
|
||||
. '<div class="modal-dialog modal-mini full-sm" role="document">'
|
||||
. '<div class="modal-content"><div class="modal-body">'
|
||||
. $header
|
||||
. '<form class="" data-aksrt-vip-points-form>' . $user_box . $lists . $desc . $form . '</form>'
|
||||
. '<form class="" data-jio-vip-points-form>' . $user_box . $lists . $desc . $form . '</form>'
|
||||
. '</div></div></div></div>';
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ trait VipServiceModal {
|
||||
return '<i class="fa fas fa-certificate mr3" aria-hidden="true"></i>';
|
||||
}
|
||||
|
||||
return '<img' . aksrt_get_lazy_attr('lazy_other', $icon_url, 'img-icon mr3')
|
||||
return '<img' . jio_get_lazy_attr('lazy_other', $icon_url, 'img-icon mr3')
|
||||
. ' title="' . esc_attr($name_text) . '" alt="' . esc_attr($name_text) . '">';
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ trait VipServiceModal {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mini hover card for header (legacy aksrtpay_get_vip_card).
|
||||
* Mini hover card for header (legacy jiopay_get_vip_card).
|
||||
*/
|
||||
public function render_vip_card(int $level, int $user_id = 0): string {
|
||||
$level = max(1, min(2, $level));
|
||||
@@ -338,13 +338,13 @@ trait VipServiceModal {
|
||||
$equity = (string) ($levels[$level]['equity'] ?? '');
|
||||
$cls = $user_id > 0 ? ' pay-vip' : ' signin-loader';
|
||||
|
||||
$equity_html = $equity !== '' && function_exists('aksrt_format_vip_equity_html')
|
||||
? aksrt_format_vip_equity_html($equity, 'mb10 relative')
|
||||
$equity_html = $equity !== '' && function_exists('jio_format_vip_equity_html')
|
||||
? jio_format_vip_equity_html($equity, 'mb10 relative')
|
||||
: ($equity !== '' ? '<div class="v-equity mb10 relative">' . wp_kses_post($equity) . '</div>' : '');
|
||||
|
||||
$icon_url = esc_url((string) ($levels[$level]['img_icon'] ?? ''));
|
||||
$icon = $icon_url !== ''
|
||||
? '<img' . aksrt_get_lazy_attr('lazy_other', $icon_url, 'img-icon') . ' title="' . esc_attr($name_text) . '" alt="' . esc_attr($name_text) . '" decoding="async">'
|
||||
? '<img' . jio_get_lazy_attr('lazy_other', $icon_url, 'img-icon') . ' title="' . esc_attr($name_text) . '" alt="' . esc_attr($name_text) . '" decoding="async">'
|
||||
: '<i class="fa fas fa-gem" aria-hidden="true"></i>';
|
||||
$html = '<div class="vip-card pointer level-' . $level . ' vip-theme' . $level . $cls . '" vip-level="' . $level . '">';
|
||||
$html .= '<div class="abs-center vip-baicon" aria-hidden="true">' . $icon . '</div>';
|
||||
@@ -353,7 +353,7 @@ trait VipServiceModal {
|
||||
$html .= '<div class="vip-name mb10"><span class="mr6">' . $icon . '</span>' . wp_kses_post($name) . '</div>';
|
||||
$html .= $equity_html;
|
||||
$html .= '<a class="but jb-blue radius payvip-button" href="javascript:;">'
|
||||
. wp_kses_post(sprintf(__('开通%s', 'aksrt'), $name))
|
||||
. wp_kses_post(sprintf(__('开通%s', 'jio'), $name))
|
||||
. '<span class="ml6"><i class="fa fas fa-chevron-circle-right" aria-hidden="true"></i></span></a>';
|
||||
$html .= '</div></div>';
|
||||
return $html;
|
||||
|
||||
Reference in new issue
Block a user