Implement version 0.0.11 features

- Add Created date column to admin license overview
- Add License Statistics page under WooCommerce menu
- Add REST API endpoints for analytics data with time-series support
- WooCommerce Analytics integration via submenu page

New files:
- src/Admin/AnalyticsController.php
- templates/admin/statistics.html.twig

REST API endpoints:
- GET /wc-licensed-product/v1/analytics/stats
- GET /wc-licensed-product/v1/analytics/products

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 23:50:57 +01:00
parent ff9b27e811
commit 45531f86d6
11 changed files with 864 additions and 11 deletions

View File

@@ -1253,6 +1253,7 @@ final class AdminController
<th><?php esc_html_e('Customer', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Domain', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Status', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Created', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Expires', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Actions', 'wc-licensed-product'); ?></th>
</tr>
@@ -1260,7 +1261,7 @@ final class AdminController
<tbody>
<?php if (empty($enrichedLicenses)): ?>
<tr>
<td colspan="8"><?php esc_html_e('No licenses found.', 'wc-licensed-product'); ?></td>
<td colspan="9"><?php esc_html_e('No licenses found.', 'wc-licensed-product'); ?></td>
</tr>
<?php else: ?>
<?php foreach ($enrichedLicenses as $item): ?>
@@ -1320,6 +1321,9 @@ final class AdminController
<button type="button" class="wclp-cancel-btn button button-small"><?php esc_html_e('Cancel', 'wc-licensed-product'); ?></button>
</div>
</td>
<td class="wclp-created-cell">
<?php echo esc_html($item['license']->getCreatedAt()->format(get_option('date_format'))); ?>
</td>
<td class="wclp-editable-cell" data-field="expiry" data-license-id="<?php echo esc_attr($item['license']->getId()); ?>">
<?php $expiresAt = $item['license']->getExpiresAt(); ?>
<span class="wclp-display-value">
@@ -1387,6 +1391,7 @@ final class AdminController
<th><?php esc_html_e('Customer', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Domain', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Status', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Created', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Expires', 'wc-licensed-product'); ?></th>
<th><?php esc_html_e('Actions', 'wc-licensed-product'); ?></th>
</tr>