• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / a4eb71e9ad0835c97de3bf63ce6f3cc3c1d4caeb

28 Apr 2026 12:13PM UTC coverage: 42.979%. First build
a4eb71e9ad0835c97de3bf63ce6f3cc3c1d4caeb

Pull #23205

github

web-flow
Merge 37cbe6119 into 777600d66
Pull Request #23205: Feature/content planner

3041 of 10419 branches covered (29.19%)

Branch coverage included in aggregate %.

632 of 1109 new or added lines in 74 files covered. (56.99%)

25420 of 55801 relevant lines covered (45.55%)

5.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ai/content-planner/user-interface/content-planner-integration.php
1
<?php
2

3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4

5
namespace Yoast\WP\SEO\AI\Content_Planner\User_Interface;
6

7
use WPSEO_Admin_Asset_Manager;
8
use Yoast\WP\SEO\AI\Content_Planner\Application\Content_Planner_Endpoints_Repository;
9
use Yoast\WP\SEO\Conditionals\AI_Conditional;
10
use Yoast\WP\SEO\Conditionals\AI_Editor_Conditional;
11
use Yoast\WP\SEO\Integrations\Integration_Interface;
12

13
/**
14
 * Content_Planner_Integration class.
15
 */
16
class Content_Planner_Integration implements Integration_Interface {
17

18
        /**
19
         * Represents the admin asset manager.
20
         *
21
         * @var WPSEO_Admin_Asset_Manager
22
         */
23
        private $asset_manager;
24

25
        /**
26
         * The endpoints repository.
27
         *
28
         * @var Content_Planner_Endpoints_Repository
29
         */
30
        private $endpoints_repository;
31

32
        /**
33
         * Returns the conditionals based in which this loadable should be active.
34
         *
35
         * @return array<string>
36
         */
NEW
37
        public static function get_conditionals(): array {
×
NEW
38
                return [ AI_Conditional::class, AI_Editor_Conditional::class ];
×
39
        }
40

41
        /**
42
         * Constructs the class.
43
         *
44
         * @param WPSEO_Admin_Asset_Manager            $asset_manager        The admin asset manager.
45
         * @param Content_Planner_Endpoints_Repository $endpoints_repository The endpoints repository.
46
         */
NEW
47
        public function __construct(
×
48
                WPSEO_Admin_Asset_Manager $asset_manager,
49
                Content_Planner_Endpoints_Repository $endpoints_repository
50
        ) {
NEW
51
                $this->asset_manager        = $asset_manager;
×
NEW
52
                $this->endpoints_repository = $endpoints_repository;
×
53
        }
54

55
        /**
56
         * Initializes the integration.
57
         *
58
         * This is the place to register hooks and filters.
59
         *
60
         * @return void
61
         */
NEW
62
        public function register_hooks() {
×
NEW
63
                \add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
×
64
                // Enqueue after Elementor_Premium integration, which re-registers the assets.
NEW
65
                \add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_assets' ], 11 );
×
66
        }
67

68
        /**
69
         * Returns the script data for the content planner.
70
         *
71
         * @return array<string, array<string>>
72
         */
NEW
73
        public function get_script_data(): array {
×
NEW
74
                return [
×
NEW
75
                        'endpoints' => $this->endpoints_repository->get_all_endpoints()->to_paths_array(),
×
NEW
76
                ];
×
77
        }
78

79
        /**
80
         * Localizes the content planner script data.
81
         *
82
         * @return void
83
         */
NEW
84
        public function enqueue_assets() {
×
NEW
85
                $this->asset_manager->enqueue_script( 'ai-content-planner' );
×
NEW
86
                $this->asset_manager->localize_script( 'ai-content-planner', 'wpseoContentPlanner', $this->get_script_data() );
×
87
        }
88
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc