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

Yoast / wordpress-seo / f9df06f1cab00cec98a3469d2f22da266b46b49b

19 Nov 2025 01:38PM UTC coverage: 52.718% (+0.001%) from 52.717%
f9df06f1cab00cec98a3469d2f22da266b46b49b

Pull #22731

github

web-flow
Merge 10a33f2e3 into cf9a5ebaa
Pull Request #22731: Misc improvements for the backend of the tasklist

8307 of 15558 branches covered (53.39%)

Branch coverage included in aggregate %.

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

3 existing lines in 3 files now uncovered.

31810 of 60539 relevant lines covered (52.54%)

47628.91 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
         */
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

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

50
        /**
51
         * Returns the task's link.
52
         *
53
         * @return string|null
54
         */
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 ) {
×
68
                        \wp_delete_post( $post->ID, true );
×
69
                }
70
        }
71

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

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