'.$rn; echo '
'.$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(); extract($commentdata); if ( ! is_user_logged_in() && $comment_type != 'pingback' && $comment_type != 'trackback') { // logged in user is not a spammer 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 error message } } if ($comment_type == 'trackback') { if( $antispam_settings['save_spam_comments'] ) { antispam_store_comment($commentdata); } antispam_counter_stats(); wp_die('Trackbacks are disabled.'); // die - do not send trackback and show error message } 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); } 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);