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

Yoast / wordpress-seo / 3b129c2485fe269efc371d6a4c9efe287e675c71

12 Mar 2026 11:18AM UTC coverage: 52.809% (-1.1%) from 53.917%
3b129c2485fe269efc371d6a4c9efe287e675c71

push

github

web-flow
Merge pull request #23031 from Yoast/refactor-ai-organization

Refactor ai organization

8535 of 16034 branches covered (53.23%)

Branch coverage included in aggregate %.

718 of 759 new or added lines in 38 files covered. (94.6%)

718 existing lines in 33 files now uncovered.

33517 of 63596 relevant lines covered (52.7%)

47043.95 hits per line

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

0.0
/src/ai-consent/application/consent-handler.php
1
<?php
2

3
namespace Yoast\WP\SEO\AI_Consent\Application;
4

5
use Yoast\WP\SEO\Helpers\User_Helper;
6

7
/**
8
 * Class Consent_Handler
9
 * Handles the consent given or revoked by the user.
10
 *
11
 * @makePublic
12
 */
13
class Consent_Handler implements Consent_Handler_Interface {
14

15
        /**
16
         * Holds the user helper instance.
17
         *
18
         * @var User_Helper
19
         */
20
        private $user_helper;
21

22
        /**
23
         * Class constructor.
24
         *
25
         * @param User_Helper $user_helper The user helper.
26
         */
UNCOV
27
        public function __construct( User_Helper $user_helper ) {
×
UNCOV
28
                $this->user_helper = $user_helper;
×
29
        }
30

31
        /**
32
         * Handles consent revoked by deleting the consent user metadata from the database.
33
         *
34
         * @param int $user_id The user ID.
35
         *
36
         * @return void
37
         */
UNCOV
38
        public function revoke_consent( int $user_id ) {
×
UNCOV
39
                $this->user_helper->delete_meta( $user_id, '_yoast_wpseo_ai_consent' );
×
40
        }
41

42
        /**
43
         * Handles consent granted by adding the consent user metadata to the database.
44
         *
45
         * @param int $user_id The user ID.
46
         *
47
         * @return void
48
         */
UNCOV
49
        public function grant_consent( int $user_id ) {
×
UNCOV
50
                $this->user_helper->update_meta( $user_id, '_yoast_wpseo_ai_consent', true );
×
51
        }
52
}
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