Add inline editing for licenses and copy license key button

- Add inline editing for status, expiry date, and domain fields
- Add copy-to-clipboard button for license keys
- Add AJAX handlers for inline editing with nonce verification
- Update LicenseManager with updateLicenseExpiry method
- Add new translations for inline editing strings (de_CH)
- Compile updated German translations to .mo file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 23:13:07 +01:00
parent e88423e882
commit 024733bb31
8 changed files with 872 additions and 29 deletions

View File

@@ -424,6 +424,39 @@ class LicenseManager
return $result !== false;
}
/**
* Update license expiry date
*
* @param int $licenseId License ID
* @param \DateTimeImmutable $expiresAt New expiry date
* @return bool Success
*/
public function updateLicenseExpiry(int $licenseId, \DateTimeImmutable $expiresAt): bool
{
global $wpdb;
$license = $this->getLicenseById($licenseId);
if (!$license) {
return false;
}
$tableName = Installer::getLicensesTable();
$result = $wpdb->update(
$tableName,
['expires_at' => $expiresAt->format('Y-m-d H:i:s')],
['id' => $licenseId],
['%s'],
['%d']
);
// If license was expired and new date is in the future, reactivate it
if ($result !== false && $license->getStatus() === License::STATUS_EXPIRED && $expiresAt > new \DateTimeImmutable()) {
$this->updateLicenseStatus($licenseId, License::STATUS_ACTIVE);
}
return $result !== false;
}
/**
* Update license domain
*/