Implement version 0.0.3 features

- Add file attachment support for product versions (Media Library)
- Add version auto-detection from uploaded filenames
- Implement secure customer downloads with hash verification
- Add license key copy-to-clipboard functionality
- Redesign customer licenses page with card-based UI
- Fix product versions meta box visibility for non-licensed types
- Add DownloadController for secure file delivery
- Update CLAUDE.md roadmap and session history

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 19:46:50 +01:00
parent 41e5f8d467
commit 78e43b9aea
15 changed files with 1036 additions and 133 deletions

View File

@@ -97,7 +97,8 @@ class VersionManager
int $productId,
string $version,
?string $releaseNotes = null,
?string $downloadUrl = null
?string $downloadUrl = null,
?int $attachmentId = null
): ?ProductVersion {
global $wpdb;
@@ -114,9 +115,10 @@ class VersionManager
'patch_version' => $parsed['patch'],
'release_notes' => $releaseNotes,
'download_url' => $downloadUrl,
'attachment_id' => $attachmentId,
'is_active' => 1,
],
['%d', '%s', '%d', '%d', '%d', '%s', '%s', '%d']
['%d', '%s', '%d', '%d', '%d', '%s', '%s', '%d', '%d']
);
if ($result === false) {
@@ -133,7 +135,8 @@ class VersionManager
int $versionId,
?string $releaseNotes = null,
?string $downloadUrl = null,
?bool $isActive = null
?bool $isActive = null,
?int $attachmentId = null
): bool {
global $wpdb;
@@ -155,6 +158,11 @@ class VersionManager
$formats[] = '%d';
}
if ($attachmentId !== null) {
$data['attachment_id'] = $attachmentId > 0 ? $attachmentId : null;
$formats[] = $attachmentId > 0 ? '%d' : null;
}
if (empty($data)) {
return true;
}