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>
106 lines
2.7 KiB
PHP
106 lines
2.7 KiB
PHP
<?php
|
||
/**
|
||
* Jio Theme — Uninstall Handler
|
||
*
|
||
* Runs when the theme is deleted via the WordPress admin.
|
||
* Optionally cleans up custom database tables and options.
|
||
*
|
||
* @package Jio
|
||
*/
|
||
|
||
// Abort if not called by WordPress
|
||
if (!defined('WP_UNINSTALL_PLUGIN') && !defined('ABSPATH')) {
|
||
exit;
|
||
}
|
||
|
||
// Only run if the user has opted in to data deletion.
|
||
// Check for a specific option flag; if not set, preserve data.
|
||
$should_cleanup = get_option('jio_cleanup_on_uninstall', false);
|
||
if (!$should_cleanup) {
|
||
return;
|
||
}
|
||
|
||
global $wpdb;
|
||
|
||
// ── Drop custom tables ──
|
||
// 与 Jio\Core\DBMigrator(DBMigratorPart2 / Identity / Vip / Ticket)创建的
|
||
// 表一一对应;新增表时同步这里。
|
||
$tables = [
|
||
'jio_ticket_reply',
|
||
'jio_ticket_note',
|
||
'jio_ticket_prereply',
|
||
'jio_ticket_status',
|
||
'jio_ticket_type',
|
||
'jio_ticket',
|
||
'jio_order_item',
|
||
'jio_order',
|
||
'jio_coupon_usage',
|
||
'jio_coupon',
|
||
'jio_charge_card',
|
||
'jio_invite_code_usage',
|
||
'jio_invite_code',
|
||
'jio_affiliate_relation',
|
||
'jio_commission_adjustment',
|
||
'jio_commission_debt',
|
||
'jio_commission_ledger',
|
||
'jio_payout_account',
|
||
'jio_revenue',
|
||
'jio_withdrawal',
|
||
'jio_identity_event',
|
||
'jio_identity_application',
|
||
'jio_vip_membership_event',
|
||
'jio_financial_flow_entry',
|
||
'jio_financial_flow',
|
||
'jio_asset_entry',
|
||
'jio_asset_transaction',
|
||
'jio_asset_account',
|
||
'jio_signin_log',
|
||
'jio_dl_token',
|
||
'jio_notification',
|
||
'jio_report',
|
||
'jio_follow',
|
||
'jio_user_restriction',
|
||
];
|
||
|
||
foreach ($tables as $table) {
|
||
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}{$table}");
|
||
}
|
||
|
||
// ── Delete Jio options ──
|
||
$options = $wpdb->get_col(
|
||
"SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE 'jio_%'"
|
||
);
|
||
if ($options) {
|
||
foreach ($options as $option) {
|
||
delete_option($option);
|
||
}
|
||
}
|
||
|
||
// ── Delete Jio user meta ──
|
||
$meta_keys = [
|
||
'jio_avatar_attachment_id',
|
||
'jio_background_attachment_id',
|
||
'jio_background_image',
|
||
'phone_number',
|
||
'jio_phone_verified',
|
||
'jio_profile_details',
|
||
'jio_phone',
|
||
'jio_email_verified',
|
||
'jio_unread_message_count',
|
||
'_jio_active_restrictions',
|
||
'_jio_is_banned',
|
||
'_jio_no_appeal',
|
||
'jio_user_ban_state',
|
||
'_jio_favorite_posts',
|
||
'jio_wechat_openid',
|
||
'jio_wechat_subscriptions',
|
||
];
|
||
|
||
foreach ($meta_keys as $key) {
|
||
$wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->usermeta} WHERE meta_key = %s", $key));
|
||
}
|
||
|
||
// ── Delete transients ──
|
||
$wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_jio_%'");
|
||
$wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_timeout_jio_%'");
|