[wp-trac] [WordPress Trac] #43438: Export registered user's personal data on request
WordPress Trac
noreply at wordpress.org
Mon Mar 12 20:16:17 UTC 2018
#43438: Export registered user's personal data on request
----------------------------+------------------
Reporter: azaozz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 5.0
Component: General | Version:
Severity: normal | Resolution:
Keywords: gdpr has-patch | Focuses:
----------------------------+------------------
Comment (by azaozz):
Replying to [comment:15 allendav]:
Yep, the screenshots look a lot better now, not even sure we need the
count after the different bits of data.
Also thinking we can perhaps remove the "Provider" column. This is showing
the personal data for a user of a particular website. There is no
difference which plugin stores the data, the important part is that the
data is on the site and they get to see and download it.
For getting only unique data from the comments query in 43438.3.diff I
think we can try something like:
{{{
$name = $url = $ip = $ua = array(); // we know the email is unique
foreach ( $comments as $comment ) {
if ( ! in_array( $comment->comment_author, $name ) ) {
$name[] = $comment->comment_author;
}
if ( ! in_array( $comment->comment_author_url, $url ) ) {
$url[] = $comment->comment_author_url;
}
.....
}}}
or alternatively just do:
{{{
foreach ( $comments as $comment ) {
$name[ $comment->comment_author ] = 1;
$url[ $comment->comment_author_url ] = 1;
.....
}
$name = array_keys( $name );
....
}}}
Maybe 10000 is too much but this way we can easily process 5000-6000
comment rows in one go and get only the unique data. The idea is to get
all of the user's comments at once and not have to merge these arrays
later in js.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43438#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list