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

Yoast / wordpress-seo / 5272b836dbc490e59498d667bfcf48eca0c036f2

21 Nov 2025 01:42PM UTC coverage: 52.666% (-0.003%) from 52.669%
5272b836dbc490e59498d667bfcf48eca0c036f2

Pull #22742

github

web-flow
Merge 09b5db01e into bd8c0cc11
Pull Request #22742: Throw exception when failing to enable the llms.txt option

8307 of 15569 branches covered (53.36%)

Branch coverage included in aggregate %.

0 of 6 new or added lines in 2 files covered. (0.0%)

36 existing lines in 4 files now uncovered.

31811 of 60605 relevant lines covered (52.49%)

47577.04 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_Post;
6
use Yoast\WP\SEO\Task_List\Domain\Components\Call_To_Action_Entry;
7
use Yoast\WP\SEO\Task_List\Domain\Components\Copy_Set;
8
use Yoast\WP\SEO\Task_List\Domain\Tasks\Abstract_Completeable_Task;
9

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

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

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

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

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

UNCOV
47
                return $post->post_date !== $post->post_modified;
×
48
        }
49

50
        /**
51
         * Returns the task's link.
52
         *
53
         * @return string|null
54
         */
UNCOV
55
        public function get_link(): ?string {
×
56
                return null;
×
57
        }
58

59
        /**
60
         * Completes a task.
61
         *
62
         * @return void
63
         */
64
        public function complete_task(): void {
×
65
                // @TODO: Add some error handling here.
66
                $post = \get_post( 1 );
×
67
                if ( $post instanceof WP_Post ) {
×
NEW
UNCOV
68
                        $result = \wp_delete_post( $post->ID, true );
×
69

NEW
70
                        if ( ! $result ) {
×
NEW
71
                                throw new \RuntimeException( __( 'Failed to delete the Hello World post.', 'wordpress-seo' ) );
×
72
                        }
73
                }
74
        }
75

76
        /**
77
         * Returns the task's call to action entry.
78
         *
79
         * @return string|null
80
         */
UNCOV
81
        public function get_call_to_action(): Call_To_Action_Entry {
×
UNCOV
82
                return new Call_To_Action_Entry(
×
UNCOV
83
                        \__( 'Delete for me', 'wordpress-seo' ),
×
84
                        'delete',
×
85
                        $this->get_link()
×
86
                );
×
87
        }
88

89
        /**
90
         * Returns the task's copy set.
91
         *
92
         * @return string|null
93
         */
UNCOV
94
        public function get_copy_set(): Copy_Set {
×
UNCOV
95
                return new Copy_Set(
×
UNCOV
96
                        \__( 'Remove the “Hello World” post', 'wordpress-seo' ),
×
97
                        \__( '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' ),
×
98
                        null
×
99
                );
×
100
        }
101
}
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