wp/wp-content/plugins/akismet/views/start.php
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
     1 <div class="no-key config-wrap"><?php
     1 <div id="akismet-plugin-container">
     2 	if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
     2 	<div class="akismet-masthead">
     3 		if ( $akismet_user->status == 'missing' ) :?>
     3 		<div class="akismet-masthead__inside-container">
     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>
     4 			<div class="akismet-masthead__logo-container">
     5 <div class="activate-highlight activate-option">
     5 				<img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
     6 	<div class="option-description">
     6 			</div>
     7 		<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
     7 		</div>
     8 		<?php echo esc_attr( $akismet_user->user_email ); ?>
       
     9 	</div>
     8 	</div>
    10 	<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
     9 	<div class="akismet-lower">
    11 		<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
    10 		<?php Akismet_Admin::display_status(); ?>
    12 		<input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
    11 		
    13 		<input type="hidden" name="redirect" value="plugin-signup"/>
    12 		<div class="akismet-box">
    14 		<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register Akismet' , 'akismet'); ?>"/>
    13 			<h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
    15 	</form>
    14 			<p><?php esc_html_e( 'Select one of the options below to get started.', 'akismet' ); ?></p>
       
    15 		</div>
       
    16 		<div class="akismet-boxes">
       
    17 			<?php if ( ! Akismet::predefined_api_key() ) { ?>
       
    18 				<?php if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { ?>
       
    19 					<?php if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) { ?>
       
    20 						<div class="akismet-box">
       
    21 							<h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
       
    22 							<p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
       
    23 							<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
       
    24 								<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
       
    25 								<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
       
    26 								<input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
       
    27 								<input type="hidden" name="redirect" value="plugin-signup"/>
       
    28 								<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
       
    29 							</form>
       
    30 							<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
       
    31 							<p><?php echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
       
    32 						</div>
       
    33 					<?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
       
    34 						<div class="akismet-box">
       
    35 							<h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
       
    36 							<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
       
    37 								<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
       
    38 								<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
       
    39 								<input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
       
    40 								<input type="hidden" name="redirect" value="upgrade"/>
       
    41 								<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet' ); ?>"/>
       
    42 							</form>
       
    43 							<p><?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
       
    44 						</div>
       
    45 					<?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
       
    46 						<div class="centered akismet-box">
       
    47 							<h3><?php esc_html_e( 'Connected via Jetpack' , 'akismet' ); ?></h3>
       
    48 							<p class="akismet-alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
       
    49 							<p><?php esc_html_e( 'No worries! Get in touch and we&#8217;ll sort this out.', 'akismet' ); ?></p>
       
    50 							<p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>
       
    51 						</div>
       
    52 					<?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
       
    53 						<div class="akismet-box">
       
    54 							<h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
       
    55 							<p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
       
    56 							<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="akismet-right">
       
    57 								<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
       
    58 								<input type="hidden" name="action" value="enter-key">
       
    59 								<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
       
    60 								<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
       
    61 							</form>
       
    62 							<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
       
    63 							<p><?php echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
       
    64 						</div>
       
    65 					<?php } ?>
       
    66 					<div class="akismet-box">
       
    67 						<h3><?php esc_html_e( 'Or sign up with a different email address', 'akismet' ); ?></h3>
       
    68 						<div class="akismet-right">
       
    69 							<?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet' ), 'classes' => array( 'akismet-button' ) ) ); ?>
       
    70 						</div>
       
    71 						<p><?php esc_html_e( 'Choose this option to use Akismet independently of your Jetpack connection.', 'akismet' ); ?></p>
       
    72 					</div>
       
    73 				<?php } else { ?>
       
    74 					<div class="akismet-box">
       
    75 						<h3><?php esc_html_e( 'Activate Akismet' , 'akismet' );?></h3>
       
    76 						<div class="akismet-right">
       
    77 							<?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
       
    78 						</div>
       
    79 						<p><?php esc_html_e( 'Log in or sign up now.', 'akismet' ); ?></p>
       
    80 					</div>
       
    81 				<?php } ?>
       
    82 				<div class="akismet-box">
       
    83 					<h3><?php esc_html_e( 'Or enter an API key', 'akismet' ); ?></h3>
       
    84 					<p><?php esc_html_e( 'Already have your key? Enter it here.', 'akismet' ); ?> <a href="https://docs.akismet.com/getting-started/api-key/" target="_blank"><?php esc_html_e( '(What is an API key?)', 'akismet' ); ?></a></p>
       
    85 					<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
       
    86 						<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
       
    87 						<input type="hidden" name="action" value="enter-key">
       
    88 						<p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;">
       
    89 							<input id="key" name="key" type="text" size="15" value="" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;">
       
    90 							<input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>">
       
    91 						</p>
       
    92 					</form>
       
    93 				</div>
       
    94 			<?php } else { ?>
       
    95 				<div class="akismet-box">
       
    96 					<h2><?php esc_html_e( 'Manual Configuration', 'akismet' ); ?></h2>
       
    97 					<p><?php echo sprintf( esc_html__( 'An Akismet API key has been defined in the %s file for this site.', 'akismet' ), '<code>wp-config.php</code>' ); ?></p>
       
    98 				</div>
       
    99 			<?php } ?>
       
   100 		</div>
       
   101 	</div>
    16 </div>
   102 </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_url( 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 ?>
       
    40 <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>
       
    41 <div class="activate-highlight activate-option">
       
    42 	<div class="option-description">
       
    43 		<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
       
    44 		<?php echo esc_attr( $akismet_user->user_email ); ?>
       
    45 	</div>
       
    46 	<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
       
    47 		<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
       
    48 		<input type="hidden" name="action" value="enter-key">
       
    49 		<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
       
    50 		<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this Akismet account' , 'akismet'); ?>"/>
       
    51 	</form>
       
    52 </div>
       
    53 <?php endif;?>
       
    54 <div class="activate-highlight secondary activate-option">
       
    55 	<div class="option-description">
       
    56 		<strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
       
    57 		<p><?php esc_html_e('Use this option if you want to setup a new Akismet account.', 'akismet'); ?></p>
       
    58 	</div>
       
    59 	<?php Akismet::view( 'get', array( 'text' => __( 'Register a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
       
    60 </div>
       
    61 <div class="activate-highlight secondary activate-option">
       
    62 	<div class="option-description">
       
    63 		<strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
       
    64 		<p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
       
    65 	</div>
       
    66 	<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
       
    67 		<input id="key" name="key" type="text" size="15" value="" class="regular-text code">
       
    68 		<input type="hidden" name="action" value="enter-key">
       
    69 		<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
       
    70 		<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
       
    71 	</form>
       
    72 </div>
       
    73 <?php else :?>
       
    74 <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>
       
    75 <div class="activate-highlight activate-option">
       
    76 	<div class="option-description">
       
    77 		<strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
       
    78 		<p><?php esc_html_e('Log in or create an account to get your API key.', 'akismet'); ?></p>
       
    79 	</div>
       
    80 	<?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
       
    81 </div>
       
    82 <div class="activate-highlight secondary activate-option">
       
    83 	<div class="option-description">
       
    84 		<strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
       
    85 		<p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
       
    86 	</div>
       
    87 	<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
       
    88 		<input id="key" name="key" type="text" size="15" value="" class="regular-text code">
       
    89 		<input type="hidden" name="action" value="enter-key">
       
    90 		<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
       
    91 		<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
       
    92 	</form>
       
    93 </div><?php
       
    94 	endif;?>
       
    95 </div>