Files
wp-fedistream/CHANGELOG.md
magdev 379fd23be0
All checks were successful
Create Release Package / build-release (push) Successful in 55s
feat: Replace Twig with native PHP templates
- Remove twig/twig dependency from composer.json
- Convert all 25 Twig templates to native PHP templates
- New render() method in Plugin.php using PHP include with output buffering
- New render_partial() helper method for including partials
- Templates support theme overrides via fedistream/ directory
- Reduced plugin size by eliminating Twig and its dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:48:10 +01:00

15 KiB

Changelog

All notable changes to WP FediStream will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.6.0 - 2026-02-02

Changed

  • Replaced Twig with native PHP templates - Major refactoring to remove external dependency
    • Removed twig/twig from composer.json dependencies
    • All 25 Twig templates converted to native PHP templates
    • New render() method in Plugin.php uses PHP include with output buffering
    • New render_partial() helper method for including partials from within templates
    • Templates support theme overrides via fedistream/ directory in themes
    • Improved performance by eliminating Twig compilation overhead
    • Reduced plugin size by removing Twig and its dependencies (symfony/polyfill-ctype, symfony/polyfill-mbstring)

Removed

  • Twig template engine dependency
  • All .twig template files (replaced with .php equivalents)
  • Twig-related initialization code in Plugin.php

0.5.1 - 2026-02-02

Added

  • Localhost license bypass - License check is automatically bypassed on local development environments
    • Detects localhost, 127.0.0.1, ::1
    • Detects common local TLDs: .local, .test, .localhost, .dev.local
    • Allows full plugin functionality without license on development sites

0.5.0 - 2026-02-02

Added

  • Prometheus Metrics Integration - Expose FediStream metrics for monitoring
    • Content metrics: fedistream_content_total (by type/status), 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 Prometheus metrics
    • Requires WP Prometheus plugin to be active

0.4.9 - 2026-02-02

Changed

  • Reverted nuclear option - Restored conditional the_content filter usage
    • get_post_data() now uses the_content filter only when NOT in shortcode context, NOT at depth > 1, and NOT loading page template
    • All other protections remain in place (render depth, page template loading flag, main template lock, shortcode context)
    • Memory leak investigation to be continued later

0.4.8 - 2026-02-02

Fixed

  • Nuclear option: NEVER apply the_content filter - Completely removed the_content filter usage (reverted in 0.4.9)
    • get_post_data() now ALWAYS strips shortcodes and uses raw content
    • NEVER calls apply_filters('the_content', ...) or get_the_excerpt()
    • FediStream posts don't need shortcode processing in their content anyway
    • This guarantees no recursion through WordPress hook system

0.4.7 - 2026-02-02

Fixed

  • Hard main template rendering lock - Added additional protection at Plugin::render() level
    • Added $rendering_main_template flag that completely blocks any other render calls while main template is rendering
    • Reduced MAX_RENDER_DEPTH from 5 to 2 (allows one level of {% include %} but prevents deeper recursion)
    • template-wrapper.php now passes is_main_template = true to enable the hard lock
    • Any render attempt during main template rendering is immediately blocked

0.4.6 - 2026-02-02

Fixed

  • Page template loading lock - Block ALL shortcode rendering during page template loading
    • Added $loading_page_template flag in TemplateLoader
    • template-wrapper.php now sets this flag before loading theme header/footer
    • Shortcodes::render_template() checks this flag and returns early if set
    • This prevents any recursion triggered by theme components, widgets, or other plugins during page template loading
    • Main template rendering still works (uses Plugin::render() directly, not through Shortcodes)

0.4.5 - 2026-02-02

Fixed

  • Multi-layer recursion protection - Added additional safeguards against infinite Twig rendering
    • Added render depth tracking in Plugin::render() with max depth of 5
    • Strip shortcodes from content when in shortcode context (prevents any later do_shortcode() calls from triggering recursion)
    • This addresses the Twig StagingExtension.php recursion error

0.4.4 - 2026-02-02

