-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathPrivacyPolicy.php
More file actions
55 lines (47 loc) · 1.65 KB
/
PrivacyPolicy.php
File metadata and controls
55 lines (47 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Plausible Analytics | Admin Actions.
*
* @since 2.5.8
* @package WordPress
* @subpackage Plausible Analytics
*/
namespace Plausible\Analytics\WP\Admin;
class PrivacyPolicy {
/**
* Constructor.
*/
public function __construct() {
$this->init();
}
/**
* Action & filter hooks.
*
* @return void
*/
private function init() {
add_action( 'admin_init', [ $this, 'add_suggested_content' ] );
}
/**
* The content to add to WP's Privacy Policy page.
*
* @return void
*
* @codeCoverageIgnore
*/
public function add_suggested_content() {
if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
return;
}
$content = '<h2 class="wp-block-heading">' . __( 'Analytics', 'plausible-analytics' ) . '</h2>';
$content .= '<p>' . '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:', 'plausible-analytics' ) . '</strong></p>';
$content .= sprintf(
/* translators: %s: URL to Plausible's data policy page. */
__( "We use Plausible Analytics to collect usage statistics about our website. Plausible is a privacy-focused analytics provider that does not use cookies or other persistent identifiers.
The data collected includes information such as page URLs, referrer, device type, browser and country. The data is processed by Plausible Analytics on servers located in the European Union.
For more details, see Plausible's data policy: %s", 'plausible-analytics' ),
'<a href="https://plausible.io/data-policy" target="_blank" rel="noopener noreferrer">https://plausible.io/data-policy</a>'
);
wp_add_privacy_policy_content( 'Plausible Analytics', wp_kses_post( wpautop( $content, false ) ) );
}
}