class-component-configuration-choices.php 2.57 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
<?php
/**
 * @package WPSEO\Admin\ConfigurationUI
 */

/**
 * Represents the configuration choices component.
 */
class WPSEO_Config_Component_Configuration_Choices implements WPSEO_Config_Component {

	/**
	 * Gets the component identifier.
	 *
	 * @return string
	 */
	public function get_identifier() {
		return 'ConfigurationChoices';
	}

	/**
	 * Gets the field.
	 *
	 * @return WPSEO_Config_Field
	 */
	public function get_field() {
		$field = new WPSEO_Config_Field_Configuration_Choices();

		$field->set_property( 'label', sprintf(
			/* translators: %s expands to 'Yoast SEO'. */
			__( 'Please choose the %s configuration of your liking:', 'wordpress-seo' ), 'Yoast SEO' )
		);

		$field->add_choice(
			sprintf(
				/* translators: %s expands to 'Yoast SEO'. */
				__( 'Configure %s in a few steps', 'wordpress-seo' ),
				'Yoast SEO'
			),
			sprintf(
				/* translators: %1$s expands to 'Yoast SEO'. */
				__( '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! %1$s will take care of all the technical optimizations your site needs.', 'wordpress-seo' ),
				'Yoast SEO'
			),
			array(
				'type'  => 'primary',
				'label' => sprintf(
					/* translators: %s expands to 'Yoast SEO'. */
					__( 'Configure %s', 'wordpress-seo' ), 'Yoast SEO'
				),
				'action' => 'nextStep',
			),
			plugin_dir_url( WPSEO_FILE ) . '/images/Yoast_SEO_Icon.svg'
		);
		$field->add_choice(
			sprintf(
				/* translators: %s expands to 'Yoast SEO'. */
				__( 'Let us set up %s for you', 'wordpress-seo' ), 'Yoast SEO'
			),
			sprintf(
				/* translators: %1$s expands to 'Yoast SEO', %2$s expands to 'Yoast SEO Premium'. */
				__( 'While we strive to make setting up %1$s as easy as possible, we understand it can still be daunting. If you would rather have us set up %1$s for you (and get a copy of %2$s in the process), order a %1$s configuration service and sit back while we configure your site.', 'wordpress-seo' ),
				'Yoast SEO',
				'Yoast SEO Premium'
			),
			array(
				'type'   => 'secondary',
				'label'  => __( 'Configuration service', 'wordpress-seo' ),
				'action' => 'followURL',
				'url'    => 'https://yoa.st/wizard-configuration-upsell',
			),
			plugin_dir_url( WPSEO_FILE ) . 'images/yoast-configuration-icon.svg'
		);

		return $field;
	}

	/**
	 * Get the data for the field.
	 *
	 * @return array
	 */
	public function get_data() {
		return array();
	}

	/**
	 * Save data
	 *
	 * @param array $data Data containing changes.
	 *
	 * @return bool
	 */
	public function set_data( $data ) {
		return true;
	}
}