fix: WooCommerce product types not appearing in selector

Fixed timing issue where WooCommerce integration hooks were registered
too late during plugins_loaded. The constructor now calls check_woocommerce()
directly instead of hooking it at priority 5 (which had already passed).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-28 23:47:56 +01:00
parent 01c256349f
commit 96269eb355
5 changed files with 26 additions and 7 deletions

View File

@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [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 ## [0.1.0] - 2026-01-28
Initial release of WP FediStream - a WordPress plugin for streaming music over ActivityPub. Initial release of WP FediStream - a WordPress plugin for streaming music over ActivityPub.
@@ -139,5 +146,6 @@ Initial release of WP FediStream - a WordPress plugin for streaming music over A
--- ---
[Unreleased]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.1.0...HEAD [Unreleased]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/compare/v0.1.1...HEAD
[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 [0.1.0]: https://src.bundespruefstelle.ch/magdev/wp-fedistream/releases/tag/v0.1.0

View File

@@ -24,10 +24,13 @@ This project is proudly **"vibe-coded"** using Claude.AI - the entire codebase w
**Note for AI Assistants:** Clean this section after the specific features are done or new releases are made. Effective changes are tracked in `CHANGELOG.md`. Do not add completed versions here - document them in the Session History section at the end of this file. **Note for AI Assistants:** Clean this section after the specific features are done or new releases are made. Effective changes are tracked in `CHANGELOG.md`. Do not add completed versions here - document them in the Session History section at the end of this file.
### Version 0.1.1 (Bugfix) ### Version 0.1.2 (Bugfix)
### Version 0.2.0 (Minor) ### Version 0.2.0 (Minor)
- Add a link to the settings page to the plugin overview page.
- Write a comprehensive user-guide on how to install, configure and get the plugin with all available features up and running
## Technical Stack ## Technical Stack
- **Language:** PHP 8.3.x - **Language:** PHP 8.3.x

View File

@@ -2,7 +2,7 @@
Stream music over ActivityPub - Build your own music streaming platform for Musicians and Labels. Stream music over ActivityPub - Build your own music streaming platform for Musicians and Labels.
[![Version](https://img.shields.io/badge/version-0.1.0-blue.svg)](CHANGELOG.md) [![Version](https://img.shields.io/badge/version-0.1.1-blue.svg)](CHANGELOG.md)
[![PHP](https://img.shields.io/badge/PHP-%3E%3D8.3-purple.svg)](https://php.net) [![PHP](https://img.shields.io/badge/PHP-%3E%3D8.3-purple.svg)](https://php.net)
[![WordPress](https://img.shields.io/badge/WordPress-%3E%3D6.4-blue.svg)](https://wordpress.org) [![WordPress](https://img.shields.io/badge/WordPress-%3E%3D6.4-blue.svg)](https://wordpress.org)
[![License](https://img.shields.io/badge/license-GPL--2.0%2B-green.svg)](https://www.gnu.org/licenses/gpl-2.0.html) [![License](https://img.shields.io/badge/license-GPL--2.0%2B-green.svg)](https://www.gnu.org/licenses/gpl-2.0.html)

View File

@@ -28,8 +28,16 @@ class Integration {
* Constructor. * Constructor.
*/ */
public function __construct() { public function __construct() {
add_action( 'plugins_loaded', array( $this, 'check_woocommerce' ), 5 ); // Check WooCommerce immediately since we're instantiated during plugins_loaded.
$this->check_woocommerce();
// If plugins_loaded hasn't fully completed, hook init at priority 20.
// Otherwise, run init directly.
if ( ! did_action( 'plugins_loaded' ) || doing_action( 'plugins_loaded' ) ) {
add_action( 'plugins_loaded', array( $this, 'init' ), 20 ); add_action( 'plugins_loaded', array( $this, 'init' ), 20 );
} else {
$this->init();
}
} }
/** /**

View File

@@ -3,7 +3,7 @@
* Plugin Name: WP FediStream * Plugin Name: WP FediStream
* Plugin URI: https://src.bundespruefstelle.ch/magdev/wp-fedistream * Plugin URI: https://src.bundespruefstelle.ch/magdev/wp-fedistream
* Description: Stream music over ActivityPub - Build your own music streaming platform for Musicians and Labels. * Description: Stream music over ActivityPub - Build your own music streaming platform for Musicians and Labels.
* Version: 0.1.0 * Version: 0.1.1
* Requires at least: 6.4 * Requires at least: 6.4
* Requires PHP: 8.3 * Requires PHP: 8.3
* Author: Marco Graetsch * Author: Marco Graetsch
@@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* *
* @var string * @var string
*/ */
define( 'WP_FEDISTREAM_VERSION', '0.1.0' ); define( 'WP_FEDISTREAM_VERSION', '0.1.1' );
/** /**
* Plugin file path. * Plugin file path.