1 | <?php |
||
6 | class Jetpack_SEO_Utils { |
||
7 | /** |
||
8 | * Site option name used to store front page meta description. |
||
9 | */ |
||
10 | const FRONT_PAGE_META_OPTION = 'advanced_seo_front_page_description'; |
||
11 | |||
12 | /** |
||
13 | * Old version of option name that was previously used under Free plan. |
||
14 | */ |
||
15 | const GRANDFATHERED_META_OPTION = 'seo_meta_description'; |
||
16 | |||
17 | /** |
||
18 | * Used to check whether SEO tools are enabled for given site. |
||
19 | * |
||
20 | * @param int $site_id Optional. Defaults to current blog id if not given. |
||
21 | * |
||
22 | * @return bool True if SEO tools are enabled, false otherwise. |
||
23 | */ |
||
24 | public static function is_enabled_jetpack_seo( $site_id = 0 ) { |
||
37 | |||
38 | /** |
||
39 | * Checks if this option was set while it was still available under free plan. |
||
40 | * |
||
41 | * @return bool True if we should enable grandfathering, false otherwise. |
||
42 | */ |
||
43 | public static function has_grandfathered_front_page_meta() { |
||
46 | |||
47 | /** |
||
48 | * Returns front page meta description for current site. |
||
49 | * |
||
50 | * Since we allowed non-business users to set Front page meta description for some time, |
||
51 | * before bundling it with other SEO tools features that require a business plan, |
||
52 | * we are supporting grandfathering here. |
||
53 | * |
||
54 | * @return string Front page meta description string or empty string. |
||
55 | */ |
||
56 | public static function get_front_page_meta_description() { |
||
65 | |||
66 | /** |
||
67 | * Updates the site option value for front page meta description. |
||
68 | * |
||
69 | * We are taking care to update the correct option, in case the value is grandfathered for current site. |
||
70 | * |
||
71 | * @param $value string New value for front page meta description. |
||
72 | * |
||
73 | * @return string Saved value, or empty string if no update was performed. |
||
74 | */ |
||
75 | public static function update_front_page_meta_description( $value ) { |
||
113 | } |
||
114 |