__( 'Agency Toolkit: last active in the admin', 'agency-toolkit' ), 'callback' => 'inspry_toolkit_privacy_export_last_seen', ); return $exporters; } /** * Export the last-seen timestamp for the user with this email address. * * @param string $email_address Email address of the data subject. * @return array Exporter response. */ function inspry_toolkit_privacy_export_last_seen( $email_address ) { $data = array(); $user = get_user_by( 'email', $email_address ); $seen = $user ? (int) get_user_meta( $user->ID, 'inspry_toolkit_last_seen', true ) : 0; if ( $seen > 0 ) { $data[] = array( 'group_id' => 'agency-toolkit', 'group_label' => __( 'Agency Toolkit', 'agency-toolkit' ), 'item_id' => 'agency-toolkit-last-seen-' . $user->ID, 'data' => array( array( 'name' => __( 'Last active in the WordPress admin (UTC)', 'agency-toolkit' ), 'value' => gmdate( 'Y-m-d H:i:s', $seen ), ), ), ); } return array( 'data' => $data, 'done' => true, ); } /** * Register the last-seen eraser. * * @param array $erasers Registered erasers. * @return array Erasers including this one. */ function inspry_toolkit_privacy_register_eraser( $erasers ) { $erasers['agency-toolkit-last-seen'] = array( 'eraser_friendly_name' => __( 'Agency Toolkit: last active in the admin', 'agency-toolkit' ), 'callback' => 'inspry_toolkit_privacy_erase_last_seen', ); return $erasers; } /** * Erase the last-seen timestamp for the user with this email address. * * @param string $email_address Email address of the data subject. * @return array Eraser response. */ function inspry_toolkit_privacy_erase_last_seen( $email_address ) { $user = get_user_by( 'email', $email_address ); $removed = $user && '' !== get_user_meta( $user->ID, 'inspry_toolkit_last_seen', true ) && delete_user_meta( $user->ID, 'inspry_toolkit_last_seen' ); return array( 'items_removed' => (bool) $removed, 'items_retained' => false, 'messages' => array(), 'done' => true, ); } /** * Suggest privacy policy text on Settings > Privacy. * * @return void */ function inspry_toolkit_privacy_policy_content() { if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { return; } wp_add_privacy_policy_content( __( 'Agency Toolkit', 'agency-toolkit' ), wp_kses_post( '
' . __( 'When the backend users summary is on, this site records when each administrator, shop manager, editor, author and contributor was last active in the WordPress admin, at most once per hour. The timestamp is stored on this site only. Site administrators can read counts built from it (for example, how many users have not signed in for 90 days). Those counts include no names or email addresses, with one exception: an administrator account with no recorded activity for a year is listed with its username, display name and email address, so the site owner can be asked whether the account is still needed. Customers and subscribers are never recorded. The timestamp is deleted when the user is deleted, when their personal data is erased, or when the plugin is uninstalled.', 'agency-toolkit' ) . '
' ) ); }