From 96269eb35597e208a41d525bb23001c11271672f Mon Sep 17 00:00:00 2001 From: magdev Date: Wed, 28 Jan 2026 23:47:56 +0100 Subject: [PATCH] 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 --- CHANGELOG.md | 10 +++++++++- CLAUDE.md | 5 ++++- README.md | 2 +- includes/WooCommerce/Integration.php | 12 ++++++++++-- wp-fedistream.php | 4 ++-- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd8ec6f..49508b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [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 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 diff --git a/CLAUDE.md b/CLAUDE.md index 4fd073e..015f152 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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. -### Version 0.1.1 (Bugfix) +### Version 0.1.2 (Bugfix) ### 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 - **Language:** PHP 8.3.x diff --git a/README.md b/README.md index 38dc931..123566e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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) [![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) diff --git a/includes/WooCommerce/Integration.php b/includes/WooCommerce/Integration.php index 960ce66..7d413f9 100644 --- a/includes/WooCommerce/Integration.php +++ b/includes/WooCommerce/Integration.php @@ -28,8 +28,16 @@ class Integration { * Constructor. */ public function __construct() { - add_action( 'plugins_loaded', array( $this, 'check_woocommerce' ), 5 ); - add_action( 'plugins_loaded', array( $this, 'init' ), 20 ); + // 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 ); + } else { + $this->init(); + } } /** diff --git a/wp-fedistream.php b/wp-fedistream.php index 1f0a091..3238a9d 100644 --- a/wp-fedistream.php +++ b/wp-fedistream.php @@ -3,7 +3,7 @@ * Plugin Name: 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. - * Version: 0.1.0 + * Version: 0.1.1 * Requires at least: 6.4 * Requires PHP: 8.3 * Author: Marco Graetsch @@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) { * * @var string */ -define( 'WP_FEDISTREAM_VERSION', '0.1.0' ); +define( 'WP_FEDISTREAM_VERSION', '0.1.1' ); /** * Plugin file path.