Files
wp-prometheus/CHANGELOG.md

270 lines
10 KiB
Markdown
Raw Normal View History

# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.7] - 2026-02-03
### Added
- Database query duration distribution panel in Grafana Runtime dashboard
- `wordpress_db_query_duration_seconds` metric now listed in Help tab
- Documentation for enabling `SAVEQUERIES` constant for query timing
### Changed
- Updated README with instructions for enabling database query timing
- Grafana Runtime dashboard now includes bucket distribution chart for DB queries
## [0.4.6] - 2026-02-03
### Added
- Dashboard extension hook `wp_prometheus_register_dashboards` for third-party plugins
- Third-party plugins can now register their own Grafana dashboard templates
- Support for file-based and inline JSON dashboard registration
- "Extension" badge for third-party dashboards in admin UI
- Plugin attribution display for third-party dashboards
- Security: Path traversal protection for registered dashboard files
- Isolated mode support for dashboard registration hook
### Changed
- DashboardProvider now supports both built-in and third-party registered dashboards
- Dashboard cards show source (built-in vs extension) with visual distinction
## [0.4.5] - 2026-02-02
### Fixed
- Settings now persist correctly across Metrics sub-tabs
- Auth token no longer gets cleared when saving from Selection sub-tab
- Enabled metrics no longer get cleared when saving from Endpoint sub-tab
- Isolated mode setting no longer gets cleared when saving from other sub-tabs
### Changed
- Split Metrics settings into separate WordPress option groups per sub-tab
- Each sub-tab now uses its own settings group to prevent cross-tab overwrites
## [0.4.4] - 2026-02-02
### Added
- Safe mode for metrics collection (default):
- Removes problematic content filters early
- Allows third-party plugins to register `wp_prometheus_collect_metrics` hooks
- Wraps custom hooks in output buffering and try-catch for protection
- Isolated mode option for maximum compatibility:
- Outputs metrics before other plugins fully load
- Use only if Safe mode causes issues
- `WP_PROMETHEUS_ISOLATED_MODE` environment variable support
- Mode comparison table in admin settings
### Changed
- Replaced "early mode" with two clear modes: Safe (default) and Isolated
- Custom metrics hooks now fire by default with protection against recursion
- Filter removal now also includes `the_content_feed` and `comment_text`
- Updated admin UI with clearer explanations of each mode
### Fixed
- Third-party plugins can now add custom metrics without memory issues
- Twig-based plugins (like wp-fedistream) no longer cause recursion
## [0.4.3] - 2026-02-02
### Added
- Sub-tabs navigation within Metrics tab (Endpoint, Selection, Runtime, Advanced)
- Option to disable early mode in admin settings (Metrics → Advanced)
- Support for `WP_PROMETHEUS_DISABLE_EARLY_MODE` environment variable
- Early mode status display in settings
### Fixed
- Early mode setting now saves correctly (moved into form with proper settings group)
### Changed
- Reorganized Metrics tab into logical sub-sections for better usability
- Early mode can now be disabled for users who need the `wp_prometheus_collect_metrics` hook
- Updated translations with sub-tab and early mode strings (English and German)
## [0.4.1] - 2026-02-02
### Fixed
- Fixed memory exhaustion when wp-fedistream (Twig-based) plugin is active
- Added early metrics endpoint handler that intercepts `/metrics` requests before full WordPress initialization
- Removed content filters (`the_content`, `the_excerpt`, `get_the_excerpt`, `the_title`) during metrics collection to prevent recursion
- Skip third-party extensibility hooks during early metrics mode to avoid conflicts
- Changed `template_redirect` hook to `parse_request` for earlier request interception
## [0.4.0] - 2026-02-02
### Added
- Persistent Storage Support:
- Redis storage adapter for shared metrics across multiple instances
- APCu storage adapter for single-server high-performance caching
- StorageFactory class for automatic adapter selection and fallback
- Connection testing with detailed error messages
- New "Storage" tab in admin settings:
- Storage adapter selection (In-Memory, Redis, APCu)
- Redis configuration (host, port, password, database, key prefix)
- APCu configuration (key prefix)
- Connection test button
- Environment variables documentation
- Environment variable configuration for Docker/containerized environments:
- `WP_PROMETHEUS_STORAGE_ADAPTER` - Select storage adapter
- `WP_PROMETHEUS_REDIS_HOST` - Redis server hostname
- `WP_PROMETHEUS_REDIS_PORT` - Redis server port
- `WP_PROMETHEUS_REDIS_PASSWORD` - Redis authentication
- `WP_PROMETHEUS_REDIS_DATABASE` - Redis database index (0-15)
- `WP_PROMETHEUS_REDIS_PREFIX` - Redis key prefix
- `WP_PROMETHEUS_APCU_PREFIX` - APCu key prefix
- Automatic fallback to In-Memory storage if configured adapter fails
- Docker Compose example in admin settings
### Changed
- Settings page now has 6 tabs: License, Metrics, Storage, Custom Metrics, Dashboards, Help
- Updated translations with all new strings (English and German)
- Collector now uses StorageFactory for storage adapter instantiation
## [0.3.0] - 2026-02-02
### Added
- Custom Metrics Builder:
- Admin UI to define custom gauge metrics
- Support for static values and WordPress option-based values
- Label support with up to 5 labels and 50 value combinations
- Metric validation following Prometheus naming conventions
- Metric Export/Import:
- JSON-based configuration export for backup
- Import with three modes: skip existing, overwrite, or rename duplicates
- Version tracking in export format
- Grafana Dashboard Templates:
- WordPress Overview dashboard (users, posts, comments, cron, transients)
- WordPress Runtime dashboard (HTTP requests, database queries)
- WordPress WooCommerce dashboard (orders, revenue, products, customers)
- Easy download and import instructions
- New "Custom Metrics" tab in admin settings
- New "Dashboards" tab in admin settings
- Reset runtime metrics button to clear accumulated data
### Changed
- Settings page now has 5 tabs: License, Metrics, Custom Metrics, Dashboards, Help
- Updated translations with all new strings
## [0.2.2] - 2026-02-02
### Fixed
- Fixed `wc_orders_count()` call missing required status parameter in WooCommerce orders metrics
## [0.2.1] - 2026-02-02
### Added
- Localhost license bypass for development environments (localhost, 127.0.0.1, ::1, \*.localhost, \*.local)
- Automatic rewrite rules flush when license status changes
### Fixed
- Fixed 404 error on `/metrics` endpoint when license becomes valid after plugin activation
## [0.2.0] - 2026-02-02
### Added
- WooCommerce integration metrics (when WooCommerce is active):
- `wordpress_woocommerce_products_total` - Products by status and type
- `wordpress_woocommerce_orders_total` - Orders by status
- `wordpress_woocommerce_revenue_total` - Revenue (all time, today, month)
- `wordpress_woocommerce_customers_total` - Customers (registered, guest)
- Cron job metrics:
- `wordpress_cron_events_total` - Scheduled cron events by hook
- `wordpress_cron_overdue_total` - Number of overdue cron events
- `wordpress_cron_next_run_timestamp` - Unix timestamp of next scheduled cron
- Transient cache metrics:
- `wordpress_transients_total` - Transients by type (total, with_expiration, persistent, expired)
- WooCommerce metrics section in settings (only visible when WooCommerce is active)
- Support for WooCommerce HPOS (High-Performance Order Storage)
### Changed
- Updated Help tab with new metrics reference
## [0.1.1] - 2026-02-02
### Changed
- Reorganized settings page with tabbed interface (License, Metrics, Help tabs)
- Moved Prometheus configuration help to dedicated Help tab
- Separated static and runtime metrics in settings with descriptions
- Added admin CSS for improved tab styling
### Added
- New Help tab with endpoint information, curl examples, and metrics reference table
- Custom code examples section in Help tab
## [0.1.0] - 2026-02-02
### Added
- HTTP request metrics:
- `wordpress_http_requests_total` - Counter of HTTP requests by method, status code, and endpoint
- `wordpress_http_request_duration_seconds` - Histogram of request durations
- Database query metrics:
- `wordpress_db_queries_total` - Counter of database queries by endpoint
- `wordpress_db_query_duration_seconds` - Histogram of query durations (requires SAVEQUERIES)
- RuntimeCollector class for collecting metrics during WordPress request lifecycle
- New settings options for enabling/disabling runtime metrics
- Translation files (.pot, .po, .mo) for German (Switzerland)
### Changed
- Metrics are now categorized into static metrics (users, posts, etc.) and runtime metrics (HTTP, database)
- Runtime metrics only collected when explicitly enabled and license is valid
## [0.0.2] - 2026-02-01
### Fixed
- Fixed composer.json dependency version constraint for wc-licensed-product-client (^0.2.2 instead of dev-main)
- Changed minimum-stability back to stable
## [0.0.1] - 2026-02-01
### Added
- Initial plugin structure and bootstrap
- Main plugin class with singleton pattern
- License management integration with wc-licensed-product-client
- Prometheus metrics collector with default WordPress metrics:
- `wordpress_info` - WordPress installation information
- `wordpress_users_total` - Total users by role
- `wordpress_posts_total` - Total posts by type and status
- `wordpress_comments_total` - Total comments by status
- `wordpress_plugins_total` - Total plugins by status
- Authenticated `/metrics` endpoint with Bearer token
- Admin settings page under Settings > Metrics
- Extensibility via `wp_prometheus_collect_metrics` action hook
- Gitea CI/CD pipeline for automated releases
- Comprehensive documentation (README.md, PLAN.md, CLAUDE.md)
### Security
- Bearer token authentication for metrics endpoint
- Nonce verification for all AJAX requests
- Capability checks for admin operations
- Input sanitization and output escaping