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

Yoast / wordpress-seo / 83ae8d97804867e16e0a1e1fed01fa1067ff47db

11 Apr 2024 07:07AM UTC coverage: 52.236% (-0.3%) from 52.566%
83ae8d97804867e16e0a1e1fed01fa1067ff47db

Pull #21307

github

leonidasmi
Uncapitalize test classes
Pull Request #21307: Stop storing empty usermeta used by sitemaps

7543 of 13885 branches covered (54.32%)

Branch coverage included in aggregate %.

189 of 201 new or added lines in 26 files covered. (94.03%)

1092 existing lines in 2 files now uncovered.

28509 of 55132 relevant lines covered (51.71%)

81433.71 hits per line

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

93.33
/src/user-meta/user-interface/cleanup-integration.php
1
<?php
2

3
namespace Yoast\WP\SEO\User_Meta\User_Interface;
4

5
use Yoast\WP\SEO\Conditionals\No_Conditionals;
6
use Yoast\WP\SEO\Integrations\Integration_Interface;
7
use Yoast\WP\SEO\User_Meta\Application\Cleanup_Repository;
8

9
/**
10
 * Handles the cleanup for user meta.
11
 */
12
class Cleanup_Integration implements Integration_Interface {
13

14
        use No_Conditionals;
15

16
        /**
17
         * The cleanup repository.
18
         *
19
         * @var Cleanup_Repository $cleanup_repository The cleanup repository.
20
         */
21
        private $cleanup_repository;
22

23
        /**
24
         * The constructor.
25
         *
26
         * @param Cleanup_Repository $cleanup_repository The cleanup repository.
27
         */
28
        public function __construct( Cleanup_Repository $cleanup_repository ) {
2✔
29
                $this->cleanup_repository = $cleanup_repository;
2✔
30
        }
1✔
31

32
        /**
33
         * Registers action hook.
34
         *
35
         * @return void
36
         */
37
        public function register_hooks(): void {
2✔
38
                \add_filter( 'wpseo_misc_cleanup_tasks', [ $this, 'add_user_meta_cleanup_tasks' ] );
2✔
39
        }
1✔
40

41
        /**
42
         * Adds cleanup tasks for the cleanup integration.
43
         *
44
         * @param Closure[] $tasks Array of tasks to be added.
45
         *
46
         * @return Closure[] An associative array of tasks to be added to the cleanup integration.
47
         */
48
        public function add_user_meta_cleanup_tasks( $tasks ) {
2✔
49
                return \array_merge(
2✔
50
                        $tasks,
2✔
51
                        [
1✔
52
                                'clean_selected_empty_usermeta' => function ( $limit ) {
1✔
NEW
53
                                        return $this->cleanup_repository->cleanup_selected_empty_usermeta( $limit );
×
54
                                },
2✔
55
                        ]
1✔
56
                );
1✔
57
        }
58
}
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