settings = get_settings('wordverify'); /* offer up the options menu */ if (is_plugin_page()) { WordVerify::plugin_options(); } add_action('admin_menu', array(&$this, 'admin_menu')); add_action('comment_form', array(&$this, 'comment_form')); add_action('comment_post', array(&$this, 'comment_post')); // Set the defaults: if (!isset($this->settings)) { $this->settings['word'] = "changeme"; $this->settings['presentation'] = "Please enter '%%CODEWORD%%' without the quotes."; } update_option('wordverify', $this->settings); } } //end constructor function admin_menu() { if (function_exists('add_options_page')) { add_options_page('WordVerify', 'WordVerify', 8, basename(__FILE__)); } } function plugin_options() { if( $_POST['action'] == 'update' ) { if (get_magic_quotes_gpc()) { $this->settings['word'] = stripslashes(trim( $_POST['word'] )); $this->settings['presentation'] = stripslashes(trim( $_POST['presentation'] )); } else { $this->settings['word'] = trim( $_POST['word'] ); $this->settings['presentation'] = trim( $_POST['presentation'] ); } update_option('wordverify', $this->settings); echo '

' . __('Options updated.') . '

'; } ?>

WordVerify Options

WordVerify requires the entering of a simple word of your choice in a text field to submit a comment.

"Security code word" is the word that the commenter must enter to post a comment.

"Presentation" is the phrase that instructs the commenter what the security code word is and that they need to enter it. By varying this phrase you decrease the ability of spammers to scrape your page and guess the word. Put %%CODEWORD%% where you want the word to appear

Security code word:
Presentation:

get_var("SELECT comment_type FROM $wpdb->comments WHERE comment_ID = $comment_ID"); if ($comment_type == '' || $comment_type == 'comment') { // If the user is not logged in check the security code if ( !$user_ID ) { // puke on an empty code if ( '' == $word ) { if ($wp_version < 2.0) { wp_set_comment_status($comment_ID, 'delete'); } else { wp_delete_comment($comment_ID); } die( __('Error: please enter the security code.') ); } // verify the code if ($word != $this->settings['word']) { if ($wp_version < 2.0) { wp_set_comment_status($comment_ID, 'delete'); } else { wp_delete_comment($comment_ID); } die('Invalid security code. Press your browsers back button and try again.'); } } } return $comment_ID; } function comment_form($post_ID) { global $wpdb, $user_ID; // If the user is logged in, dont prompt for code if (isset($user_ID)) return $post_ID; // SET SESSION VARIABLE $hashtext = md5($textstr); //print $hashtext; $msgtext = $this->settings['presentation']; $msg = str_replace("%%CODEWORD%%", $this->settings['word'], $msgtext); ?>