Major improvements: Fix download limits, enhance license display, fix software filenames
🔧 Bug Fixes: - Fixed download limits defaulting to 5 instead of 0 for unlimited downloads - Fixed software license filename sanitization (spaces→dashes, dots→underscores, proper .zip extension) - Software downloads now show as "Test-Plugin-v2-2-0.zip" instead of "Test Plugin v2.2.0" ✨ UI/UX Enhancements: - Redesigned license key display to span full table width with FontAwesome copy icons - Added responsive CSS styling for license key rows - Integrated FontAwesome CDN for modern copy icons 🏗️ Architecture Improvements: - Added comprehensive filename sanitization in both download handler and API paths - Enhanced software license product handling for local package files - Improved error handling and logging throughout download processes 📦 Infrastructure: - Added Gitea workflows for automated releases on push to main - Created comprehensive .gitignore excluding test files and browser automation - Updated documentation with all recent improvements and technical insights 🔍 Technical Details: - Software license products served from wp-content/uploads/wpdd-packages/ - Download flow: token → process_download_by_token() → process_download() → deliver_file() - Dual path coverage for both API downloads and regular file delivery - Version placeholder system for automated deployment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,9 @@ jQuery(document).ready(function($) {
|
||||
|
||||
// Download status check
|
||||
$(document).on('click', '.wpdd-check-download', this.checkDownloadStatus);
|
||||
|
||||
// Copy license key
|
||||
$(document).on('click', '.wpdd-copy-license', this.copyLicenseKey);
|
||||
},
|
||||
|
||||
initProductCards: function() {
|
||||
@@ -358,6 +361,61 @@ jQuery(document).ready(function($) {
|
||||
|
||||
formatPrice: function(price) {
|
||||
return '$' + parseFloat(price).toFixed(2);
|
||||
},
|
||||
|
||||
copyLicenseKey: function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $button = $(this);
|
||||
var licenseKey = $button.data('license');
|
||||
|
||||
if (!licenseKey) {
|
||||
WPDD.showNotice('No license key to copy', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to use the modern clipboard API
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
navigator.clipboard.writeText(licenseKey).then(function() {
|
||||
WPDD.showNotice('License key copied to clipboard!', 'success');
|
||||
$button.text('Copied!');
|
||||
setTimeout(function() {
|
||||
$button.text('Copy');
|
||||
}, 2000);
|
||||
}).catch(function() {
|
||||
WPDD.fallbackCopyTextToClipboard(licenseKey, $button);
|
||||
});
|
||||
} else {
|
||||
WPDD.fallbackCopyTextToClipboard(licenseKey, $button);
|
||||
}
|
||||
},
|
||||
|
||||
fallbackCopyTextToClipboard: function(text, $button) {
|
||||
var textArea = document.createElement('textarea');
|
||||
textArea.value = text;
|
||||
textArea.style.position = 'fixed';
|
||||
textArea.style.left = '-999999px';
|
||||
textArea.style.top = '-999999px';
|
||||
document.body.appendChild(textArea);
|
||||
textArea.focus();
|
||||
textArea.select();
|
||||
|
||||
try {
|
||||
var successful = document.execCommand('copy');
|
||||
if (successful) {
|
||||
WPDD.showNotice('License key copied to clipboard!', 'success');
|
||||
$button.text('Copied!');
|
||||
setTimeout(function() {
|
||||
$button.text('Copy');
|
||||
}, 2000);
|
||||
} else {
|
||||
WPDD.showNotice('Failed to copy license key', 'error');
|
||||
}
|
||||
} catch (err) {
|
||||
WPDD.showNotice('Failed to copy license key', 'error');
|
||||
}
|
||||
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user