| 1 |
<?php namespace TierPricingTable\Services; |
| 2 |
|
| 3 |
/* |
| 4 |
* Class Status |
| 5 |
* |
| 6 |
* @package TierPricingTable/Services |
| 7 |
*/ |
| 8 |
|
| 9 |
use TierPricingTable\Admin\Tips\Tip; |
| 10 |
use TierPricingTable\Admin\Tips\TipsManager; |
| 11 |
use TierPricingTable\Core\ServiceContainerTrait; |
| 12 |
use TierPricingTable\TierPricingTablePlugin; |
| 13 |
|
| 14 |
class SystemStatusReportService { |
| 15 |
|
| 16 |
use ServiceContainerTrait; |
| 17 |
|
| 18 |
public function __construct() { |
| 19 |
add_action( 'woocommerce_system_status_report', array( $this, 'addReport' ) ); |
| 20 |
} |
| 21 |
|
| 22 |
public function addReport() { |
| 23 |
?> |
| 24 |
<table class="wc_status_table widefat" cellspacing="0"> |
| 25 |
<thead> |
| 26 |
<tr> |
| 27 |
<th colspan="3" data-export-label="Tiered Pricing Table"> |
| 28 |
<h2><?php esc_html_e( 'Tiered Pricing Table', 'tier-pricing-table' ); ?></h2> |
| 29 |
</th> |
| 30 |
</tr> |
| 31 |
</thead> |
| 32 |
<tbody> |
| 33 |
<tr> |
| 34 |
<td data-export-label="Tiered Pricing: Activation date"> |
| 35 |
<?php esc_html_e( 'Activation date', 'tier-pricing-table' ); ?>: |
| 36 |
</td> |
| 37 |
|
| 38 |
<td> |
| 39 |
<?php |
| 40 |
$time = TierPricingTablePlugin::getPluginActivationDate(); |
| 41 |
|
| 42 |
if ( ! $time ) { |
| 43 |
echo '----'; |
| 44 |
} |
| 45 |
$activationDate = gmdate( 'Y-m-d H:i:s', $time ); |
| 46 |
$diff = human_time_diff( time(), $time ); |
| 47 |
|
| 48 |
echo esc_html( $activationDate . " ($diff)" ); |
| 49 |
?> |
| 50 |
</td> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<td data-export-label="Tiered Pricing: Seen notifications"> |
| 54 |
<?php esc_html_e( 'Seen notifications', 'tier-pricing-table' ); ?>: |
| 55 |
</td> |
| 56 |
|
| 57 |
<td> |
| 58 |
<?php |
| 59 |
$seenNotifications = $this->getContainer()->getNotificationManager()->getSeenNotifications(); |
| 60 |
|
| 61 |
echo esc_html( implode( ', ', array_keys( $seenNotifications ) ) ); |
| 62 |
?> |
| 63 |
</td> |
| 64 |
</tr> |
| 65 |
<tr> |
| 66 |
<td data-export-label="Tiered Pricing: Tips hidden"> |
| 67 |
<?php esc_html_e( 'Tips hidden', 'tier-pricing-table' ); ?>: |
| 68 |
</td> |
| 69 |
|
| 70 |
<td> |
| 71 |
<?php |
| 72 |
echo esc_html( implode( ', ', Tip::getSeenTips() ) ); |
| 73 |
?> |
| 74 |
</td> |
| 75 |
</tr> |
| 76 |
</tbody> |
| 77 |
</table> |
| 78 |
<?php |
| 79 |
} |
| 80 |
|
| 81 |
} |