From 6e45b0b6f1868bf541cca11ab87da69b758f3094 Mon Sep 17 00:00:00 2001 From: magdev Date: Mon, 2 Feb 2026 20:53:52 +0100 Subject: [PATCH] docs: Update CLAUDE.md with v0.5.0/v0.5.1 session history - Added Prometheus metrics integration documentation - Added localhost license bypass documentation - Updated memory leak status to resolved (fixed in WP Prometheus) Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index bda25f1..c89640a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -606,4 +606,55 @@ wp-fedistream/ - WordPress hook system (class-wp-hook.php) can itself be the recursion point - The interaction between FediStream and WP Prometheus appears to be at a fundamental WordPress level -**Status:** UNRESOLVED - Documented as known incompatibility, investigation to continue later +**Status:** RESOLVED - Issue was fixed in WP Prometheus plugin, removed from known incompatibilities + +### 2026-02-02 - Prometheus Metrics & License Bypass v0.5.0/v0.5.1 + +**Summary:** Added Prometheus metrics integration and localhost license bypass for development. + +**v0.5.0 - Prometheus Metrics Integration:** + +- Created `includes/Prometheus/Integration.php` with comprehensive metrics collection +- Content metrics: `fedistream_content_total`, `fedistream_genres_total`, `fedistream_moods_total` +- Engagement metrics: `fedistream_plays_total`, `fedistream_plays_today`, `fedistream_favorites_total`, `fedistream_local_follows_total`, `fedistream_listening_history_entries` +- User metrics: `fedistream_users_with_library`, `fedistream_users_following_artists`, `fedistream_notifications_total`, `fedistream_notifications_pending` +- WooCommerce metrics (conditional): `fedistream_purchases_total`, `fedistream_customers_total`, `fedistream_products_total` +- ActivityPub metrics (conditional): `fedistream_activitypub_followers_total`, `fedistream_activitypub_followers_by_artist`, `fedistream_activitypub_reactions_total` +- New setting in Integrations tab to enable/disable +- Uses `wp_prometheus_collect_metrics` action hook + +**v0.5.1 - Localhost License Bypass:** + +- Added `is_localhost()` method to License Manager +- Bypasses license check on: `localhost`, `127.0.0.1`, `::1` +- Also bypasses for TLDs: `.local`, `.test`, `.localhost`, `.dev.local` +- Allows full plugin functionality during local development + +**Files Created:** + +- `includes/Prometheus/Integration.php` - Metrics collection class +- `includes/Prometheus/index.php` - Security file + +**Files Modified:** + +- `includes/Plugin.php` - Added Prometheus integration, settings toggle, `is_prometheus_active()` method +- `includes/Installer.php` - Added `wp_fedistream_enable_prometheus` default option +- `includes/License/Manager.php` - Added `is_localhost()` method, bypass in `is_license_valid()` +- `README.md` - Removed known incompatibility section, updated version badge + +**Integration Pattern:** + +Follows same pattern as WooCommerce/ActivityPub integrations: + +```php +if (get_option('wp_fedistream_enable_prometheus', 0) && $this->is_prometheus_active()) { + new PrometheusIntegration(); +} +``` + +**Notes:** + +- WP Prometheus memory leak issue was fixed in WP Prometheus itself +- Metrics use simple COUNT queries for performance +- ActivityPub followers limited to top 10 to avoid cardinality explosion +- Default disabled (opt-in via Settings > Integrations)