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
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Admin;
|
||||
namespace Jio\Admin;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -81,21 +81,21 @@ class SchemaProvider {
|
||||
public function get_option_key(string $domain, string $section = ''): string {
|
||||
if ($section !== '') {
|
||||
$schema = $this->get_section_schema($domain, $section);
|
||||
return (string) ($schema['option_key'] ?? 'aksrt_settings');
|
||||
return (string) ($schema['option_key'] ?? 'jio_settings');
|
||||
}
|
||||
|
||||
$primary = [
|
||||
'global' => 'aksrt_settings',
|
||||
'page_display' => 'aksrt_settings',
|
||||
'post_list' => 'aksrt_settings',
|
||||
'permissions' => 'aksrt_settings',
|
||||
'users' => 'aksrt_settings',
|
||||
'payment' => 'aksrt_settings',
|
||||
'extensions' => 'aksrt_settings',
|
||||
'tools' => 'aksrt_settings',
|
||||
'global' => 'jio_settings',
|
||||
'page_display' => 'jio_settings',
|
||||
'post_list' => 'jio_settings',
|
||||
'permissions' => 'jio_settings',
|
||||
'users' => 'jio_settings',
|
||||
'payment' => 'jio_settings',
|
||||
'extensions' => 'jio_settings',
|
||||
'tools' => 'jio_settings',
|
||||
];
|
||||
|
||||
return $primary[$this->normalize_domain($domain)] ?? 'aksrt_settings';
|
||||
return $primary[$this->normalize_domain($domain)] ?? 'jio_settings';
|
||||
}
|
||||
|
||||
public function get_defaults(string $domain, string $section = ''): array {
|
||||
@@ -271,7 +271,7 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
if ($domain === 'users' && ($section === 'oauth' || $section === '')) {
|
||||
$stored = get_option('aksrt_settings', []);
|
||||
$stored = get_option('jio_settings', []);
|
||||
$merged = is_array($stored) ? array_merge($stored, $data) : $data;
|
||||
foreach ((array) ($data['__clear_secrets'] ?? []) as $secret_key) {
|
||||
$merged[sanitize_key((string) $secret_key)] = '';
|
||||
@@ -280,27 +280,27 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
if ($domain === 'payment' && $section === 'withdrawal') {
|
||||
$stored = get_option('aksrt_settings', []);
|
||||
$stored = get_option('jio_settings', []);
|
||||
$merged = is_array($stored) ? array_merge($stored, $data) : $data;
|
||||
$count = $merged['affiliate_daily_withdrawal_count'] ?? 3;
|
||||
$min_raw = $merged['affiliate_min_withdrawal'] ?? '50.00';
|
||||
$limit_raw = $merged['affiliate_daily_withdrawal_limit'] ?? '500.00';
|
||||
$time = (string) ($merged['affiliate_withdrawal_reset_time'] ?? '00:00');
|
||||
if (filter_var($count, FILTER_VALIDATE_INT) === false || (int) $count < 0) {
|
||||
$errors[] = __('每日可提现次数必须是非负整数', 'aksrt');
|
||||
$errors[] = __('每日可提现次数必须是非负整数', 'jio');
|
||||
}
|
||||
try {
|
||||
$min_minor = \AKSRT\Ledger\AssetAmount::balance(is_string($min_raw) ? $min_raw : '')->minor();
|
||||
$limit_minor = \AKSRT\Ledger\AssetAmount::balance(is_string($limit_raw) ? $limit_raw : '')->minor();
|
||||
$min_minor = \Jio\Ledger\AssetAmount::balance(is_string($min_raw) ? $min_raw : '')->minor();
|
||||
$limit_minor = \Jio\Ledger\AssetAmount::balance(is_string($limit_raw) ? $limit_raw : '')->minor();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$min_minor = 0;
|
||||
$limit_minor = 0;
|
||||
}
|
||||
if ($limit_minor < $min_minor) {
|
||||
$errors[] = __('每日提现上限不得低于最低提现金额', 'aksrt');
|
||||
$errors[] = __('每日提现上限不得低于最低提现金额', 'jio');
|
||||
}
|
||||
if (preg_match('/^(?:[01]\\d|2[0-3]):[0-5]\\d$/', $time) !== 1) {
|
||||
$errors[] = __('重置时间必须为 HH:MM', 'aksrt');
|
||||
$errors[] = __('重置时间必须为 HH:MM', 'jio');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,8 +366,8 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
private function get_schema_builder_map(): array {
|
||||
// Builders live under AKSRT\Admin\Schema (Composer PSR-4). Relative
|
||||
// Schema\*::class resolves correctly from this AKSRT\Admin namespace.
|
||||
// Builders live under Jio\Admin\Schema (Composer PSR-4). Relative
|
||||
// Schema\*::class resolves correctly from this Jio\Admin namespace.
|
||||
return [
|
||||
'global' => Schema\GlobalSchema::class,
|
||||
'page_display' => Schema\SchemaPageDisplay::class,
|
||||
@@ -381,7 +381,7 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
private function read_section_settings(array $schema): array {
|
||||
$option_key = (string) ($schema['option_key'] ?? 'aksrt_settings');
|
||||
$option_key = (string) ($schema['option_key'] ?? 'jio_settings');
|
||||
$stored = get_option($option_key, []);
|
||||
if (!is_array($stored)) {
|
||||
$stored = [];
|
||||
@@ -426,14 +426,14 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
// Captcha: always surface the normalized positive scene list.
|
||||
if ($option_key === 'aksrt_captcha_config' && function_exists('aksrt_get_captcha_config')) {
|
||||
$normalized = aksrt_get_captcha_config();
|
||||
if ($option_key === 'jio_captcha_config' && function_exists('jio_get_captcha_config')) {
|
||||
$normalized = jio_get_captcha_config();
|
||||
foreach (['enabled', 'active_provider', 'enabled_scenarios'] as $key) {
|
||||
if (array_key_exists($key, $normalized)) {
|
||||
$data[$key] = $normalized[$key];
|
||||
}
|
||||
}
|
||||
foreach (function_exists('aksrt_captcha_providers') ? aksrt_captcha_providers() : [] as $provider) {
|
||||
foreach (function_exists('jio_captcha_providers') ? jio_captcha_providers() : [] as $provider) {
|
||||
$data[$provider] = $this->mask_captcha_provider_secrets($provider, (array) ($normalized[$provider] ?? []));
|
||||
}
|
||||
}
|
||||
@@ -442,7 +442,7 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
private function write_section_settings(array $schema, array $data): bool {
|
||||
$option_key = (string) ($schema['option_key'] ?? 'aksrt_settings');
|
||||
$option_key = (string) ($schema['option_key'] ?? 'jio_settings');
|
||||
$stored = get_option($option_key, []);
|
||||
if (!is_array($stored)) {
|
||||
$stored = [];
|
||||
@@ -482,28 +482,28 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
// Captcha stores a single positive scene list.
|
||||
if ($option_key === 'aksrt_captcha_config' && function_exists('aksrt_captcha_scenes')) {
|
||||
if ($option_key === 'jio_captcha_config' && function_exists('jio_captcha_scenes')) {
|
||||
$stored['enabled'] = !empty($stored['enabled']);
|
||||
$active_provider = sanitize_key((string) ($stored['active_provider'] ?? ''));
|
||||
$stored['active_provider'] = in_array($active_provider, aksrt_captcha_providers(), true) ? $active_provider : '';
|
||||
$stored['enabled_scenarios'] = function_exists('aksrt_captcha_sanitize_scene_list')
|
||||
? aksrt_captcha_sanitize_scene_list($stored['enabled_scenarios'] ?? [])
|
||||
$stored['active_provider'] = in_array($active_provider, jio_captcha_providers(), true) ? $active_provider : '';
|
||||
$stored['enabled_scenarios'] = function_exists('jio_captcha_sanitize_scene_list')
|
||||
? jio_captcha_sanitize_scene_list($stored['enabled_scenarios'] ?? [])
|
||||
: (array) ($stored['enabled_scenarios'] ?? []);
|
||||
foreach (aksrt_captcha_providers() as $provider) {
|
||||
$stored[$provider] = function_exists('aksrt_captcha_sanitize_provider_config')
|
||||
? aksrt_captcha_sanitize_provider_config($provider, $stored[$provider] ?? [])
|
||||
foreach (jio_captcha_providers() as $provider) {
|
||||
$stored[$provider] = function_exists('jio_captcha_sanitize_provider_config')
|
||||
? jio_captcha_sanitize_provider_config($provider, $stored[$provider] ?? [])
|
||||
: (array) ($stored[$provider] ?? []);
|
||||
}
|
||||
}
|
||||
|
||||
$updated = update_option($option_key, $stored);
|
||||
if ($option_key === 'aksrt_captcha_config' && function_exists('aksrt_captcha_config_reset')) {
|
||||
aksrt_captcha_config_reset();
|
||||
if ($option_key === 'jio_captcha_config' && function_exists('jio_captcha_config_reset')) {
|
||||
jio_captcha_config_reset();
|
||||
}
|
||||
\AKSRT\Settings\Settings::flush_settings_cache();
|
||||
\Jio\Settings\Settings::flush_settings_cache();
|
||||
|
||||
if (isset($stored['site_favicon'])) {
|
||||
\AKSRT\Settings\Settings::sync_native_site_icon((string) $stored['site_favicon']);
|
||||
\Jio\Settings\Settings::sync_native_site_icon((string) $stored['site_favicon']);
|
||||
}
|
||||
|
||||
return $updated || true;
|
||||
@@ -525,8 +525,8 @@ class SchemaProvider {
|
||||
if (!empty($field['secret'])) {
|
||||
$paths[] = $key;
|
||||
}
|
||||
if (!empty($field['captcha_provider']) && function_exists('aksrt_captcha_provider_secret_fields')) {
|
||||
foreach (aksrt_captcha_provider_secret_fields((string) $field['captcha_provider']) as $secret) {
|
||||
if (!empty($field['captcha_provider']) && function_exists('jio_captcha_provider_secret_fields')) {
|
||||
foreach (jio_captcha_provider_secret_fields((string) $field['captcha_provider']) as $secret) {
|
||||
$paths[] = $key . '.' . sanitize_key((string) $secret);
|
||||
}
|
||||
}
|
||||
@@ -535,21 +535,21 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
private function mask_captcha_provider_secrets(string $provider, array $config): array {
|
||||
$clean = function_exists('aksrt_captcha_sanitize_provider_config')
|
||||
? aksrt_captcha_sanitize_provider_config($provider, $config)
|
||||
$clean = function_exists('jio_captcha_sanitize_provider_config')
|
||||
? jio_captcha_sanitize_provider_config($provider, $config)
|
||||
: $config;
|
||||
foreach (function_exists('aksrt_captcha_provider_secret_fields') ? aksrt_captcha_provider_secret_fields($provider) : [] as $secret) {
|
||||
foreach (function_exists('jio_captcha_provider_secret_fields') ? jio_captcha_provider_secret_fields($provider) : [] as $secret) {
|
||||
$clean[$secret] = trim((string) ($config[$secret] ?? '')) !== '' ? '***' : '';
|
||||
}
|
||||
return $clean;
|
||||
}
|
||||
|
||||
private function merge_captcha_provider_config(string $provider, array $stored, array $incoming, array $clear_paths): array {
|
||||
$current = function_exists('aksrt_captcha_sanitize_provider_config')
|
||||
? aksrt_captcha_sanitize_provider_config($provider, $stored)
|
||||
$current = function_exists('jio_captcha_sanitize_provider_config')
|
||||
? jio_captcha_sanitize_provider_config($provider, $stored)
|
||||
: $stored;
|
||||
$defaults = function_exists('aksrt_captcha_provider_defaults') ? aksrt_captcha_provider_defaults($provider) : [];
|
||||
$secret_fields = function_exists('aksrt_captcha_provider_secret_fields') ? aksrt_captcha_provider_secret_fields($provider) : [];
|
||||
$defaults = function_exists('jio_captcha_provider_defaults') ? jio_captcha_provider_defaults($provider) : [];
|
||||
$secret_fields = function_exists('jio_captcha_provider_secret_fields') ? jio_captcha_provider_secret_fields($provider) : [];
|
||||
foreach (array_keys($defaults) as $key) {
|
||||
$path = $provider . '.' . $key;
|
||||
if (in_array($path, $clear_paths, true)) {
|
||||
@@ -565,8 +565,8 @@ class SchemaProvider {
|
||||
}
|
||||
$current[$key] = $value;
|
||||
}
|
||||
return function_exists('aksrt_captcha_sanitize_provider_config')
|
||||
? aksrt_captcha_sanitize_provider_config($provider, $current)
|
||||
return function_exists('jio_captcha_sanitize_provider_config')
|
||||
? jio_captcha_sanitize_provider_config($provider, $current)
|
||||
: $current;
|
||||
}
|
||||
|
||||
@@ -659,7 +659,7 @@ class SchemaProvider {
|
||||
}
|
||||
|
||||
try {
|
||||
return \AKSRT\Ledger\AssetAmount::balance(trim($value))->decimal();
|
||||
return \Jio\Ledger\AssetAmount::balance(trim($value))->decimal();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return '';
|
||||
}
|
||||
@@ -679,8 +679,8 @@ class SchemaProvider {
|
||||
// Inline whitelist for card title/desc: `badge` is a custom
|
||||
// element that wp_kses_post() would strip, but legacy (Zibll)
|
||||
// renders such markup verbatim.
|
||||
return function_exists('aksrt_icon_card_kses')
|
||||
? aksrt_icon_card_kses((string) $value)
|
||||
return function_exists('jio_icon_card_kses')
|
||||
? jio_icon_card_kses((string) $value)
|
||||
: wp_kses_post((string) $value);
|
||||
case 'textarea':
|
||||
return sanitize_textarea_field((string) $value);
|
||||
@@ -716,13 +716,13 @@ class SchemaProvider {
|
||||
}
|
||||
return $out;
|
||||
case 'icon':
|
||||
return function_exists('aksrt_sanitize_icon_value')
|
||||
? aksrt_sanitize_icon_value((string) $value)
|
||||
return function_exists('jio_sanitize_icon_value')
|
||||
? jio_sanitize_icon_value((string) $value)
|
||||
: sanitize_text_field((string) $value);
|
||||
case 'color':
|
||||
return \AKSRT\Core\Color::sanitize($value);
|
||||
return \Jio\Core\Color::sanitize($value);
|
||||
case 'color_alpha':
|
||||
return \AKSRT\Core\Color::sanitize($value, true);
|
||||
return \Jio\Core\Color::sanitize($value, true);
|
||||
default:
|
||||
return sanitize_text_field((string) $value);
|
||||
}
|
||||
@@ -730,8 +730,8 @@ class SchemaProvider {
|
||||
|
||||
private function sanitize_field_value($value, array $field) {
|
||||
if (!empty($field['captcha_provider'])) {
|
||||
return function_exists('aksrt_captcha_sanitize_provider_config')
|
||||
? aksrt_captcha_sanitize_provider_config((string) $field['captcha_provider'], $value)
|
||||
return function_exists('jio_captcha_sanitize_provider_config')
|
||||
? jio_captcha_sanitize_provider_config((string) $field['captcha_provider'], $value)
|
||||
: [];
|
||||
}
|
||||
$type = (string) ($field['type'] ?? 'text');
|
||||
@@ -749,8 +749,8 @@ class SchemaProvider {
|
||||
// fields already route through sanitize_value('icon'); group/repeater
|
||||
// sub-fields (e.g. header_slider_card_option.cards[].icon) must too.
|
||||
if ($type === 'icon') {
|
||||
return function_exists('aksrt_sanitize_icon_value')
|
||||
? aksrt_sanitize_icon_value((string) $value)
|
||||
return function_exists('jio_sanitize_icon_value')
|
||||
? jio_sanitize_icon_value((string) $value)
|
||||
: $this->sanitize_value($value, 'icon');
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user