You've already forked wc-licensed-product
Remove License Statistics page due to issues
Keep existing Reports > Licenses dashboard which works correctly. Version 0.0.11 now only includes the Created column in license overview. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,196 +0,0 @@
|
||||
<div class="wrap wclp-statistics">
|
||||
<h1>{{ __('License Statistics') }}</h1>
|
||||
|
||||
<div class="wclp-stats-overview">
|
||||
<div class="wclp-stat-cards">
|
||||
<div class="wclp-stat-card wclp-stat-total">
|
||||
<div class="wclp-stat-icon"><span class="dashicons dashicons-admin-network"></span></div>
|
||||
<div class="wclp-stat-content">
|
||||
<span class="wclp-stat-number">{{ stats.total }}</span>
|
||||
<span class="wclp-stat-label">{{ __('Total Licenses') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wclp-stat-card wclp-stat-active">
|
||||
<div class="wclp-stat-icon"><span class="dashicons dashicons-yes-alt"></span></div>
|
||||
<div class="wclp-stat-content">
|
||||
<span class="wclp-stat-number">{{ stats.by_status.active }}</span>
|
||||
<span class="wclp-stat-label">{{ __('Active') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wclp-stat-card wclp-stat-inactive">
|
||||
<div class="wclp-stat-icon"><span class="dashicons dashicons-marker"></span></div>
|
||||
<div class="wclp-stat-content">
|
||||
<span class="wclp-stat-number">{{ stats.by_status.inactive }}</span>
|
||||
<span class="wclp-stat-label">{{ __('Inactive') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wclp-stat-card wclp-stat-expired">
|
||||
<div class="wclp-stat-icon"><span class="dashicons dashicons-calendar-alt"></span></div>
|
||||
<div class="wclp-stat-content">
|
||||
<span class="wclp-stat-number">{{ stats.by_status.expired }}</span>
|
||||
<span class="wclp-stat-label">{{ __('Expired') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wclp-stat-card wclp-stat-revoked">
|
||||
<div class="wclp-stat-icon"><span class="dashicons dashicons-dismiss"></span></div>
|
||||
<div class="wclp-stat-content">
|
||||
<span class="wclp-stat-number">{{ stats.by_status.revoked }}</span>
|
||||
<span class="wclp-stat-label">{{ __('Revoked') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if stats.expiring_soon > 0 %}
|
||||
<div class="notice notice-warning">
|
||||
<p>
|
||||
<span class="dashicons dashicons-warning"></span>
|
||||
<strong>{{ __('Attention:') }}</strong>
|
||||
{{ stats.expiring_soon }} {{ stats.expiring_soon == 1 ? __('license is') : __('licenses are') }}
|
||||
{{ __('expiring within the next 30 days.') }}
|
||||
<a href="{{ admin_url }}?page=wc-licenses">{{ __('View Licenses') }}</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="wclp-stats-details">
|
||||
<div class="wclp-stat-box">
|
||||
<h3>{{ __('License Types') }}</h3>
|
||||
<table class="widefat striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ __('Lifetime Licenses') }}</td>
|
||||
<td class="wclp-stat-value">{{ stats.lifetime }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('Time-limited Licenses') }}</td>
|
||||
<td class="wclp-stat-value">{{ stats.expiring }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('Expiring Soon (30 days)') }}</td>
|
||||
<td class="wclp-stat-value {% if stats.expiring_soon > 0 %}wclp-warning{% endif %}">
|
||||
{{ stats.expiring_soon }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="wclp-stat-box">
|
||||
<h3>{{ __('Top Products by Licenses') }}</h3>
|
||||
{% if stats.by_product is empty %}
|
||||
<p class="description">{{ __('No license data available yet.') }}</p>
|
||||
{% else %}
|
||||
<table class="widefat striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Product') }}</th>
|
||||
<th class="wclp-stat-value">{{ __('Licenses') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for product in stats.by_product %}
|
||||
<tr>
|
||||
<td>{{ esc_html(product.product_name) }}</td>
|
||||
<td class="wclp-stat-value">{{ product.count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="wclp-stat-box">
|
||||
<h3>{{ __('Top Domains') }}</h3>
|
||||
{% if stats.top_domains is empty %}
|
||||
<p class="description">{{ __('No license data available yet.') }}</p>
|
||||
{% else %}
|
||||
<table class="widefat striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Domain') }}</th>
|
||||
<th class="wclp-stat-value">{{ __('Licenses') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for domain in stats.top_domains %}
|
||||
<tr>
|
||||
<td><code>{{ esc_html(domain.domain) }}</code></td>
|
||||
<td class="wclp-stat-value">{{ domain.count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wclp-chart-section">
|
||||
<h3>{{ __('Licenses Created (Last 12 Months)') }}</h3>
|
||||
{% if stats.monthly is empty %}
|
||||
<p class="description">{{ __('No license data available yet.') }}</p>
|
||||
{% else %}
|
||||
<div class="wclp-chart-container">
|
||||
<div class="wclp-bar-chart" id="wclp-monthly-chart">
|
||||
{% set max_value = 1 %}
|
||||
{% for count in stats.monthly %}
|
||||
{% if count > max_value %}
|
||||
{% set max_value = count %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for month, count in stats.monthly %}
|
||||
<div class="wclp-bar-wrapper">
|
||||
<div class="wclp-bar" style="height: {{ (count / max_value * 100)|round }}%;" title="{{ count }} {{ __('licenses') }}">
|
||||
<span class="wclp-bar-value">{{ count }}</span>
|
||||
</div>
|
||||
<span class="wclp-bar-label">{{ month|date('M Y') }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wclp-stats-actions">
|
||||
<h2>{{ __('Quick Actions') }}</h2>
|
||||
<div class="wclp-action-buttons">
|
||||
<a href="{{ admin_url }}?page=wc-licenses" class="button button-primary">
|
||||
<span class="dashicons dashicons-admin-network"></span>
|
||||
{{ __('Manage Licenses') }}
|
||||
</a>
|
||||
<a href="{{ admin_url }}?page=wc-licenses&action=export_csv" class="button">
|
||||
<span class="dashicons dashicons-download"></span>
|
||||
{{ __('Export to CSV') }}
|
||||
</a>
|
||||
<a href="{{ admin_url }}?page=wc-settings&tab=licensed_product" class="button">
|
||||
<span class="dashicons dashicons-admin-generic"></span>
|
||||
{{ __('Settings') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wclp-api-info">
|
||||
<h3>{{ __('REST API Endpoints') }}</h3>
|
||||
<p class="description">
|
||||
{{ __('The following REST API endpoints are available for retrieving license statistics:') }}
|
||||
</p>
|
||||
<table class="widefat striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Endpoint') }}</th>
|
||||
<th>{{ __('Description') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>GET {{ rest_url }}stats</code></td>
|
||||
<td>{{ __('Get license statistics with time-series data') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>GET {{ rest_url }}products</code></td>
|
||||
<td>{{ __('Get license counts by product') }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user