定制 pixelopen/sulu-plausiblebundle 二次开发

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

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

pixelopen/sulu-plausiblebundle

Composer 安装命令:

composer require pixelopen/sulu-plausiblebundle

包简介

This bundle allows you to integrate Plausible analytics statistics into the Sulu administration interface via an embedded iframe.

README 文档

README

Plausible Bundle for Sulu

This bundle allows you to integrate Plausible analytics statistics into the Sulu administration interface via an embedded iframe.

Minimum PHP Version Minimum Sulu Version GitHub release Quality Gate Status

screenshot.png

❤️ Features

  • ✅ Display Plausible statistics in Sulu admin
  • ✅ Configuration via environment variables
  • ✅ Support for custom Plausible instances
  • ✅ Interface integrated with Sulu design
  • ✅ Responsive and optimized for administration
  • ✅ Multilingual support (English/French)
  • ✅ Translation system using Sulu standards

🚀 Installation

  1. Install the bundle with composer
composer require pixelopen/sulu-plausiblebundle
  1. Create the file plausible.yaml in the config/packages folder
plausible:
  domain: '%env(PLAUSIBLE_DOMAIN)%'
  base_url: '%env(default:plausible_default_url:PLAUSIBLE_BASE_URL)%'
  auth_key: '%env(PLAUSIBLE_AUTH_KEY)%'

parameters:
  plausible_default_url: 'https://plausible.io'
  1. Configure the environment variables in your .env file:
# Plausible Configuration
PLAUSIBLE_DOMAIN=your-domain.com
PLAUSIBLE_BASE_URL=https://plausible.io
PLAUSIBLE_AUTH_KEY=your-auth-key
  1. Add the plausible.js file to the assets/admin folder located in the vendor/pixelopen/sulu-plausiblebundle/src/Resources/js/plausible.js folder.
  2. Add plausible script on app.js to the asset/admin folder :
import './plausible';
  1. Install all npm dependencies and build the admin UI (see all options):
cd assets/admin
npm install
npm run build

⚙️ Configuration

Environment Variables

  • PLAUSIBLE_DOMAIN: The domain configured in Plausible (required)
  • PLAUSIBLE_BASE_URL: The base URL of your Plausible instance (default: https://plausible.io)
  • PLAUSIBLE_AUTH_KEY: Authentication key for shared links (optional but recommended)

Advanced Configuration

You can customize the configuration in config/packages/plausible.yaml:

plausible:
    domain: 'my-site.com'
    base_url: 'https://analytics.my-domain.com'
    auth_key: '%env(PLAUSIBLE_AUTH_KEY)%'

📖 Usage

  1. Log in to the Sulu administration
  2. Add permission from User roles
  3. Click on "Statistics" in the navigation menu
  4. Statistics are displayed in an integrated iframe

✅ Requirements

  • Sulu CMS ^2.6
  • PHP ^8.2
  • A Plausible account with a configured domain
  • Public sharing enabled in Plausible for your site

🏳️ Translations

The bundle includes full translation support:

Supported Languages

  • English (admin.en.json)
  • French (admin.fr.json)

Translation Keys

  • plausible.statistics - Main navigation title
  • plausible.configuration_missing - Error message for missing config
  • plausible.domain_not_configured - Domain configuration error
  • plausible.check_env_variable - Environment variable check message
  • plausible.domain - Domain label
  • plausible.statistics_for - Iframe title with domain interpolation

Adding New Languages

To add support for additional languages, create new translation files:

src/Resources/translations/admin.{locale}.json

📝 Notes

  • Ensure that public sharing is enabled in your Plausible settings
  • The iframe uses the parameters: embed=true&theme=light&background=transparent
  • The bundle automatically integrates into the administration navigation
  • All user-facing text uses Sulu's translation system for internationalization support

pixelopen/sulu-plausiblebundle 适用场景与选型建议

pixelopen/sulu-plausiblebundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 120 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 pixelopen/sulu-plausiblebundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 120
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 27
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-28