Fixed

  • Fix excerpt-triggered recursion - get_the_excerpt() internally calls the_content filter when generating auto-excerpts
    • When in shortcode context, now uses raw $post->post_excerpt or generates simple excerpt with wp_trim_words() instead
    • This was the remaining recursion path causing memory exhaustion in class-wp-hook.php

0.4.3 - 2026-02-02

Fixed

  • Further memory leak fix - v0.4.2 fix was still incomplete
    • Changed $in_shortcode_context boolean to $shortcode_context_depth counter to properly handle nested shortcodes
    • Added shortcode context protection to template-wrapper.php for single page views
    • This fixes the remaining recursion path where the_content filter was still being applied when viewing single FediStream posts (artists, albums, tracks, playlists)

0.4.2 - 2026-02-02

Fixed

  • Complete fix for memory leak - v0.4.1 fix was incomplete
    • Added $in_shortcode_context flag to TemplateLoader to track when we're rendering shortcodes
    • All shortcode render methods now call enter_shortcode_context() before loading data
    • When in shortcode context, the_content filter is always skipped to prevent recursive shortcode processing
    • This prevents infinite recursion when post content contains FediStream shortcodes

0.4.1 - 2026-02-02

Fixed

  • Critical memory leak causing "Allowed memory size exhausted" errors in Twig's StagingExtension
    • Root cause: apply_filters('the_content') in get_post_data() triggered shortcode processing, causing infinite recursion when post content contained FediStream shortcodes
    • Added recursion depth tracking with MAX_RECURSION_DEPTH = 3 to prevent runaway nesting
    • Nested items now skip the_content filter, using wp_kses_post() instead
    • Nested data loading (albums within artists, tracks within albums) is now properly bounded

Changed

  • Made get_artist_data(), get_album_data(), get_track_data(), and get_playlist_data() public methods in TemplateLoader (previously private but called externally)
  • These methods now accept both int post IDs and WP_Post objects for flexibility
  • Added $load_nested parameter to control whether nested items are fully loaded or just counted

0.4.0 - 2026-01-29

Added

  • Gitea Actions CI/CD pipeline for automated release package creation
    • Triggered by v* tags
    • PHP 8.3 environment with production dependencies
    • Automatic translation compilation (.po to .mo)
    • Version verification (plugin version must match tag)
    • WordPress-compliant zip structure
    • SHA256 checksum generation
    • Package structure verification
    • Changelog extraction for release notes
    • Automatic Gitea release creation with attachments
    • Pre-release detection for tags containing -

0.3.0 - 2026-01-29

Added

  • License management integration using magdev/wc-licensed-product-client package
  • Tabbed settings page with License, Default Settings, and Integrations tabs
  • License validation and activation via AJAX with real-time status updates
  • License status banner showing current license state and expiration
  • License checks for frontend components (unlicensed sites show message instead of content)

Changed

  • Reorganized settings page into three tabs for better organization
  • Frontend features (player, shortcodes, ActivityPub) now require valid license
  • Admin/backend functionality works regardless of license status

Security

  • Server secret stored securely in WordPress options
  • HMAC signature verification for license server responses
  • Nonce verification for all license AJAX operations

0.2.0 - 2026-01-28

Added

  • Settings and Dashboard links on the WordPress Plugins page for quick access
  • Comprehensive user guide (USERGUIDE.md) covering installation, configuration, and all features

0.1.1 - 2026-01-28

Fixed

  • WooCommerce product types (FediStream Album/Track) not appearing in product type selector
    • Fixed timing issue where WooCommerce integration hooks were registered too late during plugins_loaded

0.1.0 - 2026-01-28

Initial release of WP FediStream - a WordPress plugin for streaming music over ActivityPub.

Added

Core Plugin Structure

  • Plugin structure with WordPress Plugin API
  • Composer setup with Twig 3.0 template engine
  • Internationalization support with .pot template and German (de_CH) translation

