X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/baca9ce86a38dc54c4574890ee2d352fd81f78b2..61343b82c4f0da4c68e4c6373daafff4a81efdd1:/wp-content/plugins/akismet/admin.php diff --git a/wp-content/plugins/akismet/admin.php b/wp-content/plugins/akismet/admin.php index 481b0f3d..f8071916 100644 --- a/wp-content/plugins/akismet/admin.php +++ b/wp-content/plugins/akismet/admin.php @@ -39,10 +39,10 @@ function akismet_load_js_and_css() { 'plugins_page_akismet-key-config', 'jetpack_page_akismet-key-config', ) ) ) { - wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.4.4' ); + wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.9' ); wp_enqueue_style( 'akismet.css'); - wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.4.6' ); + wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.9' ); wp_enqueue_script( 'akismet.js' ); wp_localize_script( 'akismet.js', 'WPAkismet', array( 'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ) @@ -67,11 +67,14 @@ add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 ); function akismet_conf() { global $akismet_nonce, $current_user; - $new_key_link = 'https://akismet.com/get/'; - $api_key = akismet_get_key(); - $show_key_form = $api_key; - $key_status = 'empty'; - $saved_ok = false; + $new_key_link = 'https://akismet.com/get/'; + $config_link = esc_url( add_query_arg( array( 'page' => 'akismet-key-config', 'show' => 'enter-api-key' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) ); + $stats_link = esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ); + $api_key = akismet_get_key(); + $show_key_form = $api_key; + $key_status = 'empty'; + $saved_ok = false; + $key_status_text = ''; $ms = array(); @@ -98,17 +101,17 @@ function akismet_conf() { $ms[] = 'key_empty'; } else - $key_status = akismet_verify_key( $key ); - + $key_status = akismet_verify_key( $key ); + if ( $key != $api_key && $key_status == 'valid' ) { - update_option('wordpress_api_key', $key); $ms[] = 'new_key_valid'; + update_option('wordpress_api_key', $key); } elseif ( $key_status == 'invalid' ) $ms[] = 'new_key_invalid'; elseif ( $key_status == 'failed' ) $ms[] = 'new_key_failed'; - + $api_key = $key_status == 'valid' ? $key : false; if ( isset( $_POST['akismet_discard_month'] ) ) @@ -130,6 +133,9 @@ function akismet_conf() { check_admin_referer( $akismet_nonce ); akismet_get_server_connectivity(0); } + elseif ( isset( $_GET['show'] ) && $_GET['show'] == 'enter-api-key' ) { + $show_key_form = true; + } if ( $show_key_form ) { //check current key status @@ -154,7 +160,14 @@ function akismet_conf() { elseif ( !empty( $key ) && $key_status == 'failed' ) $ms[] = 'key_failed'; } - } + } + + $key_status_strings = array( + 'empty' => __( 'Empty' ), + 'valid' => __( 'Valid' ), + 'invalid' => __( 'Invalid' ), + 'failed' => __( 'Failed' ), + ); $messages = array( 'new_key_empty' => array( 'class' => 'updated fade', 'text' => __('Your key has been cleared.' ) ), @@ -174,7 +187,7 @@ function akismet_conf() {

-

Stats' ), esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ) ); ?>

+

Stats' ), $stats_link ); ?>

@@ -182,10 +195,10 @@ function akismet_conf() { - +
- +
@@ -203,7 +216,7 @@ function akismet_conf() { -
+

create one here'), '#' );?>

@@ -212,8 +225,8 @@ function akismet_conf() {
-
- +
+
@@ -301,12 +314,13 @@ function akismet_conf() { function akismet_stats_display() { global $akismet_api_host, $akismet_api_port; - $blog = urlencode( get_bloginfo('url') ); - $api_key = akismet_get_key();?> + $blog = urlencode( get_bloginfo('url') ); + $api_key = akismet_get_key(); + $config_link = esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) );?>
-

enter your Akismet API key for it to work.' ), esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), admin_url( 'admin.php' ) ) ) );?>

enter your Akismet API key for it to work.' ), $config_link );?>

@@ -368,7 +382,7 @@ function akismet_admin_warnings() { -
+ @@ -376,10 +390,10 @@ function akismet_admin_warnings() {
A
-
Activate your Akismet account
+
'.__('Activate your Akismet account').'
-
Almost done - activate your account and say goodbye to comment spam.
+
'.__('Almost done - activate your account and say goodbye to comment spam').'