diff --git a/assets/admin/src/api/modules/permissions.js b/assets/admin/src/api/modules/permissions.js
index b6b1fa19..1b6e47ed 100644
--- a/assets/admin/src/api/modules/permissions.js
+++ b/assets/admin/src/api/modules/permissions.js
@@ -10,7 +10,6 @@ export const permissionsApiMethods = {
savePermissionsLoginSettings(data) { return this.saveSchemaPage('permissions', 'login', data) },
getPermissionsModerationSettings() { return this.getSchemaPage('permissions', 'moderation') },
- savePermissionsModerationSettings(data) { return this.saveSchemaPage('permissions', 'moderation', data) },
getCapabilities() { return this.request('/permissions/capabilities') },
saveCapabilities(user_caps) { return this.request('/permissions/capabilities', { method: 'POST', body: JSON.stringify({ user_caps }) }) },
diff --git a/assets/admin/src/constants/sections/index.js b/assets/admin/src/constants/sections/index.js
index 6a0cd22f..ce969f51 100644
--- a/assets/admin/src/constants/sections/index.js
+++ b/assets/admin/src/constants/sections/index.js
@@ -15,7 +15,7 @@ const SECTION_DEFAULT_CHILDREN = {
'post-list': 'post-list-page',
permissions: 'permissions-comment',
users: 'users-auth',
- payment: 'payment-paid',
+ payment: 'payment-recharge',
extensions: 'extensions-ip',
tools: 'tools-import-export',
'theme-info': 'theme-info-dashboard',
diff --git a/assets/admin/src/constants/sections/payment.js b/assets/admin/src/constants/sections/payment.js
index 4bfe2222..9a3ff308 100644
--- a/assets/admin/src/constants/sections/payment.js
+++ b/assets/admin/src/constants/sections/payment.js
@@ -6,15 +6,6 @@ export const paymentSection = {
icon: renderFaIcon('fas fa-wallet'),
route: '/payment',
children: [
- customPage({
- key: 'payment-paid',
- name: 'PaymentPaid',
- label: '下载/付费内容中心',
- route: '/payment/paid',
- title: '下载/付费内容中心',
- desc: '资源下载门槛、付费内容策略和人工交付说明。',
- component: 'ResourceDownload',
- }),
schemaPage({
key: 'payment-recharge',
name: 'PaymentRecharge',
diff --git a/assets/admin/src/constants/sections/permissions.js b/assets/admin/src/constants/sections/permissions.js
index 1d198c39..6749c7fe 100644
--- a/assets/admin/src/constants/sections/permissions.js
+++ b/assets/admin/src/constants/sections/permissions.js
@@ -30,9 +30,9 @@ export const permissionsSection = {
schemaPage({
key: 'permissions-moderation',
name: 'PermissionsModeration',
- label: '内容审核',
+ label: '评论审核',
route: '/permissions/moderation',
- title: '内容审核',
+ title: '评论审核',
desc: '评论审核、反垃圾、限流与风控配置。',
canonicalDomain: 'permissions',
section: 'moderation',
diff --git a/assets/admin/src/pages/ResourceDownload.vue b/assets/admin/src/pages/ResourceDownload.vue
deleted file mode 100644
index fc26b6be..00000000
--- a/assets/admin/src/pages/ResourceDownload.vue
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
-
-
-
- 基本权限
- 收款接口
-
-
-
-
-
-
-
-
-
- 积分购买模式:{{ form.download_credit ? '已启用' : '已关闭' }}
-
-
- 默认积分价:{{ form.download_default_cost }} {{ currencyName }}
-
-
- 角色白名单免费:{{ form.payment_vip_free_download ? '已启用' : '未启用' }}
-
-
- Token TTL:10 分钟
-
-
-
-
-
-
-
-
-
-
- 开启后,文章 pay_modo=积分 可走收银台一次购买解锁;下载 token 不再按次扣积分。关闭时积分模式资源按免费/需登录策略处理。
-
-
-
-
-
-
- 仅作运营参考/兼容字段;实际价格以文章 _aksrt_pay 的积分价/现金价为准。角色白名单命中时免费下载。
-
-
-
-
-
-
-
-
-
-
-
- 逗号分隔,标记纳入统一付费策略的内容类型。
-
-
-
-
-
-
-
-
-
-
- 命中这些 WordPress role 的用户可免费下载(无需购买)。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 当前收款模式:{{ gatewayModeLabel }}。充值、VIP、返佣和分成页均已提供稳定结构,订单和结算台账直接衔接这些字段。
-
-
-
-
- 保存配置
-
-
-
-
-
-
diff --git a/assets/admin/src/pages/payment/PaymentGateway.vue b/assets/admin/src/pages/payment/PaymentGateway.vue
index 22768053..97b90542 100644
--- a/assets/admin/src/pages/payment/PaymentGateway.vue
+++ b/assets/admin/src/pages/payment/PaymentGateway.vue
@@ -7,7 +7,6 @@
:links="[
{ label: '余额充值', path: '/payment/recharge' },
{ label: '充值卡', path: '/payment/card-pass' },
- { label: '付费内容', path: '/payment/paid' },
]"
>
diff --git a/assets/admin/src/pages/permissions/AttachmentPermissions.vue b/assets/admin/src/pages/permissions/AttachmentPermissions.vue
index c0703126..fb5cc25d 100644
--- a/assets/admin/src/pages/permissions/AttachmentPermissions.vue
+++ b/assets/admin/src/pages/permissions/AttachmentPermissions.vue
@@ -70,28 +70,6 @@
-
-
-
-
-
-
-
- 命中高风险时会阻断上传,并保留上一次背景图。
-
-
-
-
-
-
- 投稿中插入的图片也会经过内容安全审核。
-
-
-
-
-
保存配置
@@ -112,15 +90,12 @@ const message = useMessage()
const loading = ref(true)
const saving = ref(false)
-const moderationSnapshot = ref({})
const form = reactive({
avatar_max_size: 2,
submit_image_max_size: 5,
comment_image_max_size: 2,
resource_max_size: 50,
- ai_moderate_background: true,
- ai_moderate_submit: false,
})
const summaryItems = computed(() => [
@@ -139,24 +114,15 @@ function goModeration() { router.push('/permissions/moderation') }
async function load() {
loading.value = true
try {
- const [permissionRes, moderationRes] = await Promise.all([
- api.getPermissionsAttachmentSettings(),
- api.getPermissionsModerationSettings(),
- ])
+ const permissionRes = await api.getPermissionsAttachmentSettings()
const permission = permissionRes?.data ?? permissionRes ?? {}
- const moderation = moderationRes?.data ?? moderationRes ?? {}
// Map permission fields
form.avatar_max_size = Number(permission.avatar_max_size || 2)
form.submit_image_max_size = Number(permission.submit_image_max_size || 5)
form.comment_image_max_size = Number(permission.comment_image_max_size || 2)
form.resource_max_size = Number(permission.resource_max_size || 50)
-
- form.ai_moderate_background = moderation.ai_moderate_background !== false
- form.ai_moderate_submit = !!moderation.ai_moderate_submit
-
- moderationSnapshot.value = { ...moderation }
} catch (error) {
message.error(error.message || '加载附件权限失败')
} finally {
@@ -167,24 +133,12 @@ async function load() {
async function handleSave() {
saving.value = true
try {
- await Promise.all([
- api.savePermissionsAttachmentSettings({
- avatar_max_size: form.avatar_max_size,
- submit_image_max_size: form.submit_image_max_size,
- comment_image_max_size: form.comment_image_max_size,
- resource_max_size: form.resource_max_size,
- }),
- api.savePermissionsModerationSettings({
- ...moderationSnapshot.value,
- ai_moderate_background: form.ai_moderate_background,
- ai_moderate_submit: form.ai_moderate_submit,
- }),
- ])
- moderationSnapshot.value = {
- ...moderationSnapshot.value,
- ai_moderate_background: form.ai_moderate_background,
- ai_moderate_submit: form.ai_moderate_submit,
- }
+ await api.savePermissionsAttachmentSettings({
+ avatar_max_size: form.avatar_max_size,
+ submit_image_max_size: form.submit_image_max_size,
+ comment_image_max_size: form.comment_image_max_size,
+ resource_max_size: form.resource_max_size,
+ })
message.success('附件治理配置已保存')
} catch (error) {
message.error(error.message || '保存失败')
diff --git a/assets/admin/src/router/component-loaders/core.js b/assets/admin/src/router/component-loaders/core.js
index 8ab0a3a7..2b4079d5 100644
--- a/assets/admin/src/router/component-loaders/core.js
+++ b/assets/admin/src/router/component-loaders/core.js
@@ -13,7 +13,6 @@ export const corePageLoaders = {
PermissionsCapabilities: () => import('@/pages/permissions/PermissionsCapabilities.vue'),
AttachmentPermissions: () => import('@/pages/permissions/AttachmentPermissions.vue'),
CmsCredits: () => import('@/pages/CmsCredits.vue'),
- ResourceDownload: () => import('@/pages/ResourceDownload.vue'),
ThemeInfoPage: () => import('@/pages/theme/ThemeInfoPage.vue'),
ThemeAuthorizationPage: () => import('@/pages/theme/ThemeAuthorizationPage.vue'),
DocsPage: () => import('@/pages/docs/DocsPage.vue'),
diff --git a/assets/admin/src/schema/sections/payment/index.js b/assets/admin/src/schema/sections/payment/index.js
index c8aa0eaf..d16780ab 100644
--- a/assets/admin/src/schema/sections/payment/index.js
+++ b/assets/admin/src/schema/sections/payment/index.js
@@ -2,7 +2,6 @@
* Payment & Paid domain schemas.
*/
-import { paidSchema } from './paid.js'
import { rechargeSchema } from './recharge.js'
import { vipSchema } from './vip.js'
import { revenueSchema } from './revenue.js'
@@ -13,7 +12,6 @@ import { cardPassSchema } from './cardPass.js'
import { withdrawalSchema } from './withdrawal.js'
export const paymentSchemas = {
- paid: paidSchema,
recharge: rechargeSchema,
vip: vipSchema,
revenue: revenueSchema,
diff --git a/assets/admin/src/schema/sections/payment/paid.js b/assets/admin/src/schema/sections/payment/paid.js
deleted file mode 100644
index f33ebe38..00000000
--- a/assets/admin/src/schema/sections/payment/paid.js
+++ /dev/null
@@ -1,85 +0,0 @@
-export const paidSchema = {
- key: 'payment.paid',
- title: '下载/付费内容中心',
- icon: 'fas fa-download',
- description: '统一管理资源下载、付费内容、角色免扣和人工交付说明。',
- defaults: {
- payment_paid_post_types: 'post',
- payment_vip_free_download: false,
- payment_vip_exempt_roles: '',
- payment_paid_catalog_note: '',
- payment_manual_delivery_note: '付费或人工确认内容请在订单备注中记录交付方式。',
- pay_mark: '付费',
- payment_currency_symbol: '¥',
- pay_show_user: true,
- pay_show_paycount: true,
- pay_box_position: 'top',
- payment_download_enable: false,
- payment_down_alone_page: false,
- payment_download_remote_s: true,
- payment_download_verify_nonce: true,
- payment_download_user_log: 50,
- payment_download_post_log: 50,
- payment_download_remote_size: 2048,
- payment_download_remote_ext: 'zip,rar,7z',
- coupon_post_s: false,
- coupon_desc: '',
- },
- groups: [
- {
- key: 'strategy',
- title: '付费内容策略',
- icon: 'fas fa-layer-group',
- fields: [
- { key: 'payment_paid_post_types', label: '受管内容类型', type: 'input', default: 'post', help: '逗号分隔,例如 post,course,doc' },
- { key: 'payment_vip_free_download', label: '角色白名单免扣下载', type: 'switch', default: false },
- { key: 'payment_vip_exempt_roles', label: '免扣角色列表', type: 'input', default: '', help: '逗号分隔的 WordPress role slug,例如 administrator,editor,vip' },
- ],
- },
- {
- key: 'delivery',
- title: '交付说明',
- icon: 'fas fa-receipt',
- fields: [
- { key: 'payment_paid_catalog_note', label: '前台付费提示', type: 'textarea', default: '', help: '显示在资源/付费内容页的运营说明。' },
- { key: 'payment_manual_delivery_note', label: '人工交付备注', type: 'textarea', default: '付费或人工确认内容请在订单备注中记录交付方式。', help: '人工确认或离线交付流程的标准说明。' },
- ],
- },
- {
- key: 'display',
- title: '展示设置',
- icon: 'fas fa-eye',
- fields: [
- { key: 'pay_mark', label: '付费标记', type: 'input', default: '付费' },
- { key: 'payment_currency_symbol', label: '货币符号', type: 'input', default: '¥', help: '商品价格前缀,如 ¥、$、¥' },
- { key: 'pay_show_user', label: '显示购买用户', type: 'switch', default: true },
- { key: 'pay_show_paycount', label: '显示购买次数', type: 'switch', default: true },
- { key: 'pay_box_position', label: '付费框位置', type: 'radio', default: 'top', options: [{ label: '文章框顶部(封面后)', value: 'box_top' }, { label: '正文顶部', value: 'top' }, { label: '正文底部', value: 'bottom' }, { label: '文章框底部(相关前)', value: 'box_bottom' }] },
- ],
- },
- {
- key: 'download',
- title: '下载设置',
- icon: 'fas fa-cloud-download-alt',
- fields: [
- { key: 'payment_download_enable', label: '启用下载功能', type: 'switch', default: false },
- { key: 'payment_down_alone_page', label: '独立下载页面', type: 'switch', default: false, help: '开启后,已获权限的下载入口跳转到独立下载页(模板:单篇资源下载),而不是在正文内联显示全部下载按钮。', dependsOn: { key: 'payment_download_enable', value: true } },
- { key: 'payment_download_remote_s', label: '远程文件下载', type: 'switch', default: true, dependsOn: { key: 'payment_download_enable', value: true } },
- { key: 'payment_download_verify_nonce', label: '下载鉴权', type: 'switch', default: true, dependsOn: { key: 'payment_download_enable', value: true } },
- { key: 'payment_download_user_log', label: '用户下载记录条数', type: 'number', default: 50, min: 0, max: 9999, help: '0 为不保存', dependsOn: { key: 'payment_download_enable', value: true } },
- { key: 'payment_download_post_log', label: '文章下载记录条数', type: 'number', default: 50, min: 0, max: 9999, help: '0 为不保存', dependsOn: { key: 'payment_download_enable', value: true } },
- { key: 'payment_download_remote_size', label: '远程文件大小限制(KB)', type: 'number', default: 2048, min: 1, max: 999999, dependsOn: { key: 'payment_download_remote_s', value: true } },
- { key: 'payment_download_remote_ext', label: '远程文件格式限制', type: 'input', default: 'zip,rar,7z', help: '逗号分隔扩展名', dependsOn: { key: 'payment_download_remote_s', value: true } },
- ],
- },
- {
- key: 'coupon',
- title: '内容优惠码',
- icon: 'fas fa-ticket-alt',
- fields: [
- { key: 'coupon_post_s', label: '全站内容允许优惠码', type: 'switch', default: false, help: '开启后所有付费内容收银台可用优惠码;关闭时仅单篇勾选「允许优惠码」的文章可用。' },
- { key: 'coupon_desc', label: '优惠码说明', type: 'textarea', default: '', dependsOn: { key: 'coupon_post_s', value: true }, help: '展示在内容收银台优惠码输入框下方。' },
- ],
- },
- ],
-}
diff --git a/assets/admin/src/schema/sections/permissions/index.js b/assets/admin/src/schema/sections/permissions/index.js
index 9494f45e..cf3d7e9a 100644
--- a/assets/admin/src/schema/sections/permissions/index.js
+++ b/assets/admin/src/schema/sections/permissions/index.js
@@ -120,7 +120,7 @@ export const permissionsSchemas = {
*/
moderation: {
key: 'permissions.moderation',
- title: '内容审核',
+ title: '评论审核',
icon: 'fas fa-gavel',
description: '管理评论审核、反垃圾、限流与拦截配置。',
defaults: {
diff --git a/src/Admin/GlobalController.php b/src/Admin/GlobalController.php
index c55ec940..a235736f 100644
--- a/src/Admin/GlobalController.php
+++ b/src/Admin/GlobalController.php
@@ -182,7 +182,6 @@ class GlobalController extends ControllerBase {
$params = $this->get_json_params($request);
$allowed = [
'resource_cpt_enabled' => 'bool',
- 'download_credit' => 'bool',
'search_include_resource' => 'bool',
];
$sanitized = $this->sanitize_fields($params, $allowed);
diff --git a/src/Admin/Schema/SchemaPayment.php b/src/Admin/Schema/SchemaPayment.php
index 9b137a4b..fe2e34af 100644
--- a/src/Admin/Schema/SchemaPayment.php
+++ b/src/Admin/Schema/SchemaPayment.php
@@ -14,49 +14,6 @@ class SchemaPayment {
'domain' => 'payment',
'title' => '支付&付费',
'sections' => [
- 'paid' => [
- 'key' => 'paid',
- 'title' => '内容付费 / 下载',
- 'version' => '1.0.0',
- 'option_key' => 'aksrt_settings',
- 'groups' => [
- ['key' => 'strategy', 'title' => '内容付费策略', 'fields' => [
- ['key' => 'payment_paid_post_types', 'label' => '受管内容类型', 'type' => 'input', 'default' => 'post'],
- ['key' => 'payment_vip_free_download', 'label' => 'VIP / 角色白名单免扣下载', 'type' => 'switch', 'default' => false],
- ['key' => 'payment_vip_exempt_roles', 'label' => '免扣角色列表', 'type' => 'input', 'default' => ''],
- ]],
- ['key' => 'delivery', 'title' => '交付说明', 'fields' => [
- ['key' => 'payment_paid_catalog_note', 'label' => '前台付费提示', 'type' => 'textarea', 'default' => ''],
- ['key' => 'payment_manual_delivery_note', 'label' => '人工交付备注', 'type' => 'textarea', 'default' => ''],
- ]],
- ['key' => 'display', 'title' => '展示设置', 'fields' => [
- ['key' => 'pay_mark', 'label' => '付费标记', 'type' => 'input', 'default' => '付费'],
- ['key' => 'payment_currency_symbol', 'label' => '货币符号', 'type' => 'input', 'default' => '¥'],
- ['key' => 'pay_show_user', 'label' => '显示购买用户', 'type' => 'switch', 'default' => true],
- ['key' => 'pay_show_paycount', 'label' => '显示购买次数', 'type' => 'switch', 'default' => true],
- ['key' => 'pay_box_position', 'label' => '付费框位置', 'type' => 'radio', 'default' => 'top', 'options' => [
- ['label' => '文章框顶部', 'value' => 'box_top'],
- ['label' => '正文顶部', 'value' => 'top'],
- ['label' => '正文底部', 'value' => 'bottom'],
- ['label' => '文章框底部', 'value' => 'box_bottom'],
- ]],
- ]],
- ['key' => 'download', 'title' => '下载能力', 'fields' => [
- ['key' => 'payment_download_enable', 'label' => '启用下载能力', 'type' => 'switch', 'default' => false],
- ['key' => 'payment_down_alone_page', 'label' => '独立下载页面', 'type' => 'switch', 'default' => false],
- ['key' => 'payment_download_remote_s', 'label' => '远程文件下载', 'type' => 'switch', 'default' => true],
- ['key' => 'payment_download_verify_nonce', 'label' => '下载鉴权', 'type' => 'switch', 'default' => true],
- ['key' => 'payment_download_user_log', 'label' => '用户下载记录条数', 'type' => 'number', 'default' => 50, 'min' => 0, 'max' => 9999],
- ['key' => 'payment_download_post_log', 'label' => '内容下载记录条数', 'type' => 'number', 'default' => 50, 'min' => 0, 'max' => 9999],
- ['key' => 'payment_download_remote_size', 'label' => '远程文件大小限制(KB)', 'type' => 'number', 'default' => 2048, 'min' => 1, 'max' => 999999],
- ['key' => 'payment_download_remote_ext', 'label' => '远程文件格式限制', 'type' => 'input', 'default' => 'zip,rar,7z'],
- ]],
- ['key' => 'coupon', 'title' => '内容优惠码', 'fields' => [
- ['key' => 'coupon_post_s', 'label' => '全站内容允许优惠码', 'type' => 'switch', 'default' => false],
- ['key' => 'coupon_desc', 'label' => '优惠码说明', 'type' => 'textarea', 'default' => '', 'dependsOn' => ['key' => 'coupon_post_s', 'value' => true]],
- ]],
- ],
- ],
'recharge' => [
'key' => 'recharge',
'title' => '余额充值',
diff --git a/src/Admin/Schema/SchemaPermissions.php b/src/Admin/Schema/SchemaPermissions.php
index cc6f8011..c8b929b0 100644
--- a/src/Admin/Schema/SchemaPermissions.php
+++ b/src/Admin/Schema/SchemaPermissions.php
@@ -74,7 +74,7 @@ class SchemaPermissions {
],
'moderation' => [
'key' => 'moderation',
- 'title' => '内容审核',
+ 'title' => '评论审核',
'version' => '1.0.0',
'option_key' => 'aksrt_moderation_config',
'groups' => [
diff --git a/src/Settings/HomeCms.php b/src/Settings/HomeCms.php
index 5ee454d9..2e18ae6c 100644
--- a/src/Settings/HomeCms.php
+++ b/src/Settings/HomeCms.php
@@ -137,7 +137,6 @@ class HomeCms {
public static function get_cms_features(): array {
$defaults = [
'resource_cpt_enabled' => true,
- 'download_credit' => true,
'search_include_resource' => true,
];
$s = Settings::get_all();
diff --git a/src/Settings/PaymentRuntime.php b/src/Settings/PaymentRuntime.php
index a7f75f06..ff926dac 100644
--- a/src/Settings/PaymentRuntime.php
+++ b/src/Settings/PaymentRuntime.php
@@ -16,9 +16,6 @@ class PaymentRuntime {
*/
public static function get_paid_content_settings(): array {
$settings = Settings::get_all();
- $features = HomeCms::get_cms_features();
- $catalog_note = trim((string) ($settings['payment_paid_catalog_note'] ?? ''));
- $manual_note = trim((string) ($settings['payment_manual_delivery_note'] ?? ''));
$box_position = sanitize_key((string) ($settings['pay_box_position'] ?? 'top'));
// Zibll: box_top | top | bottom | box_bottom
@@ -27,35 +24,37 @@ class PaymentRuntime {
}
return [
- 'download_credit' => !empty($features['download_credit']) && Settings::credits_enabled(),
+ // 下载门槛永远支持积分购买模式(不再由页面开关控制)。
+ 'download_credit' => Settings::credits_enabled(),
'default_cost' => Settings::download_default_cost(),
- 'paid_post_types' => self::parse_slug_list((string) ($settings['payment_paid_post_types'] ?? 'post'), ['post']),
- 'vip_free_download' => !empty($settings['payment_vip_free_download']),
- 'vip_exempt_roles' => self::parse_slug_list((string) ($settings['payment_vip_exempt_roles'] ?? '')),
- 'catalog_note' => $catalog_note,
- 'manual_delivery_note' => $manual_note !== '' ? $manual_note : __('付费或人工确认内容请在订单备注中记录交付方式。', 'aksrt'),
+ // 付费内容仅文章。
+ 'paid_post_types' => ['post'],
+ 'vip_free_download' => false,
+ 'vip_exempt_roles' => [],
+ 'catalog_note' => '',
+ 'manual_delivery_note' => __('付费或人工确认内容请在订单备注中记录交付方式。', 'aksrt'),
'no_logged_in' => !isset($settings['pay_no_logged_in']) || !empty($settings['pay_no_logged_in']),
- 'down_alone_page' => !empty($settings['payment_down_alone_page']),
+ 'down_alone_page' => false,
'display' => [
'mark' => sanitize_text_field((string) ($settings['pay_mark'] ?? '付费')),
- 'currency_symbol' => sanitize_text_field((string) ($settings['payment_currency_symbol'] ?? '¥')),
+ 'currency_symbol' => '¥',
'show_user' => !isset($settings['pay_show_user']) || !empty($settings['pay_show_user']),
'show_paycount' => !isset($settings['pay_show_paycount']) || !empty($settings['pay_show_paycount']),
'box_position' => $box_position,
],
'download' => [
- 'enabled' => !empty($settings['payment_download_enable']),
- 'remote' => !isset($settings['payment_download_remote_s']) || !empty($settings['payment_download_remote_s']),
- 'verify_nonce' => !isset($settings['payment_download_verify_nonce']) || !empty($settings['payment_download_verify_nonce']),
- 'user_log' => max(0, min(9999, (int) ($settings['payment_download_user_log'] ?? 50))),
- 'post_log' => max(0, min(9999, (int) ($settings['payment_download_post_log'] ?? 50))),
- 'remote_size' => max(1, (int) ($settings['payment_download_remote_size'] ?? 2048)),
- 'remote_ext' => sanitize_text_field((string) ($settings['payment_download_remote_ext'] ?? 'zip,rar,7z')),
- 'alone_page' => !empty($settings['payment_down_alone_page']),
+ 'enabled' => true,
+ 'remote' => true,
+ 'verify_nonce' => true,
+ 'user_log' => 50,
+ 'post_log' => 50,
+ 'remote_size' => 2048,
+ 'remote_ext' => 'zip,rar,7z',
+ 'alone_page' => false,
],
- // Content cashier coupon (zibll coupon_post_s / coupon_desc).
- 'coupon_post_s' => !empty($settings['coupon_post_s']),
- 'coupon_desc' => sanitize_textarea_field((string) ($settings['coupon_desc'] ?? '')),
+ // 内容收银台优惠码:不再提供全局开关,默认关闭。
+ 'coupon_post_s' => false,
+ 'coupon_desc' => '',
];
}
@@ -495,22 +494,6 @@ class PaymentRuntime {
return true;
}
- /**
- * @param string[] $fallback
- * @return string[]
- */
- private static function parse_slug_list(string $raw, array $fallback = []): array {
- $items = preg_split('/[\s,]+/', $raw, -1, PREG_SPLIT_NO_EMPTY);
- $normalized = [];
- foreach ((array) $items as $item) {
- $slug = sanitize_key((string) $item);
- if ($slug !== '' && !in_array($slug, $normalized, true)) {
- $normalized[] = $slug;
- }
- }
- return !empty($normalized) ? $normalized : $fallback;
- }
-
private static function count_structured_lines(string $raw): int {
$lines = preg_split('/[\r\n]+/', $raw, -1, PREG_SPLIT_NO_EMPTY);
$count = 0;