PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.3
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 19.1 All 128 releases
wordpress-seo / src / main.php

main.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.3, at src/main.php

83 lines 1.8 KB
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;
4
5 use Yoast\WP\Lib\Abstract_Main;
6 use Yoast\WP\SEO\Dependency_Injection\Container_Compiler;
7 use Yoast\WP\SEO\Generated\Cached_Container;
8 use Yoast\WP\SEO\Surfaces\Classes_Surface;
9 use Yoast\WP\SEO\Surfaces\Helpers_Surface;
10 use Yoast\WP\SEO\Surfaces\Meta_Surface;
11
12 if ( ! \defined( 'WPSEO_VERSION' ) ) {
13 \header( 'Status: 403 Forbidden' );
14 \header( 'HTTP/1.1 403 Forbidden' );
15 exit();
16 }
17
18 /**
19 * Class Main.
20 *
21 * @property Classes_Surface $classes The classes surface.
22 * @property Meta_Surface $meta The meta surface.
23 * @property Helpers_Surface $helpers The helpers surface.
24 */
25 class Main extends Abstract_Main {
26
27 /**
28 * The API namespace constant.
29 *
30 * @var string
31 */
32 public const API_V1_NAMESPACE = 'yoast/v1';
33
34 /**
35 * The WP CLI namespace constant.
36 *
37 * @var string
38 */
39 public const WP_CLI_NAMESPACE = 'yoast';
40
41 /**
42 * {@inheritDoc}
43 */
44 protected function get_container() {
45 if ( $this->is_development() && \class_exists( '\Yoast\WP\SEO\Dependency_Injection\Container_Compiler' ) ) {
46 // Exception here is unhandled as it will only occur in development.
47 Container_Compiler::compile(
48 $this->is_development(),
49 __DIR__ . '/generated/container.php',
50 __DIR__ . '/../config/dependency-injection/services.php',
51 __DIR__ . '/../vendor/composer/autoload_classmap.php',
52 'Yoast\WP\SEO\Generated',
53 );
54 }
55
56 if ( \file_exists( __DIR__ . '/generated/container.php' ) ) {
57 require_once __DIR__ . '/generated/container.php';
58
59 return new Cached_Container();
60 }
61
62 return null;
63 }
64
65 /**
66 * {@inheritDoc}
67 */
68 protected function get_name() {
69 return 'yoast-seo';
70 }
71
72 /**
73 * {@inheritDoc}
74 */
75 protected function get_surfaces() {
76 return [
77 'classes' => Classes_Surface::class,
78 'meta' => Meta_Surface::class,
79 'helpers' => Helpers_Surface::class,
80 ];
81 }
82 }
83