For people coming here, this plugin is mostly unmaintained.
There is an older fork Crowd Control, which was mostly rewritten in JavaScript, then was abandoned. I see it is being maintained again.
There is a fork Zeno Report Comments, that has the old code mostly left intact, with bugfixes and features added.
]]>It would be nice to be able to translate phrases in this plugin.
There are already several patches available for older versions:
https://www.ads-software.com/support/topic/fork-internationalization-support/
https://www.ads-software.com/support/topic/translation-patch/
Hi, is there any developer around? I’ve added a localization fix, see the github. If you point me to the right URL, I would be more than glad to give you a pull request.
]]>Did I got it all right, set it right ?
Reporting comments makes it disabled for all visitors ? It should never work this way.
Activated the plugin but see no report link on comments, can’t even find any setting at admin backend either. Can anyone help get me out of the dark? It feels like nothing is there.
]]>Hi,
I modified the code to allow translation (and edited french translation)
You can apply following patch to allow translations in your code.
Thanx in advance for new release with this patch ??
diff –git a/safe-report-comments.php b/safe-report-comments.php
index 82fc30d..e6070b3 100644
— a/safe-report-comments.php
+++ b/safe-report-comments.php
@@ -10,10 +10,16 @@ Author: Thorsten Ott, Daniel Bachhuber, Automattic
Author URI: https://automattic.com
*/
+add_action( ‘init’, ‘safe_report_comments_load_textdomain’ );
+function safe_report_comments_load_textdomain() {
+ load_plugin_textdomain( ‘safe-report-comments’, false, dirname( plugin_basename( __FILE__ ) ) . ‘/lang’ );
+}
+
if ( !class_exists( “Safe_Report_Comments” ) ) {
class Safe_Report_Comments {
+ private $_domain_name = ‘safe-report-comments’;
private $_plugin_prefix = ‘srcmnt’;
private $_admin_notices = array();
private $_nonce_key = ‘flag_comment_nonce’;
@@ -70,13 +76,13 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
public function backend_init() {
do_action( ‘safe_report_comments_backend_init’ );
– add_settings_field( $this->_plugin_prefix . ‘_enabled’, __( ‘Allow comment flagging’ ), array( $this, ‘comment_flag_enable’ ), ‘discussion’, ‘default’ );
+ add_settings_field( $this->_plugin_prefix . ‘_enabled’, __( ‘Allow comment flagging’, $this->_domain_name ), array( $this, ‘comment_flag_enable’ ), ‘discussion’, ‘default’ );
register_setting( ‘discussion’, $this->_plugin_prefix . ‘_enabled’ );
if ( ! $this->is_enabled() )
return;
– add_settings_field( $this->_plugin_prefix . ‘_threshold’, __( ‘Flagging threshold’ ), array( $this, ‘comment_flag_threshold’ ), ‘discussion’, ‘default’ );
+ add_settings_field( $this->_plugin_prefix . ‘_threshold’, __( ‘Flagging threshold’, $this->_domain_name ), array( $this, ‘comment_flag_threshold’ ), ‘discussion’, ‘default’ );
register_setting( ‘discussion’, $this->_plugin_prefix . ‘_threshold’, array( $this, ‘check_threshold’ ) );
add_filter(‘manage_edit-comments_columns’, array( $this, ‘add_comment_reported_column’ ) );
add_action(‘manage_comments_custom_column’, array( $this, ‘manage_comment_reported_column’ ), 10, 2);
@@ -185,7 +191,7 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
?>
<label for=”<?php echo $this->_plugin_prefix; ?>_enabled”>
<input name=”<?php echo $this->_plugin_prefix; ?>_enabled” id=”<?php echo $this->_plugin_prefix; ?>_enabled” type=”checkbox” value=”1″ <?php if ( $enabled === true ) echo ‘ checked=”checked”‘; ?> />
– <?php _e( “Allow your visitors to flag a comment as inappropriate.” ); ?>
+ <?php _e( “Allow your visitors to flag a comment as inappropriate.”, $this->_domain_name ); ?>
</label>
<?php
}
@@ -198,7 +204,7 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
?>
<label for=”<?php echo $this->_plugin_prefix; ?>_threshold”>
<input size=”2″ name=”<?php echo $this->_plugin_prefix; ?>_threshold” id=”<?php echo $this->_plugin_prefix; ?>_threshold” type=”text” value=”<?php echo $threshold; ?>” />
– <?php _e( “Amount of user reports needed to send a comment to moderation?” ); ?>
+ <?php _e( “Amount of user reports needed to send a comment to moderation?”, $this->_domain_name ); ?>
</label>
<?php
}
@@ -353,9 +359,9 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
*/
private function cond_die( $message ) {
if ( isset( $_REQUEST[‘no_js’] ) && true == (boolean) $_REQUEST[‘no_js’] )
– wp_die( __( $message ), “Safe Report Comments Notice”, array(‘response’ => 200 ) );
+ wp_die( $message, __( “Safe Report Comments Notice”, $this->_domain_name ), array(‘response’ => 200 ) );
else
– die( __( $message ) );
+ die( $message );
}
/*
@@ -363,34 +369,38 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
*/
public function flag_comment() {
if ( (int) $_REQUEST[ ‘comment_id’ ] != $_REQUEST[ ‘comment_id’ ] || empty( $_REQUEST[ ‘comment_id’ ] ) )
– $this->cond_die( __( $this->invalid_values_message ) );
+ //$this->cond_die( __( $this->invalid_values_message ) );
+ $this->cond_die( __( ‘Cheating huh? <!– invalid values –>’, $this->_domain_name ) );
$comment_id = (int) $_REQUEST[ ‘comment_id’ ];
if ( $this->already_flagged( $comment_id ) )
– $this->cond_die( __( $this->already_flagged_message ) );
+ //$this->cond_die( __( $this->already_flagged_message ) );
+ $this->cond_die( __( ‘It seems you already reported this comment. <!– already flagged –>’, $this->_domain_name ) );
$nonce = $_REQUEST[ ‘sc_nonce’ ];
// checking if nonces help
if ( ! wp_verify_nonce( $nonce, $this->_plugin_prefix . ‘_’ . $this->_nonce_key ) )
– $this->cond_die( __( $this->invalid_nonce_message ) );
+ //$this->cond_die( __( $this->invalid_nonce_message ) );
+ $this->cond_die( __( ‘It seems you already reported this comment. <!– nonce invalid –>’, $this->_domain_name ) );
else {
$this->mark_flagged( $comment_id );
– $this->cond_die( __( $this->thank_you_message ) );
+ //$this->cond_die( __( $this->thank_you_message ) );
+ $this->cond_die( __( ‘Thank you for your feedback. We will look into it.’, $this->_domain_name ) );
}
}
– public function print_flagging_link( $comment_id=”, $result_id=”, $text=’Report comment’ ) {
– echo $this->get_flagging_link( $comment_id=”, $result_id=”, $text=’Report comment’ );
+ public function print_flagging_link( $comment_id, $result_id ) {
+ echo $this->get_flagging_link( $comment_id, $result_id );
}
/*
* Output Link to report a comment
*/
– public function get_flagging_link( $comment_id=”, $result_id=”, $text=’Report comment’ ) {
+ public function get_flagging_link( $comment_id=”, $result_id=” ) {
global $in_comment_loop;
if ( empty( $comment_id ) && !$in_comment_loop ) {
– return __( ‘Wrong usage of print_flagging_link().’ );
+ return __( ‘Wrong usage of print_flagging_link().’, $this->_domain_name );
}
if ( empty( $comment_id ) ) {
$comment_id = get_comment_ID();
@@ -398,14 +408,15 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
else {
$comment_id = (int) $comment_id;
if ( !get_comment( $comment_id ) ) {
– return __( ‘This comment does not exist.’ );
+ return __( ‘This comment does not exist.’, $this->_domain_name );
}
}
if ( empty( $result_id ) )
$result_id = ‘safe-comments-result-‘ . $comment_id;
$result_id = apply_filters( ‘safe_report_comments_result_id’, $result_id );
– $text = apply_filters( ‘safe_report_comments_flagging_link_text’, $text );
+ // use default translations to modify flagging_link_text, not a filter !
+ //$text = apply_filters( ‘safe_report_comments_flagging_link_text’, $text );
$nonce = wp_create_nonce( $this->_plugin_prefix . ‘_’ . $this->_nonce_key );
$params = array(
@@ -417,10 +428,11 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
);
if ( $this->already_flagged( $comment_id ) )
– return __( $this->already_flagged_note );
+ return __( ‘<!– already flagged –>’, $this->_domain_name );
+ //return __( $this->already_flagged_note );
return apply_filters( ‘safe_report_comments_flagging_link’, ‘
– <span id=”‘ . $result_id . ‘”>‘ . __( $text ) . ‘</span>’ );
+ <span id=”‘ . $result_id . ‘”>_domain_name ) . ‘” onclick=”safe_report_comments_flag_comment( \” . $comment_id . ‘\’, \” . $nonce . ‘\’, \” . $result_id . ‘\’);”>’ . __( ‘Report comment’, $this->_domain_name ) . ‘</span>’ );
}
@@ -442,7 +454,7 @@ if ( !class_exists( “Safe_Report_Comments” ) ) {
* Callback function to add the report counter to comments screen. Remove action manage_edit-comments_columns if not desired
*/
public function add_comment_reported_column( $comment_columns ) {
– $comment_columns[‘comment_reported’] = _x(‘Reported’, ‘column name’);
+ $comment_columns[‘comment_reported’] = _x(‘Reported’, ‘column name’, $this->_domain_name);
return $comment_columns;
}
hI
Nice plugin but there is one major flaw that i hope you could fix.
If i set for example threshold to report comment at 3 (just an example) if a user click on “report comment”, once he refresh the page, the button appears again so he can click on again and again making for one user very easy to abuse the system by clicking and refreshing till the comment disapear for report.
Could you fix that so that one user can report only one time a comment, no matter if he refreshes, log out/LOGIN, clear cookies etc.
Thanks
]]>Comment still shows on frontend under ‘Your comment is awaiting moderation.’ statement. Should the comment not be hidden when held in moderation?
I am test on 2016 wordpress theme on WAMP local server
]]>Please delete, I found the solution here https://www.ads-software.com/plugins/safe-report-comments/other_notes/
]]>Hi I am using a WP_Comment_Query to get comments. At the bottom of my custom query I have:
<?php echo get_comment_reply_link(); ?>
At this point I see an error echoed immediately afterwards reading “Wrong usage of print_flagging_link().”
Could you tell me:
1. Why is this being generated here?
2. How do I stop it?
3. How do I manually call the function in a template to get the “Report Abuse” link outputted?
Thanks.
]]>Did this:
5.Activate the flag and set the threshold value which will appear on the same page after activation
But still nothing appears on the blogposts.
]]>Hi your plugin is not working with woocommerce. Is there way that we can get report a comment link on woocommerce comments as well.?
]]>I’m doing some optimizations on a site, and was hoping to get the JS to be “non-render-blocking”. I changed $in_footer to true on line 121 of safe-report-comments.php.
wp_enqueue_script( $this->_plugin_prefix . '-ajax-request', $this->plugin_url . '/js/ajax.js', array( 'jquery' ), false, true );
I did some really quick testing on my site, but wasn’t exactly sure if this javascript was required in the < head> for some reason.
If this isn’t an issue, is it possible to add this into the next version of the plugin?
Thanks!
Ryan
hello guys thanks for this great tool.
how could i remove the arrow? since i moved my reply button the arrow between reply button and report comment link is looking in the wrong direction. i couldnt find the arrow in the code. wher can i find and remove it?
thank you very much
]]>Hello,
I have developed my own mobile template.
I have activated the plugin.
In JS Console of Firefox, I am getting an error –
“ReferenceError: SafeCommentsAjax is not defined”
Can you please tell me how to fix this error!!?
]]>Hello! Great and smooth plugin, has been easy to implement and style on my client’s site, https://www.davisvanguard.org/ where it is currently running. I have two questions on the plugin, both of which seem to have been asked before in some form, though I have not found a resolution:
1. Moderator Notifications: I saw the method of editing the functions.php file to have a moderator notified once a comment is bumped back to Pending, but I wanted to learn if there is a method for the moderator to be notified any time a report is made. This way, the moderator has the chance to proactively log in and deal with the comment if need be without waiting for reports to hit the threshold.
2. Max Thread Level Issue: Comments at the max thread level seem to still be having an issue, since they are tied to the Reply link. Is there a way to break the report link away from the reply link and then add it to the comments.php template?
Any information you have for either of these would be much appreciated!
]]>Hi there,
I have noticed a couple of strange things with the plugin which is great by the way.
1. A user can report their own comment for abuse.
2. Even after a comment has been re-approved by a user, the same user can report it again. Although nothing happens on the back end it is not until the second report that the button is vanishing.
Kind Regards
KatieKat
]]>I’ve changed the ‘Report abuse’ text like mentioned in the section other notes with this code:
add_filter( 'safe_report_comments_flagging_link_text', function(){ return __( 'This reaction is spam / inappropriate' ); } );
But now I’m trying to change the “thank you message” trought the add_filter function.
But it doesn’t seem to be working, this is my code:
add_filter( 'safe_report_comments_thank_you_message', function(){ return 'Thank you, this is a test message' ); } );
Could someone please tell me what I’m doing wrong?
]]>Hi! Firstly, thank you for a great plugin!
How ever, I would like to load scripts only where needed; this case on single.php, where comments are.
I was able to do this on main site with <?php if (is_single()) { ?>
-rule in the header, (I know, that’s not the most best way to do it), and all works fine. But with subdomains this does not work fully, cause I’m out of ideas, how to link correctly plugins ajaxurl.
Any help would be really appreciated.
]]>Hello i just installed the plugin and activated but its not working for me. I tried the manual thing but its totally different for my theme, i am using Reactor as my theme and not able to get where to put that all please help. Thanks in advance
]]>in debug mod, i have this notice when reporting a comment:
Notice: Undefined offset: 14 in /Applications/MAMP/htdocs/video-wordpress/wp-content/plugins/safe-report-comments/safe-report-comments.php on line 307
Daniel,
Did you ever figure out displaying the “Report Comment” link on the last level of threaded comments? Previous thread regarding this matter titled, “Not showing on “children” reply comments”.
Thanks,
Jesse
]]>I’m using WordPress Liveblog which makes use of a custom comment type ‘liveblog’. Can I use the Safe Report Comments on liveblog comments (also called liveblog entries)?
]]>Hi there,
fantastic plugin and I have set up an email as per your “notify the moderator” thread and all is working well.
However I was wondering if there was some way of showing who has actually reported the abuse either when the reported comment appears in pending or if that is too onerous, in the email notification.
People have to be registered for my site anyway but it would be really userful to have the person’s username, email address and IP address included somewhere just in case someone is reporting comments regularly and I need to understand why.
Kind Regards
KatieKat
]]>My comments are structured as follows, in comments.php:
<?php foreach($comments as $comment) : ?>
//lots of code here
<?php comment_text() ?>
//lots of code here
<?php do_action( 'comment_report_abuse_link' ); ?>
<?php endforeach; ?>
(I don’t actually have a reply link at all, because it’s a very customized theme.)
I get the message “Wrong usage of print_flagging_link().”
When I added the rest of the code to functions.php, I just got the message twice instead of once.
I’m probably also going to have to customize the html of the link.
Is there another way to construct the Flag link?
Thanks!
]]>Seeing the code, seems people have no idea on how gettext works and added gettext entries randomly.
Here’s the translation fix + Fr translation patch.
https://fcartegnie.free.fr/patchs/translation.patch
Hi How con i get this to work with bbpress? or will you be updating this to work with bbpress
]]>Just installed this plugin on my WordPress site. It isn’t working at all. A link doesn’t even show up on the comments. What’s the issue?
https://www.ads-software.com/extend/plugins/safe-report-comments/
]]>Hi there – I would like to use your Plugin. But it seems like the Anti Spam Plugin is kind of messing it up.
It is regeneration the comments list to disable some feature to prevent spam.
Have you any experience with the plugin mentioned and your implementation?
Cheers
Marcel
https://www.ads-software.com/extend/plugins/safe-report-comments/
]]>This plugin does not work if the Site Address and URL Address are different. When they are different the plugin uses the home_url to find the admin-ajax.php file when it should be using the site_url.
You can fix this by replacing this (line 117):
$ajaxurl = home_url( '/wp-admin/admin-ajax.php' );
with this:
$ajaxurl = site_url( '/wp-admin/admin-ajax.php' );
Hope this helps, and hopefully this fix can get worked into the next version.
-Scott
https://www.ads-software.com/extend/plugins/safe-report-comments/
]]>