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,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: AKSRT - 单篇资源下载
|
||||
* Template Name: Jio - 单篇资源下载
|
||||
* Template Post Type: page
|
||||
*
|
||||
* legacy pages/download.php equivalent.
|
||||
@@ -8,7 +8,7 @@
|
||||
* Only for pay_type=download posts. Shows download buttons when allowed,
|
||||
* or a no-permission state with a back link to the article.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -19,21 +19,21 @@ $post = $post_id > 0 ? get_post($post_id) : null;
|
||||
if (!$post instanceof WP_Post || $post->post_status !== 'publish') {
|
||||
get_header();
|
||||
echo '<main class="container"><div class="content-wrap"><div class="content-layout">';
|
||||
echo '<div class="alert jb-red em12" style="margin:2em;"><b>' . esc_html__('无效的下载请求', 'aksrt') . '</b></div>';
|
||||
echo '<div class="alert jb-red em12" style="margin:2em;"><b>' . esc_html__('无效的下载请求', 'jio') . '</b></div>';
|
||||
echo '</div></div></main>';
|
||||
get_footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
$pay_meta = function_exists('aksrt_get_pay_meta') ? aksrt_get_pay_meta($post) : ['pay_type' => 'no', 'downloads' => []];
|
||||
$pay_meta = function_exists('jio_get_pay_meta') ? jio_get_pay_meta($post) : ['pay_type' => 'no', 'downloads' => []];
|
||||
$pay_type = (string) ($pay_meta['pay_type'] ?? 'no');
|
||||
$is_download = $pay_type === 'download' || (function_exists('aksrt_is_downloadable_content') && aksrt_is_downloadable_content($post));
|
||||
$is_download = $pay_type === 'download' || (function_exists('jio_is_downloadable_content') && jio_is_downloadable_content($post));
|
||||
|
||||
if (!$is_download) {
|
||||
get_header();
|
||||
echo '<main class="container"><div class="content-wrap"><div class="content-layout">';
|
||||
echo '<div class="alert jb-red em12" style="margin:2em;"><b>' . esc_html__('该内容不是可下载资源', 'aksrt') . '</b></div>';
|
||||
echo '<p><a class="but jb-yellow padding-lg" href="' . esc_url(get_permalink($post)) . '#posts-pay"><i class="fa fas fa-long-arrow-alt-left" aria-hidden="true"></i><span class="ml10">' . esc_html__('返回文章', 'aksrt') . '</span></a></p>';
|
||||
echo '<div class="alert jb-red em12" style="margin:2em;"><b>' . esc_html__('该内容不是可下载资源', 'jio') . '</b></div>';
|
||||
echo '<p><a class="but jb-yellow padding-lg" href="' . esc_url(get_permalink($post)) . '#posts-pay"><i class="fa fas fa-long-arrow-alt-left" aria-hidden="true"></i><span class="ml10">' . esc_html__('返回文章', 'jio') . '</span></a></p>';
|
||||
echo '</div></div></main>';
|
||||
get_footer();
|
||||
exit;
|
||||
@@ -47,54 +47,54 @@ $pay_details = trim((string) ($pay_meta['pay_details'] ?? ''));
|
||||
$pay_extra_hide = trim((string) ($pay_meta['pay_extra_hide'] ?? ''));
|
||||
$subtitle = '';
|
||||
if (function_exists('get_the_subtitle')) {
|
||||
// noop — AKSRT may not have legacy subtitle helper
|
||||
// noop — Jio may not have legacy subtitle helper
|
||||
}
|
||||
$has_access = function_exists('aksrt_has_paid_access') ? aksrt_has_paid_access($post) : false;
|
||||
$gate = function_exists('aksrt_can_download') ? aksrt_can_download($post) : true;
|
||||
$has_access = function_exists('jio_has_paid_access') ? jio_has_paid_access($post) : false;
|
||||
$gate = function_exists('jio_can_download') ? jio_can_download($post) : true;
|
||||
$can_dl = $gate === true;
|
||||
$gate_code = is_wp_error($gate) ? $gate->get_error_code() : '';
|
||||
$need_login = $gate_code === 'aksrt_need_login';
|
||||
$need_purchase = $gate_code === 'aksrt_need_purchase';
|
||||
$need_vip = $gate_code === 'aksrt_need_vip';
|
||||
$need_login = $gate_code === 'jio_need_login';
|
||||
$need_purchase = $gate_code === 'jio_need_purchase';
|
||||
$need_vip = $gate_code === 'jio_need_vip';
|
||||
|
||||
$priced = function_exists('aksrt_get_user_pay_price') ? aksrt_get_user_pay_price($post) : null;
|
||||
$priced = function_exists('jio_get_user_pay_price') ? jio_get_user_pay_price($post) : null;
|
||||
$price = is_array($priced) ? (float) ($priced['amount'] ?? 0) : (float) ($pay_meta['price'] ?? 0);
|
||||
$pay_modo = is_array($priced) ? ((($priced['modo'] ?? '0') === 'points') ? 'points' : '0') : ((($pay_meta['pay_modo'] ?? '0') === 'points') ? 'points' : '0');
|
||||
$currency = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_currency_name() : __('积分', 'aksrt');
|
||||
$currency = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_currency_name() : __('积分', 'jio');
|
||||
$cash_symbol = '¥';
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$paid_display = \AKSRT\Settings\Settings::get_paid_content_settings();
|
||||
if (class_exists('\Jio\Settings\Settings')) {
|
||||
$paid_display = \Jio\Settings\Settings::get_paid_content_settings();
|
||||
$cash_symbol = (string) ($paid_display['display']['currency_symbol'] ?? '¥');
|
||||
}
|
||||
$price_text = $price <= 0
|
||||
? __('免费', 'aksrt')
|
||||
? __('免费', 'jio')
|
||||
: ($pay_modo === 'points'
|
||||
? (function_exists('aksrt_format_price') ? aksrt_format_price($price) : (string) $price) . ' ' . $currency
|
||||
: $cash_symbol . (function_exists('aksrt_format_price') ? aksrt_format_price($price) : (string) $price));
|
||||
? (function_exists('jio_format_price') ? jio_format_price($price) : (string) $price) . ' ' . $currency
|
||||
: $cash_symbol . (function_exists('jio_format_price') ? jio_format_price($price) : (string) $price));
|
||||
$login_url = wp_login_url(add_query_arg('post', $post_id, get_permalink()));
|
||||
$vip_url = function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/');
|
||||
$vip_url = function_exists('jio_get_user_center_url') ? jio_get_user_center_url() : home_url('/');
|
||||
|
||||
$paid_name = '';
|
||||
if ($has_access || $can_dl) {
|
||||
if ($price <= 0) {
|
||||
$paid_name = __('免费资源', 'aksrt');
|
||||
$paid_name = __('免费资源', 'jio');
|
||||
} else {
|
||||
$paid_name = __('已获得下载权限', 'aksrt');
|
||||
$paid_name = __('已获得下载权限', 'jio');
|
||||
}
|
||||
}
|
||||
|
||||
get_header();
|
||||
?>
|
||||
<style>
|
||||
.aksrt-single-download .but-download > .but,
|
||||
.aksrt-single-download .but-download > a,
|
||||
.aksrt-single-download .but-download > button,
|
||||
.aksrt-single-download .resource-download-box__btn {
|
||||
.jio-single-download .but-download > .but,
|
||||
.jio-single-download .but-download > a,
|
||||
.jio-single-download .but-download > button,
|
||||
.jio-single-download .resource-download-box__btn {
|
||||
min-width: 200px;
|
||||
padding: .5em;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.aksrt-single-download .pay-extra-hide {
|
||||
.jio-single-download .pay-extra-hide {
|
||||
background: var(--muted-border-color, #f0f0f0);
|
||||
display: block;
|
||||
margin: 10px 0;
|
||||
@@ -103,7 +103,7 @@ get_header();
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
<main class="container aksrt-single-download">
|
||||
<main class="container jio-single-download">
|
||||
<div class="content-wrap">
|
||||
<div class="content-layout">
|
||||
<article class="article page-article main-bg theme-box box-body radius8 main-shadow">
|
||||
@@ -133,9 +133,9 @@ get_header();
|
||||
global $post;
|
||||
$GLOBALS['post'] = $post;
|
||||
setup_postdata($post);
|
||||
$GLOBALS['aksrt_on_download_file_page'] = true;
|
||||
$GLOBALS['jio_on_download_file_page'] = true;
|
||||
get_template_part('templates/parts/resource-download-box');
|
||||
unset($GLOBALS['aksrt_on_download_file_page']);
|
||||
unset($GLOBALS['jio_on_download_file_page']);
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
@@ -144,59 +144,59 @@ get_header();
|
||||
<?php endif; ?>
|
||||
<?php elseif ($need_login) : ?>
|
||||
<div class="alert jb-yellow em12" style="margin:2em;">
|
||||
<b><?php echo ($price <= 0) ? esc_html__('免费资源,请登录后下载', 'aksrt') : esc_html__('请先登录后再下载', 'aksrt'); ?></b>
|
||||
<b><?php echo ($price <= 0) ? esc_html__('免费资源,请登录后下载', 'jio') : esc_html__('请先登录后再下载', 'jio'); ?></b>
|
||||
</div>
|
||||
<div class="pay-extra-hide">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: login url */
|
||||
wp_kses_post(__('Hi!请先 <a href="%s">登录</a> 后再下载。', 'aksrt')),
|
||||
wp_kses_post(__('Hi!请先 <a href="%s">登录</a> 后再下载。', 'jio')),
|
||||
esc_url($login_url)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<a style="margin-bottom:2em;" href="<?php echo esc_url($login_url); ?>" class="but jb-red padding-lg">
|
||||
<i class="fa fas fa-sign-in-alt" aria-hidden="true"></i>
|
||||
<span class="ml10"><?php esc_html_e('前往登录', 'aksrt'); ?></span>
|
||||
<span class="ml10"><?php esc_html_e('前往登录', 'jio'); ?></span>
|
||||
</a>
|
||||
<?php elseif ($need_vip) : ?>
|
||||
<div class="alert jb-yellow em12" style="margin:2em;">
|
||||
<b><?php echo esc_html(is_wp_error($gate) ? $gate->get_error_message() : __('该资源仅限会员购买/下载。', 'aksrt')); ?></b>
|
||||
<b><?php echo esc_html(is_wp_error($gate) ? $gate->get_error_message() : __('该资源仅限会员购买/下载。', 'jio')); ?></b>
|
||||
</div>
|
||||
<a style="margin-bottom:1em;" href="<?php echo esc_url($vip_url); ?>" class="but jb-vip padding-lg">
|
||||
<i class="fa fas fa-certificate" aria-hidden="true"></i>
|
||||
<span class="ml10"><?php esc_html_e('开通会员', 'aksrt'); ?></span>
|
||||
<span class="ml10"><?php esc_html_e('开通会员', 'jio'); ?></span>
|
||||
</a>
|
||||
<a style="margin-bottom:2em;" href="<?php echo esc_url($article_url); ?>" class="but jb-yellow padding-lg">
|
||||
<i class="fa fas fa-long-arrow-alt-left" aria-hidden="true"></i>
|
||||
<span class="ml10"><?php esc_html_e('返回文章', 'aksrt'); ?></span>
|
||||
<span class="ml10"><?php esc_html_e('返回文章', 'jio'); ?></span>
|
||||
</a>
|
||||
<?php elseif ($need_purchase) : ?>
|
||||
<div class="alert jb-red em12" style="margin:2em;">
|
||||
<b><?php esc_html_e('请先购买后再下载', 'aksrt'); ?></b>
|
||||
<b><?php esc_html_e('请先购买后再下载', 'jio'); ?></b>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="but <?php echo $pay_modo === 'points' ? 'jb-yellow' : 'jb-red'; ?> padding-lg cashier-link"
|
||||
data-action="aksrt-need-purchase"
|
||||
data-aksrt-pay-content="<?php echo esc_attr((string) $post_id); ?>"
|
||||
data-action="jio-need-purchase"
|
||||
data-jio-pay-content="<?php echo esc_attr((string) $post_id); ?>"
|
||||
data-post-id="<?php echo esc_attr((string) $post_id); ?>"
|
||||
style="margin-bottom:1em;"
|
||||
>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i>
|
||||
<span class="ml10"><?php printf(esc_html__('立即购买(%s)', 'aksrt'), $price_text); ?></span>
|
||||
<span class="ml10"><?php printf(esc_html__('立即购买(%s)', 'jio'), $price_text); ?></span>
|
||||
</button>
|
||||
<a style="margin-bottom:2em;" href="<?php echo esc_url($article_url); ?>" class="but jb-yellow padding-lg">
|
||||
<i class="fa fas fa-long-arrow-alt-left" aria-hidden="true"></i>
|
||||
<span class="ml10"><?php esc_html_e('返回文章', 'aksrt'); ?></span>
|
||||
<span class="ml10"><?php esc_html_e('返回文章', 'jio'); ?></span>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<div class="alert jb-red em12" style="margin:2em;">
|
||||
<b><?php echo esc_html(is_wp_error($gate) ? $gate->get_error_message() : __('暂无下载权限', 'aksrt')); ?></b>
|
||||
<b><?php echo esc_html(is_wp_error($gate) ? $gate->get_error_message() : __('暂无下载权限', 'jio')); ?></b>
|
||||
</div>
|
||||
<a style="margin-bottom:2em;" href="<?php echo esc_url($article_url); ?>" class="but jb-yellow padding-lg">
|
||||
<i class="fa fas fa-long-arrow-alt-left" aria-hidden="true"></i>
|
||||
<span class="ml10"><?php esc_html_e('返回文章', 'aksrt'); ?></span>
|
||||
<span class="ml10"><?php esc_html_e('返回文章', 'jio'); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user