licenses.php 10.2 KB
Newer Older
imac's avatar
imac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
<?php
/**
 * @package WPSEO\Admin
 * @since      1.5.0
 */

if ( ! defined( 'WPSEO_VERSION' ) ) {
	header( 'Status: 403 Forbidden' );
	header( 'HTTP/1.1 403 Forbidden' );
	exit();
}

$extensions = array(
	'seo-premium'     => (object) array(
		'url'       => WPSEO_Shortlinker::get( 'https://yoa.st/pe-premium-page' ),
		'title'     => 'Yoast SEO Premium',
		/* translators: %1$s expands to Yoast SEO */
		'desc'      => sprintf( __( 'The premium version of %1$s with more features & support.', 'wordpress-seo' ), 'Yoast SEO' ),
		'installed' => false,
		'image'     => plugins_url( 'images/extensions-premium-ribbon.png', WPSEO_FILE ),
		'benefits'  => array(),
	),
	'video-seo'       => (object) array(
		'buyUrl'    => WPSEO_Shortlinker::get( 'https://yoa.st/zx/' ),
		'infoUrl'   => WPSEO_Shortlinker::get( 'https://yoa.st/zw/' ),
		'title'     => 'Video SEO',
		'desc'      => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
		'installed' => false,
		'image'     => plugins_url( 'images/extensions-video.png', WPSEO_FILE ),
		'benefits'  => array(
			__( 'Show your videos in Google Videos', 'wordpress-seo' ),
			__( 'Enhance the experience of sharing posts with videos', 'wordpress-seo' ),
			__( 'Make videos responsive through enabling fitvids.js', 'wordpress-seo' ),
		),
	),
	'news-seo'        => (object) array(
		'buyUrl'    => WPSEO_Shortlinker::get( 'https://yoa.st/zv/' ),
		'infoUrl'   => WPSEO_Shortlinker::get( 'https://yoa.st/zu/' ),
		'title'     => 'News SEO',
		'desc'      => __( 'Are you in Google News? Increase your traffic from Google News by optimizing for it!', 'wordpress-seo' ),
		'installed' => false,
		'image'     => plugins_url( 'images/extensions-news.png', WPSEO_FILE ),
		'benefits'  => array(
			__( 'Optimize your site for Google News', 'wordpress-seo' ),
			__( 'Immediately pings Google on the publication of a new post', 'wordpress-seo' ),
			__( 'Creates XML News Sitemaps', 'wordpress-seo' ),
		),
	),
	'local-seo'     => (object) array(
		'buyUrl'    => WPSEO_Shortlinker::get( 'https://yoa.st/zt' ),
		'infoUrl'   => WPSEO_Shortlinker::get( 'https://yoa.st/zs' ),
		'title'     => 'Local SEO',
		'desc'      => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
		'installed' => false,
		'image'     => plugins_url( 'images/extensions-local.png', WPSEO_FILE ),
		'benefits'  => array(
			__( 'Get found by potential clients', 'wordpress-seo' ),
			__( 'Easily insert Google Maps, a store locator, opening hours and more', 'wordpress-seo' ),
			__( 'Improve the usability of your contact page', 'wordpress-seo' ),
		),
	),
	'woocommerce-seo' => (object) array(
		'buyUrl'    => WPSEO_Shortlinker::get( 'https://yoa.st/zr' ),
		'infoUrl'   => WPSEO_Shortlinker::get( 'https://yoa.st/zq' ),
		'title'     => 'Yoast WooCommerce SEO',
		/* translators: %1$s expands to Yoast SEO */
		'desc'      => sprintf( __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), 'Yoast SEO' ),
		'installed' => false,
		'image'     => plugins_url( 'images/extensions-woo.png', WPSEO_FILE ),
		'benefits' => array(
			sprintf( __( 'Improve sharing on Pinterest', 'wordpress-seo' ) ),

			/* translators: %1$s expands to Yoast, %2$s expands to WooCommerce */
			sprintf( __( 'Use %1$s breadcrumbs instead of %2$s ones', 'wordpress-seo' ), 'Yoast', 'WooCommerce' ),

			/* translators: %1$s expands to Yoast SEO, %2$s expands to WooCommerce */
			sprintf( __( 'A seamless integration between %1$s and %2$s', 'wordpress-seo' ), 'Yoast SEO', 'WooCommerce' ),
		),
		'buy_button' => 'WooCommerce SEO',
	),
);

