acrossai-co/addons-page
Composer 安装命令:
composer require acrossai-co/addons-page
包简介
Reusable WordPress Add-ons page with free and paid add-ons support via Freemius.
README 文档
README
A reusable Composer package that adds a fully working Add-ons page inside WP Admin for any WordPress plugin.
Requirements
- PHP 8.1+
- WordPress 6.0+
automattic/jetpack-autoloader: ^5.0in your plugin'scomposer.json
Installation
composer require acrossai-co/addons-page
Load the autoloader in your plugin (jetpack-autoloader generates vendor/autoload_packages.php):
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload_packages.php';
Integration
Register a free product in your Freemius dashboard (WordPress Plugin, Analytics only, free plan ON) and grab its Product ID and Public Key.
Then call the constructor anywhere after your plugin's admin menu is registered (e.g. inside a plugins_loaded callback or define_admin_hooks()):
new \AcrossAI_Addon\AddonsPage( 'your-plugin-menu-slug', // parent menu slug registered with add_menu_page() __FILE__, // your plugin's main file [ 'fs_product_id' => '12345', // your Freemius product ID 'fs_public_key' => 'pk_abc123', // your Freemius public key 'fs_slug' => 'your-plugin', // optional — defaults to menu slug ] );
Each plugin gets its own Freemius product so activations and analytics are tracked separately per plugin in your dashboard.
The package handles:
- Registering the Add-ons submenu under your parent menu slug
- Rendering the add-ons grid (free + paid)
- Installing free add-ons silently (WordPress.org API or GitHub ZIP)
- Paid add-on checkout via Freemius JS popup
- Opt-in / "Login & Connect" flow
- Shared opt-in: if the user opted in via another plugin using this package, the banner is already hidden
Upgrading jetpack-autoloader from v3
If your plugin currently has "automattic/jetpack-autoloader": "^3.0", bump it to ^5.0:
"automattic/jetpack-autoloader": "^5.0"
Then run:
composer update automattic/jetpack-autoloader
Your existing vendor/autoload_packages.php bootstrap call continues to work unchanged.
See docs/upgrade-notes.md for the full migration guide.
readme.txt sections (for wordpress.org submissions)
Copy the blocks from docs/readme-template.txt into your plugin's readme.txt.
These sections are required by wordpress.org:
== Installation ==== External Services ==== Privacy Policy ==
Known limitations
- Multisite: not tested or supported in v1. Works on per-site dashboards but network-activated behaviour is undefined.
- Uninstall edge case: if you have two plugins using this package and one is uninstalled (not just deactivated) while the other is active, Freemius may clear shared opt-in state. Recovery: the user clicks "Login / Connect" on the remaining plugin's Add-ons page.
- Non-plugin contexts: instantiating outside a WordPress plugin (theme, mu-plugin, CLI) throws
\RuntimeException.
License
GPL-2.0-or-later — see LICENSE.txt.
acrossai-co/addons-page 适用场景与选型建议
acrossai-co/addons-page 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 274 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 06 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 acrossai-co/addons-page 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 acrossai-co/addons-page 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 274
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 51
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-06-11