Release version 1.1.5 - Critical bug fix for plugin activation

CRITICAL FIX: Resolved fatal error that prevented plugin activation in
versions 1.1.3 and 1.1.4. The add_cart_quantity_css() method was attempting
to access WooCommerce cart object during wp_head action, causing failures
when WooCommerce wasn't fully initialized or on admin pages.

Fixes:
- Plugin activation error in v1.1.3 and v1.1.4
- Fatal error when WooCommerce cart object not available
- Frontend errors on admin pages
- Issues during plugin initialization

Technical Changes:
- Added function_exists('WC') check before accessing WooCommerce
- Added is_admin() check to prevent CSS injection on admin pages
- Enhanced add_cart_quantity_css() with proper guards
- Line 191: if (!function_exists('WC') || !WC()->cart || is_admin())

Root Cause:
The add_cart_quantity_css() method (added in v1.1.3) hooks into wp_head
but didn't properly check if WooCommerce cart was available, causing
errors during plugin activation and on admin pages.

Updated Files:
- includes/class-wc-tpp-cart.php (enhanced error checking)
- wc-tier-and-package-prices.php (version 1.1.5)
- composer.json (version 1.1.5)
- CHANGELOG.md (v1.1.5 section)
- All translation files (.pot, .po, .mo) updated to version 1.1.5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-21 19:49:24 +01:00
parent 5cfabedb94
commit 9765c5f119
11 changed files with 20 additions and 8 deletions

View File

@@ -5,6 +5,18 @@ All notable changes to WooCommerce Tier and Package Prices will be documented in
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.5] - 2025-12-21
### Fixed
- **CRITICAL:** Plugin activation error in v1.1.3 and v1.1.4 caused by `add_cart_quantity_css()` method
- Fatal error when WooCommerce cart object not available during plugin initialization
- Frontend errors on admin pages and during activation
### Technical
- Added `function_exists('WC')` check before accessing WooCommerce functions
- Added `is_admin()` check to prevent CSS injection on admin pages
- Enhanced error prevention in `add_cart_quantity_css()` method
## [1.1.4] - 2025-12-21
### Added