integrations if their conditionals are met. * * @return void */ public function load_integrations() { foreach ( $this->integrations as $class ) { if ( ! $this->conditionals_are_met( $class ) ) { continue; } $integration = $this->get_class( $class ); if ( $integration === null ) { continue; } $integration->register_hooks(); } } /** * Loads all registered routes if their conditionals are met. * * @return void */ public function load_routes() { foreach ( $this->routes as $class ) { if ( ! $this->conditionals_are_met( $class ) ) { continue; } $route = $this->get_class( $class ); if ( $route === null ) { continue; } $route->register_routes(); } } /** * Checks if all conditionals of a given loadable are met. * * @param string $loadable_class The class name of the loadable. * * @return bool Whether all conditionals of the loadable are met. */ protected function conditionals_are_met( $loadable_class ) { // In production environments do not fatal if the class does not exist but log and fail gracefully. if ( \YOAST_ENVIRONMENT === 'production' && ! \class_exists( $loadable_class ) ) { if ( \defined( 'WP_DEBUG' ) && \WP_DEBUG ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log \error_log( \sprintf( /* translators: %1$s expands to Yoast SEO, %2$s expands to the name of the class that could not be found. */ \__( '%1$s attempted to load the class %2$s but it could not be found.', 'wordpress-seo' ), 'Yoast SEO', $loadable_class ) ); } return false; } $conditionals = $loadable_class::get_conditionals(); foreach ( $conditionals as $class ) { $conditional = $this->get_class( $class ); if ( $conditional === null || ! $conditional->is_met() ) { return false; } } return true; } /** * Gets a class from the container. * * @param string $class_name The class name. * * @return object|null The class or, in production environments, null if it does not exist. * * @throws Throwable If the class does not exist in development environments. */ protected function get_class( $class_name ) { try { return $this->container->get( $class_name ); } catch ( Throwable $e ) { // In production environments do not fatal if the class could not be constructed but log and fail gracefully. if ( \YOAST_ENVIRONMENT === 'production' ) { if ( \defined( 'WP_DEBUG' ) && \WP_DEBUG ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log \error_log( $e->getMessage() ); } return null; } throw $e; } } }
Fatal error: Uncaught Error: Class "Yoast\WP\SEO\Loader" not found in /htdocs/wp-content/plugins/wordpress-seo/src/generated/container.php:4859 Stack trace: #0 /htdocs/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/Container.php(271): Yoast\WP\SEO\Generated\Cached_Container->getLoaderService() #1 /htdocs/wp-content/plugins/wordpress-seo/lib/abstract-main.php(54): YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container->get('Yoast\\WP\\SEO\\Lo...') #2 /htdocs/wp-content/plugins/wordpress-seo/src/functions.php(34): Yoast\WP\Lib\Abstract_Main->load() #3 /htdocs/wp-content/plugins/wordpress-seo/wp-seo-main.php(445): YoastSEO() #4 /htdocs/wp-content/plugins/wordpress-seo/wp-seo.php(50): require_once('/htdocs/wp-cont...') #5 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #6 /htdocs/wp-config.php(101): require_once('/htdocs/wp-sett...') #7 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #8 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #9 /htdocs/index.php(17): require('/htdocs/wp-blog...') #10 {main} thrown in /htdocs/wp-content/plugins/wordpress-seo/src/generated/container.php on line 4859