You've already forked wc-licensed-product
Update CLAUDE.md with Docker environment variable fix session
- Documented bug fix for API Verification Secret not visible in Docker - Added ResponseSigner::getServerSecret() method documentation - Removed known bug from roadmap (now fixed) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
34
CLAUDE.md
34
CLAUDE.md
@@ -32,7 +32,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.
|
**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.
|
||||||
|
|
||||||
No pending roadmap items.
|
### Known Bugs
|
||||||
|
|
||||||
|
None currently tracked.
|
||||||
|
|
||||||
## Technical Stack
|
## Technical Stack
|
||||||
|
|
||||||
@@ -1958,3 +1960,33 @@ composer install
|
|||||||
- Composer `symlink: false` doesn't always work - CI must manually replace symlinks with `cp -r`
|
- Composer `symlink: false` doesn't always work - CI must manually replace symlinks with `cp -r`
|
||||||
- Never create zip archives locally on this machine (fills up RAM indefinitely)
|
- Never create zip archives locally on this machine (fills up RAM indefinitely)
|
||||||
- Gitea API endpoint for releases by tag: `GET /api/v1/repos/{owner}/{repo}/releases/tags/{tag}`
|
- Gitea API endpoint for releases by tag: `GET /api/v1/repos/{owner}/{repo}/releases/tags/{tag}`
|
||||||
|
|
||||||
|
### 2026-02-01 - Bug Fix: API Verification Secret Not Visible
|
||||||
|
|
||||||
|
**Overview:**
|
||||||
|
|
||||||
|
Fixed the "API Verification Secret" (customer secret) not appearing on the customer account licenses page in Docker environments.
|
||||||
|
|
||||||
|
**Root Cause:**
|
||||||
|
|
||||||
|
The `WC_LICENSE_SERVER_SECRET` constant was not being defined even though the environment variable was set. In Docker WordPress setups using `wp-config-docker.php`, the `getenv_docker()` function retrieves values from environment variables, but the constant wasn't being created properly. The plugin was only checking for the PHP constant, not the environment variable directly.
|
||||||
|
|
||||||
|
**Fix:**
|
||||||
|
|
||||||
|
Added `ResponseSigner::getServerSecret()` static method that checks multiple sources for the server secret:
|
||||||
|
|
||||||
|
1. `WC_LICENSE_SERVER_SECRET` constant (standard WordPress configuration)
|
||||||
|
2. `getenv('WC_LICENSE_SERVER_SECRET')` (Docker environments)
|
||||||
|
3. `$_ENV['WC_LICENSE_SERVER_SECRET']` (some PHP configurations)
|
||||||
|
4. `$_SERVER['WC_LICENSE_SERVER_SECRET']` (fallback)
|
||||||
|
|
||||||
|
**Modified files:**
|
||||||
|
|
||||||
|
- `src/Api/ResponseSigner.php` - Added `getServerSecret()` method, updated `isSigningEnabled()` and `getCustomerSecretForLicense()` to use it
|
||||||
|
- `src/Plugin.php` - Updated to use `ResponseSigner::isSigningEnabled()` instead of direct constant check
|
||||||
|
|
||||||
|
**Technical notes:**
|
||||||
|
|
||||||
|
- The fix maintains backward compatibility with standard WordPress installations using constants
|
||||||
|
- Docker environments can now use environment variables directly without needing the constant to be defined
|
||||||
|
- All three methods (`isSigningEnabled()`, `getCustomerSecretForLicense()`, and constructor) now use the centralized `getServerSecret()` method
|
||||||
|
|||||||
Reference in New Issue
Block a user