justinholtweb/craft-controltower 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

justinholtweb/craft-controltower

Composer 安装命令:

composer require justinholtweb/craft-controltower

包简介

Live operational monitoring dashboard for Craft CMS — site activity, editor tracking, content health, queue watch, and system metrics at a glance.

README 文档

README

Live operational monitoring dashboard for Craft CMS 5. Know what's happening on your site right now and what needs attention.

Features

  • Live Traffic — Active visitors, requests per minute, top URLs, bot vs human breakdown
  • Editor Tracking — Who's logged in, what they're editing, collision warnings when two editors work on the same entry
  • Content Health — Entries by section, stale content detection, scheduled/expired entries, drafts awaiting attention, asset volume summaries
  • Queue Watch — Waiting/running/failed jobs, common failure patterns, queue health status
  • System Pulse — CPU, memory, disk, load average, DB response time, PHP info, uptime
  • Alerts — Automatic warnings for queue failures, editor collisions, server resource spikes
  • Dashboard Widget — Configurable at-a-glance summary card with auto-refresh
  • Full CP Section — Seven-tab deep dive (Overview, Live Traffic, Editors, Content Health, Queue Watch, System Pulse, Alerts)

Requirements

  • Craft CMS 5.0 or later
  • PHP 8.2 or later

Installation

With Composer

# If developing locally, add as a path repository first:
composer config repositories.control-tower path /path/to/craft-controltower

composer require justinholtweb/craft-controltower
php craft plugin/install control-tower

Manual

  1. Copy the plugin to your project
  2. Add the path repository to your composer.json:
    "repositories": [
        { "type": "path", "url": "./plugins/control-tower" }
    ]
  3. Run composer require justinholtweb/craft-controltower
  4. Install via the CLI (php craft plugin/install control-tower) or through the CP under Settings > Plugins

Configuration

After installation, visit Control Tower > Settings in the control panel to configure:

Tracking

Setting Default Description
Track Visitors On Enable front-end visitor tracking via request logging
Track Editors On Track CP user activity and element editing
Track Server Metrics On Periodically sample CPU, memory, disk, and DB metrics
Collision Detection On Alert when multiple editors work on the same content

Refresh & Timeouts

Setting Default Description
Refresh Interval 30s How often the dashboard auto-refreshes
Visitor Timeout 2 min Minutes before a visitor is considered inactive
Editor Timeout 5 min Minutes before an editor session is considered inactive

Data Retention

Setting Default Description
Visitor Data 30 days
Editor Data 90 days
Content Events 90 days
Metric Samples 30 days
Alert History 90 days

Alert Thresholds

Setting Default Description
Queue Failure Threshold 3 Failed jobs before triggering an alert
5xx Error Rate 10/min Errors per minute before alert
404 Spike 50/min 404s per minute before alert
Stale Content 90 days Days without update before flagging

Scheduled Jobs

Control Tower includes three queue jobs that should be run on a schedule via cron:

# Collect server metrics (every 1-2 minutes)
php craft queue/push justinholtweb\\controltower\\jobs\\CollectMetricsJob

# Run alert checks (every 5 minutes)
php craft queue/push justinholtweb\\controltower\\jobs\\RunAlertChecksJob

# Data retention cleanup (daily)
php craft queue/push justinholtweb\\controltower\\jobs\\CleanupJob

Or push them programmatically:

use justinholtweb\controltower\jobs\CollectMetricsJob;
use justinholtweb\controltower\jobs\RunAlertChecksJob;
use justinholtweb\controltower\jobs\CleanupJob;

Craft::$app->getQueue()->push(new CollectMetricsJob());
Craft::$app->getQueue()->push(new RunAlertChecksJob());
Craft::$app->getQueue()->push(new CleanupJob());

Dashboard Widget

Add the Control Tower widget to any user's dashboard. The widget is configurable:

  • Toggle visibility for each panel (visitors, editors, queue, server, alerts, content, top URLs)
  • Set a custom refresh interval
  • Resize to any column span

The widget links to the full CP section for deeper investigation.

Architecture

Plugin.php              → Event wiring, CP nav, settings
controllers/
  DashboardController   → 8 CP page actions
  ApiController         → 8 JSON endpoints for live polling
services/
  VisitorTrackingService   → Session-hash tracking, bot detection
  EditorTrackingService    → CP route parsing, collision detection
  ContentHealthService     → Stale/scheduled/expired content, pipeline
  QueueMonitorService      → Queue health, failed jobs
  MetricsCollectorService  → CPU/memory/disk/DB, cross-platform
  AlertService             → Alert lifecycle, automated checks
records/                → ActiveRecord models (6 tables)
migrations/Install.php → Database schema
jobs/                   → CleanupJob, CollectMetricsJob, RunAlertChecksJob
widgets/                → Dashboard widget
assets/                 → CSS + JS with auto-refresh polling
templates/              → CP section (7 tabs) + widget

Privacy

  • Visitor IP addresses are stored as SHA-256 hashes, never in plain text
  • User agents are hashed for bot detection grouping
  • Session identity uses a daily-rotating hash of IP + user agent
  • All tracking data is automatically purged based on retention settings
  • Visitor tracking can be fully disabled in settings

Roadmap

v1.5 — Trend charts (15m / 1h / 24h / 7d), per-section content health, 404 and error rate trends, configurable alert thresholds

v2 — Slack/email alert notifications, deployment awareness (git SHA, last deploy, environment), cache metrics, database slow query panel, multi-site comparisons

License

See LICENSE.md.

justinholtweb/craft-controltower 适用场景与选型建议

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

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

围绕 justinholtweb/craft-controltower 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-05-02