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

Yoast / wordpress-seo / 2a894cf47d0e70869069e2d63512a3138ffd4ae5

14 Mar 2024 02:18PM UTC coverage: 53.672% (-0.08%) from 53.753%
2a894cf47d0e70869069e2d63512a3138ffd4ae5

Pull #21233

github

web-flow
Merge 927fc8baa into d84bd62f7
Pull Request #21233: WIP: Create FTC via WP CLI

7584 of 13912 branches covered (54.51%)

Branch coverage included in aggregate %.

0 of 92 new or added lines in 5 files covered. (0.0%)

669 existing lines in 1 file now uncovered.

29510 of 55200 relevant lines covered (53.46%)

40522.4 hits per line

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

0.0
/src/commands/first-time-configuration-command.php
1
<?php
2

3
namespace Yoast\WP\SEO\Commands;
4

5
use Exception;
6
use WP_CLI;
7
use WP_CLI\Utils;
8
use Yoast\WP\SEO\Actions\Configuration\First_Time_Configuration_Action;
9
use Yoast\WP\SEO\Commands\First_Time_Configuration\Site_Representation_Command;
10
use Yoast\WP\SEO\Commands\First_Time_Configuration\Social_Profiles_Command;
11
use Yoast\WP\SEO\Main;
12
use Yoast\WP\SEO\Helpers\Options_Helper;
13

14

15
/**
16
 * Command to generate indexables for all posts and terms.
17
 */
18
class First_Time_Configuration_Command implements Command_Interface {
19

20
        use Ask_Trait;
21

22
        /**
23
         *  The first tinme configuration action.
24
         *
25
         * @var First_Time_Configuration_Action
26
         */
27
        private $first_time_configuration_action;
28

29
        /**
30
         * The options helper.
31
         *
32
         * @var Options_Helper
33
         */
34
        private $options_helper;
35

36
        /**
37
         * The constructor.
38
         *
39
         * @param First_Time_Configuration_Action $first_time_configuration_action The first tinme configuration action.
40
         */
NEW
41
        public function __construct(
×
42
                First_Time_Configuration_Action $first_time_configuration_action,
43
                Options_Helper $options_helper) {
NEW
44
                $this->first_time_configuration_action = $first_time_configuration_action;
×
NEW
45
                $this->options_helper                  = $options_helper;
×
46
        }
47

48
        /**
49
         * The main command.
50
         *
51
         * @param array|null $args       The arguments.
52
         * @param array|null $assoc_args The associative arguments.
53
         *
54
         * @return void
55
         */
NEW
56
        public function first_time_configuration() {
×
57
                /// SEO data optimization
NEW
58
                WP_CLI::confirm( \__( 'Do you want to run the SEO data optimization?', 'wordpress-seo' ) );
×
59

NEW
60
                WP_CLI::runcommand( 'yoast index', $options = [] );
×
61
                
NEW
62
                WP_CLI::line( \__( "SEO data optimization completed successfully", 'wordpress-seo' ) );
×
63

NEW
64
                WP_CLI::runcommand( 'yoast site_representation', $options = [] );
×
65

NEW
66
                WP_CLI::runcommand( 'yoast social_profiles', $options = [] );
×
67

NEW
68
                WP_CLI::runcommand( 'yoast personal_preferences', $options = [] );
×
69

NEW
70
                WP_CLI::line( \__( "Great work! Thanks to the details you've provided, Yoast has enhanced your site for search engines, giving them a clearer picture of what your site is all about.", "wordpress-seo" ) );
×
71
        }
72
        /**
73
         * Gets the namespace.
74
         *
75
         * @return string
76
         */
NEW
77
        public static function get_namespace() {
×
NEW
78
                return Main::WP_CLI_NAMESPACE;
×
79
        }
80
}
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