class-component-suggestions.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\ConfigurationUI
  6. */
  7. /**
  8. * Represents the configuration suggestions component.
  9. */
  10. class WPSEO_Config_Component_Suggestions implements WPSEO_Config_Component {
  11. /**
  12. * Gets the component identifier.
  13. *
  14. * @return string
  15. */
  16. public function get_identifier() {
  17. return 'Suggestions';
  18. }
  19. /**
  20. * Gets the field.
  21. *
  22. * @return WPSEO_Config_Field
  23. */
  24. public function get_field() {
  25. $field = new WPSEO_Config_Field_Suggestions();
  26. // Only show Premium upsell when we are not inside a Premium install.
  27. if ( ! WPSEO_Utils::is_yoast_seo_premium() ) {
  28. $field->add_suggestion(
  29. /* translators: %s resolves to Yoast SEO Premium */
  30. sprintf( __( 'Outrank the competition with %s', 'wordpress-seo' ), 'Yoast SEO Premium' ),
  31. /* translators: %1$s resolves to Yoast SEO Premium */
  32. sprintf( __( 'Do you want to outrank your competition? %1$s gives you awesome additional features that\'ll help you to set up your SEO strategy like a professional. Use the multiple focus keywords functionality, the redirect manager and our internal linking tool. %1$s will also give you access to premium support.', 'wordpress-seo' ), 'Yoast SEO Premium' ),
  33. array(
  34. 'label' => __( 'Upgrade to Premium', 'wordpress-seo' ),
  35. 'type' => 'primary',
  36. 'url' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-premium' ),
  37. ),
  38. WPSEO_Shortlinker::get( 'https://yoa.st/video-yoast-seo-premium' )
  39. );
  40. }
  41. $field->add_suggestion(
  42. sprintf(
  43. /* translators: %1$s resolves to Basic SEO training */
  44. __( 'Learn all about SEO with our %1$s', 'wordpress-seo' ),
  45. 'Basic SEO training'
  46. ),
  47. sprintf(
  48. /* translators: %1$s resolves to Basic SEO training, 2: Yoast SEO */
  49. __( 'Do you want to learn how you can improve your SEO yourself? In our %1$s you\'ll learn practical SEO skills from keyword research and copywriting to technical SEO and off-page SEO. Using the %2$s plugin is one thing. Doing good SEO day-to-day is another. You simply won\'t get the results you want without putting in work yourself. The %1$s teaches you how.', 'wordpress-seo' ),
  50. 'Basic SEO training',
  51. 'Yoast SEO'
  52. ),
  53. array(
  54. 'label' => 'Basic SEO training',
  55. 'type' => 'link',
  56. 'url' => WPSEO_Shortlinker::get( 'https://yoa.st/2up' ),
  57. ),
  58. WPSEO_Shortlinker::get( 'https://yoa.st/2v0' )
  59. );
  60. $field->add_suggestion(
  61. /* translators: %1$s resolves to Yoast SEO, %2$s resolves to Yoast SEO plugin training */
  62. sprintf( __( 'Get the most out of %1$s with the %2$s', 'wordpress-seo' ), 'Yoast SEO', 'Yoast SEO plugin training' ),
  63. /* translators: %1$s resolves to Yoast SEO */
  64. sprintf( __( 'Do you want to know all the ins and outs of the %1$s plugin? Do you want to learn all about our advanced settings? Want to be able to really get the most out of the %1$s plugin? Check out our %1$s plugin training and start outranking the competition!', 'wordpress-seo' ), 'Yoast SEO' ),
  65. array(
  66. 'label' => 'Yoast SEO plugin training',
  67. 'type' => 'link',
  68. 'url' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-plugin-course' ),
  69. ),
  70. WPSEO_Shortlinker::get( 'https://yoa.st/video-plugin-course' )
  71. );
  72. // When we are running in Yoast SEO Premium and don't have Local SEO installed, show Local SEO as suggestion.
  73. if ( WPSEO_Utils::is_yoast_seo_premium() && ! defined( 'WPSEO_LOCAL_FILE' ) ) {
  74. $field->add_suggestion(
  75. sprintf( __( 'Attract more customers near you', 'wordpress-seo' ), 'Yoast SEO', 'Yoast SEO plugin training' ),
  76. /* translators: %1$s resolves to Local SEO */
  77. sprintf( __( 'If you want to outrank the competition in a specific town or region, check out our %1$s plugin! You’ll be able to easily insert Google maps, opening hours, contact information and a store locator. Besides that %1$s helps you to improve the usability of your contact page.', 'wordpress-seo' ), 'Local SEO' ),
  78. array(
  79. 'label' => 'Local SEO',
  80. 'type' => 'link',
  81. 'url' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-suggestion-localseo' ),
  82. ),
  83. WPSEO_Shortlinker::get( 'https://yoa.st/video-localseo' )
  84. );
  85. }
  86. return $field;
  87. }
  88. /**
  89. * Get the data for the field.
  90. *
  91. * @return array
  92. */
  93. public function get_data() {
  94. return array();
  95. }
  96. /**
  97. * Save data
  98. *
  99. * @param array $data Data containing changes.
  100. *
  101. * @return bool
  102. */
  103. public function set_data( $data ) {
  104. return true;
  105. }
  106. }