<fieldset>
	<legend class="screen-reader-text">
		<?php _e('License key','xml-sitemap-feed'); ?>
	</legend>

	<input name="xmlsf_news_license[key]" id="xmlsf_news_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $key ); ?>" />

	<?php if ( $message = xmlsf_news_license_error_msg( $error, $expires ) ) { ?>
	<p class="button-link-delete"><?php echo $message; ?></p>
	<?php } ?>
  
 	<p class="description">
	<?php
	if ( empty( $key ) ) {
		_e( 'Enter your license key.', 'xml-sitemap-feed' );
	} else {
		switch ($status) {
			case 'valid':
				_e( 'Your license is active for this site.', 'xml-sitemap-feed' );
				if ( ! empty($expires) ) {
					printf( '<br/>' . /* Translators: Expiration date */ __( 'Your license expires on %s.', 'xml-sitemap-feed' ), $expires );
				}
				break;

			case 'inactive':
				echo '<span class="button-link-delete">';
				printf( /* Translators: Plugin name */
					__( 'To receive updates for %s, please activate your license for this site.','xml-sitemap-feed'),
					__('Google News Advanced','xml-sitemap-feed')
				);
				echo '</span>';
				break;

			case 'expired':
				printf( /* Translators: Plugin name, renew your license (linked) */
					__( 'To continue receiving updates for %1$s, please %2$s.', 'xml-sitemap-feed' ), __( 'Google News Advanced', 'xml-sitemap-feed' ),
					'<a href="' . trailingslashit( XMLSF_NEWS_ADV_STORE_URL ) . 'checkout/?edd_license_key=' . $key . '&download_id=' . XMLSF_NEWS_ADV_ITEM_ID . '" target="_blank">' . __( 'renew your license', 'xml-sitemap-feed' ) . '</a>'
				);
				break;

			default:
				if ( 'no_activations_left' === $error ) {
					printf( /* Translators: Account (linked), Plugin name */
						__( 'Please check your %1$s for possibilities to upgrade your %2$s license.', 'xml-sitemap-feed' ),
						'<a href="' . $account_url . '" target="_blank">' . __( 'Account', 'xml-sitemap-feed' ) . '</a>',
						__( 'Google News Advanced', 'xml-sitemap-feed' )
					);
				}
		}
	}
	?>
	</p>
</fieldset>
