{"id":15040215,"url":"https://github.com/automattic/safe-report-comments","last_synced_at":"2025-10-19T18:32:28.175Z","repository":{"id":5397930,"uuid":"6587306","full_name":"Automattic/safe-report-comments","owner":"Automattic","description":"This plugin gives your visitors the possibility to report a comment as inappropriate.","archived":false,"fork":false,"pushed_at":"2021-06-25T16:58:19.000Z","size":526,"stargazers_count":19,"open_issues_count":3,"forks_count":9,"subscribers_count":119,"default_branch":"master","last_synced_at":"2025-01-30T01:11:53.344Z","etag":null,"topics":["comments","wordpress","wordpress-plugin","wpvip-plugin"],"latest_commit_sha":null,"homepage":"https://wordpress.org/plugins/safe-report-comments/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Automattic.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-07T22:16:50.000Z","updated_at":"2023-08-10T09:58:43.000Z","dependencies_parsed_at":"2022-07-06T15:03:37.179Z","dependency_job_id":null,"html_url":"https://github.com/Automattic/safe-report-comments","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fsafe-report-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fsafe-report-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fsafe-report-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Automattic%2Fsafe-report-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Automattic","download_url":"https://codeload.github.com/Automattic/safe-report-comments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237192631,"owners_count":19269949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comments","wordpress","wordpress-plugin","wpvip-plugin"],"created_at":"2024-09-24T20:44:23.316Z","updated_at":"2025-10-19T18:32:22.897Z","avatar_url":"https://github.com/Automattic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Run PHPUnit and PHPCS](https://github.com/Automattic/safe-report-comments/actions/workflows/integrate.yml/badge.svg)](https://github.com/Automattic/safe-report-comments/actions/workflows/integrate.yml)\n\n# Safe Report Comments\n\nThis plugin gives your visitors the possibility to report a comment as inappropriate. After a set threshold is reached the comment is put into moderation where the moderator can decide whether or not he want to approve the comment or not. If a comment is approved by a moderator it will not be auto-moderated again while still counting the amount of reports.\n\n## Installation\n\n1. Download and unzip the plugin.\n2. Copy the safe-report-comments directory into your plugins folder.\n3. Visit your Plugins page and activate the plugin.\n4. A new checkbox called \"Allow comment flagging\" will appear in the Settings-\u003eDiscussion page.\n5. Activate the flag and set the threshold value which will appear on the same page after activation\n\n## Screenshots\n\n![Simple activation via discussion settings](screenshot-1.png)\n\n![Amount of reports per comment is shown in comments administration screen](screenshot-2.png)\n\n![Fits well within most themes without any further action.](screenshot-3.png)\n\n![Ajax feedback right in place where available.](screenshot-4.png)\n\n\n## Changelog\n\n### 0.4.1 (July 23, 2014)\n\n* Typo fix, props spencermorin\n\n### 0.4 (July 23, 2014)\n\n* Security fix, h/t vortfu\n\n### 0.3.2 (Mar. 6, 2013)\n* New 'safe_report_comments_allow_moderated_to_be_reflagged' filter allows comments to be reflagged after being moderated.\n\n### 0.3.1 (Nov. 21, 2012)\n* Use home_url() for generating the ajaxurl on mapped domains, but admin_url() where the domain isn't mapped.\n\n### 0.3 (Nov. 7, 2012)\n* Coding standards and cleanup\n\n## Customizations\n\nBy default this script should hook in just fine in most existing themes as it attaches itsself after the comment-reply link via the comment_reply_link filter.\nIn case this does not work out you can place the flagging link manually by defining no_autostart_safe_report_comments in your themes' functions.php file and initializing the class via `$safe_report_comments = new Safe_Report_Comments(false);`.\n\nHere is an example of a custom setup via `functions.php` and placing the link comments callback function.\n\nIn `functions.php`:\n\n```\n//flag comments plugin included in themes' functions.php - disable plugin.\ndefine( 'no_autostart_safe_report_comments', true );\ninclude_once( 'replace-with-path-to/safe-report-comments/safe-report-comments.php');\n// make sure not to auto-attach to comment reply link\n$safe_report_comments = new Safe_Report_Comments(false);\n\n// change link layout to have a pipe prepended\nadd_filter( 'safe_report_comments_flagging_link', 'adjust_flagging_link' );\nfunction adjust_flagging_link( $link ) {\n\treturn ' | ' . $link;\n}\n\n// adjust the text to \"Report abuse\" rather than \"Report comment\"\nadd_filter( 'safe_report_comments_flagging_link_text', 'adjust_flagging_text' );\nfunction adjust_flagging_text( $text ) {\n\treturn 'Report abuse';\n}\n```\n\nIn your custom comment callback function used by `wp_list_comments`: [http://codex.wordpress.org/Template_Tags/wp_list_comments](http://codex.wordpress.org/Template_Tags/wp_list_comments) place the following action which will print the link.\n\n`\u003c?php do_action( 'comment_report_abuse_link' ); ?\u003e`\n\nA possible callback function could look like this:\n\n```\nfunction mytheme_comment($comment, $args, $depth) {\n\t$GLOBALS['comment'] = $comment; ?\u003e\n\t\u003cli \u003c?php comment_class(); ?\u003e id=\"li-comment-\u003c?php comment_ID() ?\u003e\"\u003e\n\t\t\u003cdiv id=\"comment-\u003c?php comment_ID(); ?\u003e\"\u003e\n\t\t\t\u003cdiv class=\"comment-author vcard\"\u003e\n\t\t\t\t\u003c?php echo get_avatar($comment,$size='48',$default='\u003cpath_to_url\u003e' ); ?\u003e\n\t\t\t\t\u003c?php printf(__('\u003ccite class=\"fn\"\u003e%s\u003c/cite\u003e \u003cspan class=\"says\"\u003esays:\u003c/span\u003e'), get_comment_author_link()) ?\u003e\n\t\t\t\u003c/div\u003e\n\t\t\t\u003c?php if ($comment-\u003ecomment_approved == '0') : ?\u003e\n\t\t\t\u003cem\u003e\u003c?php _e('Your comment is awaiting moderation.') ?\u003e\u003c/em\u003e\n\t\t\t\u003cbr /\u003e\n\t\t\u003c?php endif; ?\u003e\n\t\t\u003cdiv class=\"comment-meta commentmetadata\"\u003e\u003ca href=\"\u003c?php echo htmlspecialchars( get_comment_link( $comment-\u003ecomment_ID ) ) ?\u003e\"\u003e\u003c?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?\u003e\u003c/a\u003e\u003c?php edit_comment_link(__('(Edit)'),'\t ','') ?\u003e\u003c/div\u003e\n\n\t\t\u003c?php comment_text() ?\u003e\n\n\t\t\u003cdiv class=\"reply\"\u003e\n\t\t\t\u003c?php comment_reply_link(array_merge( $args, array('depth' =\u003e $depth, 'max_depth' =\u003e $args['max_depth']))) ?\u003e\n\t\t\u003c/div\u003e\n\t\t\u003cdiv class=\"report-abuse\"\u003e\n\t\t\t\u003c?php do_action( 'comment_report_abuse_link' ); ?\u003e\n\t\t\u003c/div\u003e\n\t\u003c/div\u003e\n\t\u003c?php\n}\n```\n\nFurthermore there are various actions and filters within the script to allow easy alteration of implemented behavior. Please see inline documentation.\n\n## Known issues\n\nAutomatic mode implementation currently does not work with threaded comments in the last level of threading. As the script attaches itself to the comment_reply which is not displayed once the maximum threading level is reached the abuse link is missing at this point. As a workaround set the threading level higher than the likely amount of threading depth.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautomattic%2Fsafe-report-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautomattic%2Fsafe-report-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautomattic%2Fsafe-report-comments/lists"}