licenses.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin
  6. * @since 5.1
  7. */
  8. if ( ! defined( 'WPSEO_VERSION' ) ) {
  9. header( 'Status: 403 Forbidden' );
  10. header( 'HTTP/1.1 403 Forbidden' );
  11. exit();
  12. }
  13. $extension_list = new WPSEO_Extensions();
  14. $extensions = $extension_list->get();
  15. // First invalidate all licenses.
  16. array_map( array( $extension_list, 'invalidate' ), $extensions );
  17. $extensions = new WPSEO_Extension_Manager();
  18. $extensions->add(
  19. 'wordpress-seo-premium',
  20. new WPSEO_Extension(
  21. array(
  22. 'url' => WPSEO_Shortlinker::get( 'https://yoa.st/pe-premium-page' ),
  23. 'title' => 'Yoast SEO Premium',
  24. /* translators: %1$s expands to Yoast SEO */
  25. 'desc' => sprintf( __( 'The premium version of %1$s with more features & support.', 'wordpress-seo' ), 'Yoast SEO' ),
  26. 'image' => plugins_url( 'images/extensions-premium-ribbon.png?v=' . WPSEO_VERSION, WPSEO_FILE ),
  27. 'benefits' => array(),
  28. )
  29. )
  30. );
  31. $extensions->add(
  32. 'wpseo-video',
  33. new WPSEO_Extension(
  34. array(
  35. 'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zx/' ),
  36. 'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zw/' ),
  37. 'title' => 'Video SEO',
  38. 'desc' => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
  39. 'image' => plugins_url( 'images/extensions-video.png?v=' . WPSEO_VERSION, WPSEO_FILE ),
  40. 'benefits' => array(
  41. __( 'Show your videos in Google Videos', 'wordpress-seo' ),
  42. __( 'Enhance the experience of sharing posts with videos', 'wordpress-seo' ),
  43. __( 'Make videos responsive through enabling fitvids.js', 'wordpress-seo' ),
  44. ),
  45. )
  46. )
  47. );
  48. $extensions->add(
  49. 'wpseo-news',
  50. new WPSEO_Extension(
  51. array(
  52. 'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zv/' ),
  53. 'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zu/' ),
  54. 'title' => 'News SEO',
  55. 'desc' => __( 'Are you in Google News? Increase your traffic from Google News by optimizing for it!', 'wordpress-seo' ),
  56. 'image' => plugins_url( 'images/extensions-news.png?v=' . WPSEO_VERSION, WPSEO_FILE ),
  57. 'benefits' => array(
  58. __( 'Optimize your site for Google News', 'wordpress-seo' ),
  59. __( 'Immediately pings Google on the publication of a new post', 'wordpress-seo' ),
  60. __( 'Creates XML News Sitemaps', 'wordpress-seo' ),
  61. ),
  62. )
  63. )
  64. );
  65. if ( ! defined( 'WPSEO_LOCAL_WOOCOMMERCE_VERSION' ) ) {
  66. $extensions->add(
  67. 'wpseo-local',
  68. new WPSEO_Extension(
  69. array(
  70. 'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zt' ),
  71. 'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zs' ),
  72. 'title' => 'Local SEO',
  73. 'desc' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
  74. 'image' => plugins_url( 'images/extensions-local.png?v=' . WPSEO_VERSION, WPSEO_FILE ),
  75. 'benefits' => array(
  76. __( 'Get found by potential clients', 'wordpress-seo' ),
  77. __( 'Easily insert Google Maps, a store locator, opening hours and more', 'wordpress-seo' ),
  78. __( 'Improve the usability of your contact page', 'wordpress-seo' ),
  79. ),
  80. )
  81. )
  82. );
  83. }
  84. $extensions->add(
  85. 'wpseo-local-woocommerce',
  86. new WPSEO_Extension(
  87. array(
  88. 'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/272' ),
  89. 'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/273' ),
  90. 'title' => 'Local SEO for WooCommerce',
  91. 'desc' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
  92. 'image' => plugins_url( 'images/extensions-local-for-woocommerce.png?v=' . WPSEO_VERSION, WPSEO_FILE ),
  93. 'benefits' => array(
  94. esc_html__( 'Get better search results in local search', 'wordpress-seo' ),
  95. esc_html__( 'Enhance your contact pages with Google Maps, opening hours and a store locator', 'wordpress-seo' ),
  96. /* translators: %1$s expands to WooCommerce */
  97. sprintf( esc_html__( 'Allow customers to pick up their %s order locally', 'wordpress-seo' ), 'WooCommerce' ),
  98. ),
  99. )
  100. )
  101. );
  102. // Add Yoast WooCommerce SEO when WooCommerce is active.
  103. if ( WPSEO_Utils::is_woocommerce_active() ) {
  104. $extensions->add(
  105. 'wpseo-woocommerce',
  106. new WPSEO_Extension(
  107. array(
  108. 'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zr' ),
  109. 'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zq' ),
  110. 'title' => 'Yoast WooCommerce SEO',
  111. /* translators: %1$s expands to Yoast SEO */
  112. 'desc' => sprintf( __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), 'Yoast SEO' ),
  113. 'image' => plugins_url( 'images/extensions-woo.png?v=' . WPSEO_VERSION, WPSEO_FILE ),
  114. 'benefits' => array(
  115. sprintf( __( 'Improve sharing on Pinterest', 'wordpress-seo' ) ),
  116. /* translators: %1$s expands to Yoast, %2$s expands to WooCommerce */
  117. sprintf( __( 'Use %1$s breadcrumbs instead of %2$s ones', 'wordpress-seo' ), 'Yoast', 'WooCommerce' ),
  118. /* translators: %1$s expands to Yoast SEO, %2$s expands to WooCommerce */
  119. sprintf( __( 'A seamless integration between %1$s and %2$s', 'wordpress-seo' ), 'Yoast SEO', 'WooCommerce' ),
  120. ),
  121. 'buy_button' => 'WooCommerce SEO',
  122. )
  123. )
  124. );
  125. }
  126. /* translators: %1$s expands to Yoast SEO. */
  127. $wpseo_extensions_header = sprintf( __( '%1$s Extensions', 'wordpress-seo' ), 'Yoast SEO' );
  128. ?>
  129. <div class="wrap yoast wpseo_table_page">
  130. <h1 id="wpseo-title" class="yoast-h1"><?php echo esc_html( $wpseo_extensions_header ); ?></h1>
  131. <div id="extensions">
  132. <section class="yoast-seo-premium-extension">
  133. <?php
  134. $extension = $extensions->get( 'wordpress-seo-premium' );
  135. $extensions->remove( 'wordpress-seo-premium' );
  136. ?>
  137. <h2>
  138. <?php
  139. printf(
  140. /* translators: %1$s expands to Yoast SEO Premium */
  141. esc_html__( '%1$s, take your optimization to the next level!', 'wordpress-seo' ),
  142. '<span class="yoast-heading-highlight">' . $extension->get_title() . '</span>'
  143. );
  144. ?>
  145. </h2>
  146. <?php
  147. if ( ! $extensions->is_activated( 'wordpress-seo-premium' ) ) :
  148. ?>
  149. <ul class="yoast-seo-premium-benefits yoast-list--usp">
  150. <li class="yoast-seo-premium-benefits__item">
  151. <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Redirect manager', 'wordpress-seo' ); ?></span>
  152. <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'create and manage redirects from within your WordPress install.', 'wordpress-seo' ); ?></span>
  153. </li>
  154. <li class="yoast-seo-premium-benefits__item">
  155. <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Multiple focus keywords', 'wordpress-seo' ); ?></span>
  156. <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'optimize a single post for up to 5 keywords.', 'wordpress-seo' ); ?></span>
  157. </li>
  158. <li class="yoast-seo-premium-benefits__item">
  159. <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Social previews', 'wordpress-seo' ); ?></span>
  160. <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'check what your Facebook or Twitter post will look like.', 'wordpress-seo' ); ?></span>
  161. </li>
  162. <li class="yoast-seo-premium-benefits__item">
  163. <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Premium support', 'wordpress-seo' ); ?></span>
  164. <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'gain access to our 24/7 support team.', 'wordpress-seo' ); ?></span>
  165. </li>
  166. </ul>
  167. <?php endif; ?>
  168. <?php if ( $extension_list->is_installed( $extension->get_title() ) ) : ?>
  169. <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-installed"><?php esc_html_e( 'Installed', 'wordpress-seo' ); ?></div>
  170. <?php if ( $extensions->is_activated( 'wordpress-seo-premium' ) ) : ?>
  171. <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-activated"><?php esc_html_e( 'Activated', 'wordpress-seo' ); ?></div>
  172. <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13k' ); ?>" class="yoast-link--license"><?php esc_html_e( 'Manage your subscription on My Yoast', 'wordpress-seo' ); ?></a>
  173. <?php else : ?>
  174. <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-not-activated"><?php esc_html_e( 'Not activated', 'wordpress-seo' ); ?></div>
  175. <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13i' ); ?>" class="yoast-link--license"><?php esc_html_e( 'Activate your site on My Yoast', 'wordpress-seo' ); ?></a>
  176. <?php endif; ?>
  177. </a>
  178. <?php else : ?>
  179. <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/zz' ); ?>" class="yoast-button yoast-button--noarrow yoast-button-go-to yoast-button--extension yoast-button--extension-buy">
  180. <?php
  181. /* translators: $1$s expands to Yoast SEO Premium */
  182. printf( __( 'Buy %1$s', 'wordpress-seo' ), $extension->get_title() );
  183. ?></a>
  184. <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/zy' ); ?>" class="yoast-link--more-info"><?php
  185. printf(
  186. /* translators: Text between %1$s and %2$s will only be shown to screen readers. %3$s expands to the product name. */
  187. __( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
  188. '<span class="screen-reader-text">',
  189. '</span>',
  190. $extension->get_title() );
  191. ?></a>
  192. <?php endif; ?>
  193. <?php if ( ! $extensions->is_activated( 'wordpress-seo-premium' ) ) { ?>
  194. <p><small class="yoast-money-back-guarantee"><?php esc_html_e( 'Comes with our 30-day no questions asked money back guarantee', 'wordpress-seo' ); ?></small></p>
  195. <?php } ?>
  196. </section>
  197. <hr class="yoast-hr" aria-hidden="true" />
  198. <section class="yoast-promo-extensions">
  199. <h2><?php
  200. /* translators: %1$s expands to Yoast SEO */
  201. $yoast_seo_extensions = sprintf( __( '%1$s extensions', 'wordpress-seo' ), 'Yoast SEO' );
  202. $yoast_seo_extensions = '<span class="yoast-heading-highlight">' . $yoast_seo_extensions . '</span>';
  203. /* translators: %1$s expands to Yoast SEO extensions */
  204. printf( __( '%1$s to optimize your site even further', 'wordpress-seo' ), $yoast_seo_extensions );
  205. ?></h2>
  206. <?php foreach ( $extensions->get_all() as $id => $extension ) : ?>
  207. <section class="yoast-promoblock secondary yoast-promo-extension">
  208. <img alt="" width="280" height="147" src="<?php echo esc_attr( $extension->get_image() ); ?>" />
  209. <h3><?php echo esc_html( $extension->get_title() ); ?></h3>
  210. <ul class="yoast-list--usp">
  211. <?php foreach ( $extension->get_benefits() as $benefit ) : ?>
  212. <li><?php echo esc_html( $benefit ); ?></li>
  213. <?php endforeach; ?>
  214. </ul>
  215. <div class="yoast-button-container">
  216. <?php if ( $extension_list->is_installed( $extension->get_title() ) ) : ?>
  217. <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-installed"><?php esc_html_e( 'Installed', 'wordpress-seo' ); ?></div>
  218. <?php if ( $extensions->is_activated( $id ) ) : ?>
  219. <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-activated"><?php esc_html_e( 'Activated', 'wordpress-seo' ); ?></div>
  220. <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13k' ); ?>" class="yoast-link--license"><?php esc_html_e( 'Manage your subscription on My Yoast', 'wordpress-seo' ); ?></a>
  221. <?php else : ?>
  222. <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-not-activated"><?php esc_html_e( 'Not activated', 'wordpress-seo' ); ?></div>
  223. <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13i' ); ?>" class="yoast-link--license"><?php esc_html_e( 'Activate your site on My Yoast', 'wordpress-seo' ); ?></a>
  224. <?php endif; ?>
  225. <?php else : ?>
  226. <a target="_blank" class="yoast-button yoast-button--noarrow yoast-button-go-to yoast-button--extension yoast-button--extension-buy" href="<?php echo esc_url( $extension->get_buy_url() ); ?>">
  227. <?php /* translators: %s expands to the product name */ ?>
  228. <?php printf( __( 'Buy %s', 'wordpress-seo' ), $extension->get_buy_button() ); ?>
  229. </a>
  230. <a target="_blank" class="yoast-link--more-info" href="<?php echo esc_url( $extension->get_info_url() ); ?>"><?php
  231. printf(
  232. /* translators: Text between %1$s and %2$s will only be shown to screen readers. %3$s expands to the product name. */
  233. __( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
  234. '<span class="screen-reader-text">',
  235. '</span>',
  236. $extension->get_title() );
  237. ?>
  238. </a>
  239. <?php endif; ?>
  240. </div>
  241. </section>
  242. <?php endforeach; ?>
  243. </section>
  244. </div>
  245. </div>