wp/wp-admin/export-personal-data.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    10 require_once __DIR__ . '/admin.php';
    10 require_once __DIR__ . '/admin.php';
    11 
    11 
    12 if ( ! current_user_can( 'export_others_personal_data' ) ) {
    12 if ( ! current_user_can( 'export_others_personal_data' ) ) {
    13 	wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) );
    13 	wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) );
    14 }
    14 }
       
    15 
       
    16 // Contextual help - choose Help on the top right of admin panel to preview this.
       
    17 get_current_screen()->add_help_tab(
       
    18 	array(
       
    19 		'id'      => 'overview',
       
    20 		'title'   => __( 'Overview' ),
       
    21 		'content' =>
       
    22 					'<p>' . __( 'This screen allows you to manage requests for an export of personal data.' ) . '</p>' .
       
    23 					'<p>' . __( 'Providing an export of all data that a business or website has collected about an individual is a requirement of many Privacy Laws around the world, and is sometimes referred to as the "Right To Data Portability".' ) . '</p>' .
       
    24 					'<p>' . __( 'The tool associates data stored in WordPress by a supplied email address, including profile data and comments.' ) . '</p>' .
       
    25 					'<p>' . __( '<strong>Note: As this tool only gathers data from WordPress and participating plugins, you may need to do more to comply with export requests. You should also send the requestor any data collected by or stored with any 3rd party services used by your business or site.</strong>' ) . '</p>',
       
    26 	)
       
    27 );
       
    28 
       
    29 get_current_screen()->add_help_tab(
       
    30 	array(
       
    31 		'id'      => 'default-data',
       
    32 		'title'   => __( 'Default Data' ),
       
    33 		'content' =>
       
    34 					'<p>' . __( 'Personal data that is collected by WordPress and is displayed in the export files include:' ) . '</p>' .
       
    35 					'<p>' . __( '<strong>Profile Information</strong> &mdash; user email address, username, display name, nickname, first name, last name, description/bio, and registration date.' ) . '</p>' .
       
    36 					'<p>' . __( '<strong>Community Events Location</strong> &mdash; The IP Address of the user used for the Upcoming Community Events shown in the dashboard widget.' ) . '</p>' .
       
    37 					'<p>' . __( '<strong>Session Tokens</strong> &mdash; User login information, IP Addresses, Expiration Date, User Agent (Browser/OS), and Last Login.' ) . '</p>' .
       
    38 					'<p>' . __( '<strong>Comments</strong> &mdash; For any comments made by the user, Email Address, IP Address, User Agent (Browser/OS), Date/Time, Comment Content, and Content URL.' ) . '</p>' .
       
    39 					'<p>' . __( '<strong>Media</strong> &mdash; A list of URLs for all media file uploads made by the user.' ) . '</p>',
       
    40 	)
       
    41 );
       
    42 
       
    43 $privacy_policy_guide = '<p>' . sprintf(
       
    44 	/* translators: %s: URL to Privacy Policy Guide screen. */
       
    45 	__( 'If you are not sure, check the plugin documentation or contact the plugin author to see if the plugin collects data and if it supports the Data Exporter tool. This information may be available in the <a href="%s">Privacy Policy Guide</a>.' ),
       
    46 	admin_url( 'options-privacy.php?tab=policyguide' )
       
    47 ) . '</p>';
       
    48 
       
    49 get_current_screen()->add_help_tab(
       
    50 	array(
       
    51 		'id'      => 'plugin-data',
       
    52 		'title'   => __( 'Plugin Data' ),
       
    53 		'content' =>
       
    54 					'<p>' . __( 'Many plugins may collect or store personal data either in the WordPress database or remotely. Any Export Personal Data request should include data from plugins as well.' ) . '</p>' .
       
    55 					'<p>' . __( 'Plugin authors can <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-exporter-to-your-plugin/" target="_blank">learn more about how to add the Personal Data Exporter to a plugin here</a>.' ) . '</p>' .
       
    56 					$privacy_policy_guide,
       
    57 	)
       
    58 );
       
    59 
       
    60 get_current_screen()->set_help_sidebar(
       
    61 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
       
    62 	'<p>' . __( '<a href="https://wordpress.org/support/article/tools-export-personal-data-screen/">Documentation on Export Personal Data</a>' ) . '</p>' .
       
    63 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
       
    64 );
    15 
    65 
    16 // Handle list table actions.
    66 // Handle list table actions.
    17 _wp_personal_data_handle_actions();
    67 _wp_personal_data_handle_actions();
    18 
    68 
    19 // Cleans up failed and expired requests before displaying the list table.
    69 // Cleans up failed and expired requests before displaying the list table.
    50 require_once ABSPATH . 'wp-admin/admin-header.php';
   100 require_once ABSPATH . 'wp-admin/admin-header.php';
    51 ?>
   101 ?>
    52 
   102 
    53 <div class="wrap nosubsub">
   103 <div class="wrap nosubsub">
    54 	<h1><?php esc_html_e( 'Export Personal Data' ); ?></h1>
   104 	<h1><?php esc_html_e( 'Export Personal Data' ); ?></h1>
       
   105 	<p><?php _e( 'This tool helps site owners comply with local laws and regulations by exporting known data for a given user in a .zip file.' ); ?></p>
    55 	<hr class="wp-header-end" />
   106 	<hr class="wp-header-end" />
    56 
   107 
    57 	<?php settings_errors(); ?>
   108 	<?php settings_errors(); ?>
    58 
   109 
    59 	<form action="<?php echo esc_url( admin_url( 'export-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form">
   110 	<form action="<?php echo esc_url( admin_url( 'export-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form">
    60 		<h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>
   111 		<h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>
    61 		<p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
       
    62 
       
    63 		<div class="wp-privacy-request-form-field">
   112 		<div class="wp-privacy-request-form-field">
    64 			<label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
   113 		<table class="form-table">
    65 			<input type="text" required class="regular-text ltr" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
   114 				<tr>
    66 			<?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
   115 					<th scope="row">
       
   116 						<label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
       
   117 					</th>
       
   118 					<td>
       
   119 						<input type="text" required class="regular-text ltr" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
       
   120 					</td>
       
   121 				</tr>
       
   122 				<tr>
       
   123 					<th scope="row">
       
   124 						<?php _e( 'Confirmation email' ); ?>
       
   125 					</th>
       
   126 					<td>
       
   127 						<label for="send_confirmation_email">
       
   128 							<input type="checkbox" name="send_confirmation_email" id="send_confirmation_email" value="1" checked="checked" />
       
   129 							<?php _e( 'Send personal data export confirmation email.' ); ?>
       
   130 						</label>
       
   131 					</td>
       
   132 				</tr>
       
   133 			</table>
       
   134 			<p class="submit">
       
   135 				<?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
       
   136 			</p>
    67 		</div>
   137 		</div>
    68 		<?php wp_nonce_field( 'personal-data-request' ); ?>
   138 		<?php wp_nonce_field( 'personal-data-request' ); ?>
    69 		<input type="hidden" name="action" value="add_export_personal_data_request" />
   139 		<input type="hidden" name="action" value="add_export_personal_data_request" />
    70 		<input type="hidden" name="type_of_action" value="export_personal_data" />
   140 		<input type="hidden" name="type_of_action" value="export_personal_data" />
    71 	</form>
   141 	</form>