fix(ns): class_exists() must use FQCN after PSR-4

Bare class_exists('Balance') looks up global Balance, always false
under AKSRT\* namespaces → REST 403 on balance exchange and friends.
Rewrite string checks to AKSRT\{Domain}\{Class}.
This commit is contained in:
kate522 committed 2026-07-17 15:40:20 +08:00
1 parent d55d1c6b62
commit 68d2e78d77
40 files changed
+105 -105

No files matched your search

+10 -10
View File
@@ -45,7 +45,7 @@ class PayMenus {
'slug' => 'aksrt_orders',
'title' => __('订单', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayOrders')) {
if (class_exists('AKSRT\Admin\Native\PayOrders')) {
PayOrders::get_instance()->render_orders_page();
return;
}
@@ -56,7 +56,7 @@ class PayMenus {
'slug' => 'aksrt_pay_products',
'title' => __('付费文章', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayProducts')) {
if (class_exists('AKSRT\\Admin\\Native\\PayProducts')) {
PayProducts::get_instance()->render_products_page();
return;
}
@@ -67,7 +67,7 @@ class PayMenus {
'slug' => 'aksrt_download_logs',
'title' => __('下载记录', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayDownloadLogs')) {
if (class_exists('AKSRT\\Admin\\Native\\PayDownloadLogs')) {
PayDownloadLogs::get_instance()->render_page();
return;
}
@@ -78,7 +78,7 @@ class PayMenus {
'slug' => 'aksrt_shipping',
'title' => __('发货及物流', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayShipping')) {
if (class_exists('AKSRT\\Admin\\Native\\PayShipping')) {
PayShipping::get_instance()->render_shipping_page();
return;
}
@@ -89,7 +89,7 @@ class PayMenus {
'slug' => 'aksrt_after_sale',
'title' => __('售后管理', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayAfterSale')) {
if (class_exists('AKSRT\\Admin\\Native\\PayAfterSale')) {
PayAfterSale::get_instance()->render_after_sale_page();
return;
}
@@ -100,7 +100,7 @@ class PayMenus {
'slug' => 'aksrt_coupons',
'title' => __('优惠码', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayCoupons')) {
if (class_exists('AKSRT\\Admin\\Native\\PayCoupons')) {
PayCoupons::get_instance()->render_page();
return;
}
@@ -111,7 +111,7 @@ class PayMenus {
'slug' => 'aksrt_charge_cards',
'title' => __('卡密管理', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayChargeCards')) {
if (class_exists('AKSRT\\Admin\\Native\\PayChargeCards')) {
PayChargeCards::get_instance()->render_charge_cards_page();
return;
}
@@ -122,7 +122,7 @@ class PayMenus {
'slug' => 'aksrt_income',
'title' => __('创作分成', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayIncome')) {
if (class_exists('AKSRT\\Admin\\Native\\PayIncome')) {
PayIncome::get_instance()->render_income_page();
return;
}
@@ -133,7 +133,7 @@ class PayMenus {
'slug' => 'aksrt_rebate',
'title' => __('推广返佣', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayRebate')) {
if (class_exists('AKSRT\\Admin\\Native\\PayRebate')) {
PayRebate::get_instance()->render_rebate_page();
return;
}
@@ -144,7 +144,7 @@ class PayMenus {
'slug' => 'aksrt_withdraw',
'title' => __('提现审核', 'aksrt'),
'callback' => static function (): void {
if (class_exists('PayWithdrawals')) {
if (class_exists('AKSRT\\Admin\\Native\\PayWithdrawals')) {
PayWithdrawals::get_instance()->render_withdrawals_page();
return;
}