Plugin Directory

Changeset 893039

Timestamp:
04/14/2014 05:20:31 PM (10 years ago)
Author:
eoigal
Message:
  • Remove redundant code on start page
  • Tidy up how we handle initial account status of Jetpack connected accounts
  • Update akismet green
  • Pass blog locale back to akismet so stats can localize text strings
Location:
akismet/trunk
Files:
5 edited

Legend:

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

    r891556 r893039  
    6666h2.ak-header {
    6767    padding: 30px;
    68     background: #7c9936 url('img/logo-full-2x.png') no-repeat 20px center;
     68    background: #6 url('img/logo-full-2x.png') no-repeat 20px center;
    6969    background-size: 185px 33px;
    7070    height: 33px;
     
    9393}
    9494.activate-option.clicked {
    95     background: #7c9936;
     95    background: #6;
    9696    color: #fff;
    9797}
     
    143143}
    144144.success {
    145     color: #7c9936;
     145    color: #6;
    146146}
    147147.option-description {
     
    212212
    213213.alert.active {
    214     background-color: #7c9936;
     214    background-color: #6;
    215215}
    216216
  • akismet/trunk/views/config.php

    r891556 r893039  
    1313                </span>
    1414
    15                 <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180', urlencode( get_bloginfo('url') ), $api_key );?>"></iframe>
     15                <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180 );?>"></iframe>
    1616                <ul>
    1717                    <li>
  • akismet/trunk/views/get.php

    r875752 r893039  
    1 <form name="akismet_activate" action="https://akismet.com/get/" method="POST">
     1<form name="akismet_activate" action="https://akismet.com/get/" method="POST">
    22    <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
    33    <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
  • akismet/trunk/views/start.php

    r892717 r893039  
    11<div class="no-key config-wrap"><?php
    2     if ( $akismet_user ) :
    3         if ( $akismet_user->status == 'active' ) : // ask do they want to use akismet account found using jetpack wpcom connection ?>
     2    if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
     3        if ( $akismet_user->status == 'missing' ) :?>
     4<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. Register your email address below to get started.', 'akismet'); ?></p>
     5<div class="activate-highlight activate-option">
     6    <div class="option-description">
     7        <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
     8        <?php echo esc_attr( $akismet_user->user_email ); ?>
     9    </div>
     10    <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
     11        <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
     12        <input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
     13        <input type="hidden" name="redirect" value="plugin-signup"/>
     14        <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register Akismet' , 'akismet'); ?>"/>
     15    </form>
     16</div>
     17<?php elseif ( $akismet_user->status == 'cancelled' ) :?>
     18<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
     19<div class="activate-highlight activate-option">
     20    <div class="option-description" style="width:75%;">
     21        <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
     22        <?php printf( esc_html__( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ); ?>
     23    </div>
     24    <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
     25        <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
     26        <input type="hidden" name="user_id" value="<?php echo $akismet_user->ID;?>"/>
     27        <input type="hidden" name="redirect" value="upgrade"/>
     28        <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
     29    </form>
     30</div>
     31<?php elseif ( $akismet_user->status == 'suspended' ) : ?>
     32<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
     33<div class="activate-highlight centered activate-option">
     34    <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
     35    <h3 class="alert-text"><?php printf( esc_html__( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ); ?></h3>
     36    <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll help sort this out.', 'akismet'); ?></p>
     37    <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
     38</div>
     39<?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
    440<p style="margin-right:10px"><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
    541<div class="activate-highlight activate-option">
     
    1551    </form>
    1652</div>
     53
    1754<div class="activate-highlight secondary activate-option">
    1855    <div class="option-description">
     
    3471    </form>
    3572</div>
    36 <?php elseif ( in_array( $akismet_user->status, array( 'missing', 'no-sub' ) ) ) : //no akismet account, ask do they want to use jetpack wpcom account to create one, then redirect to plans page?>
    37 <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. Register your email address below to get started.', 'akismet'); ?></p>
    38 <div class="activate-highlight activate-option">
    39     <div class="option-description">
    40         <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
    41         <?php echo esc_attr( $akismet_user->user_email ); ?>
    42     </div>
    43     <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right">
    44         <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
    45         <input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
    46         <input type="hidden" name="redirect" value="plugin-signup"/>
    47         <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register Akismet' , 'akismet'); ?>"/>
    48     </form>
    49 </div>
    50 <div class="activate-highlight secondary activate-option">
    51     <div class="option-description">
    52         <strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
    53         <p><?php esc_html_e('Use this option if you want to setup a new Akismet account.', 'akismet'); ?></p>
    54     </div>
    55     <?php Akismet::view( 'get', array( 'text' => __( 'Register a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
    56 </div>
    57 <div class="activate-highlight secondary activate-option">
    58     <div class="option-description">
    59         <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
    60         <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
    61     </div>
    62     <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
    63         <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
    64         <input type="hidden" name="action" value="enter-key">
    65         <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
    66         <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
    67     </form>
    68 </div>
    69 <?php elseif ( $akismet_user->status == 'cancelled' ) : ?>
    70 <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
    71 <div class="activate-highlight activate-option">
    72     <div class="option-description" style="width:75%;">
    73         <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
    74         <?php printf( esc_html__( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ); ?>
    75     </div>
    76     <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right">
    77         <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
    78         <input type="hidden" name="redirect" value="upgrade"/>
    79         <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
    80     </form>
    81 </div>
    82 <div class="activate-highlight secondary activate-option">
    83     <div class="option-description">
    84         <strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
    85         <p><?php esc_html_e('Use this option if you want to setup a new Akismet account.', 'akismet'); ?></p>
    86     </div>
    87     <?php Akismet::view( 'get', array( 'text' => __( 'Register a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
    88 </div>
    89 <div class="activate-highlight secondary activate-option">
    90     <div class="option-description">
    91         <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
    92         <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
    93     </div>
    94     <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
    95         <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
    96         <input type="hidden" name="action" value="enter-key">
    97         <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
    98         <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
    99     </form>
    100 </div>
    101 <?php elseif ( $akismet_user->status == 'suspended' ) : //has an akismet account but the key is suspended, need to upgrade their account to unsuspend key ?>
    102 <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
    103 <div class="activate-highlight centered activate-option">
    104     <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
    105     <h3 class="alert-text"><?php printf( esc_html__( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ); ?></h3>
    106     <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll help sort this out.', 'akismet'); ?></p>
    107     <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
    108 
    109 </div><?php
    110         endif;
    111     else :?>
     73<?php else :?>
    11274<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
    11375<div class="activate-highlight activate-option">
  • akismet/trunk/views/stats.php

    r891556 r893039  
    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( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s', 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( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
    44</div>
Note: See TracChangeset for help on using the changeset viewer.