diff --git a/.gitignore b/.gitignore index bce07e6..b8a61eb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ npm-debug.log # Logs *.log +/logs # Notes notes.* diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d0a0c..d4a1224 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ 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.10] - 2025-12-22 + +### Fixed + +- **CRITICAL:** Function redeclaration error for `wc_tpp_init()` affecting version 1.1.9 +- Fatal error "Cannot redeclare function wc_tpp_init()" when plugin file loaded multiple times +- Plugin activation failures caused by function redeclaration + +### Technical Details + +- Wrapped `wc_tpp_init()` function in `function_exists()` check +- Completes the fix started in v1.1.9 by protecting all global functions +- Prevents fatal errors during WordPress plugin activation cycles +- Both `wc_tpp_woocommerce_missing_notice()` and `wc_tpp_init()` now safely guarded + ## [1.1.9] - 2025-12-22 ### Fixed diff --git a/composer.json b/composer.json index 1c93b8e..a2df238 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.9", + "version": "1.1.10", "type": "wordpress-plugin", "license": "GPL-2.0-or-later", "authors": [ diff --git a/releases/wc-tier-and-package-prices-1.1.10.zip b/releases/wc-tier-and-package-prices-1.1.10.zip new file mode 100644 index 0000000..2735587 Binary files /dev/null and b/releases/wc-tier-and-package-prices-1.1.10.zip differ diff --git a/releases/wc-tier-and-package-prices-1.1.10.zip.md5 b/releases/wc-tier-and-package-prices-1.1.10.zip.md5 new file mode 100644 index 0000000..77870f7 --- /dev/null +++ b/releases/wc-tier-and-package-prices-1.1.10.zip.md5 @@ -0,0 +1 @@ +81be5283219cfa722f6d382a788e7dc1 releases/wc-tier-and-package-prices-1.1.10.zip diff --git a/releases/wc-tier-and-package-prices-1.1.10.zip.sha256 b/releases/wc-tier-and-package-prices-1.1.10.zip.sha256 new file mode 100644 index 0000000..c8ddde8 --- /dev/null +++ b/releases/wc-tier-and-package-prices-1.1.10.zip.sha256 @@ -0,0 +1 @@ +2d3b01e61c8a03a8f20bc99b2019ca50fa08ecd68188feb2d2105dfe35d36f0d releases/wc-tier-and-package-prices-1.1.10.zip diff --git a/wc-tier-and-package-prices.php b/wc-tier-and-package-prices.php index fae1dd9..299eb6b 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/magdev/wc-tier-package-prices * Description: Add tier pricing and package prices to WooCommerce products with configurable quantities at fixed prices - * Version: 1.1.9 + * Version: 1.1.10 * 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.9'); +define('WC_TPP_VERSION', '1.1.10'); 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__)); @@ -119,8 +119,10 @@ class WC_Tier_Package_Prices { } // Initialize the plugin -function wc_tpp_init() { - return WC_Tier_Package_Prices::get_instance(); +if (!function_exists('wc_tpp_init')) { + function wc_tpp_init() { + return WC_Tier_Package_Prices::get_instance(); + } } add_action('plugins_loaded', 'wc_tpp_init', 11);