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
@@ -6,7 +6,7 @@ declare(strict_types=1);
|
||||
namespace {
|
||||
define('ABSPATH', __DIR__ . '/');
|
||||
define('HOUR_IN_SECONDS', 3600);
|
||||
define('WP_CONTENT_DIR', sys_get_temp_dir() . '/aksrt-split-test-' . getmypid());
|
||||
define('WP_CONTENT_DIR', sys_get_temp_dir() . '/jio-split-test-' . getmypid());
|
||||
|
||||
function sanitize_file_name(string $name): string { return preg_replace('/[^A-Za-z0-9._\-]/', '', $name) ?? ''; }
|
||||
function __(string $text, string $domain = ''): string { return $text; }
|
||||
@@ -63,9 +63,9 @@ namespace {
|
||||
require dirname(__DIR__, 2) . '/src/Core/FrontSubmitChunk.php';
|
||||
}
|
||||
|
||||
namespace AKSRT\Core {
|
||||
namespace Jio\Core {
|
||||
final class FakeFrontSubmit {
|
||||
use \AKSRT\Core\FrontSubmitChunk;
|
||||
use \Jio\Core\FrontSubmitChunk;
|
||||
|
||||
public static int $limit_bytes = 10 * 1048576;
|
||||
public static array $persisted = [];
|
||||
@@ -83,10 +83,10 @@ namespace AKSRT\Core {
|
||||
}
|
||||
|
||||
namespace {
|
||||
use AKSRT\Core\FakeFrontSubmit;
|
||||
use Jio\Core\FakeFrontSubmit;
|
||||
|
||||
$submit = new FakeFrontSubmit();
|
||||
$temp_dir = WP_CONTENT_DIR . '/aksrt-temp';
|
||||
$temp_dir = WP_CONTENT_DIR . '/jio-temp';
|
||||
|
||||
// 1) Chunk parameter validation.
|
||||
$err = $submit->rest_upload_chunk(new FakeRestRequest(['name' => '', 'chunks' => 3, 'chunk' => 0, 'size' => 10]));
|
||||
@@ -124,12 +124,12 @@ namespace {
|
||||
|
||||
// 4) Merge refuses when a chunk is missing.
|
||||
$err = $submit->rest_upload_chunk_merge(new FakeRestRequest(['kind' => 'video', 'name' => 'movie.mp4', 'chunks' => 3, 'size' => 9]));
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'aksrt_chunk_missing', 'merge should refuse with missing chunks');
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'jio_chunk_missing', 'merge should refuse with missing chunks');
|
||||
|
||||
// 5) Merge with a size mismatch is refused.
|
||||
$submit->rest_upload_chunk(new FakeRestRequest($params(1, 3, 6), ['file' => ['tmp_name' => $make_file('BBB'), 'error' => 0]]));
|
||||
$err = $submit->rest_upload_chunk_merge(new FakeRestRequest(['kind' => 'video', 'name' => 'movie.mp4', 'chunks' => 3, 'size' => 999]));
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'aksrt_chunk_size_mismatch', 'size mismatch should refuse the merge');
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'jio_chunk_size_mismatch', 'size mismatch should refuse the merge');
|
||||
|
||||
// 6) Happy-path merge concatenates in order, flags sideload, and cleans up.
|
||||
$response = $submit->rest_upload_chunk_merge(new FakeRestRequest(['kind' => 'video', 'name' => 'movie.mp4', 'chunks' => 3, 'size' => 9]));
|
||||
@@ -147,20 +147,20 @@ namespace {
|
||||
// 8) Chunk size cap refuses oversized chunk blobs.
|
||||
$big = $make_file(str_repeat('x', 3 * 1048576));
|
||||
$err = $submit->rest_upload_chunk(new FakeRestRequest($params(0, 1, 3 * 1048576), ['file' => ['tmp_name' => $big, 'error' => 0]]));
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'aksrt_chunk_invalid_size', 'oversized chunk blobs should be refused');
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'jio_chunk_invalid_size', 'oversized chunk blobs should be refused');
|
||||
|
||||
// 9) Kind size limit caps cumulative uploads.
|
||||
FakeFrontSubmit::$limit_bytes = 4;
|
||||
$err = $submit->rest_upload_chunk(new FakeRestRequest($params(0, 2, 9), ['file' => ['tmp_name' => $make_file('AAAAA'), 'error' => 0]]));
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'aksrt_upload_too_large', 'cumulative size over the kind limit should be refused');
|
||||
split_upload_check($err instanceof \WP_Error && $err->get_error_code() === 'jio_upload_too_large', 'cumulative size over the kind limit should be refused');
|
||||
|
||||
// Cleanup.
|
||||
FakeFrontSubmit::$persisted = [];
|
||||
foreach ((array) glob(WP_CONTENT_DIR . '/*.part') as $leftover) {
|
||||
@unlink((string) $leftover);
|
||||
}
|
||||
@unlink(WP_CONTENT_DIR . '/aksrt-temp/index.php');
|
||||
@rmdir(WP_CONTENT_DIR . '/aksrt-temp');
|
||||
@unlink(WP_CONTENT_DIR . '/jio-temp/index.php');
|
||||
@rmdir(WP_CONTENT_DIR . '/jio-temp');
|
||||
@rmdir(WP_CONTENT_DIR);
|
||||
|
||||
echo "Split upload harness passed\n";
|
||||
|
||||
Reference in new issue
Block a user