diff --git a/CHANGELOG.md b/CHANGELOG.md index 633b94d..959cdef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/composer.json b/composer.json index 34a4dbf..577130e 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "magdev/wc-tier-package-prices", "description": "WooCommerce plugin for tier pricing and package prices with Twig templates", - "version": "1.1.4", + "version": "1.1.5", "type": "wordpress-plugin", "license": "GPL-2.0-or-later", "authors": [ diff --git a/includes/class-wc-tpp-cart.php b/includes/class-wc-tpp-cart.php index f2a9d2e..d334f7e 100644 --- a/includes/class-wc-tpp-cart.php +++ b/includes/class-wc-tpp-cart.php @@ -188,7 +188,7 @@ class WC_TPP_Cart { public function add_cart_quantity_css() { // Get all cart items and check which products have restrictions - if (!WC()->cart) { + if (!function_exists('WC') || !WC()->cart || is_admin()) { return; } diff --git a/languages/wc-tier-package-prices-de_CH_informal.mo b/languages/wc-tier-package-prices-de_CH_informal.mo index c4057a1..e3767a8 100644 Binary files a/languages/wc-tier-package-prices-de_CH_informal.mo and b/languages/wc-tier-package-prices-de_CH_informal.mo differ diff --git a/languages/wc-tier-package-prices-de_CH_informal.po b/languages/wc-tier-package-prices-de_CH_informal.po index 0bfbe8c..8fb6239 100644 --- a/languages/wc-tier-package-prices-de_CH_informal.po +++ b/languages/wc-tier-package-prices-de_CH_informal.po @@ -3,7 +3,7 @@ # This file is distributed under the GPL v2 or later. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.4\n" +"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.5\n" "Report-Msgid-Bugs-To: https://src.bundespruefstelle.ch/wc-tier-package-prices\n" "POT-Creation-Date: 2025-12-21 00:00+0000\n" "PO-Revision-Date: 2025-12-21 00:00+0000\n" diff --git a/languages/wc-tier-package-prices-de_DE.mo b/languages/wc-tier-package-prices-de_DE.mo index 519e6d2..c6eb948 100644 Binary files a/languages/wc-tier-package-prices-de_DE.mo and b/languages/wc-tier-package-prices-de_DE.mo differ diff --git a/languages/wc-tier-package-prices-de_DE.po b/languages/wc-tier-package-prices-de_DE.po index df9e7c3..5e1fd76 100644 --- a/languages/wc-tier-package-prices-de_DE.po +++ b/languages/wc-tier-package-prices-de_DE.po @@ -3,7 +3,7 @@ # This file is distributed under the GPL v2 or later. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.4\n" +"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.5\n" "Report-Msgid-Bugs-To: https://src.bundespruefstelle.ch/wc-tier-package-prices\n" "POT-Creation-Date: 2025-12-21 00:00+0000\n" "PO-Revision-Date: 2025-12-21 00:00+0000\n" diff --git a/languages/wc-tier-package-prices-en_US.mo b/languages/wc-tier-package-prices-en_US.mo index 053659f..1688963 100644 Binary files a/languages/wc-tier-package-prices-en_US.mo and b/languages/wc-tier-package-prices-en_US.mo differ diff --git a/languages/wc-tier-package-prices-en_US.po b/languages/wc-tier-package-prices-en_US.po index f7b3053..9c21c85 100644 --- a/languages/wc-tier-package-prices-en_US.po +++ b/languages/wc-tier-package-prices-en_US.po @@ -3,7 +3,7 @@ # This file is distributed under the GPL v2 or later. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.4\n" +"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.5\n" "Report-Msgid-Bugs-To: https://src.bundespruefstelle.ch/wc-tier-package-prices\n" "POT-Creation-Date: 2025-12-21 00:00+0000\n" "PO-Revision-Date: 2025-12-21 00:00+0000\n" diff --git a/languages/wc-tier-package-prices.pot b/languages/wc-tier-package-prices.pot index e50faf0..a44a67a 100644 --- a/languages/wc-tier-package-prices.pot +++ b/languages/wc-tier-package-prices.pot @@ -2,7 +2,7 @@ # This file is distributed under the GPL v2 or later. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.4\n" +"Project-Id-Version: WooCommerce Tier and Package Prices 1.1.5\n" "Report-Msgid-Bugs-To: https://src.bundespruefstelle.ch/wc-tier-package-prices\n" "POT-Creation-Date: 2025-12-21 00:00+0000\n" "MIME-Version: 1.0\n" diff --git a/wc-tier-and-package-prices.php b/wc-tier-and-package-prices.php index e441515..81b8312 100644 --- a/wc-tier-and-package-prices.php +++ b/wc-tier-and-package-prices.php @@ -4,7 +4,7 @@ * Plugin Name: WooCommerce Tier and Package Prices * Plugin URI: https://src.bundespruefstelle.ch/wc-tier-package-prices * Description: Add tier pricing and package prices to WooCommerce products with configurable quantities at fixed prices - * Version: 1.1.4 + * Version: 1.1.5 * Author: Marco Graetsch * Author URI: https://src.bundespruefstelle.ch/magdev * Text Domain: wc-tier-package-prices @@ -22,7 +22,7 @@ if (!defined('ABSPATH')) { } // Define plugin constants -define('WC_TPP_VERSION', '1.1.4'); +define('WC_TPP_VERSION', '1.1.5'); define('WC_TPP_PLUGIN_DIR', plugin_dir_path(__FILE__)); define('WC_TPP_PLUGIN_URL', plugin_dir_url(__FILE__)); define('WC_TPP_PLUGIN_BASENAME', plugin_basename(__FILE__));