Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add report spam link #344

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions antispam_bee.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,22 @@ public static function init() {
'print_column_styles',
)
);

add_filter(
'manage_edit-comments_sortable_columns',
array(
'Antispam_Bee_Columns',
'register_sortable_columns',
)
);
add_filter(
'comment_row_actions',
array(
'Antispam_Bee_Columns',
'add_report_comment_action_link',
),
10,
2
);
add_action(
'pre_get_comments',
array(
Expand Down Expand Up @@ -295,7 +303,6 @@ public static function init() {
'populate_post_id',
)
);

add_action(
'template_redirect',
array(
Expand Down Expand Up @@ -2796,6 +2803,7 @@ private static function db_version_is_current() {
return $current_version === self::$db_version;

}

}


Expand Down
34 changes: 34 additions & 0 deletions inc/columns.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,38 @@ public static function print_column_styles() {
</style>
<?php
}

/**
* Add comment action link to report spam to ASB
schlessera marked this conversation as resolved.
Show resolved Hide resolved
*
* @since 2.9.3
*
* @param array $actions Array of actions.
* @param comment $comment Comment object.
schlessera marked this conversation as resolved.
Show resolved Hide resolved
*/
public static function add_report_comment_action_link( $actions, $comment ) {

// URLencode comment data.
$name = rawurlencode( $comment->comment_author );
$email = rawurlencode( $comment->comment_author_email );
$ip = rawurlencode( $comment->comment_author_IP );
Comment on lines +171 to +174
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the GDPR implications, when we collect those values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already do this now. This is just a a helpful link to prefill the form.

But if we want to follow this path. My research says:

        Consent must be “freely given, specific, informed and unambiguous.”

        Requests for consent must be “clearly distinguishable from the other matters” and presented in “clear and plain language.”

        Data subjects can withdraw previously given consent whenever they want, and you have to honor their decision. You can’t simply change the legal basis of the processing to one of the other justifications.

        Children under 13 can only give consent with permission from their parent.

    You need to keep documentary evidence of consent.

The sixth legal basis is to have a “legitimate interest” to process the person’s data. 

I think the legitimate interest in fighting spam outweighs the rights of any spammer (or false positive user). But I am not a lawyer. I try to ping someone from the community to have look.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a legal point of view, I would have no problems with this.

In terms of data protection, this is possible without consent as it is within the context of a legitimate interest. (In the case of a legitimate interest, an opt-out option is required, but that is easily possible for the spammer, so you don't need to think of it.)

Also I don't see any major problems in terms of copyright law, because on the one hand, emails of this kind regularly do not have the necessary level of creation for copyright protection, on the other hand, the author has also consented to storage and processing by sending, because that is exactly the purpose of his mail.

So: just make it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @PraetorIM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going through the discussion here, I get the impression that we are only looking at whether we as the pluginkollektiv get the user's consent to get access to this data.

However, what we are doing here is giving immediate access to a third-party (Google) via these unencrypted URL values. The way I see it, we would also need to inform the user about which third-parties we'd also give access to this data and need the user's consent for that as well.

So, even if we say that we don't need consent in this case, we still need to let the user know about the third-parties involved, no?

@PraetorIM It's not clear to me whether you consider this (we're sending unencrypted user data via a URL to a Google application), so I'd be grateful for any further clarification you can provide.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with mention and opt-out option in the data protection declaration or at the comment-form

What do you mean with that?

This PR adds a link to every spam comment in the admin area which is a link called "Report to Antispam Bee" which is going to a Google Form page and prepopulates it with the data from the comment.

It is just an external link IMHO. Everyone can see where it goes. If I need to mention it in a data protection declaration, I would need to mention every external link to a non-EU website ... or not?

And to which data protection declaration should we add it? On the website where it is used? This would not be working out I think. And why should we add it to the comment form? It is just added in the admin area and it does not do anything in the frontend. And how should I provide an opt-out for a link? You click it or you don't click it. How can we opt-out there?

I think we are all not in the same boat and speak about completely different things here.

Maybe we can talk about this in a chat. Maybe in German. To get this sorted out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schlessera @PraetorIM @websupporter I really would like to get 2.9.3 released soon. Any chance to get this legal question solved?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all: The reporting of a URL is irrelevant in terms of data protection law, since a URL (apart from extreme exceptional cases) is not a personal date. Even a URL like firstname-lastname.de is initially without privacy problems (hard to believe in today's hysteria, I know). This would only become personal data if the person of the commentator / spammer was also transmitted. But that's not what you've planned. So just get that feature in.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PraetorIM We are not just reporting an URL.

We are reporting what was entered as author name, e-mail and website url. Additionally the IP address used by the visitor, the host (for this IP), the content of the comment and the user agent used.

These values are send to a Google form via URL, so that the Google form is prepopulated.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Torsten, melde dich einfach einmal bei mir, ehe wir hier noch eine Brieffreundschaft anfangen ;-)

$host = rawurlencode( gethostbyaddr( $comment->comment_author_IP ) );
$url = rawurlencode( $comment->comment_author_url );
$content = rawurlencode( $comment->comment_content );
$agent = rawurlencode( $comment->comment_agent );

// Build action link.
$target = ' target="_blank" ';
$rel = ' rel="noopener noreferrer" ';
$href = 'href="https://docs.google.com/forms/d/e/1FAIpQLSeQlKVZZYsF1qkKz7U78B2wy_6s6I7aNSdQc-DGpjeqWx70-A/viewform?c=0&w=1&entry.437446945=' . $name . '&entry.462884433=' . $ip . '&entry.1346967038=' . $host . '&entry.121560485=' . $email . '&entry.1210529682=' . $url . '&entry.1837399577=' . $content . '&entry.372858475=' . $agent . '" ';

$action = '';
$action .= "<a $target $href $rel>";
$action .= __( 'Report to Antispam Bee', 'antispam-bee' );
$action .= '</a>';

$actions['report_spam trash'] = $action;

return $actions;
}
}