class-field-upsell-configuration-service.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\ConfigurationUI
  6. */
  7. /**
  8. * Class WPSEO_Config_Field_Upsell_Configuration_Service.
  9. */
  10. class WPSEO_Config_Field_Upsell_Configuration_Service extends WPSEO_Config_Field {
  11. /**
  12. * HTML tags allowed in the upsell text.
  13. *
  14. * @var array
  15. */
  16. private $allowed_html = [
  17. 'a' => [
  18. 'href' => [],
  19. 'target' => [ '_blank' ],
  20. ],
  21. ];
  22. /**
  23. * WPSEO_Config_Field_Upsell_Configuration_Service constructor.
  24. */
  25. public function __construct() {
  26. parent::__construct( 'upsellConfigurationService', 'HTML' );
  27. $intro_text = sprintf(
  28. /* translators: %1$s expands to Yoast SEO. */
  29. __( 'Welcome to the %1$s configuration wizard. In a few simple steps we\'ll help you configure your SEO settings to match your website\'s needs!', 'wordpress-seo' ),
  30. 'Yoast SEO'
  31. );
  32. $upsell_text = sprintf(
  33. /* Translators: %1$s expands to Yoast SEO, %2$s expands to Yoast SEO Premium, %3$s opens the link, %4$s closes the link. */
  34. __( 'While we strive to make setting up %1$s as easy as possible, we understand it can be daunting. If you’d rather have us set up %1$s for you (and get a copy of %2$s in the process), order our %3$s%1$s configuration service%4$s here!', 'wordpress-seo' ),
  35. 'Yoast SEO',
  36. 'Yoast SEO Premium',
  37. '<a target="_blank" href="' . WPSEO_Shortlinker::get( 'https://yoa.st/configuration-package' ) . '">',
  38. '</a>'
  39. );
  40. $html = '<p>' . esc_html( $intro_text ) . '</p>';
  41. $html .= '<p><em>' . wp_kses( $upsell_text, $this->allowed_html ) . '</em></p>';
  42. $this->set_property( 'html', $html );
  43. }
  44. }