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

Yoast / wordpress-seo / 9594812bf110d67afe78816058eb15ec830063d2

15 Jul 2025 10:16AM UTC coverage: 52.595% (-1.0%) from 53.638%
9594812bf110d67afe78816058eb15ec830063d2

Pull #22432

github

web-flow
Merge branch 'trunk' into feature/ai-generator-in-free
Pull Request #22432: Merge feature branch into trunk

8341 of 15027 branches covered (55.51%)

Branch coverage included in aggregate %.

382 of 1769 new or added lines in 122 files covered. (21.59%)

2 existing lines in 2 files now uncovered.

30934 of 59648 relevant lines covered (51.86%)

40029.26 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
         */
NEW
27
        public function __construct( User_Helper $user_helper ) {
×
NEW
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
         */
NEW
38
        public function revoke_consent( int $user_id ) {
×
NEW
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
         */
NEW
49
        public function grant_consent( int $user_id ) {
×
NEW
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