';
$cookieadmin_powered_by_html = apply_filters('cookieadmin_powered_by_html', $cookieadmin_powered_by_html);
return [
'powered_by_html' => $cookieadmin_powered_by_html,
'logo_svg' => cookieadmin_logo_svg(),
'plugin_url' => esc_url(COOKIEADMIN_PLUGIN_URL),
'powered_by' => __('Powered by', 'cookieadmin'),
'show_more' => __('show more', 'cookieadmin'),
'reconsent' => __('Re-consent', 'cookieadmin'),
'cookie_preferences' => __('Cookie Preferences', 'cookieadmin'),
'remark_standard' => __('Standard', 'cookieadmin'),
'remark' => __('Remark', 'cookieadmin'),
'none' => __('None', 'cookieadmin'),
'necessary_cookies' => __('Necessary Cookies', 'cookieadmin'),
'necessary_cookies_desc' => __('Necessary cookies enable essential site features like secure log-ins and consent preference adjustments. They do not store personal data.', 'cookieadmin'),
'functional_cookies' => __('Functional Cookies', 'cookieadmin'),
'functional_cookies_desc' => __('Functional cookies support features like content sharing on social media, collecting feedback, and enabling third-party tools.', 'cookieadmin'),
'analytical_cookies' => __('Analytical Cookies', 'cookieadmin'),
'analytical_cookies_desc' => __('Analytical cookies track visitor interactions, providing insights on metrics like visitor count, bounce rate, and traffic sources.', 'cookieadmin'),
'advertisement_cookies' => __('Advertisement Cookies', 'cookieadmin'),
'advertisement_cookies_desc' => __('Advertisement cookies deliver personalized ads based on your previous visits and analyze the effectiveness of ad campaigns.', 'cookieadmin'),
'unclassified_cookies' => __('Unclassified Cookies', 'cookieadmin'),
'unclassified_cookies_desc' => __('Unclassified cookies are cookies that we are in the process of classifying, together with the providers of individual cookies.', 'cookieadmin'),
];
}
//Loads consent data from file
function cookieadmin_load_consent_template($policy, $view){
if(!file_exists(COOKIEADMIN_DIR.'assets/cookie/template.json')){
return false;
}
$content = json_decode(file_get_contents(COOKIEADMIN_DIR.'assets/cookie/template.json'), true);
if(empty($content)){
return false;
}
$template = array();
$template[$view] = $content['cookieadmin_layout'][$policy['cookieadmin_layout']];
$template[$view] .= $content['cookieadmin_modal'][$policy['cookieadmin_modal']];
$template[$view] .= $content['cookieadmin_reconsent'];
$cookieadmin_strings = cookieadmin_load_strings();
foreach($cookieadmin_strings as $ck => $cv){
$template[$view] = str_replace('[['.$ck.']]', $cv, $template[$view]);
}
$template[$view] = apply_filters('cookieadmin_consent_banner_template', $template[$view]);
return $template;
}
// Still in progress| No use for now.
function cookieadmin_compare_consent_id($consent_id) {
if (strlen($consent_id) !== 32) {
return false;
}
// Split into random part and signature
$random_part = substr($consent_id, 0, 16);
$provided_signature = substr($consent_id, 16, 16);
// Recompute the HMAC
$expected_hmac = hash_hmac('sha256', $random_part . $domain, $secret_key);
$expected_signature = substr($expected_hmac, 0, 16);
return hash_equals($provided_signature, $expected_signature);
}
function cookieadmin_r_print($array){
echo '