[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/ -> erase-personal-data.php (source)

   1  <?php
   2  /**
   3   * Privacy tools, Erase Personal Data screen.
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   */
   8  
   9  /** WordPress Administration Bootstrap */
  10  require_once  __DIR__ . '/admin.php';
  11  
  12  if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {
  13      wp_die( __( 'Sorry, you are not allowed to erase personal data on this site.' ) );
  14  }
  15  
  16  // Used in the HTML title tag.
  17  $title = __( 'Erase Personal Data' );
  18  
  19  // Contextual help - choose Help on the top right of admin panel to preview this.
  20  get_current_screen()->add_help_tab(
  21      array(
  22          'id'      => 'overview',
  23          'title'   => __( 'Overview' ),
  24          'content' =>
  25                      '<p>' . __( 'This screen is where you manage requests to erase personal data.' ) . '</p>' .
  26                      '<p>' . __( 'Privacy Laws around the world require businesses and online services to delete, anonymize, or forget the data they collect about an individual. The rights those laws enshrine are sometimes called the "Right to be Forgotten".' ) . '</p>' .
  27                      '<p>' . __( 'The tool associates data stored in WordPress with a supplied email address, including profile data and comments.' ) . '</p>' .
  28                      '<p><strong>' . __( 'Note: As this tool only gathers data from WordPress and participating plugins, you may need to do more to comply with erasure requests. For example, you are also responsible for ensuring that data collected by or stored with the 3rd party services your organization uses gets deleted.' ) . '</strong></p>',
  29      )
  30  );
  31  
  32  get_current_screen()->add_help_tab(
  33      array(
  34          'id'      => 'default-data',
  35          'title'   => __( 'Default Data' ),
  36          'content' =>
  37                      '<p>' . __( 'WordPress collects (but <em>never</em> publishes) a limited amount of data from logged-in users but then deletes it or anonymizes it. That data can include:' ) . '</p>' .
  38                      '<p>' . __( '<strong>Profile Information</strong> &mdash; user email address, username, display name, nickname, first name, last name, description/bio, and registration date.' ) . '</p>' .
  39                      '<p>' . __( '<strong>Community Events Location</strong> &mdash; The IP Address of the user which is used for the Upcoming Community Events shown in the dashboard widget.' ) . '</p>' .
  40                      '<p>' . __( '<strong>Session Tokens</strong> &mdash; User login information, IP Addresses, Expiration Date, User Agent (Browser/OS), and Last Login.' ) . '</p>' .
  41                      '<p>' . __( '<strong>Comments</strong> &mdash; WordPress does not delete comments. The software does anonymize (but, again, <em>never</em> publishes) the associated Email Address, IP Address, and User Agent (Browser/OS).' ) . '</p>' .
  42                      '<p>' . __( '<strong>Media</strong> &mdash; A list of URLs for all media file uploads made by the user.' ) . '</p>',
  43      )
  44  );
  45  
  46  $privacy_policy_guide = '<p>' . sprintf(
  47      /* translators: %s: URL to Privacy Policy Guide screen. */
  48      __( '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 Eraser tool. This information may be available in the <a href="%s">Privacy Policy Guide</a>.' ),
  49      admin_url( 'options-privacy.php?tab=policyguide' )
  50  ) . '</p>';
  51  
  52  get_current_screen()->add_help_tab(
  53      array(
  54          'id'      => 'plugin-data',
  55          'title'   => __( 'Plugin Data' ),
  56          'content' =>
  57                      '<p>' . __( 'Many plugins may collect or store personal data either in the WordPress database or remotely. Any Erase Personal Data request should delete data from plugins as well.' ) . '</p>' .
  58                      '<p>' . __( 'If you are a plugin author, you can <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-eraser-to-your-plugin/" target="_blank">learn more about how to add support for the Personal Data Eraser to a plugin here</a>.' ) . '</p>' .
  59                      $privacy_policy_guide,
  60      )
  61  );
  62  
  63  get_current_screen()->set_help_sidebar(
  64      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
  65      '<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-erase-personal-data-screen/">Documentation on Erase Personal Data</a>' ) . '</p>' .
  66      '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
  67  );
  68  
  69  // Handle list table actions.
  70  _wp_personal_data_handle_actions();
  71  
  72  // Cleans up failed and expired requests before displaying the list table.
  73  _wp_personal_data_cleanup_requests();
  74  
  75  wp_enqueue_script( 'privacy-tools' );
  76  
  77  add_screen_option(
  78      'per_page',
  79      array(
  80          'default' => 20,
  81          'option'  => 'remove_personal_data_requests_per_page',
  82      )
  83  );
  84  
  85  $_list_table_args = array(
  86      'plural'   => 'privacy_requests',
  87      'singular' => 'privacy_request',
  88  );
  89  
  90  $requests_table = _get_list_table( 'WP_Privacy_Data_Removal_Requests_List_Table', $_list_table_args );
  91  
  92  $requests_table->screen->set_screen_reader_content(
  93      array(
  94          'heading_views'      => __( 'Filter erase personal data list' ),
  95          'heading_pagination' => __( 'Erase personal data list navigation' ),
  96          'heading_list'       => __( 'Erase personal data list' ),
  97      )
  98  );
  99  
 100  $requests_table->process_bulk_action();
 101  $requests_table->prepare_items();
 102  
 103  require_once  ABSPATH . 'wp-admin/admin-header.php';
 104  ?>
 105  
 106  <div class="wrap nosubsub">
 107      <h1><?php esc_html_e( 'Erase Personal Data' ); ?></h1>
 108      <p><?php _e( 'This tool helps site owners comply with local laws and regulations by deleting or anonymizing known data for a given user.' ); ?></p>
 109      <hr class="wp-header-end" />
 110  
 111      <?php settings_errors(); ?>
 112  
 113      <form action="<?php echo esc_url( admin_url( 'erase-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form">
 114          <h2><?php esc_html_e( 'Add Data Erasure Request' ); ?></h2>
 115          <div class="wp-privacy-request-form-field">
 116              <table class="form-table">
 117                  <tr>
 118                      <th scope="row">
 119                          <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
 120                      </th>
 121                      <td>
 122                          <input type="text" required class="regular-text ltr" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
 123                      </td>
 124                  </tr>
 125                  <tr>
 126                      <th scope="row">
 127                          <?php _e( 'Confirmation email' ); ?>
 128                      </th>
 129                      <td>
 130                          <label for="send_confirmation_email">
 131                              <input type="checkbox" name="send_confirmation_email" id="send_confirmation_email" value="1" checked="checked" />
 132                              <?php _e( 'Send personal data erasure confirmation email.' ); ?>
 133                          </label>
 134                      </td>
 135                  </tr>
 136              </table>
 137              <p class="submit">
 138                  <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
 139              </p>
 140          </div>
 141          <?php wp_nonce_field( 'personal-data-request' ); ?>
 142          <input type="hidden" name="action" value="add_remove_personal_data_request" />
 143          <input type="hidden" name="type_of_action" value="remove_personal_data" />
 144      </form>
 145      <hr />
 146  
 147      <?php $requests_table->views(); ?>
 148  
 149      <form class="search-form wp-clearfix">
 150          <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
 151          <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
 152          <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
 153          <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
 154      </form>
 155  
 156      <form method="post">
 157          <?php
 158          $requests_table->display();
 159          $requests_table->embed_scripts();
 160          ?>
 161      </form>
 162  </div>
 163  
 164  <?php
 165  require_once  ABSPATH . 'wp-admin/admin-footer.php';


Generated : Mon Mar 18 08:20:01 2024 Cross-referenced by PHPXref