You've already forked wc-licensed-product
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3abf05cff3 | |||
| 169eed65eb | |||
| 90cb8d97bd | |||
| fc281f7f4a |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.5.8] - 2026-01-27
|
||||
|
||||
### Fixed
|
||||
|
||||
- **CRITICAL:** Fixed critical error on frontend product pages for licensed variable products
|
||||
- Variable product add-to-cart template now passes required variables (`available_variations`, `attributes`, `selected_attributes`)
|
||||
- Variants tab no longer disappears when saving attributes on licensed variable products
|
||||
- Added WooCommerce AJAX event listeners to maintain tab visibility during attribute operations
|
||||
|
||||
### Changed
|
||||
|
||||
- Improved JavaScript event handling for licensed-variable product type in admin
|
||||
- Added listeners for `woocommerce_variations_loaded`, `woocommerce_variations_added`, `woocommerce_variations_saved` events
|
||||
- Added AJAX complete handler for attribute save operations
|
||||
|
||||
## [0.5.7] - 2026-01-27
|
||||
|
||||
### Changed
|
||||
|
||||
58
CLAUDE.md
58
CLAUDE.md
@@ -1437,3 +1437,61 @@ Critical bug fix for response signing. The key derivation algorithm was incompat
|
||||
- Length: 32 bytes (256 bits)
|
||||
- Info: license_key (context-specific info)
|
||||
- **Breaking change for existing signatures** - customer secrets will change after upgrade
|
||||
|
||||
### 2026-01-27 - Version 0.5.6 - License Settings Tab Visibility Fix
|
||||
|
||||
**Overview:**
|
||||
|
||||
Fixed License Settings tab visibility for non-licensed product types and updated README with v0.5.x features.
|
||||
|
||||
**Bug Fix:**
|
||||
|
||||
- License Settings tab now only shows for Licensed Product and Licensed Variable Product types
|
||||
- Previously the tab was visible on all product types due to CSS `!important` override forcing `display: block`
|
||||
|
||||
**Modified files:**
|
||||
|
||||
- `assets/css/admin.css` - Changed from `display: block !important` to `display: none` for `.show_if_licensed` and `.show_if_licensed-variable`
|
||||
- `src/Product/LicensedProductType.php` - Added consolidated `toggleLicensedProductOptions()` JavaScript function
|
||||
- `README.md` - Updated with complete feature documentation for v0.5.x features
|
||||
|
||||
**Technical notes:**
|
||||
|
||||
- CSS now hides License Settings tab by default
|
||||
- JavaScript `toggleLicensedProductOptions()` function shows/hides tab based on product type selector
|
||||
- Function is called both on page load and on product type change
|
||||
- README updated with: Variable Licensed Products, Multi-Domain Licensing, Per-License Secrets, Download Statistics, Configurable Rate Limiting
|
||||
|
||||
**Release v0.5.6:**
|
||||
|
||||
- Created release package: `releases/wc-licensed-product-0.5.6.zip` (1.1 MB)
|
||||
- SHA256: `4d35a319fe4cb4e7055bae17fc030487ca05e5e9ac905f76d0ac62002bde4336`
|
||||
- Tagged as `v0.5.6` and pushed to `main` branch
|
||||
|
||||
### 2026-01-27 - Version 0.5.7 - Settings UI Cleanup
|
||||
|
||||
**Overview:**
|
||||
|
||||
Removed redundant "Default" prefix from setting labels on the Default Settings page for cleaner UI.
|
||||
|
||||
**Changed:**
|
||||
|
||||
- "Max Activations" (was "Default Max Activations")
|
||||
- "License Validity (Days)" (was "Default License Validity (Days)")
|
||||
- "Bind to Major Version" (was "Default Bind to Major Version")
|
||||
|
||||
**Modified files:**
|
||||
|
||||
- `src/Admin/SettingsController.php` - Removed "Default" prefix from three setting labels
|
||||
|
||||
**Technical notes:**
|
||||
|
||||
- Labels are cleaner since the page section itself is already named "Default Settings"
|
||||
- No functional changes, purely UI improvement
|
||||
- Updated all translations (388 strings)
|
||||
|
||||
**Release v0.5.7:**
|
||||
|
||||
- Created release package: `releases/wc-licensed-product-0.5.7.zip` (856 KB)
|
||||
- SHA256: `ceb4d57598f576f4f172153ff80df8c180ecd4dca873cf109327fc5ac718930f`
|
||||
- Tagged as `v0.5.7` and pushed to `main` branch
|
||||
|
||||
@@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WC Licensed Product 0.5.0\n"
|
||||
"Report-Msgid-Bugs-To: magdev3.0@gmail.com\n"
|
||||
"POT-Creation-Date: 2026-01-27 11:54+0100\n"
|
||||
"POT-Creation-Date: 2026-01-27 13:34+0100\n"
|
||||
"PO-Revision-Date: 2026-01-25T18:30:00+00:00\n"
|
||||
"Last-Translator: Marco Graetsch <magdev3.0@gmail.com>\n"
|
||||
"Language-Team: German (Switzerland) <de_CH@li.org>\n"
|
||||
@@ -314,7 +314,7 @@ msgstr "Speichern"
|
||||
#: src/Product/LicensedProductVariation.php:139
|
||||
#: src/Product/LicensedProductType.php:136
|
||||
#: src/Product/LicensedProductType.php:184
|
||||
#: src/Product/LicensedProductType.php:385
|
||||
#: src/Product/LicensedProductType.php:403
|
||||
#: src/Frontend/AccountController.php:286
|
||||
msgid "Lifetime"
|
||||
msgstr "Lebenslang"
|
||||
@@ -1167,7 +1167,7 @@ msgstr ""
|
||||
"Individuelle Produkteinstellungen überschreiben diese Standards."
|
||||
|
||||
#: src/Admin/SettingsController.php:176 src/Product/LicensedProductType.php:154
|
||||
#: src/Product/LicensedProductType.php:402
|
||||
#: src/Product/LicensedProductType.php:420
|
||||
msgid "Max Activations"
|
||||
msgstr "Max. Aktivierungen"
|
||||
|
||||
@@ -1475,7 +1475,7 @@ msgid "License Settings"
|
||||
msgstr "Lizenz-Einstellungen"
|
||||
|
||||
#: src/Product/LicensedProductType.php:135
|
||||
#: src/Product/LicensedProductType.php:384
|
||||
#: src/Product/LicensedProductType.php:402
|
||||
#, php-format
|
||||
msgid "%d days"
|
||||
msgstr "%d Tage"
|
||||
@@ -1516,27 +1516,27 @@ msgstr "Ja"
|
||||
msgid "No"
|
||||
msgstr "Nein"
|
||||
|
||||
#: src/Product/LicensedProductType.php:327
|
||||
#: src/Product/LicensedProductType.php:329
|
||||
msgid "Version:"
|
||||
msgstr "Version:"
|
||||
|
||||
#: src/Product/LicensedProductType.php:355
|
||||
#: src/Product/LicensedProductType.php:373
|
||||
msgid "Licensed products are always virtual"
|
||||
msgstr "Lizenzierte Produkte sind immer virtuell"
|
||||
|
||||
#: src/Product/LicensedProductType.php:357
|
||||
#: src/Product/LicensedProductType.php:375
|
||||
msgid "Virtual"
|
||||
msgstr "Virtuell"
|
||||
|
||||
#: src/Product/LicensedProductType.php:390
|
||||
#: src/Product/LicensedProductType.php:408
|
||||
msgid "License Duration (Days)"
|
||||
msgstr "Lizenz-Gültigkeit (Tage)"
|
||||
|
||||
#: src/Product/LicensedProductType.php:399
|
||||
#: src/Product/LicensedProductType.php:417
|
||||
msgid "Leave empty for parent default. 0 = Lifetime."
|
||||
msgstr "Leer lassen für übergeordneten Standard. 0 = Lebenslang."
|
||||
|
||||
#: src/Product/LicensedProductType.php:411
|
||||
#: src/Product/LicensedProductType.php:429
|
||||
msgid "Leave empty for parent default."
|
||||
msgstr "Leer lassen für übergeordneten Standard."
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WC Licensed Product 0.5.7\n"
|
||||
"Project-Id-Version: WC Licensed Product 0.5.8\n"
|
||||
"Report-Msgid-Bugs-To: magdev3.0@gmail.com\n"
|
||||
"POT-Creation-Date: 2026-01-27 11:54+0100\n"
|
||||
"POT-Creation-Date: 2026-01-27 13:34+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -307,7 +307,7 @@ msgstr ""
|
||||
#: src/Product/LicensedProductVariation.php:139
|
||||
#: src/Product/LicensedProductType.php:136
|
||||
#: src/Product/LicensedProductType.php:184
|
||||
#: src/Product/LicensedProductType.php:385
|
||||
#: src/Product/LicensedProductType.php:403
|
||||
#: src/Frontend/AccountController.php:286
|
||||
msgid "Lifetime"
|
||||
msgstr ""
|
||||
@@ -1134,7 +1134,7 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#: src/Admin/SettingsController.php:176 src/Product/LicensedProductType.php:154
|
||||
#: src/Product/LicensedProductType.php:402
|
||||
#: src/Product/LicensedProductType.php:420
|
||||
msgid "Max Activations"
|
||||
msgstr ""
|
||||
|
||||
@@ -1426,7 +1426,7 @@ msgid "License Settings"
|
||||
msgstr ""
|
||||
|
||||
#: src/Product/LicensedProductType.php:135
|
||||
#: src/Product/LicensedProductType.php:384
|
||||
#: src/Product/LicensedProductType.php:402
|
||||
#, php-format
|
||||
msgid "%d days"
|
||||
msgstr ""
|
||||
@@ -1465,27 +1465,27 @@ msgstr ""
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
#: src/Product/LicensedProductType.php:327
|
||||
#: src/Product/LicensedProductType.php:329
|
||||
msgid "Version:"
|
||||
msgstr ""
|
||||
|
||||
#: src/Product/LicensedProductType.php:355
|
||||
#: src/Product/LicensedProductType.php:373
|
||||
msgid "Licensed products are always virtual"
|
||||
msgstr ""
|
||||
|
||||
#: src/Product/LicensedProductType.php:357
|
||||
#: src/Product/LicensedProductType.php:375
|
||||
msgid "Virtual"
|
||||
msgstr ""
|
||||
|
||||
#: src/Product/LicensedProductType.php:390
|
||||
#: src/Product/LicensedProductType.php:408
|
||||
msgid "License Duration (Days)"
|
||||
msgstr ""
|
||||
|
||||
#: src/Product/LicensedProductType.php:399
|
||||
#: src/Product/LicensedProductType.php:417
|
||||
msgid "Leave empty for parent default. 0 = Lifetime."
|
||||
msgstr ""
|
||||
|
||||
#: src/Product/LicensedProductType.php:411
|
||||
#: src/Product/LicensedProductType.php:429
|
||||
msgid "Leave empty for parent default."
|
||||
msgstr ""
|
||||
|
||||
|
||||
BIN
releases/wc-licensed-product-0.5.7.zip
Normal file
BIN
releases/wc-licensed-product-0.5.7.zip
Normal file
Binary file not shown.
1
releases/wc-licensed-product-0.5.7.zip.sha256
Normal file
1
releases/wc-licensed-product-0.5.7.zip.sha256
Normal file
@@ -0,0 +1 @@
|
||||
ceb4d57598f576f4f172153ff80df8c180ecd4dca873cf109327fc5ac718930f wc-licensed-product-0.5.7.zip
|
||||
@@ -201,19 +201,21 @@ final class LicensedProductType
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($) {
|
||||
// Show/hide panels based on product type
|
||||
// Show/hide panels based on product type for license settings tab
|
||||
function toggleLicensedProductOptions() {
|
||||
var productType = $('#product-type').val();
|
||||
var isLicensed = productType === 'licensed';
|
||||
var isLicensedVariable = productType === 'licensed-variable';
|
||||
|
||||
if (isLicensed || isLicensedVariable) {
|
||||
// Show license settings tab
|
||||
$('.show_if_licensed').show();
|
||||
$('.show_if_licensed-variable').show();
|
||||
$('.general_options').show();
|
||||
$('.pricing').show();
|
||||
$('.general_tab').show();
|
||||
} else {
|
||||
// Hide license settings tab for other product types
|
||||
$('.show_if_licensed').hide();
|
||||
$('.show_if_licensed-variable').hide();
|
||||
}
|
||||
@@ -334,7 +336,23 @@ final class LicensedProductType
|
||||
*/
|
||||
public function variableAddToCartTemplate(): void
|
||||
{
|
||||
wc_get_template('single-product/add-to-cart/variable.php');
|
||||
global $product;
|
||||
|
||||
if (!$product instanceof \WC_Product_Variable) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get variations count to determine if we should load them via AJAX
|
||||
$getVariations = count($product->get_children()) <= apply_filters('woocommerce_ajax_variation_threshold', 30, $product);
|
||||
|
||||
wc_get_template(
|
||||
'single-product/add-to-cart/variable.php',
|
||||
[
|
||||
'available_variations' => $getVariations ? $product->get_available_variations() : false,
|
||||
'attributes' => $product->get_variation_attributes(),
|
||||
'selected_attributes' => $product->get_default_attributes(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -507,9 +525,13 @@ final class LicensedProductType
|
||||
// Show general and variations tabs
|
||||
$('.general_tab').show();
|
||||
$('.variations_tab').show();
|
||||
$('.variations_options').show();
|
||||
|
||||
// Hide shipping tab (virtual products)
|
||||
$('.shipping_tab').hide();
|
||||
|
||||
// Ensure the variations panel can be displayed
|
||||
$('#variable_product_options').show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,8 +540,29 @@ final class LicensedProductType
|
||||
|
||||
// On product type change
|
||||
$('#product-type').on('change', function() {
|
||||
toggleLicensedVariableOptions();
|
||||
// Use setTimeout to let WooCommerce finish its own processing first
|
||||
setTimeout(toggleLicensedVariableOptions, 100);
|
||||
});
|
||||
|
||||
// Re-apply after WooCommerce AJAX operations that may reset visibility
|
||||
$(document).on('woocommerce_variations_loaded', toggleLicensedVariableOptions);
|
||||
$(document).on('woocommerce_variations_added', toggleLicensedVariableOptions);
|
||||
$(document).on('woocommerce_variations_saved', toggleLicensedVariableOptions);
|
||||
|
||||
// Handle AJAX complete events for attribute saving
|
||||
$(document).ajaxComplete(function(event, xhr, settings) {
|
||||
// Check if this was a product data save or attribute action
|
||||
if (settings.data && (
|
||||
settings.data.indexOf('action=woocommerce_save_attributes') !== -1 ||
|
||||
settings.data.indexOf('action=woocommerce_load_variations') !== -1 ||
|
||||
settings.data.indexOf('action=woocommerce_add_variation') !== -1
|
||||
)) {
|
||||
setTimeout(toggleLicensedVariableOptions, 100);
|
||||
}
|
||||
});
|
||||
|
||||
// Also listen for the WooCommerce product type show/hide trigger
|
||||
$('body').on('woocommerce-product-type-change', toggleLicensedVariableOptions);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Plugin Name: WooCommerce Licensed Product
|
||||
* Plugin URI: https://src.bundespruefstelle.ch/magdev/wc-licensed-product
|
||||
* Description: WooCommerce plugin to sell software products using license keys with domain-based validation.
|
||||
* Version: 0.5.7
|
||||
* Version: 0.5.8
|
||||
* Author: Marco Graetsch
|
||||
* Author URI: https://src.bundespruefstelle.ch/magdev
|
||||
* License: GPL-2.0-or-later
|
||||
@@ -28,7 +28,7 @@ if (!defined('ABSPATH')) {
|
||||
}
|
||||
|
||||
// Plugin constants
|
||||
define('WC_LICENSED_PRODUCT_VERSION', '0.5.7');
|
||||
define('WC_LICENSED_PRODUCT_VERSION', '0.5.8');
|
||||
define('WC_LICENSED_PRODUCT_PLUGIN_FILE', __FILE__);
|
||||
define('WC_LICENSED_PRODUCT_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||
define('WC_LICENSED_PRODUCT_PLUGIN_URL', plugin_dir_url(__FILE__));
|
||||
|
||||
Reference in New Issue
Block a user