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

Yoast / wordpress-seo / d4b7a0deee344617e60f024748453537bc0cdb4b

12 Dec 2025 03:04PM UTC coverage: 53.032%. First build
d4b7a0deee344617e60f024748453537bc0cdb4b

push

github

leonidasmi
Merge branch 'release/26.6' of github.com:Yoast/wordpress-seo into trunk

8706 of 16079 branches covered (54.15%)

Branch coverage included in aggregate %.

0 of 10 new or added lines in 1 file covered. (0.0%)

32417 of 61465 relevant lines covered (52.74%)

46911.82 hits per line

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

0.0
/src/task-list/application/tasks/delete-hello-world.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
namespace Yoast\WP\SEO\Task_List\Application\Tasks;
4

5
use WP_Comment;
6
use WP_Post;
7
use Yoast\WP\SEO\Task_List\Domain\Components\Call_To_Action_Entry;
8
use Yoast\WP\SEO\Task_List\Domain\Components\Copy_Set;
9
use Yoast\WP\SEO\Task_List\Domain\Exceptions\Complete_Hello_World_Task_Exception;
10
use Yoast\WP\SEO\Task_List\Domain\Tasks\Abstract_Completeable_Task;
11

12
/**
13
 * Represents the task for deleting the Hello World post.
14
 */
15
class Delete_Hello_World extends Abstract_Completeable_Task {
16

17
        /**
18
         * Holds the id.
19
         *
20
         * @var string
21
         */
22
        protected $id = 'delete-hello-world';
23

24
        /**
25
         * Holds the priority.
26
         *
27
         * @var string
28
         */
29
        protected $priority = 'medium';
30

31
        /**
32
         * Holds the duration.
33
         *
34
         * @var int
35
         */
36
        protected $duration = 1;
37

38
        /**
39
         * Returns whether this task is completed.
40
         *
41
         * @return bool Whether this task is completed.
42
         */
43
        public function get_is_completed(): bool {
×
44
                $post = \get_post( 1 );
×
45
                if ( $post instanceof WP_Post === false || $post->post_status !== 'publish' ) {
×
46
                        return true;
×
47
                }
48

49
                // Check if this is the actual Hello World post by checking the first comment.
NEW
50
                $comments = \get_comments(
×
NEW
51
                        [
×
NEW
52
                                'post_id' => 1,
×
NEW
53
                                'number'  => 1,
×
NEW
54
                                'order'   => 'ASC',
×
NEW
55
                        ]
×
NEW
56
                );
×
57

NEW
58
                if ( empty( $comments ) || \is_a( $comments[0], WP_Comment::class ) === false || $comments[0]->comment_author_email !== 'wapuu@wordpress.example' ) {
×
59
                        // Not the Hello World post, so consider task completed.
NEW
60
                        return true;
×
61
                }
62

63
                return $post->post_date !== $post->post_modified;
×
64
        }
65

66
        /**
67
         * Returns the task's link.
68
         *
69
         * @return string|null
70
         */
71
        public function get_link(): ?string {
×
72
                return null;
×
73
        }
74

75
        /**
76
         * Completes a task.
77
         *
78
         * @return void
79
         *
80
         * @throws Complete_Hello_World_Task_Exception If the Hello World post could not be deleted.
81
         */
82
        public function complete_task(): void {
×
83
                $post = \get_post( 1 );
×
84

85
                if ( $post instanceof WP_Post ) {
×
NEW
86
                        $result = \wp_delete_post( $post->ID );
×
87

88
                        if ( ! $result ) {
×
89
                                throw new Complete_Hello_World_Task_Exception();
×
90
                        }
91
                }
92
        }
93

94
        /**
95
         * Returns the task's call to action entry.
96
         *
97
         * @return string|null
98
         */
99
        public function get_call_to_action(): Call_To_Action_Entry {
×
100
                return new Call_To_Action_Entry(
×
101
                        \__( 'Delete for me', 'wordpress-seo' ),
×
102
                        'delete',
×
103
                        $this->get_link()
×
104
                );
×
105
        }
106

107
        /**
108
         * Returns the task's copy set.
109
         *
110
         * @return string|null
111
         */
112
        public function get_copy_set(): Copy_Set {
×
113
                return new Copy_Set(
×
114
                        \__( 'Remove the “Hello World” post', 'wordpress-seo' ),
×
115
                        \__( 'Leaving placeholder content makes your site look unfinished and untrustworthy. Removing it keeps your site clean and professional for visitors and search engines.', 'wordpress-seo' ),
×
116
                        null
×
117
                );
×
118
        }
119
}
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