Changeset 883068
- Timestamp:
- 03/27/2014 05:55:35 PM (10 years ago)
- Location:
- akismet/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
akismet/trunk/class.akismet-admin.php
r878668 r883068 93 93 'strings' => array( 94 94 'Remove this URL' => __( 'Remove this URL' , 'akismet'), 95 'Removing...' => __( 'Removing...' , 'akismet'),96 'URL removed' => __( 'URL removed' , 'akismet'),97 '(undo)' => __( '(undo)' , 'akismet'),98 'Re-adding...' => __( 'Re-adding...' , 'akismet'),95 'Removing...' => __( 'Removing...' , 'akismet'), 96 'URL removed' => __( 'URL removed' , 'akismet'), 97 '(undo)' => __( '(undo)' , 'akismet'), 98 'Re-adding...' => __( 'Re-adding...' , 'akismet'), 99 99 ) 100 100 ) ); … … 243 243 244 244 if ( $key_status == 'valid' ) { 245 update_option( 'wordpress_api_key', $api_key ); 246 self::$notices[] = 'new-key-valid'; 245 $akismet_user = self::get_akismet_user( $api_key ); 246 247 if ( $akismet_user ) { 248 if ( $akismet_user->status != 'missing' ) 249 update_option( 'wordpress_api_key', $api_key ); 250 251 if ( $akismet_user->status == 'active' ) 252 self::$notices['status'] = 'new-key-valid'; 253 else 254 self::$notices['status'] = $akismet_user->status; 255 } 256 else 257 self::$notices['status'] = 'new-key-invalid'; 247 258 } 248 259 elseif ( in_array( $key_status, array( 'invalid', 'failed' ) ) ) 249 self::$notices[ ] = 'new-key-'.$key_status;260 self::$notices[] = 'new-key-'.$key_status; 250 261 } 251 262 … … 719 730 return $url; 720 731 } 732 733 734 735 736 737 738 739 740 741 742 721 743 722 744 public static function display_alert() { … … 808 830 public static function display_configuration_page() { 809 831 $api_key = Akismet::get_api_key(); 810 $akismet_user = Akismet::http_post( http_build_query( array( 'key' => $api_key ) ), 'get-subscription' ); 811 812 if ( count( $akismet_user ) > 1 ) 813 $akismet_user = json_decode( $akismet_user[1] ); 814 else 815 $akismet_user = false; 832 $akismet_user = self::get_akismet_user( $api_key ); 816 833 817 834 $blog = parse_url( get_option('home'), PHP_URL_HOST ); … … 846 863 Akismet::view( 'notice', array( 'type' => 'active-notice', 'time_saved' => $time_saved ) ); 847 864 } 848 elseif ( in_array( $akismet_user->status, array( 'cancelled', 'suspended' ) ) ) 849 Akismet::view( 'notice', array( 'type' => $akismet_user->status ) ); 850 } 865 } 866 867 if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing' ) ) ) 868 Akismet::view( 'notice', array( 'type' => $akismet_user->status ) ); 851 869 852 870 Akismet::log( compact( 'stat_totals', 'akismet_user' ) ); -
akismet/trunk/views/notice.php
r879359 r883068 42 42 <p class="description"><?php printf( __('Your firewall may be blocking us. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p> 43 43 </div> 44 <?php elseif ( $type == ' overdue' ) :?>44 <?php elseif ( $type == '' ) :?> 45 45 <div class="wrap alert critical"> 46 46 <h3 class="key-status"><?php esc_html_e("Please update your payment details.", 'akismet'); ?></h3> … … 62 62 <p class="description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p> 63 63 </div> 64 65 66 67 68 64 69 <?php elseif ( $type == 'new-key-valid' ) :?> 65 70 <div class="wrap alert active">
Note: See TracChangeset
for help on using the changeset viewer.