'.$rn; // question (hidden with js) echo ' '.$rn; // empty field (hidden with css); trap for spammers because many bots will try to put email or url here } } add_action('comment_form', 'antispam_form_part'); // add anti-spam inputs to the comment form function antispam_check_comment($commentdata) { $antispam_settings = antispam_get_settings(); if( antispam_check_for_spam() ) { if( $antispam_settings['save_spam_comments'] ) { antispam_store_comment($commentdata); } antispam_counter_stats(); wp_die('Comment is a spam.'); // die - do not send comment and show errors //return false; } return $commentdata; // if comment does not looks like spam } if ( ! is_admin()) { // without this check it is not possible to add comment in admin section add_filter('preprocess_comment', 'antispam_check_comment', 1); } // This way still sends the email notifications /*function antispam_process_comments( $comment_ID, $comment_approved ) { global $antispam_settings; if ( $antispam_settings['save_spam_comments'] ) { if( antispam_check_for_spam() ) { wp_set_comment_status( $comment_ID, 'spam' ); antispam_counter_stats(); } } }*/ //add_action( 'comment_post', 'antispam_process_comments', 10, 2 ); function antispam_plugin_meta($links, $file) { // add some links to plugin meta row if ( $file == plugin_basename( __FILE__ ) ) { $row_meta = array( 'support' => '' . __( 'Anti-spam', 'anti-spam' ) . '', 'donate' => '' . __( 'Donate', 'anti-spam' ) . '', 'upgrage' => '' . __( 'Anti-spam Pro', 'anti-spam' ) . '' ); $links = array_merge( $links, $row_meta ); } return (array) $links; } add_filter('plugin_row_meta', 'antispam_plugin_meta', 10, 2);