PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.2
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.2
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / helpers / product-helper.php

product-helper.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.2, at src/helpers/product-helper.php

54 lines 973 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Helpers;
4
5 /**
6 * A helper object for the Yoast products.
7 */
8 class Product_Helper {
9
10 /**
11 * Gets the product name.
12 *
13 * @return string
14 */
15 public function get_product_name() {
16 if ( $this->is_premium() ) {
17 return 'Yoast SEO Premium';
18 }
19
20 return 'Yoast SEO';
21 }
22
23 /**
24 * Gets the product name in the head section.
25 *
26 * @return string
27 */
28 public function get_name() {
29 return $this->get_product_name() . ' plugin';
30 }
31
32 /**
33 * Checks if the installed version is Yoast SEO Premium.
34 *
35 * @return bool True when is premium.
36 */
37 public function is_premium() {
38 return \defined( 'WPSEO_PREMIUM_FILE' );
39 }
40
41 /**
42 * Gets the Premium version if defined, returns null otherwise.
43 *
44 * @return string|null The Premium version or null when premium version is not defined.
45 */
46 public function get_premium_version() {
47 if ( \defined( 'WPSEO_PREMIUM_VERSION' ) ) {
48 return \WPSEO_PREMIUM_VERSION;
49 }
50
51 return null;
52 }
53 }
54