if ( class_exists( 'WPSEO_Premium' ) ) {
	$extensions['seo-premium']->installed = true;
}
if ( class_exists( 'wpseo_Video_Sitemap' ) ) {
	$extensions['video-seo']->installed = true;
}
if ( class_exists( 'WPSEO_News' ) ) {
	$extensions['news-seo']->installed = true;
}
if ( defined( 'WPSEO_LOCAL_VERSION' ) ) {
	$extensions['local-seo']->installed = true;
}
if ( ! class_exists( 'Woocommerce' ) ) {
	unset( $extensions['woocommerce-seo'] );
}
elseif ( class_exists( 'Yoast_WooCommerce_SEO' ) ) {
	$extensions['woocommerce-seo']->installed = true;
}

?>

<div class="wrap yoast wpseo_table_page">

	<h1 id="wpseo-title" class="yoast-h1"><?php
		/* translators: %1$s expands to Yoast SEO */
		printf( __( '%1$s Extensions', 'wordpress-seo' ), 'Yoast SEO' );
		?></h1>

	<h2 class="nav-tab-wrapper" id="wpseo-tabs">
		<a class="nav-tab" id="extensions-tab" href="#top#extensions"><?php _e( 'Extensions', 'wordpress-seo' ); ?></a>
		<a class="nav-tab" id="licenses-tab" href="#top#licenses"><?php _e( 'Licenses', 'wordpress-seo' ); ?></a>
	</h2>

	<div class="tabwrapper">
		<div id="extensions" class="wpseotab">
			<section class="yoast-seo-premium-extension">
				<?php
					$extension = $extensions['seo-premium'];
					$url = $extension->url;
				?>
				<h2><?php
					/* translators: %1$s expands to Yoast SEO Premium */
					printf( __( '%1$s, take your optimization to the next level!', 'wordpress-seo' ), '<span class="yoast-heading-highlight">' . $extension->title . '</span>' );
					?></h2>

				<ul class="yoast-seo-premium-benefits yoast-list--usp">
					<li class="yoast-seo-premium-benefits__item">
						<span class="yoast-seo-premium-benefits__title"><?php _e( 'Redirect manager', 'wordpress-seo' ); ?></span>
						<span class="yoast-seo-premium-benefits__description"><?php _e( 'create and manage redirects from within your WordPress install.', 'wordpress-seo' ); ?></span>
					</li>
					<li class="yoast-seo-premium-benefits__item">
						<span class="yoast-seo-premium-benefits__title"><?php _e( 'Multiple focus keywords', 'wordpress-seo' ); ?></span>
						<span class="yoast-seo-premium-benefits__description"><?php _e( 'optimize a single post for up to 5 keywords.', 'wordpress-seo' ); ?></span>
					</li>
					<li class="yoast-seo-premium-benefits__item">
						<span class="yoast-seo-premium-benefits__title"><?php _e( 'Social previews', 'wordpress-seo' ); ?></span>
						<span class="yoast-seo-premium-benefits__description"><?php _e( 'check what your Facebook or Twitter post will look like.', 'wordpress-seo' ); ?></span>
					</li>
					<li class="yoast-seo-premium-benefits__item">
						<span class="yoast-seo-premium-benefits__title"><?php _e( 'Premium support', 'wordpress-seo' ); ?></span>
						<span class="yoast-seo-premium-benefits__description"><?php _e( 'gain access to our 24/7 support team.', 'wordpress-seo' ); ?></span>
					</li>
				</ul>

				<?php if ( $extension->installed ) : ?>
					<div class="yoast-button yoast-button--noarrow yoast-button--installed"><?php _e( 'Installed', 'wordpress-seo' ); ?></div>
				<?php else : ?>
					<a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/zz' ); ?>" class="yoast-button default yoast-button--noarrow yoast-button-go-to"><?php
						/* translators: $1$s expands to Yoast SEO Premium */
						printf( __( 'Buy %1$s', 'wordpress-seo' ), $extension->title );
						?></a>
				<?php endif; ?>

				<a target="_blank" href="<?php WPSEO_Shortlinker::get( 'https://yoa.st/zy' ); ?>" class="yoast-link--more-info"><?php
					printf(
						/* translators: Text between %1$s and %2$s will only be shown to screen readers. %3$s expands to the product name. */
						__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
						'<span class="screen-reader-text">',
						'</span>',
						$extension->title
					);
					?></a>

				<p><small class="yoast-money-back-guarantee"><?php _e( 'Comes with our 30-day no questions asked money back guarantee', 'wordpress-seo' ); ?></small></p>
			</section>

			<hr class="yoast-hr" aria-hidden="true" />

			<section class="yoast-promo-extensions">
				<h2><?php
					/* translators: %1$s expands to Yoast SEO */
					$yoast_seo_extensions = sprintf( __( '%1$s extensions', 'wordpress-seo' ), 'Yoast SEO' );

					$yoast_seo_extensions = '<span class="yoast-heading-highlight">' . $yoast_seo_extensions . '</span>';

					/* translators: %1$s expands to Yoast SEO extensions */
					printf( __( '%1$s to optimize your site even further', 'wordpress-seo' ), $yoast_seo_extensions );
					?></h2>

				<?php unset( $extensions['seo-premium'] ); ?>

				<?php foreach ( $extensions as $id => $extension ) : ?>
					<?php $buy_url = $extension->buyUrl;
					$info_url = $extension->infoUrl; ?>


					<section class="yoast-promoblock secondary yoast-promo-extension">
						<img alt="" width="280" height="147" src="<?php echo esc_attr( $extension->image ); ?>" />
						<h3><?php echo esc_html( $extension->title ); ?></h3>

						<ul class="yoast-list--usp">
							<?php foreach ( $extension->benefits as $benefit ) : ?>
								<li><?php echo esc_html( $benefit ); ?></li>
							<?php endforeach; ?>
						</ul>


						<?php if ( $extension->installed ) : ?>
							<div class="yoast-button yoast-button--noarrow yoast-button--installed"><?php _e( 'Installed', 'wordpress-seo' ); ?></div>
						<?php else : ?>
							<a target="_blank" class="yoast-button default yoast-button--noarrow academy--secondary yoast-button-go-to" href="<?php echo esc_url( $buy_url ); ?>">
								<?php $product_name = isset( $extension->buy_button ) ? $extension->buy_button : $extension->title; ?>
								<?php /* translators: %s expands to the product name */ ?>
								<?php printf( __( 'Buy %s', 'wordpress-seo' ), $product_name ); ?>
							</a>
						<?php endif; ?>

						<a target="_blank" class="yoast-link--more-info" href="<?php echo esc_url( $info_url ); ?>"><?php
							printf(
								/* translators: Text between %1$s and %2$s will only be shown to screen readers. %3$s expands to the product name. */
								__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
								'<span class="screen-reader-text">',
								'</span>',
								$extension->title
							);
							?></a>
					</section>
				<?php endforeach; ?>
			</section>
		</div>

		<div id="licenses" class="wpseotab">
			<?php

			/**
			 * Display license page
			 */
			settings_errors();
			if ( ! has_action( 'wpseo_licenses_forms' ) ) {
				echo '<div class="msg"><p>', __( 'This is where you would enter the license keys for one of our premium plugins, should you activate one.', 'wordpress-seo' ), '</p></div>';
			}
			else {
				do_action( 'wpseo_licenses_forms' );
			}
			?>
		</div>
	</div>

</div>