Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/maze/wp-content/plugins/reddit-for-woocommerce/includes/Tracking/ |
Upload File : |
<?php
/**
* Consent handler for marketing tracking.
*
* This class provides a static interface for checking user consent
* for marketing-related tracking, using the WordPress Consent API.
* If the Consent API is not available, it fails open by assuming consent is granted.
*
* Intended for use before initializing or firing marketing tracking scripts.
*
* @package RedditForWooCommerce\Tracking
* @since 0.1.0
*/
namespace RedditForWooCommerce\Tracking;
/**
* Static interface for checking marketing consent.
*
* Checks whether the current visitor has granted consent for marketing tracking,
* using the WordPress Consent API. Fails open by returning `true` if the API
* is not present (e.g., no consent management plugin is installed).
*
* Designed to be used in tracking logic and script enqueuing conditions.
*
* @since 0.1.0
*/
final class Consent {
/**
* Determines whether the visitor has granted marketing consent.
*
* Uses the WordPress Consent API to verify if the visitor has opted into
* marketing tracking. If the API is not available (e.g., no Consent plugin
* installed), the method defaults to assuming consent is granted (fail-open).
*
* @since 0.1.0
*
* @return bool True if consent is granted or undetermined; false if explicitly denied.
*/
public static function has_marketing_consent(): bool {
if ( function_exists( 'wp_has_consent' ) ) {
return wp_has_consent( 'marketing' );
}
// Consent API not present — assume consent granted (fail-open).
return true;
}
}