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

Yoast / wordpress-seo / 8902429d51b3f7824505257cd9f756866d74786b

29 May 2025 07:09AM UTC coverage: 51.845% (-5.5%) from 57.298%
8902429d51b3f7824505257cd9f756866d74786b

push

github

web-flow
Merge pull request #22264 from Yoast/move-and-refactor-ai-generator-helper

Move and refactor ai generator helper

8230 of 14678 branches covered (56.07%)

Branch coverage included in aggregate %.

0 of 741 new or added lines in 38 files covered. (0.0%)

29750 of 58579 relevant lines covered (50.79%)

40756.97 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
class Consent_Handler implements Consent_Handler_Interface {
12

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

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

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

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