Files
wp-fedistream/CHANGELOG.md
magdev b592e45d58
Some checks failed
Create Release Package / build-release (push) Failing after 53s
fix: Hard main template rendering lock
- Added $rendering_main_template flag that blocks all other renders
- Reduced MAX_RENDER_DEPTH from 5 to 2
- template-wrapper.php passes is_main_template=true to enable hard lock
- Any render attempt during main template rendering is blocked

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:55:23 +01:00

280 lines
12 KiB
Markdown

# Changelog
All notable changes to WP FediStream will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [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)
---
[Unreleased]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.7...HEAD
[0.4.7]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.6...v0.4.7
[0.4.6]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.5...v0.4.6
[0.4.5]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.4...v0.4.5
[0.4.4]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.3...v0.4.4
[0.4.3]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.2...v0.4.3
[0.4.2]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.1...v0.4.2
[0.4.1]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.4.0...v0.4.1
[0.4.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.3.0...v0.4.0
[0.3.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.2.0...v0.3.0
[0.2.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.1.1...v0.2.0
[0.1.1]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.1.0...v0.1.1
[0.1.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/releases/tag/v0.1.0