Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../componen.../gdpr
File: gdpr.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit;
[2] Fix | Delete
}
[3] Fix | Delete
function amp_gdpr_output(){
[4] Fix | Delete
global $redux_builder_amp;
[5] Fix | Delete
$headline = $accept = $reject = $settings = $user_data = $form_url = '';
[6] Fix | Delete
$headline = $redux_builder_amp['amp-gdpr-compliance-headline-text'];
[7] Fix | Delete
$accept = $redux_builder_amp['amp-gdpr-compliance-accept-text'];
[8] Fix | Delete
$reject = $redux_builder_amp['amp-gdpr-compliance-reject-text'];
[9] Fix | Delete
$settings = $redux_builder_amp['amp-gdpr-compliance-settings-text'];
[10] Fix | Delete
$user_data = !empty($redux_builder_amp['amp-gdpr-compliance-textarea'])?$redux_builder_amp['amp-gdpr-compliance-textarea']:'You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:';
[11] Fix | Delete
$form_url = admin_url('admin-ajax.php?action=amp_consent_submission&verify_nonce='.wp_create_nonce('amp_consent'));
[12] Fix | Delete
$form_url = preg_replace('#^https?:#', '', $form_url);
[13] Fix | Delete
$more_info = $redux_builder_amp['amp-gdpr-compliance-for-more-privacy-info'];
[14] Fix | Delete
$cookie_enable = isset($redux_builder_amp['amp-gdpr-compliance-enable-options'])? $redux_builder_amp['amp-gdpr-compliance-enable-options'] :null;
[15] Fix | Delete
$cookie_options = isset($redux_builder_amp['amp-gdpr-compliance-options'])? $redux_builder_amp['amp-gdpr-compliance-options'] :null;
[16] Fix | Delete
$cookie_toggle = isset($redux_builder_amp['amp-gdpr-compliance-enable-toggle'])? $redux_builder_amp['amp-gdpr-compliance-enable-toggle'] :null;
[17] Fix | Delete
[18] Fix | Delete
$privacy_page = '';
[19] Fix | Delete
$privacy_button_text = '';
[20] Fix | Delete
if(isset($redux_builder_amp['amp-gdpr-compliance-select-privacy-page']) && $redux_builder_amp['amp-gdpr-compliance-select-privacy-page']){
[21] Fix | Delete
$privacy_page = get_permalink($redux_builder_amp['amp-gdpr-compliance-select-privacy-page']);}
[22] Fix | Delete
[23] Fix | Delete
if(isset($redux_builder_amp['amp-gdpr-compliance-privacy-page-button-text']) && $redux_builder_amp['amp-gdpr-compliance-privacy-page-button-text']){
[24] Fix | Delete
$privacy_button_text = $redux_builder_amp['amp-gdpr-compliance-privacy-page-button-text'];
[25] Fix | Delete
}
[26] Fix | Delete
$gdpr_countries = array("AT","BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IS", "IE", "IT", "LV", "LI", "LT", "LU", "MT", "NL", "NO", "PL", "PT", "RO", "SK", "SI", "ES", "SE", "GB", "AX", "IC", "EA", "GF", "PF", "TF", "GI", "GP", "GG", "JE", "MQ", "YT", "NC", "RE", "BL", "MF", "PM", "SJ", "VA", "WF", "EZ", "CH","BR");
[27] Fix | Delete
$gdpr_countries = apply_filters( 'ampforwp_gdpr_country_list' , $gdpr_countries );
[28] Fix | Delete
$gdpr_text = array("headline"=>$headline,"user_data"=>$user_data,"accept"=>$accept,"reject"=>$reject,"settings"=>$settings,"more_info "=>$more_info,"privacy_button_text"=>$privacy_button_text );
[29] Fix | Delete
$gdpr_text = apply_filters('ampforwp_modify_gdpr_output',$gdpr_text);
[30] Fix | Delete
$headline = $gdpr_text['headline'];
[31] Fix | Delete
$user_data = $gdpr_text['user_data'];
[32] Fix | Delete
$accept = $gdpr_text['accept'];
[33] Fix | Delete
$reject = $gdpr_text['reject'];
[34] Fix | Delete
$settings = $gdpr_text['settings'];
[35] Fix | Delete
$more_info = isset($gdpr_text['more_info']) ? $gdpr_text['more_info'] : "";
[36] Fix | Delete
$privacy_button_text = $gdpr_text['privacy_button_text'];
[37] Fix | Delete
?>
[38] Fix | Delete
<amp-geo layout="nodisplay">
[39] Fix | Delete
<script type="application/json">
[40] Fix | Delete
{
[41] Fix | Delete
"ISOCountryGroups": {
[42] Fix | Delete
"eea": [ "preset-eea", "unknown" ]
[43] Fix | Delete
}
[44] Fix | Delete
}
[45] Fix | Delete
</script>
[46] Fix | Delete
</amp-geo>
[47] Fix | Delete
<amp-consent id="ampforwpConsent" layout="nodisplay">
[48] Fix | Delete
<script type="application/json">{
[49] Fix | Delete
"consentInstanceId": "ampforwp-consent",
[50] Fix | Delete
"consentRequired": false,
[51] Fix | Delete
"geoOverride": {
[52] Fix | Delete
"eea": {
[53] Fix | Delete
"promptUI": "gdpr_c",
[54] Fix | Delete
"consentRequired": true
[55] Fix | Delete
}
[56] Fix | Delete
},
[57] Fix | Delete
"postPromptUI": "post-consent-ui"
[58] Fix | Delete
}</script>
[59] Fix | Delete
<div class="gdpr" id="gdpr_c">
[60] Fix | Delete
<div class="gdpr_w">
[61] Fix | Delete
<div class="gdpr_x" role="button" tabindex="0" on="tap:ampforwpConsent.dismiss">X</div>
[62] Fix | Delete
<div class="gdpr-l">
[63] Fix | Delete
<div class="gdpr_t">
[64] Fix | Delete
<h3><?php echo esc_html__($headline,'accelerated-mobile-pages'); ?></h3>
[65] Fix | Delete
<p><?php echo esc_html__($user_data,'accelerated-mobile-pages'); ?></p>
[66] Fix | Delete
<?php $cookie_options = is_array($cookie_options)?$cookie_options:null;?>
[67] Fix | Delete
<?php if (ampforwp_get_setting('amp-gdpr-newguidelines-switch') || $cookie_enable) { ?>
[68] Fix | Delete
<div class="choices">
[69] Fix | Delete
<?php if ($cookie_options==null || (isset($cookie_options['marketing']) && $cookie_options['marketing'] ==1)) { ?>
[70] Fix | Delete
<label class="consentLabel" for="consent-purpose-marketing">
[71] Fix | Delete
<input id="consent-purpose-marketing" type="checkbox" on="change:ampforwpConsent.setPurpose(purpose-marketing=event.checked)">
[72] Fix | Delete
<?php echo esc_html__('Marketing cookies','accelerated-mobile-pages'); ?>
[73] Fix | Delete
</label>
[74] Fix | Delete
<?php } ?>
[75] Fix | Delete
<?php if ($cookie_options==null || (isset($cookie_options['conversion']) && $cookie_options['conversion'] ==1)) { ?>
[76] Fix | Delete
<label class="consentLabel" for="consent-purpose-conversion">
[77] Fix | Delete
<input id="consent-purpose-conversion" type="checkbox" on="change:ampforwpConsent.setPurpose(purpose-conversion=event.checked)">
[78] Fix | Delete
<?php echo esc_html__('Conversion tracking cookies','accelerated-mobile-pages'); ?>
[79] Fix | Delete
</label>
[80] Fix | Delete
<?php } ?>
[81] Fix | Delete
<?php if ($cookie_options==null || (isset($cookie_options['analytics']) && $cookie_options['analytics'] ==1)) { ?>
[82] Fix | Delete
<label class="consentLabel" for="consent-purpose-analytics">
[83] Fix | Delete
<input id="consent-purpose-analytics" type="checkbox" on="change:ampforwpConsent.setPurpose(purpose-analytics=event.checked)">
[84] Fix | Delete
<?php echo esc_html__('Analytics','accelerated-mobile-pages'); ?>
[85] Fix | Delete
</label>
[86] Fix | Delete
<?php } ?>
[87] Fix | Delete
</div>
[88] Fix | Delete
<?php } ?>
[89] Fix | Delete
</div><?php if(isset($redux_builder_amp['amp-gdpr-compliance-select-privacy-page']) && $redux_builder_amp['amp-gdpr-compliance-select-privacy-page']){?>
[90] Fix | Delete
<div class="gdpr_fmi">
[91] Fix | Delete
<span><?php echo esc_html__($more_info,'accelerated-mobile-pages'); ?></span>
[92] Fix | Delete
<a class="gdpr_fmi pri_page_link" href="<?php echo esc_attr($privacy_page); ?>" target="_blank"><?php echo esc_html__($privacy_button_text,'accelerated-mobile-pages'); ?></a>
[93] Fix | Delete
</div><?php } ?>
[94] Fix | Delete
</div>
[95] Fix | Delete
<div id="gdpr_yn" class="gdpr_yn">
[96] Fix | Delete
<div class="gdpr-btns">
[97] Fix | Delete
<form class="acp" action-xhr="<?php echo esc_url($form_url); ?>" method="post" target="_top">
[98] Fix | Delete
<button type="submit" on="tap:ampforwpConsent.accept(purposeConsentDefault=false)" class="btn gdpr_y btn"><?php echo esc_html__($accept,'accelerated-mobile-pages'); ?></button>
[99] Fix | Delete
</form>
[100] Fix | Delete
<form class="rej" action-xhr="<?php echo esc_url($form_url); ?>" method="post" target="_top">
[101] Fix | Delete
<button type="submit" on="tap:ampforwpConsent.reject" class="btn gdpr_n"><?php echo esc_html__($reject,'accelerated-mobile-pages'); ?></button>
[102] Fix | Delete
</form>
[103] Fix | Delete
</div>
[104] Fix | Delete
</div>
[105] Fix | Delete
</div>
[106] Fix | Delete
</div>
[107] Fix | Delete
<div id="post-consent-ui">
[108] Fix | Delete
<?php if($cookie_toggle ==null || $cookie_toggle == 1){ ?>
[109] Fix | Delete
<a href="#" on="tap:ampforwpConsent.prompt()" class="btn"><?php echo esc_html__($settings,'accelerated-mobile-pages'); ?></a>
[110] Fix | Delete
<?php } ?>
[111] Fix | Delete
</div>
[112] Fix | Delete
</amp-consent>
[113] Fix | Delete
<?php
[114] Fix | Delete
}
[115] Fix | Delete
global $loadComponent;
[116] Fix | Delete
if (ampforwp_get_setting('amp-gdpr-compliance-switch') || (isset($loadComponent['AMP-gdpr']) && true == $loadComponent['AMP-gdpr'] )) {
[117] Fix | Delete
if(!isset($_COOKIE['ampforwp_gdpr_action'])){
[118] Fix | Delete
// Scripts
[119] Fix | Delete
add_filter('amp_post_template_data' , 'ampforwp_gdpr_data', 15);
[120] Fix | Delete
// CSS
[121] Fix | Delete
add_action('amp_post_template_css' , 'ampforwp_gdpr_css');
[122] Fix | Delete
}
[123] Fix | Delete
// Consent Submission
[124] Fix | Delete
add_action('wp_ajax_amp_consent_submission','amp_consent_submission');
[125] Fix | Delete
add_action('wp_ajax_nopriv_amp_consent_submission','amp_consent_submission');
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
function ampforwp_gdpr_data( $data ) {
[129] Fix | Delete
global $redux_builder_amp;
[130] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-consent'] ) ) {
[131] Fix | Delete
$data['amp_component_scripts']['amp-consent'] = 'https://cdn.ampproject.org/v0/amp-consent-0.1.js';
[132] Fix | Delete
}
[133] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-form'] ) ) {
[134] Fix | Delete
$data['amp_component_scripts']['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js';
[135] Fix | Delete
}
[136] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-geo'] ) ) {
[137] Fix | Delete
$data['amp_component_scripts']['amp-geo'] = 'https://cdn.ampproject.org/v0/amp-geo-0.1.js';
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
return $data;
[141] Fix | Delete
}
[142] Fix | Delete
[143] Fix | Delete
function ampforwp_gdpr_css(){
[144] Fix | Delete
global $redux_builder_amp;
[145] Fix | Delete
// GDPR popup Design
[146] Fix | Delete
if($redux_builder_amp['gdpr-type'] == '1'){?>
[147] Fix | Delete
.gdpr{position: fixed; top: 0; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.7);color: #333;z-index:9999999;line-height:1.3;height: 100vh;width: 100vw}
[148] Fix | Delete
.gdpr_w{padding: 2rem;background: #fff;max-width: 700px;width: 95%;margin: 5% auto;text-align: center;position:fixed;left: 0;right: 0;margin:10% auto;}
[149] Fix | Delete
.gdpr_t{margin-bottom:15px;}
[150] Fix | Delete
.gdpr_t h3{font-size: 30px;margin:0px 0 10px 0;}
[151] Fix | Delete
.gdpr_t p{font-size: 16px;line-height: 1.45;margin:0;}
[152] Fix | Delete
.gdpr_x {position: absolute; right: 24px; top: 16px; cursor:pointer;}
[153] Fix | Delete
.gdpr_yn{margin-top:10px;}
[154] Fix | Delete
.gdpr_yn form{display: inline;}
[155] Fix | Delete
.gdpr_yn button{background: #37474F;border: none;color: #fff;padding: 8px 30px;font-size: 13px;margin: 0 3px;}
[156] Fix | Delete
.gdpr_yn .gdpr_n{background: #fff;color: #222;border: 1px solid #999;}
[157] Fix | Delete
amp-consent{margin-left: 10px;top: 2px;width: auto;background: transparent;}
[158] Fix | Delete
.gdpr_fmi{
[159] Fix | Delete
width:100%;
[160] Fix | Delete
font-size: 15px;
[161] Fix | Delete
line-height: 1.45;
[162] Fix | Delete
margin: 0;
[163] Fix | Delete
}
[164] Fix | Delete
#footer .gdpr_fmi span, .gdpr_fmi span {
[165] Fix | Delete
display: inline-block;
[166] Fix | Delete
}
[167] Fix | Delete
#footer .gdpr_fmi a{
[168] Fix | Delete
color: <?php echo ampforwp_sanitize_color( ampforwp_get_setting('swift-color-scheme','color') ); ?>;
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
@media(max-width:768px){
[172] Fix | Delete
.gdpr_w{width: 85%;margin:0 auto;padding:1.5rem;}
[173] Fix | Delete
}
[174] Fix | Delete
@media(max-width:700px){
[175] Fix | Delete
.gdpr_w{margin:0 auto; width: 85%;}
[176] Fix | Delete
[177] Fix | Delete
}<?php
[178] Fix | Delete
} // GDPR Type 1 End
[179] Fix | Delete
// GDPR Notice bar
[180] Fix | Delete
if($redux_builder_amp['gdpr-type'] == '2'){
[181] Fix | Delete
$position = ampforwp_get_setting('amp-gdpr-type2-position');
[182] Fix | Delete
?>
[183] Fix | Delete
.gdpr{position: fixed; <?php if($position==1){?>top: 0;<?php }else{?> bottom: 0;<?php }?> left: 0; right: 0; z-index:99999;}
[184] Fix | Delete
.gdpr_w{padding:20px 40px;background: #383B75;width: 95%;position: relative;margin: 0% auto;display: inline-flex;}
[185] Fix | Delete
.gdpr_t h3, .gdpr_fmi{
[186] Fix | Delete
font-size: 16px;
[187] Fix | Delete
color:#fff;
[188] Fix | Delete
margin: 0;
[189] Fix | Delete
font-weight: 400;
[190] Fix | Delete
}
[191] Fix | Delete
.gdpr_fmi a{
[192] Fix | Delete
text-decoration:underline;
[193] Fix | Delete
margin-left: 10px;
[194] Fix | Delete
color:#fff;
[195] Fix | Delete
opacity: .8;
[196] Fix | Delete
}
[197] Fix | Delete
.gdpr_fmi a:hover{
[198] Fix | Delete
opacity: 1;
[199] Fix | Delete
color:#fff;
[200] Fix | Delete
}
[201] Fix | Delete
.gdpr-l{
[202] Fix | Delete
display: flex;
[203] Fix | Delete
flex-direction: row;
[204] Fix | Delete
align-items: center;
[205] Fix | Delete
order: 0;
[206] Fix | Delete
}
[207] Fix | Delete
.gdpr_t, .gdpr_fmi{
[208] Fix | Delete
display:inline-block;
[209] Fix | Delete
}
[210] Fix | Delete
.gdpr_t p{display:none;}
[211] Fix | Delete
.gdpr_x {position: absolute;right: 18px;top: 6px; cursor:pointer;color: #fff;visibility: hidden;}
[212] Fix | Delete
.gdpr_yn{
[213] Fix | Delete
text-align: right;
[214] Fix | Delete
order: 0;
[215] Fix | Delete
flex-grow: 1;
[216] Fix | Delete
}
[217] Fix | Delete
.gdpr_yn form{display: inline;}
[218] Fix | Delete
.gdpr_yn button{background: #FFFC26;border: none;color: #333;padding: 8px 40px;font-size: 15px;margin: 0 3px;font-weight: 600;cursor: pointer;}
[219] Fix | Delete
.gdpr_yn .gdpr_n{background: transparent;}
[220] Fix | Delete
amp-consent{position: relative;margin-left: 10px;width: auto;background: transparent;margin:0;left:40%;}
[221] Fix | Delete
.gdpr_fmi span, .gdpr_fmi a:before{
[222] Fix | Delete
display:none;
[223] Fix | Delete
}
[224] Fix | Delete
.gdpr-btns{
[225] Fix | Delete
display:inline-flex;
[226] Fix | Delete
align-items: center;
[227] Fix | Delete
}
[228] Fix | Delete
.gdpr_yn .acp{
[229] Fix | Delete
order: 1;
[230] Fix | Delete
}
[231] Fix | Delete
.rej button{
[232] Fix | Delete
font-size: 15px;
[233] Fix | Delete
padding: 0;
[234] Fix | Delete
font-weight: 500;
[235] Fix | Delete
margin-right: 20px;
[236] Fix | Delete
cursor: pointer;
[237] Fix | Delete
color:#fff;
[238] Fix | Delete
}
[239] Fix | Delete
.rej button:hover{
[240] Fix | Delete
text-decoration:underline;
[241] Fix | Delete
}
[242] Fix | Delete
@media(max-width:768px){
[243] Fix | Delete
.gdpr-l{display:inline-block;}
[244] Fix | Delete
.gdpr_fmi a{margin:0;}
[245] Fix | Delete
.gdpr_t, .gdpr_fmi {
[246] Fix | Delete
display: block;
[247] Fix | Delete
line-height: 1.4;
[248] Fix | Delete
}
[249] Fix | Delete
.gdpr_w{padding:10px 15px;
[250] Fix | Delete
display:inline-block;text-align:left;
[251] Fix | Delete
}
[252] Fix | Delete
.gdpr_yn {
[253] Fix | Delete
margin-top: 10px;
[254] Fix | Delete
text-align: center;
[255] Fix | Delete
}
[256] Fix | Delete
}<?php
[257] Fix | Delete
} // GDPR Type 2 End
[258] Fix | Delete
[259] Fix | Delete
if ( '1' === $redux_builder_amp['amp-design-selector'] ) { ?>
[260] Fix | Delete
#ampforwpConsent{
[261] Fix | Delete
left: 50%;
[262] Fix | Delete
font-size: 13px;
[263] Fix | Delete
top: -15px;
[264] Fix | Delete
}
[265] Fix | Delete
#ampforwpConsent a{
[266] Fix | Delete
text-decoration:none;
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
<?php
[270] Fix | Delete
}
[271] Fix | Delete
if ( '3' === $redux_builder_amp['amp-design-selector'] ) {?>
[272] Fix | Delete
amp-consent{background:none}
[273] Fix | Delete
@media(max-width:425px){
[274] Fix | Delete
#footer amp-consent a{font-size:12px;margin-top:7px;display:inline-block;}
[275] Fix | Delete
}<?php
[276] Fix | Delete
}
[277] Fix | Delete
if ( '4' === $redux_builder_amp['amp-design-selector'] ) {?>
[278] Fix | Delete
.gdpr_fmi a:before{
[279] Fix | Delete
display:none;
[280] Fix | Delete
}
[281] Fix | Delete
.gdpr_w{width:100%;}
[282] Fix | Delete
.f-w-f2 {
[283] Fix | Delete
padding: 50px 0px;
[284] Fix | Delete
}
[285] Fix | Delete
<?php
[286] Fix | Delete
} ?>
[287] Fix | Delete
footer amp-consent.amp-active {
[288] Fix | Delete
z-index:9999;
[289] Fix | Delete
display: initial;
[290] Fix | Delete
position: inherit;
[291] Fix | Delete
height:20px;
[292] Fix | Delete
width:100%;
[293] Fix | Delete
}
[294] Fix | Delete
body[class*="amp-iso-country-"] .amp-active{
[295] Fix | Delete
display: contents;
[296] Fix | Delete
}
[297] Fix | Delete
#post-consent-ui {
[298] Fix | Delete
position: fixed;
[299] Fix | Delete
z-index: 9999;
[300] Fix | Delete
left: 45%;
[301] Fix | Delete
margin-top: 10px;
[302] Fix | Delete
top: 0;
[303] Fix | Delete
}
[304] Fix | Delete
<?php }
[305] Fix | Delete
[306] Fix | Delete
function amp_consent_submission(){
[307] Fix | Delete
if(wp_verify_nonce( $_REQUEST['verify_nonce'], 'amp_consent' ) ) {
[308] Fix | Delete
//setcookie('ampforwp_gdpr_action','true', time() + (86400 * 30), "/");
[309] Fix | Delete
$current_url = $site_url = $site_host = $amp_site = '';
[310] Fix | Delete
$current_url = wp_get_referer();
[311] Fix | Delete
$site_url = parse_url( get_site_url() );
[312] Fix | Delete
$site_host = $site_url['host'];
[313] Fix | Delete
$amp_site = $site_url['scheme'] . '://' . $site_url['host'];
[314] Fix | Delete
header("AMP-Access-Control-Allow-Source-Origin: ".esc_url($amp_site));
[315] Fix | Delete
header("AMP-Redirect-To: ".esc_url($current_url));
[316] Fix | Delete
}else{
[317] Fix | Delete
echo wp_json_encode(array("status"=>300,"message"=>esc_html__('Request not valid','accelerated-mobile-pages')));
[318] Fix | Delete
die;
[319] Fix | Delete
}
[320] Fix | Delete
[321] Fix | Delete
}
[322] Fix | Delete
[323] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function