Plugin Directory

Changeset 891556

Timestamp:
04/11/2014 09:04:22 PM (10 years ago)
Author:
eoigal
Message:
  • Add 'Settings' link to the plugins page
  • Update the iframe urls to be protocol relative to avoid using is_ssl
  • Tidy up no subscription notice to be less confusing
  • Allow key to be saved if the key active, has no sub or if the sub is in dunning
  • Change active alert color to akismet green
  • Localize the subscription status text
Location:
akismet/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • akismet/trunk/_inc/akismet.css

    r890710 r891556  
    212212
    213213.alert.active {
    214     background-color: #3db238;
     214    background-color: #;
    215215}
    216216
  • akismet/trunk/class.akismet-admin.php

    r891336 r891556  
    4343        add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );
    4444        add_filter( 'comment_text', array( 'Akismet_Admin', 'text_add_link_class' ) );
     45
     46
    4547    }
    4648
     
    6062        if ( !current_user_can( 'manage_options' ) )
    6163            return;
     64
     65
     66
     67
     68
     69
    6270    }
    6371
     
    245253            $akismet_user = self::get_akismet_user( $api_key );
    246254           
    247             if ( $akismet_user ) {
    248                 if ( $akismet_user->status != 'missing' )
     255            if ( $akismet_user ) {
     256                if ( )
    249257                    update_option( 'wordpress_api_key', $api_key );
    250258               
    251                 if ( $akismet_user->status == 'active' )
     259                if ( $akismet_user->status == 'active' )
    252260                    self::$notices['status'] = 'new-key-valid';
    253261                else
     
    742750           
    743751        return $akismet_user;
     752
     753
     754
     755
     756
     757
     758
     759
     760
     761
     762
     763
     764
    744765    }
    745766   
     
    841862        $api_key      = Akismet::get_api_key();
    842863        $akismet_user = self::get_akismet_user( $api_key );
     864
    843865       
    844866        // If unset, create the new strictness option using the old discard option to determine its default
    845867        if ( get_option( 'akismet_strictness' ) === false )
    846868            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         }
    857869
    858870        if ( empty( self::$notices ) ) {
     
    884896        }
    885897       
    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' ) ) ) 
    887899            Akismet::view( 'notice', array( 'type' => $akismet_user->status ) );
    888900
    889901        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' ) );
    891903    }
    892904
  • akismet/trunk/views/config.php

    r891108 r891556  
    1313                </span>
    1414
    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>
    1616                <ul>
    1717                    <li>
     
    132132                                            <td width="5%"/>
    133133                                            <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>
    135148                                            </td>
    136149                                        </tr>
     
    149162                            <div id="major-publishing-actions">
    150163                                <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' ) ); ?>
    152165                                </div>
    153166                                <div class="clear"></div>
  • akismet/trunk/views/notice.php

    r888811 r891556  
    6464<?php elseif ( $type == 'missing' ) :?>
    6565<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>
    6767    <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
    6873</div>
    6974<?php elseif ( $type == 'new-key-valid' ) :?>
     
    8388    <?php if ( $level == 'yellow' ): ?>
    8489    <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>
    8691    <?php elseif ( $level == 'red' ): ?>
    8792    <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>
    8994    <?php endif; ?>
    9095</div>
  • akismet/trunk/views/stats.php

    r878668 r891556  
    11<div class="wrap">
    22    <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>
    44</div>
Note: See TracChangeset for help on using the changeset viewer.