/wp-content/plugins/wordpress-seo/admin/metabox/class-metabox-add-keyword-tab.php

https://bitbucket.org/carloskikea/helpet · PHP · 69 lines · 39 code · 7 blank · 23 comment · 0 complexity · ee39b0d67ede4d437c5af7fa08240b7a MD5 · raw file

  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Metabox
  6. */
  7. /**
  8. * Tab to add a keyword to analyze
  9. */
  10. class WPSEO_Metabox_Add_Keyword_Tab implements WPSEO_Metabox_Tab {
  11. /**
  12. * Returns a button because a link is inappropriate here
  13. *
  14. * @return string
  15. */
  16. public function link() {
  17. // Ensure thickbox is enqueued.
  18. add_thickbox();
  19. ob_start();
  20. ?>
  21. <li class="wpseo-tab-add-keyword">
  22. <button type="button" class="wpseo-add-keyword button button-link">
  23. <span class="wpseo-add-keyword-plus" aria-hidden="true">+</span>
  24. <?php esc_html_e( 'Add keyword', 'wordpress-seo' ); ?>
  25. </button>
  26. </li>
  27. <?php
  28. $popup_title = __( 'Want to add more than one keyword?', 'wordpress-seo' );
  29. /* translators: %1$s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
  30. $popup_content = '<p>' . sprintf( __( 'Great news: you can, with %1$s!', 'wordpress-seo' ),
  31. '<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/pe-premium-page' ) . '">Yoast SEO Premium</a>'
  32. ) . '</p>';
  33. $popup_content .= '<p>' . sprintf(
  34. /* translators: %s expands to 'Yoast SEO Premium'. */
  35. __( 'Other benefits of %s for you:', 'wordpress-seo' ), 'Yoast SEO Premium'
  36. ) . '</p>';
  37. $popup_content .= '<ul>';
  38. $popup_content .= '<li>' . sprintf(
  39. /* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
  40. __( '%1$sNo more dead links%2$s: easy redirect manager', 'wordpress-seo' ), '<strong>', '</strong>'
  41. ) . '</li>';
  42. $popup_content .= '<li><strong>' . __( 'Superfast internal links suggestions', 'wordpress-seo' ) . '</strong></li>';
  43. $popup_content .= '<li>' . sprintf(
  44. /* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
  45. __( '%1$sSocial media preview%2$s: Facebook &amp; Twitter', 'wordpress-seo' ), '<strong>', '</strong>'
  46. ) . '</li>';
  47. $popup_content .= '<li><strong>' . __( '24/7 support', 'wordpress-seo' ) . '</strong></li>';
  48. $popup_content .= '<li><strong>' . __( 'No ads!', 'wordpress-seo' ) . '</strong></li>';
  49. $popup_content .= '</ul>';
  50. $premium_popup = new WPSEO_Premium_Popup( 'add-keyword', 'h1', $popup_title, $popup_content, WPSEO_Shortlinker::get( 'https://yoa.st/add-keywords-popup' ) );
  51. echo $premium_popup->get_premium_message();
  52. return ob_get_clean();
  53. }
  54. /**
  55. * Returns an empty string because this tab has no content
  56. *
  57. * @return string
  58. */
  59. public function content() {
  60. return '';
  61. }
  62. }