Custom Post Types

  • fedistream_artist - Artist/band profiles with social links, biography, and member management
  • fedistream_album - Albums, EPs, singles, and compilations with release metadata
  • fedistream_track - Individual tracks with audio upload, duration, BPM, key, and ISRC codes
  • fedistream_playlist - User-created playlists with drag-drop ordering

Custom Taxonomies

  • fedistream_genre - Hierarchical music genres with default terms
  • fedistream_mood - Non-hierarchical mood tags for tracks and playlists
  • fedistream_license - Copyright and Creative Commons license options

User Roles

  • fedistream_artist - Manage own content, upload files, view stats
  • fedistream_label - Manage all content, taxonomies, and view all statistics

Admin Interface

  • Dashboard with statistics and quick actions
  • Organized menu under "FediStream"
  • Meta boxes for all post types with full metadata support
  • Settings page for ActivityPub and WooCommerce configuration
  • Custom list table columns with sortable fields
  • Artwork thumbnails, artist links, and duration display

Frontend Display

  • Archive templates for all post types and taxonomies
  • Single templates with full metadata display
  • Card partials for responsive grid layouts
  • Comprehensive CSS styling with custom properties for theming

Shortcodes

  • [fedistream_artist] - Display artist profile
  • [fedistream_album] - Display album with tracklist
  • [fedistream_track] - Display track with player
  • [fedistream_playlist] - Display playlist with tracks
  • [fedistream_latest_releases] - Recent releases grid
  • [fedistream_popular_tracks] - Popular tracks list
  • [fedistream_artists] - Artists grid
  • [fedistream_player] - Audio player widget
  • [fedistream_library] - User library page

Widgets

  • Recent Releases Widget
  • Popular Tracks Widget
  • Featured Artist Widget
  • Now Playing Widget

Audio Player

  • Full playback controls (play, pause, next, previous)
  • Queue management with add, clear, shuffle functionality
  • Repeat modes (none, all, one)
  • Shuffle mode with Fisher-Yates algorithm
  • Progress bar with seek functionality
  • Volume control with mute toggle and localStorage persistence
  • Media Session API integration for system controls
  • Play count tracking via AJAX

ActivityPub Integration

  • Integration with WordPress ActivityPub plugin
  • Artists represented as Person/Group actors
  • RSA key generation for HTTP Signatures
  • Webfinger support for artist discovery
  • Object transformers for tracks, albums, and playlists
  • Inbox handling for Follow, Like, Announce, and Create activities
  • Outbox publishing with Create, Update, and Delete activities
  • Follower management with shared inbox deduplication
  • REST API endpoints for actors, inbox, outbox, and collections

WooCommerce Integration (Optional)

  • Album product type extending WC_Product
  • Track product type extending WC_Product
  • Multiple download formats (MP3, FLAC, WAV, AAC, OGG)
  • Pricing models: Fixed, Pay What You Want, Name Your Price
  • Secure digital delivery with purchase verification
  • Album ZIP downloads with all tracks and cover art
  • Streaming access control based on purchases
  • 30-second preview for non-purchasers
  • Purchase tracking database table

User Library

  • Favorite tracks, albums, and playlists
  • Follow local artists
  • Listening history tracking with clear option
  • Library page with tabs (Favorites, Artists, History)
  • Filter favorites by content type
  • AJAX endpoints for all library operations

Notification System

  • In-app notifications with admin bar indicator
  • Email notifications with HTML templates
  • Notification types: new_release, new_follower, fediverse_like, fediverse_boost, playlist_added, purchase, system
  • Event triggers for releases, follows, and Fediverse interactions
  • User preference settings for email notifications
  • Real-time polling and mark as read functionality

Database Tables

  • fedistream_plays - Track play statistics
  • fedistream_playlist_tracks - Playlist-track relationships
  • fedistream_followers - ActivityPub followers
  • fedistream_purchases - WooCommerce purchase tracking
  • fedistream_favorites - User favorites
  • fedistream_user_follows - Local artist follows
  • fedistream_listening_history - Track play history
  • fedistream_notifications - User notifications
  • fedistream_reactions - Fediverse reactions (likes, boosts)