class-admin-page.php
1 month ago
class-ai-crawlers.php
1 month ago
class-ai-seo.php
4 hours ago
class-author-schema-node.php
1 month ago
class-breadcrumb-schema-node.php
1 month ago
class-content-coverage.php
1 month ago
class-dashboard-data.php
4 hours ago
class-initializer.php
4 hours ago
class-llms-txt.php
1 month ago
class-local-business-schema-node.php
1 month ago
class-organization-schema-node.php
1 month ago
class-post-schema-node.php
1 month ago
class-post-types.php
1 month ago
class-schema-builder.php
1 month ago
class-schema-graph.php
1 month ago
class-schema-node-ids.php
1 month ago
class-schema-settings-controller.php
1 month ago
class-schema-settings.php
1 month ago
class-surface-visibility.php
4 weeks ago
class-website-schema-node.php
1 month ago
class-ai-seo.php
40 lines
| 1 | <?php |
| 2 | /** |
| 3 | * The AI SEO feature's availability gate. This package owns the SEO surfaces |
| 4 | * the feature writes to, so the shared predicate lives here. |
| 5 | * |
| 6 | * @package automattic/jetpack-seo-package |
| 7 | */ |
| 8 | |
| 9 | namespace Automattic\Jetpack\SEO; |
| 10 | |
| 11 | use Automattic\Jetpack\Current_Plan; |
| 12 | use Automattic\Jetpack\Modules; |
| 13 | |
| 14 | /** |
| 15 | * Whether AI SEO is offered on this site. |
| 16 | */ |
| 17 | class Ai_Seo { |
| 18 | |
| 19 | /** |
| 20 | * Whether the site can offer AI SEO, independent of the admin's toggle. |
| 21 | * Callers own the outer AI master and host gates. |
| 22 | * |
| 23 | * The plan term is `advanced-seo`, the entitlement for the SEO title and |
| 24 | * meta description fields every AI SEO surface writes to. Automatic |
| 25 | * generation needs `ai-seo-enhancer` on top, checked where it runs. |
| 26 | * |
| 27 | * @since 0.8.2 |
| 28 | * |
| 29 | * @return bool |
| 30 | */ |
| 31 | public static function is_available() { |
| 32 | /** This filter is documented in projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php */ |
| 33 | return (bool) apply_filters( 'ai_seo_enhancer_enabled', true ) |
| 34 | /** This filter is documented in projects/plugins/jetpack/modules/seo-tools/class-jetpack-seo-utils.php */ |
| 35 | && ! apply_filters( 'jetpack_disable_seo_tools', false ) |
| 36 | && ( new Modules() )->is_active( 'seo-tools' ) |
| 37 | && Current_Plan::supports( 'advanced-seo' ); |
| 38 | } |
| 39 | } |
| 40 |