PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / src / helper / analytics / class-rate.php

class-rate.php in Defender Security – Malware Scanner, Login Security & Firewall 6.3.0, at src/helper/analytics/class-rate.php

90 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Responsible for gathering analytics data for the rating functionality.
4 *
5 * @package WP_Defender\Helper\Analytics
6 */
7
8 namespace WP_Defender\Helper\Analytics;
9
10 use WP_Defender\Event;
11 use WP_Defender\Component\Rate as Rate_Component;
12
13 /**
14 * Gather analytics data required for rating functionality.
15 */
16 class Rate extends Event {
17
18 public const EVENT_ARCHIEVEMENT_REVIEW_PROMPT = 'Rating Notice';
19
20 /**
21 * Provides data for the frontend.
22 *
23 * @return array An array of data for the frontend.
24 */
25 public function data_frontend(): array {
26 return array();
27 }
28
29 /**
30 * Converts the current state of the object to an array.
31 *
32 * @return array Returns an associative array of object properties.
33 */
34 public function to_array(): array {
35 return array();
36 }
37
38 /**
39 * Imports data into the model.
40 *
41 * @param array $data Data to be imported into the model.
42 */
43 public function import_data( array $data ) {
44 }
45
46 /**
47 * Removes settings for all submodules.
48 */
49 public function remove_settings() {
50 }
51
52 /**
53 * Delete all the data & the cache.
54 */
55 public function remove_data() {
56 }
57
58 /**
59 * Exports strings.
60 *
61 * @return array
62 */
63 public function export_strings() {
64 return array();
65 }
66
67 /**
68 * Track feature.
69 *
70 * @param string $notice_slug Notice slug.
71 * @param string $action CTA clicked.
72 * @param string $location Page showing the notice. 'Issues' is added since v6.0.
73 *
74 * @return void
75 */
76 public function track_rating( string $notice_slug, string $action, string $location ) {
77 $prompt = Rate_Component::get_label_by_slug( $notice_slug );
78 if ( '' !== $prompt && '' !== $location ) {
79 $this->track_feature(
80 self::EVENT_ARCHIEVEMENT_REVIEW_PROMPT,
81 array(
82 'Action' => $action,
83 'Notice Type' => $prompt,
84 'Location' => $location,
85 )
86 );
87 }
88 }
89 }
90