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

Yoast / wordpress-seo / fe259c02342341200554aa5aab07ba3a5b3eae4a

12 Apr 2024 08:14AM UTC coverage: 47.449%. First build
fe259c02342341200554aa5aab07ba3a5b3eae4a

Pull #21307

github

leonidasmi
Move database query to infrastructure layer
Pull Request #21307: Stop storing empty usermeta used by sitemaps

192 of 204 new or added lines in 27 files covered. (94.12%)

15040 of 31697 relevant lines covered (47.45%)

3.54 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_Service;
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 service.
18
         *
19
         * @var Cleanup_Service $cleanup_service The cleanup service.
20
         */
21
        private $cleanup_service;
22

23
        /**
24
         * The constructor.
25
         *
26
         * @param Cleanup_Service $cleanup_service The cleanup service.
27
         */
28
        public function __construct( Cleanup_Service $cleanup_service ) {
2✔
29
                $this->cleanup_service = $cleanup_service;
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_service->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