Changeset 891556
- Timestamp:
- 04/11/2014 09:04:22 PM (10 years ago)
- Location:
- akismet/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
akismet/trunk/_inc/akismet.css
r890710 r891556 212 212 213 213 .alert.active { 214 background-color: # 3db238;214 background-color: #; 215 215 } 216 216 -
akismet/trunk/class.akismet-admin.php
r891336 r891556 43 43 add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 ); 44 44 add_filter( 'comment_text', array( 'Akismet_Admin', 'text_add_link_class' ) ); 45 46 45 47 } 46 48 … … 60 62 if ( !current_user_can( 'manage_options' ) ) 61 63 return; 64 65 66 67 68 69 62 70 } 63 71 … … 245 253 $akismet_user = self::get_akismet_user( $api_key ); 246 254 247 if ( $akismet_user ) { 248 if ( $akismet_user->status != 'missing')255 if ( $akismet_user ) { 256 if ( ) 249 257 update_option( 'wordpress_api_key', $api_key ); 250 258 251 if ( $akismet_user->status == 'active' )259 if ( $akismet_user->status == 'active' ) 252 260 self::$notices['status'] = 'new-key-valid'; 253 261 else … … 742 750 743 751 return $akismet_user; 752 753 754 755 756 757 758 759 760 761 762 763 764 744 765 } 745 766 … … 841 862 $api_key = Akismet::get_api_key(); 842 863 $akismet_user = self::get_akismet_user( $api_key ); 864 843 865 844 866 // If unset, create the new strictness option using the old discard option to determine its default 845 867 if ( get_option( 'akismet_strictness' ) === false ) 846 868 add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') ); 847 848 $blog = parse_url( get_option('home'), PHP_URL_HOST );849 850 foreach( array( '6-months', 'all' ) as $interval ) {851 $response = Akismet::http_post( http_build_query( array( 'blog' => urlencode( $blog ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );852 853 if ( ! empty( $response[1] ) ) {854 $stat_totals[$interval] = json_decode( $response[1] );855 }856 }857 869 858 870 if ( empty( self::$notices ) ) { … … 884 896 } 885 897 886 if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing' ) ) )898 if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing' ) ) ) 887 899 Akismet::view( 'notice', array( 'type' => $akismet_user->status ) ); 888 900 889 901 Akismet::log( compact( 'stat_totals', 'akismet_user' ) ); 890 Akismet::view( 'config', compact( 'api_key', ' blog', 'akismet_user', 'stat_totals' ) );902 Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals' ) ); 891 903 } 892 904 -
akismet/trunk/views/config.php
r891108 r891556 13 13 </span> 14 14 15 <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( ' %s://akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180', is_ssl()?'https':'http', $blog, $api_key );?>"></iframe>15 <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( ', $api_key );?>"></iframe> 16 16 <ul> 17 17 <li> … … 132 132 <td width="5%"/> 133 133 <td align="left"> 134 <span><?php echo ucwords( $akismet_user->status ); ?></span> 134 <span><?php 135 if ( 'active-dunning' == $akismet_user->status ) : 136 esc_html_e( 'Active (Dunning)', 'akismet' ); 137 elseif ( 'cancelled' == $akismet_user->status ) : 138 esc_html_e( 'Cancelled', 'akismet' ); 139 elseif ( 'suspended' == $akismet_user->status ) : 140 esc_html_e( 'Suspended', 'akismet' ); 141 elseif ( 'missing' == $akismet_user->status ) : 142 esc_html_e( 'Missing', 'akismet' ); 143 elseif ( 'no-sub' == $akismet_user->status ) : 144 esc_html_e( 'No Subscription Found', 'akismet' ); 145 else : 146 esc_html_e( 'Active', 'akismet' ); 147 endif; ?></span> 135 148 </td> 136 149 </tr> … … 149 162 <div id="major-publishing-actions"> 150 163 <div id="publishing-action"> 151 <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>164 <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?> 152 165 </div> 153 166 <div class="clear"></div> -
akismet/trunk/views/notice.php
r888811 r891556 64 64 <?php elseif ( $type == 'missing' ) :?> 65 65 <div class="wrap alert critical"> 66 <h3 class="key-status failed"><?php esc_html_e( "Your subscription is missing.", 'akismet'); ?></h3>66 <h3 class="key-status failed"><?php esc_html_e(, 'akismet'); ?></h3> 67 67 <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p> 68 69 70 71 72 68 73 </div> 69 74 <?php elseif ( $type == 'new-key-valid' ) :?> … … 83 88 <?php if ( $level == 'yellow' ): ?> 84 89 <h3 class="key-status failed"><?php esc_html_e("You're using your Akismet key on more sites than your Pro subscription allows.", 'akismet'); ?></h3> 85 <p class="description"><?php printf( __('If you would like to use Akismet on more than 10 sites, you will need to <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>. If you have any questions, please <a href="%s" target="_blank">get in touch with our support team</a>', 'akismet'), 'https://akismet.com/account/ ', 'https://akismet.com/contact/'); ?></p>90 <p class="description"><?php printf( __('If you would like to use Akismet on more than 10 sites, you will need to <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>. If you have any questions, please <a href="%s" target="_blank">get in touch with our support team</a>', 'akismet'), 'https://akismet.com/account/', 'https://akismet.com/contact/'); ?></p> 86 91 <?php elseif ( $level == 'red' ): ?> 87 92 <h3 class="key-status failed"><?php esc_html_e("You're using Akismet on far too many sites for your Pro subscription.", 'akismet'); ?></h3> 88 <p class="description"><?php printf( __('To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites. Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet'), 'https://akismet.com/account/ ', 'https://akismet.com/contact/'); ?></p>93 <p class="description"><?php printf( __('To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites. Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet'), 'https://akismet.com/account/', 'https://akismet.com/contact/'); ?></p> 89 94 <?php endif; ?> 90 95 </div> -
akismet/trunk/views/stats.php
r878668 r891556 1 1 <div class="wrap"> 2 2 <h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2> 3 <iframe src="<?php echo esc_url( sprintf( ' %s://akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s', is_ssl()?'https':'http', urlencode( get_bloginfo('url') ), Akismet::get_api_key() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>3 <iframe src="<?php echo esc_url( sprintf( '', urlencode( get_bloginfo('url') ), Akismet::get_api_key() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe> 4 4 </div>
Note: See TracChangeset
for help on using the changeset viewer.