" . __('After the Deadline is almost ready.') . ' ' . sprintf( __( 'You must enter your API key for it to work.' ), 'plugins.php?page=atd-key-config' ) . '

'; } add_action( 'admin_notices', 'AtD_warning' ); } /* * post an admin message if fsockopen is disabled */ if ( !function_exists('fsockopen') ) { function AtD_warning_fsockopen() { echo "

After the Deadine can't connect to the proofreading service. Contact your system administrator and ask them to allow the use of fsockopen from PHP.

"; } add_action( 'admin_notices', 'AtD_warning_fsockopen' ); } /* * connect to the AtD service and verify the key the user entered */ function AtD_verify_key( $key ) { $session = AtD_http_get( 'service.afterthedeadline.com', '/verify?blog=' . urlencode( get_option( 'home' ) ) . '&key=' . urlencode( $key )); return $session[1]; } /* * display the form for the user to enter the key, also saving of the key option is handled here as well. */ function AtD_display_key_form() { if ( isset($_POST['submit']) ) { if ( function_exists( 'current_user_can' ) && ! current_user_can( 'manage_options' ) ) { die( __('Cheatin’ uh?') ); } $key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] ); } else { $key = get_option( 'AtD_api_key' ); } if ( empty($key) ) { $key_status = 'empty'; $ms[] = isset( $_POST['submit'] ) ? 'new_key_empty' : 'key_empty'; delete_option( 'AtD_api_key' ); } else if ( strlen($key) < 32 ) { $key_status = 'key_invalid'; $ms[] = 'new_key_is_wp_key'; delete_option( 'AtD_api_key' ); } else { $key_status = trim( AtD_verify_key( $key ) ); if ( strcmp( $key_status, 'valid' ) == 0 || strcmp( $key_status, 'Got it!' ) == 0) { update_option( 'AtD_api_key', $key ); $ms[] = isset( $_POST['submit'] ) ? 'new_key_valid' : 'key_valid'; } else if ( strcmp( $key_status, 'invalid' ) == 0 ) { delete_option( 'AtD_api_key' ); $ms[] = isset( $_POST['submit'] ) ? 'new_key_invalid' : 'key_invalid'; } else { $ms[] = isset( $_POST['submit'] ) ? 'new_key_failed' : 'key_failed'; } } /* potential messages */ $messages = array( 'new_key_is_wp_key' => array('color' => 'd22', 'text' => sprintf(__('A WordPress.com API key doesn\'t work here. (Get your After the Deadline API key.)'), 'http://www.afterthedeadline.com/profile.slp')), 'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key is cleared.')), 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key is now verified. Enjoy!')), 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please check it.')), 'new_key_failed' => array('color' => 'd22', 'text' => __('Unable to connect to afterthedeadline.com to verify your key. Please check your server configuration.')), 'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (Get your key.)'), 'http://www.afterthedeadline.com/profile.slp')), 'key_valid' => array('color' => '2d2', 'text' => __('Your key is valid.')), 'key_failed' => array('color' => 'aa0', 'text' => __('Your key was valid but I was unable to connect to afterthedeadline.com and verify it.')) ); ?>

Write better and spend less time editing with After the Deadline. To use this plugin you'll need an After the Deadline API key. You can get this from the After the Deadline website.

0 ) { foreach ( $ms as $m ) { ?>

Using

Click the AtD button in the editor to check spelling, style, and grammar.

Options

Visit your profile page to configure After the Deadline proofreading software options.

Feedback

Visit After the Deadline to give feedback, report bugs, and offer suggestions.