#43547 closed enhancement (fixed)
Add personal data from usermeta/userdata to personal data export
Reported by: | allendav | Owned by: | tz-media |
---|---|---|---|
Milestone: | 4.9.6 | Priority: | normal |
Severity: | normal | Version: | 5.1 |
Component: | Privacy | Keywords: | gdpr needs-patch needs-unit-tests |
Focuses: | Cc: |
Description (last modified by )
Attachments (4)
Change History (31)
This ticket was mentioned in Slack in #gdpr-compliance by tz-media. View the logs.
7 years ago
#3
@
7 years ago
- Keywords has-patch 2nd-opinion added; needs-patch removed
43440.patch adds a data exporter for user and user_meta, based on the code for the comments exporter.
It currently does not export the hashed password, and any data related to roles and capabilities. Should these be added, too?
#4
@
7 years ago
- Milestone changed from Awaiting Review to 4.9.6
- Owner set to tz-media
- Status changed from new to assigned
This ticket was mentioned in Slack in #core by desrosj. View the logs.
7 years ago
#7
@
7 years ago
- Keywords needs-testing needs-unit-tests added; needs-refresh removed
I refreshed the patch to apply correctly. While I was at it, I also included the following updates:
- Added missing space at the beginning and/or end of the
add_filter()
call and control structures. - Added
@since
tags to inline documentation for added functions. - Aligned the
$data_to_export
array at the=>
. - Associative arrays should have each item on its own line when there are more than one.
- Add missing
=
sign in theelseif ($user->data->user_status = '1' )
condition. Also, converted theuser_status
conditionals to be Yoda conditions to follow the coding standards. (Should these use strict comparisons as well?)
Questions:
- Email is passed through
strtolower()
. I think might cause issues with mixed case emails. wp_user_personal_data_exporter()
has a second parameter,$page
. For the comments export (the original source of this code), this seems to represent the page of results. If this is needed for the user data export, there should be a description added to that paremter's@param
tag. Side note: I think the description for the comment$page
parameter could be confusing.Comment page.
could be interpreted as a few different things: the page post that the comments belong to, page of the data results, etc..- I removed the password related items. I don't think that needs to be included. It is something that is a secret to you. But I could be wrong.
- The
$done
variable at the end ofwp_user_personal_data_exporter()
is not tied into any logic. If$page
needs to be utilized, then this needs to be tied into that like in comments. - The comments export checks that the email address is not empty and returns early if it is. Should this do the same for consistency? An early return could also be added if the
get_user_by()
result is empty.
I would also like to see some tests for this. I can come back and write some if I am not beaten to it.
#8
follow-up:
↓ 13
@
7 years ago
Also, I just noticed that there is no default
for the switch()
. As it stands now, I don't think any user meta would display that is not whitelisted in the switch()
. Not sure if this is intentional or not, but should this be more flexible?
This ticket was mentioned in Slack in #gdpr-compliance by desrosj. View the logs.
7 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
7 years ago
#12
@
7 years ago
- Keywords needs-refresh removed
- refreshed patch to correctly apply with current trunk.
- removed
$page
as it is not needed fur user export. - simplified done return parameter to
'done' => true
. - early return when no user is found for email address.
- Will the implementation cause problems processing the export?
The mentioned early return if email is empty is on the comments remover, not on the exporter. Should this be added to the exporters as well?
Have not written any tests. @desrosj I would be glad if you could review my changes and do the unit tests for this. Haven's written tests before for core.
#13
in reply to:
↑ 8
@
7 years ago
Replying to desrosj:
Also, I just noticed that there is no
default
for theswitch()
. As it stands now, I don't think any user meta would display that is not whitelisted in theswitch()
. Not sure if this is intentional or not, but should this be more flexible?
Same reasoning here as with user exporter. If some theme or plugin adds user meta data, it is responsible for exporting these into the post.
This ticket was mentioned in Slack in #gdpr-compliance by desrosj. View the logs.
7 years ago
#15
@
7 years ago
- Keywords 2nd-opinion needs-unit-tests removed
In 43547.patch:
- Fixed inconsistency with tab vs space indentation.
- Moved filter hook registration with the other privacy hooks.
- Added missing
break;
on the finalswitch
conditional. - Added unit tests.
Also, I checked the comments exporter, and that one was returning an empty array when a nothing was found, so that should also be enough for users.
@TZ Media That makes sense about other user meta.
This ticket was mentioned in Slack in #gdpr-compliance by desrosj. View the logs.
7 years ago
#17
follow-up:
↓ 18
@
7 years ago
Hmm, why do we export "user_status"? We don't export the comment status, right? Imho 0
or 1
is not "personal data" by a long shot :)
#18
in reply to:
↑ 17
@
7 years ago
Replying to azaozz:
Hmm, why do we export "user_status"? We don't export the comment status, right? Imho
0
or1
is not "personal data" by a long shot :)
I agree - it doesn't seem like personal data - i cannot use it to identify a person. Let's not export that piece of meta.
#21
@
7 years ago
- Keywords commit fixed-major added; needs-testing needs-refresh removed
This seems to work well, ready for merging :)
#22
@
7 years ago
- Keywords needs-patch needs-unit-tests added; has-patch commit fixed-major removed
[43055] is causing unit test failures on Travis, and locally.
1) Tests_User::test_wp_user_personal_data_exporter Failed asserting that 11 is identical to 12. /srv/www/wordpress-develop/public_html/tests/phpunit/tests/user.php:1619
Exporter for user and user_meta