PluginProbe
Metricool – Social media and site statistics / 2.0.2
Metricool – Social media and site statistics v2.0.2
2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
metricool / app / Services / TrackingScriptService.php

TrackingScriptService.php in Metricool – Social media and site statistics 2.0.2, at app/Services/TrackingScriptService.php

42 lines 879 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Metricool\Services;
6
7 class TrackingScriptService
8 {
9 /**
10 * Stores the tracking hash in the database
11 */
12 public function storeTrackingHash(string $hash): self
13 {
14 update_option('metricool_tracking_script_hash', $hash);
15
16 return $this;
17 }
18
19 public function activateTrackingWidget(): self
20 {
21 update_option('metricool_tracking_script_active', true);
22
23 return $this;
24 }
25
26 /**
27 * Returns if the user has enabled the widget in the settings
28 */
29 public function isTrackingWidgetActive(): bool
30 {
31 return (bool) get_option('metricool_tracking_script_active', false);
32 }
33
34 /**
35 * Returns the hash from settings
36 */
37 public function getTrackingHash(): string
38 {
39 return (string) get_option('metricool_tracking_script_hash', '');
40 }
41 }
42