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,31 +2,31 @@
|
||||
/**
|
||||
* Registers all non-forum email notifications.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
final class MailNotifications {
|
||||
public static function init(): void {
|
||||
add_action('aksrt_order_paid', [self::class, 'order_paid'], 20, 2);
|
||||
add_action('aksrt_order_status_changed', [self::class, 'order_status'], 20, 3);
|
||||
add_action('aksrt_asset_transaction_committed', [self::class, 'asset_transaction'], 20, 2);
|
||||
add_action('aksrt_notification_sent', [self::class, 'notification'], 20, 3);
|
||||
add_action('aksrt_withdrawal_submitted', [self::class, 'withdrawal_submitted'], 20, 2);
|
||||
add_action('aksrt_withdrawal_status_changed', [self::class, 'withdrawal_status'], 20, 4);
|
||||
add_action('aksrt_ban_appeal_submitted', [self::class, 'ban_appeal_submitted'], 20, 2);
|
||||
add_action('aksrt_ban_appeal_processed', [self::class, 'ban_appeal_processed'], 20, 3);
|
||||
add_action('aksrt_new_posts_pending', [self::class, 'post_pending'], 20, 1);
|
||||
add_action('jio_order_paid', [self::class, 'order_paid'], 20, 2);
|
||||
add_action('jio_order_status_changed', [self::class, 'order_status'], 20, 3);
|
||||
add_action('jio_asset_transaction_committed', [self::class, 'asset_transaction'], 20, 2);
|
||||
add_action('jio_notification_sent', [self::class, 'notification'], 20, 3);
|
||||
add_action('jio_withdrawal_submitted', [self::class, 'withdrawal_submitted'], 20, 2);
|
||||
add_action('jio_withdrawal_status_changed', [self::class, 'withdrawal_status'], 20, 4);
|
||||
add_action('jio_ban_appeal_submitted', [self::class, 'ban_appeal_submitted'], 20, 2);
|
||||
add_action('jio_ban_appeal_processed', [self::class, 'ban_appeal_processed'], 20, 3);
|
||||
add_action('jio_new_posts_pending', [self::class, 'post_pending'], 20, 1);
|
||||
add_action('transition_post_status', [self::class, 'post_status_changed'], 20, 3);
|
||||
add_action('aksrt_report_submitted', [self::class, 'report_submitted'], 20, 2);
|
||||
add_action('aksrt_report_status_changed', [self::class, 'report_status_changed'], 20, 4);
|
||||
add_action('aksrt_friend_link_submitted', [self::class, 'friend_link_submitted'], 20, 1);
|
||||
add_action('aksrt_user_phone_changed', [self::class, 'phone_changed'], 20, 2);
|
||||
add_action('aksrt_user_restriction_changed', [self::class, 'restriction_changed'], 20, 4);
|
||||
add_action('aksrt_ticket_urged', [self::class, 'ticket_urged'], 20, 1);
|
||||
add_action('jio_report_submitted', [self::class, 'report_submitted'], 20, 2);
|
||||
add_action('jio_report_status_changed', [self::class, 'report_status_changed'], 20, 4);
|
||||
add_action('jio_friend_link_submitted', [self::class, 'friend_link_submitted'], 20, 1);
|
||||
add_action('jio_user_phone_changed', [self::class, 'phone_changed'], 20, 2);
|
||||
add_action('jio_user_restriction_changed', [self::class, 'restriction_changed'], 20, 4);
|
||||
add_action('jio_ticket_urged', [self::class, 'ticket_urged'], 20, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ final class MailNotifications {
|
||||
'count' => (int) ($ticket['urge_count'] ?? 0),
|
||||
'ticket_num' => (string) ($ticket['ticket_num'] ?? ''),
|
||||
'title' => (string) ($ticket['title'] ?? ''),
|
||||
'url' => admin_url('users.php?page=aksrt_tickets&id=' . (int) ($ticket['id'] ?? 0)),
|
||||
'url' => admin_url('users.php?page=jio_tickets&id=' . (int) ($ticket['id'] ?? 0)),
|
||||
];
|
||||
$assignee = get_userdata((int) ($ticket['admin_id'] ?? 0));
|
||||
if ($assignee instanceof \WP_User && is_email($assignee->user_email)) {
|
||||
@@ -55,7 +55,7 @@ final class MailNotifications {
|
||||
if (!$user instanceof \WP_User) return;
|
||||
self::send('user_ban', $user->user_email, [
|
||||
'username' => $user->display_name,
|
||||
'status' => $action === 'removed' ? __('限制已解除', 'aksrt') : $type,
|
||||
'status' => $action === 'removed' ? __('限制已解除', 'jio') : $type,
|
||||
'note' => $reason,
|
||||
]);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ final class MailNotifications {
|
||||
}
|
||||
|
||||
public static function asset_transaction($result, $command): void {
|
||||
if (!$result instanceof \AKSRT\Ledger\LedgerResult || !$command instanceof \AKSRT\Ledger\LedgerCommand || $result->replayed) return;
|
||||
if (!$result instanceof \Jio\Ledger\LedgerResult || !$command instanceof \Jio\Ledger\LedgerCommand || $result->replayed) return;
|
||||
$reason = $command->reason;
|
||||
if (!in_array($reason, ['affiliate_commission', 'creator_income', 'transfer', 'tip', 'referral'], true)) return;
|
||||
foreach ($result->entries as $entry) {
|
||||
@@ -115,7 +115,7 @@ final class MailNotifications {
|
||||
$user = get_userdata((int) ($entry['user_id'] ?? 0));
|
||||
if (!$user instanceof \WP_User) continue;
|
||||
$amount = self::minor_amount((string) ($entry['asset'] ?? 'balance'), (int) $entry['delta_minor']);
|
||||
$url = function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url('credits') : home_url('/');
|
||||
$url = function_exists('jio_get_user_center_url') ? jio_get_user_center_url('credits') : home_url('/');
|
||||
if ($reason === 'affiliate_commission') {
|
||||
self::send('affiliate_commission', $user->user_email, ['username' => $user->display_name, 'amount' => $amount, 'order_number' => $command->ref_key, 'url' => $url]);
|
||||
} elseif ($reason === 'creator_income') {
|
||||
@@ -126,8 +126,8 @@ final class MailNotifications {
|
||||
$sender = get_userdata((int) ($entry['counterparty_user_id'] ?? 0));
|
||||
self::send('transfer_received', $user->user_email, [
|
||||
'username' => $user->display_name,
|
||||
'sender' => $sender instanceof \WP_User ? $sender->display_name : __('其他用户', 'aksrt'),
|
||||
'asset' => ((string) ($entry['asset'] ?? '') === 'points') ? __('积分', 'aksrt') : __('余额', 'aksrt'),
|
||||
'sender' => $sender instanceof \WP_User ? $sender->display_name : __('其他用户', 'jio'),
|
||||
'asset' => ((string) ($entry['asset'] ?? '') === 'points') ? __('积分', 'jio') : __('余额', 'jio'),
|
||||
'amount' => $amount,
|
||||
'note' => (string) ($entry['remark'] ?? ''),
|
||||
'url' => $url,
|
||||
@@ -155,19 +155,19 @@ final class MailNotifications {
|
||||
public static function auth_submitted(int $user_id, array $application): void {
|
||||
$user = get_userdata($user_id);
|
||||
self::send_admin('auth_apply_admin', [
|
||||
'username' => $user instanceof \WP_User ? $user->display_name : (string) ($application['public_name'] ?? __('用户', 'aksrt')),
|
||||
'url' => admin_url('users.php?page=aksrt_users_verify'),
|
||||
'username' => $user instanceof \WP_User ? $user->display_name : (string) ($application['public_name'] ?? __('用户', 'jio')),
|
||||
'url' => admin_url('users.php?page=jio_users_verify'),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function auth_reviewed(int $user_id, string $status, string $note, int $reviewer_id): void {
|
||||
$user = get_userdata($user_id);
|
||||
if ($user instanceof \WP_User) self::send('auth_apply_result', $user->user_email, ['username' => $user->display_name, 'status' => $status, 'note' => $note, 'url' => function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('auth') : home_url('/')]);
|
||||
if ($user instanceof \WP_User) self::send('auth_apply_result', $user->user_email, ['username' => $user->display_name, 'status' => $status, 'note' => $note, 'url' => function_exists('jio_get_user_center_tab_url') ? jio_get_user_center_tab_url('auth') : home_url('/')]);
|
||||
}
|
||||
|
||||
public static function ban_appeal_submitted(int $user_id, array $payload): void {
|
||||
$user = get_userdata($user_id);
|
||||
if ($user instanceof \WP_User) self::send_admin('ban_appeal_admin', ['username' => $user->display_name, 'url' => admin_url('users.php?page=aksrt_user_ban&type=appeal&status=pending')]);
|
||||
if ($user instanceof \WP_User) self::send_admin('ban_appeal_admin', ['username' => $user->display_name, 'url' => admin_url('users.php?page=jio_user_ban&type=appeal&status=pending')]);
|
||||
}
|
||||
|
||||
public static function ban_appeal_processed(int $user_id, string $decision, string $note): void {
|
||||
@@ -196,7 +196,7 @@ final class MailNotifications {
|
||||
|
||||
public static function report_submitted(int $report_id, array $report): void {
|
||||
$reporter = get_userdata((int) ($report['reporter_id'] ?? 0));
|
||||
self::send_admin('report_admin', ['username' => $reporter instanceof \WP_User ? $reporter->display_name : __('用户', 'aksrt'), 'title' => (string) ($report['target_type'] ?? ''), 'url' => admin_url('users.php?page=aksrt_user_ban')]);
|
||||
self::send_admin('report_admin', ['username' => $reporter instanceof \WP_User ? $reporter->display_name : __('用户', 'jio'), 'title' => (string) ($report['target_type'] ?? ''), 'url' => admin_url('users.php?page=jio_user_ban')]);
|
||||
}
|
||||
|
||||
public static function report_status_changed(int $report_id, int $reporter_id, string $status, string $note = ''): void {
|
||||
@@ -206,21 +206,21 @@ final class MailNotifications {
|
||||
}
|
||||
// 状态值中文化后进入邮件;处理说明来自后台“处理说明”输入(钩子第 4 参)。
|
||||
$labels = [
|
||||
'pending' => __('待处理', 'aksrt'),
|
||||
'reviewing' => __('审核中', 'aksrt'),
|
||||
'resolved' => __('已解决', 'aksrt'),
|
||||
'dismissed' => __('已驳回', 'aksrt'),
|
||||
'pending' => __('待处理', 'jio'),
|
||||
'reviewing' => __('审核中', 'jio'),
|
||||
'resolved' => __('已解决', 'jio'),
|
||||
'dismissed' => __('已驳回', 'jio'),
|
||||
];
|
||||
self::send('report_result', $reporter->user_email, [
|
||||
'username' => $reporter->display_name,
|
||||
'status' => $labels[$status] ?? $status,
|
||||
'note' => $note !== '' ? $note : __('—', 'aksrt'),
|
||||
'note' => $note !== '' ? $note : __('—', 'jio'),
|
||||
'url' => home_url('/'),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function friend_link_submitted(array $link): void {
|
||||
self::send_admin('links_submit_admin', ['title' => (string) ($link['name'] ?? ''), 'username' => __('访客', 'aksrt'), 'url' => (string) ($link['url'] ?? '')]);
|
||||
self::send_admin('links_submit_admin', ['title' => (string) ($link['name'] ?? ''), 'username' => __('访客', 'jio'), 'url' => (string) ($link['url'] ?? '')]);
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $vars */
|
||||
@@ -248,7 +248,7 @@ final class MailNotifications {
|
||||
/** @return array<string,string> */
|
||||
private static function order_vars(string $order_number, array $order, \WP_User $user): array {
|
||||
$product = (string) ($order['product_type'] ?? 'order');
|
||||
return ['username' => $user->display_name, 'order_number' => $order_number, 'product' => $product, 'amount' => (string) ($order['amount'] ?? ''), 'currency' => (string) ($order['currency'] ?? 'CNY'), 'payment_method' => (string) ($order['payment_method'] ?? ''), 'url' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url('orders') : home_url('/')];
|
||||
return ['username' => $user->display_name, 'order_number' => $order_number, 'product' => $product, 'amount' => (string) ($order['amount'] ?? ''), 'currency' => (string) ($order['currency'] ?? 'CNY'), 'payment_method' => (string) ($order['payment_method'] ?? ''), 'url' => function_exists('jio_get_user_center_url') ? jio_get_user_center_url('orders') : home_url('/')];
|
||||
}
|
||||
|
||||
private static function minor_amount(string $asset, int $minor): string {
|
||||
|
||||
Reference in new issue
Block a user