Version 1.4.1 - Localhost license bypass and auto-updates
All checks were successful
Create Release Package / build-release (push) Successful in 1m3s

Added localhost/self-licensing license bypass and WordPress auto-update
integration from license server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-03 11:55:41 +01:00
parent a4b84f7e41
commit fa26247d1b
21 changed files with 1940 additions and 38 deletions

View File

@@ -1,7 +1,7 @@
# WooCommerce Tier and Package Prices - AI Context Document
**Last Updated:** 2026-01-29
**Current Version:** 1.4.0
**Last Updated:** 2026-02-03
**Current Version:** 1.4.1
**Author:** Marco Graetsch
**Project Status:** Production-ready WordPress plugin
@@ -20,9 +20,9 @@ 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. Always keep the `Known Bugs` section and create a section with the next bugfix and minor version after a release.
### Version 1.4.1
### Version 1.4.2
- No planned changes yet
- No planned features yet
## Technical Stack
@@ -1270,6 +1270,57 @@ The plugin architecture is solid and well-tested. Most bugs arise from:
- Uses `actions/checkout@v4` with `submodules: recursive`
- Modeled after working wp-fedistream implementation
### v1.4.1 Release Session (2026-02-03)
**Accomplished:**
1. Implemented localhost license bypass:
- Created `WC_TPP_License_Checker` class (singleton pattern)
- `is_localhost()` detects localhost environments: localhost, 127.0.0.1, ::1, `*.localhost`, `*.local`, `*.test`, `*.example`, `*.invalid`, and private IP ranges
- `is_self_licensing()` compares license server URL with site URL
- `is_license_valid()` returns true for localhost/self-licensing without server check
- Updated license status display to show bypass reason
2. Implemented auto-update system:
- Created `WC_TPP_Update_Checker` class (singleton pattern)
- Hooks into WordPress plugin update system (`pre_set_site_transient_update_plugins`, `plugins_api`, `http_request_args`, `auto_update_plugin`)
- Fetches update info from license server API endpoint
- Supports auto-install when WordPress performs background updates
- Configurable check frequency (1-168 hours)
3. Added Auto-Updates settings tab:
- Enable Update Notifications (checkbox, default: yes)
- Automatically Install Updates (checkbox, default: no, requires valid license)
- Check Frequency in Hours (number, default: 12)
- Update Status display with "Check for Updates" button
- AJAX handler for manual update checks
4. Updated all translation files:
- Added 23 new translation strings for v1.4.1
- All 7 language variants updated (de_DE, de_DE_informal, de_CH, de_CH_informal, fr_CH, it_CH, en_US)
- Compiled all .mo files
**Key Implementation Details:**
- License checker uses 1-hour cache for successful validation, 5-minute cache for errors
- Update checker respects `WC_TPP_DISABLE_AUTO_UPDATE` constant to disable updates
- Update server endpoint: `POST /wp-json/wc-licensed-product/v1/update-check`
- Both new classes are instantiated in main plugin's `includes()` method
- Auto-install requires valid license (disabled when no license active)
**New Files:**
- `includes/class-wc-tpp-license-checker.php`
- `includes/class-wc-tpp-update-checker.php`
**Modified Files:**
- `wc-tier-and-package-prices.php` - Version bump, include new classes
- `includes/class-wc-tpp-settings.php` - Added Auto-Updates tab, updated license status display
- All translation files (.pot, .po, .mo)
- `CHANGELOG.md` - v1.4.1 release notes
- `CLAUDE.md` - Updated version and session history
---
Always refer to this document when starting work on this project. Good luck!