| 1 |
<?php |
| 2 |
/** |
| 3 |
* This file is responsible for adding help sections to the plugin pages. |
| 4 |
* |
| 5 |
* @link http://trewknowledge.com |
| 6 |
* @since 0.1.0 |
| 7 |
* |
| 8 |
* @package GDPR |
| 9 |
* @subpackage includes |
| 10 |
* @author Fernando Claussen <fernandoclaussen@gmail.com> |
| 11 |
*/ |
| 12 |
|
| 13 |
/** |
| 14 |
* A class that adds help tabs to the plugin pages. |
| 15 |
* |
| 16 |
* @since 1.0.0 |
| 17 |
* @package GDPR |
| 18 |
* @subpackage includes |
| 19 |
* @author Fernando Claussen <fernandoclaussen@gmail.com> |
| 20 |
*/ |
| 21 |
class GDPR_Help { |
| 22 |
|
| 23 |
/** |
| 24 |
* Add the requests page help tabs. |
| 25 |
* @since 1.0.0 |
| 26 |
* @author Fernando Claussen <fernandoclaussen@gmail.com> |
| 27 |
* @static |
| 28 |
*/ |
| 29 |
public static function add_requests_help() { |
| 30 |
$overview = '<h2>' . esc_html__( 'Overview', 'gdpr' ) . '</h2>' . |
| 31 |
'<p>' . esc_html__( 'This page has multiple request tables. Users can request multiple things like getting deleted from the site or having their data rectified. All requests will come to these tables.', 'gdpr' ) . '</p>'; |
| 32 |
get_current_screen()->add_help_tab( array( |
| 33 |
'id' => 'overview', |
| 34 |
'title' => esc_html__( 'Overview', 'gdpr' ), |
| 35 |
'content' => $overview, |
| 36 |
) ); |
| 37 |
|
| 38 |
$rectify_help = '<h2>' . esc_html__( 'Rectify Data', 'gdpr' ) . '</h2>' . |
| 39 |
'<p>' . esc_html__( 'Users may request to have their data rectified. They can place a request somewhere on your site and those requests will show up here.', 'gdpr' ) . '</p>' . |
| 40 |
'<p>' . esc_html__( 'When you complete the request, mark it as resolved and the requester will get a notification email confirming that their request was resolved.', 'gdpr' ) . '</p>'; |
| 41 |
get_current_screen()->add_help_tab( array( |
| 42 |
'id' => 'rectify-data', |
| 43 |
'title' => esc_html__( 'Rectify Data', 'gdpr' ), |
| 44 |
'content' => $rectify_help, |
| 45 |
) ); |
| 46 |
|
| 47 |
$complaint_help = '<h2>' . esc_html__( 'Complaints', 'gdpr' ) . '</h2>' . |
| 48 |
'<p>' . esc_html__( 'Users may complain about something that happened. They can place a complaint somewhere on your site and those complaints will show up here.', 'gdpr' ) . '</p>' . |
| 49 |
'<p>' . esc_html__( 'When you resolve the problem, mark it as resolved and the requester will get a notification email confirming that his complaint was resolved.', 'gdpr' ) . '</p>'; |
| 50 |
get_current_screen()->add_help_tab( array( |
| 51 |
'id' => 'complaint', |
| 52 |
'title' => esc_html__( 'Complaints', 'gdpr' ), |
| 53 |
'content' => $complaint_help, |
| 54 |
) ); |
| 55 |
|
| 56 |
$erasure_help = '<h2>' . esc_html__( 'Erasure', 'gdpr' ) . '</h2>' . |
| 57 |
'<p>' . esc_html__( 'Users may request to be deleted from the site. If they don\'t have any content published on the site (including comments) they will be removed from the site automatically. Otherwise, they will show up at this review table where you can reassign or delete their published content and anonymize his comments.', 'gdpr' ) . '</p>' . |
| 58 |
'<p>' . esc_html__( 'User may request their data to be deleted. The controller has, according to GDPR, 30 days to fulfill the request. On some occasions, you can ask to extend this time limit. When the request has been resolved the user will receive a notification that their account has been closed.', 'gdpr' ) . '</p>'; |
| 59 |
get_current_screen()->add_help_tab( array( |
| 60 |
'id' => 'erasure', |
| 61 |
'title' => esc_html__( 'Erasures', 'gdpr' ), |
| 62 |
'content' => $erasure_help, |
| 63 |
) ); |
| 64 |
} |
| 65 |
|
| 66 |
/** |
| 67 |
* Add the tools page help tabs. |
| 68 |
* @since 1.0.0 |
| 69 |
* @author Fernando Claussen <fernandoclaussen@gmail.com> |
| 70 |
* @static |
| 71 |
*/ |
| 72 |
public static function add_tools_help() { |
| 73 |
$overview = '<h2>' . esc_html__( 'Overview', 'gdpr' ) . '</h2>' . |
| 74 |
'<p>' . esc_html__( 'We added tools to make your life easier when you need to perform administrative tasks like notify all your users of a possible data breach.', 'gdpr' ) . '</p>'; |
| 75 |
get_current_screen()->add_help_tab( array( |
| 76 |
'id' => 'overview', |
| 77 |
'title' => esc_html__( 'Overview', 'gdpr' ), |
| 78 |
'content' => $overview, |
| 79 |
) ); |
| 80 |
|
| 81 |
$access_data_help = '<h2>' . esc_html__( 'Access Data', 'gdpr' ) . '</h2>' . |
| 82 |
'<p>' . esc_html__( 'Use this page to look for all known data about a user. You can look it up using the user\'s email address and are able to download it in XML and JSON formats.', 'gdpr' ) . '</p>'; |
| 83 |
get_current_screen()->add_help_tab( array( |
| 84 |
'id' => 'access-data', |
| 85 |
'title' => esc_html__( 'Access Data', 'gdpr' ), |
| 86 |
'content' => $access_data_help, |
| 87 |
) ); |
| 88 |
|
| 89 |
$data_breach_help = '<h2>' . esc_html__( 'Data Breach Notification', 'gdpr' ) . '</h2>' . |
| 90 |
'<p><strong>' . esc_html__( 'Use this carefully.', 'gdpr' ) . '</strong></p>' . |
| 91 |
'<p>' . esc_html__( 'This will send a mass email to all your users with the information provided on these fields. This email is throttled based on the hourly limit set on the plugin settings page. ', 'gdpr' ) . '</p>' . |
| 92 |
'<p><strong>' . esc_html__( 'Only use this tool if you believe your site has been compromised and that your user\'s personal data might have been leaked.', 'gdpr' ) . '</strong></p>'; |
| 93 |
get_current_screen()->add_help_tab( array( |
| 94 |
'id' => 'data-breach', |
| 95 |
'title' => esc_html__( 'Data Breach', 'gdpr' ), |
| 96 |
'content' => $data_breach_help, |
| 97 |
) ); |
| 98 |
|
| 99 |
$audit_log_help = '<h2>' . esc_html__( 'Audit Log', 'gdpr' ) . '</h2>' . |
| 100 |
'<p><strong>' . esc_html__( 'We do not log any of the user\'s personal data.', 'gdpr' ) . '</strong></p>' . |
| 101 |
'<p>' . esc_html__( 'All logs are encrypted before saving to the database. An encrypted log file is created whenever a user gets removed from the site.', 'gdpr' ) . '</p>' . |
| 102 |
'<p>' . esc_html__( 'This tool will keep a record of some actions such as changing consent preferences, placing a request, data breach notifications received, etc…', 'gdpr' ) . '<br />' . |
| 103 |
esc_html__( 'The only way to read the logs is to search for the user email. If the data subject is not a registered site user anymore, you need to ask for the 6 digit token that was provided during deletion. That will allow this tool to look for a log file with his information.', 'gdpr' ) . '</p>'; |
| 104 |
get_current_screen()->add_help_tab( array( |
| 105 |
'id' => 'audit-log', |
| 106 |
'title' => esc_html__( 'Audit Log', 'gdpr' ), |
| 107 |
'content' => $audit_log_help, |
| 108 |
) ); |
| 109 |
} |
| 110 |
|
| 111 |
/** |
| 112 |
* Add the settings page help tabs. |
| 113 |
* @since 1.0.0 |
| 114 |
* @author Fernando Claussen <fernandoclaussen@gmail.com> |
| 115 |
* @static |
| 116 |
*/ |
| 117 |
public static function add_settings_help() { |
| 118 |
$general_settings_help = '<h2>' . esc_html__( 'General Settings', 'gdpr' ) . '</h2>' . |
| 119 |
'<p>' . esc_html__( 'This plugin needs to know your privacy policy page to track updates to it and ask users to re-consent to your new terms.', 'gdpr' ) . '</p>' . |
| 120 |
'<p>' . esc_html__( 'When sending a data breach notification to your users, we need to throttle the emails because of server limitations. This is an hourly limit. Check with your hosting provider before changing this value.', 'gdpr' ) . '</p>'; |
| 121 |
get_current_screen()->add_help_tab( array( |
| 122 |
'id' => 'general', |
| 123 |
'title' => esc_html__( 'General Settings', 'gdpr' ), |
| 124 |
'content' => $general_settings_help, |
| 125 |
) ); |
| 126 |
|
| 127 |
$cookies_settings_help = sprintf( '<h2>' . esc_html__( 'Cookie Management', 'gdpr' ) . '</h2>' . |
| 128 |
'<p>' . esc_html__( 'Fill out every information you can about the cookies your site uses. Set the cookies that you set under Cookies Used and cookies used and set by third parties under the Third party domains.', 'gdpr' ) . '</p>' . |
| 129 |
/* translators: the function */ |
| 130 |
'<p>' . esc_html__( 'You must ask your developer to wrap the code that sets the cookies with our helper function %s.', 'gdpr' ) . '</p>' . |
| 131 |
'<p>' . esc_html__( 'Some services like Google Analytics provide a way to opt out from their code with an extra parameter to their snippet.', 'gdpr' ) . '</p>' . |
| 132 |
'<h3>' . esc_html__( 'External Links', 'gdpr' ) . '</h3>' . |
| 133 |
'<ul>' . |
| 134 |
'<li><a href="https://codex.wordpress.org/WordPress_Cookies" title="' . esc_attr__( 'WordPress cookies', 'gdpr' ) . '" target="_blank">'. esc_html__( 'WordPress cookies', 'gdpr' ) .'</a></li>' . |
| 135 |
'</ul>', |
| 136 |
'<code>is_allowed_cookie( $cookie_name )</code>' |
| 137 |
); |
| 138 |
get_current_screen()->add_help_tab( array( |
| 139 |
'id' => 'cookies', |
| 140 |
'title' => esc_html__( 'Cookie Management', 'gdpr' ), |
| 141 |
'content' => $cookies_settings_help, |
| 142 |
) ); |
| 143 |
|
| 144 |
$consent_settings_help = sprintf( '<h2>' . esc_html__( 'Consent Management ( Coming Soon )', 'gdpr' ) . '</h2>' . |
| 145 |
'<p>' . esc_html__( 'All consents are disabled by default. On first registration, your users will need to consent to your privacy policy. Depending on your privacy policy you should register multiple types of consent on this page and allow them to be toggled on/off.', 'gdpr' ) . '</p>' . |
| 146 |
/* translators: the function */ |
| 147 |
'<p>' . esc_html__( 'If you have an optional consent type, you must have a developer wrap the functionality in our helper function %s.', 'gdpr' ) . '</p>' . |
| 148 |
'<p><strong>' . esc_html__( 'i.e.', 'gdpr' ) . '</strong><br />' . esc_html__( 'You registered email marketing as an optional consent but the user did not actively opt into it on their profile page. You should have your email capture form wrapped in our helper function to block registration or better yet, not even display the email capture form. Same goes for blocking adding the user to your mailing system on registration if consent is not given.', 'gdpr' ) . '</p>' . |
| 149 |
'<h3>' . esc_html__( 'External Links', 'gdpr' ) . '</h3>' . |
| 150 |
'<ul>' . |
| 151 |
'<li><a href="https://gdpr-info.eu/art-7-gdpr/" title="' . esc_attr__( 'Article 7 - Conditions for consent', 'gdpr' ) . '" target="_blank">'. esc_html__( 'Article 7 - Conditions for consent', 'gdpr' ) .'</a></li>' . |
| 152 |
'<li><a href="https://gdpr-info.eu/art-8-gdpr/" title="' . esc_attr__( "Article 8 - conditions applicable to child's consent in relation to information society services", 'gdpr' ) . '" target="_blank">'. esc_html__( "Article 8 - conditions applicable to child's consent in relation to information society services", 'gdpr' ) .'</a></li>' . |
| 153 |
'<li><a href="https://gdpr-info.eu/recitals/no-42/" title="' . esc_attr__( 'Recital 42 - Burden of proof and requirements for consent', 'gdpr' ) . '" target="_blank">'. esc_html__( 'Recital 42 - Burden of proof and requirements for consent', 'gdpr' ) .'</a></li>' . |
| 154 |
'<li><a href="https://gdpr-info.eu/recitals/no-43/" title="' . esc_attr__( 'Recital 43 - Freely Given consent', 'gdpr' ) . '" target="_blank">'. esc_html__( 'Recital 43 - Freely Given consent', 'gdpr' ) .'</a></li>' . |
| 155 |
'</ul>', |
| 156 |
'<code>have_consent( $consent_id )</code>' |
| 157 |
); |
| 158 |
|
| 159 |
get_current_screen()->add_help_tab( array( |
| 160 |
'id' => 'consents', |
| 161 |
'title' => esc_html__( 'Consent Management', 'gdpr' ), |
| 162 |
'content' => $consent_settings_help, |
| 163 |
) ); |
| 164 |
} |
| 165 |
|
| 166 |
/** |
| 167 |
* Add the telemetry page help tabs. |
| 168 |
* @since 1.0.0 |
| 169 |
* @author Fernando Claussen <fernandoclaussen@gmail.com> |
| 170 |
* @static |
| 171 |
*/ |
| 172 |
public static function add_telemetry_help() { |
| 173 |
if ( 'edit-telemetry' !== get_current_screen()->id ) { |
| 174 |
return; |
| 175 |
} |
| 176 |
|
| 177 |
$telemetry_help = '<h2>' . esc_html__( 'Overview', 'gdpr' ) . '</h2>' . |
| 178 |
'<p>' . esc_html__( 'This is all data that are being sent outside of your site. WordPress send some data to it\'s servers to be able to do automatic updates. You can reduce the amount of data being sent using filters.', 'gdpr' ) . '</p>' . |
| 179 |
'<p>' . esc_html__( 'Some plugins also capture data and send it to their servers. Such practice is not allowed for plugins hosted on wordpress.org plugin repository. In case this is a Premium plugin, you should have been given the option to choose which type of data you want to send.', 'gdpr' ) . '</p>' . |
| 180 |
'<p>' . esc_html__( 'Use this tool to identify plugins or themes sending potential personal data outside of your server and take action if necessary.', 'gdpr' ) . '</p>' . |
| 181 |
'<p>' . esc_html__( 'All information on this page is automatically deleted every 12 hours so this doesn\'t grow too large and slow your site.' ) . '</p>'; |
| 182 |
get_current_screen()->add_help_tab( array( |
| 183 |
'id' => 'overview', |
| 184 |
'title' => esc_html__( 'Overview', 'gdpr' ), |
| 185 |
'content' => $telemetry_help, |
| 186 |
) ); |
| 187 |
} |
| 188 |
} |
| 189 |
|