定制 millipress/millibase 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

millipress/millibase

Composer 安装命令:

composer require millipress/millibase

包简介

Declarative WordPress settings framework. Define your settings page in PHP arrays — sections, fields, tabs, validation — and get a React UI automatically.

README 文档

README

Declarative WordPress settings framework. Define your settings page in PHP arrays — tabs, sections, fields, validation — and get a React-powered admin UI automatically.

Requirements

Requirement Version
PHP >= 7.4
WordPress >= 6.0

Quick Start

⚠ Plugin authors: prefix MilliBase before shipping. If you bundle MilliBase inside a distributed plugin, you must vendor-prefix it with Strauss or php-scoper. Two plugins shipping the unprefixed MilliBase\ namespace will collide at runtime — only one copy will load, and the other plugin runs against a version it wasn't tested with. See Namespace Prefixing for setup and the rationale behind MilliBase's cross-prefix-tolerant typing.

composer require millipress/millibase
use MilliBase\Manager;

$manager = new Manager(
    slug: 'my-plugin',
    config: fn() => [
        'page_title' => __( 'My Plugin', 'my-plugin' ),
        'menu_title' => __( 'My Plugin', 'my-plugin' ),
        'header'     => [ 'title' => __( 'My Plugin Settings', 'my-plugin' ) ],
        'tabs'       => [
            [
                'name'     => 'general',
                'title'    => __( 'General', 'my-plugin' ),
                'sections' => [
                    [
                        'id'     => 'main',
                        'title'  => __( 'Main Settings', 'my-plugin' ),
                        'fields' => [
                            [
                                'key'     => 'general.enabled',
                                'type'    => 'toggle',
                                'label'   => __( 'Enable Feature', 'my-plugin' ),
                                'default' => true,
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
);

// Programmatic access:
$manager->settings()->get('general.enabled'); // true

Features

  • Declarative schema — define tabs, sections, and fields in PHP arrays
  • React admin UI — auto-generated from the schema using @wordpress/components
  • 9 built-in field types — text, number, password, toggle, select, unit, token-list, color, code
  • Custom extensibility — register custom field types and custom tab components from JS
  • Provided components — reusable React UI on window.MilliBase.components (InfoPopover, LabelWithTooltip) for custom tabs
  • Conditional display — show/hide fields based on other settings values
  • Settings priority — constants > config file > database > defaults
  • Encryption — automatic sodium encryption for sensitive fields (keys prefixed with enc_)
  • Config file sync — write settings to PHP files for pre-WordPress access (blog-aware per-operation; _network-<id>.php mirror for network-mode)
  • Network mode'network' => true routes storage to wp_sitemeta and the admin page to Network Admin
  • Migrations — declarative name@version one-shot runner with per-scope state (site / network)
  • Backup & restore — transient-based backup with 12-hour expiry
  • Import / export — settings serialization with encryption handling
  • Tab overrides — add-on plugins can extend or replace tabs and sections via filters
  • REST API — namespaced GET/POST /{namespace}/v1/settings + custom action endpoints
  • WP-CLI — auto-registered wp <slug> config commands; two Managers sharing a cli.slug auto-merge into one tree

Documentation

Full documentation is in the docs/ directory:

License

GPL-2.0-or-later

millipress/millibase 适用场景与选型建议

millipress/millibase 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.96k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 millipress/millibase 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 millipress/millibase 我们能提供哪些服务?
定制开发 / 二次开发

基于 millipress/millibase 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 36
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-03-06