PluginProbe
Metricool – Social media and site statistics / 2.1.1
Metricool – Social media and site statistics v2.1.1
2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
← All changes | app/Features/TaskManagement/Tasks/HistoricalDataTask.php +50 -0 2.0.0 → 2.1.1 View file →
@@ -1,0 +1,50 @@
1 +<?php
2 +
3 +declare(strict_types=1);
4 +
5 +namespace Metricool\Features\TaskManagement\Tasks;
6 +
7 +use Metricool\Support\Helpers\MetricoolUrl;
8 +use Metricool\Support\Helpers\Storages\EnvironmentConfig;
9 +
10 +class HistoricalDataTask extends AbstractTask
11 +{
12 + public const IDENTIFIER = 'store_historical_data';
13 +
14 + /**
15 + * @inheritDoc
16 + */
17 + protected bool $required = true;
18 +
19 + /**
20 + * @inheritDoc
21 + */
22 + protected bool $premium = true;
23 +
24 + private EnvironmentConfig $env;
25 +
26 + public function __construct(EnvironmentConfig $env)
27 + {
28 + $this->env = $env;
29 + }
30 +
31 + /**
32 + * @inheritDoc
33 + */
34 + public function getText(): string
35 + {
36 + return __('Gain access to analytics with unlimited historical data.', 'metricool');
37 + }
38 +
39 + /**
40 + * @inheritDoc
41 + */
42 + public function getAction(): array
43 + {
44 + return [
45 + 'text' => __('Upgrade', 'metricool'),
46 + 'link' => MetricoolUrl::adminUrl($this->env->getUrl('metricool.upgrade_premium_url')),
47 + 'target' => '_blank',
48 + ];
49 + }
50 +}