Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/gdpr-cookie-consent/admin/class-gdpr-cookie-consent-admin.php
+++ b/gdpr-cookie-consent/admin/class-gdpr-cookie-consent-admin.php
@@ -354,10 +354,10 @@
$the_options = Gdpr_Cookie_Consent::gdpr_get_settings();
$the_options['cookie_bar_popup_overlay_opacity'] = 50;
- $the_options['cookie_bar_padding'] = 20;
- $the_options['cookie_bar_horizontal_padding'] = 120;
- $the_options['cookie_bar_vertical_padding'] = 20;
- $the_options['cookie_bar_spacing'] = 15;
+ $the_options['cookie_bar_padding'] = 14;
+ $the_options['cookie_bar_horizontal_padding'] = 30;
+ $the_options['cookie_bar_vertical_padding'] = 14;
+ $the_options['cookie_bar_spacing'] = 5;
$the_options['cookie_bar_blur'] = 0;
$the_options['cookie_bar_shadow_color'] = '#000000';
$the_options['cookie_bar_shadow_size'] = 5;
@@ -368,7 +368,7 @@
$the_options['default_logo'] = 'icon1';
$the_options['use_uploaded_logo'] = $banner_image ? true : false; //true case of first statement
- $the_options['bypass_button_is_on'] = true;
+ $the_options['bypass_button_is_on'] = false;
$the_options['bypass_button_size'] = 'md';
$the_options['bypass_button_text_color'] = $the_options['button_accept_all_button_color']; //same as accept all color
@@ -387,16 +387,16 @@
$the_options['button_text_weight'] = '400';
$the_options['button_accept_all_btn_width'] = $the_options['template'] === 'blue_full' ? 'full' : 'fit';
- $the_options['button_accept_all_btn_min_width'] = ($the_options['template'] === 'default' || $the_options['template'] === 'dark') ? 110 : ($the_options['template'] === 'blue_center_column' ? 280 : 140);
+ $the_options['button_accept_all_btn_min_width'] = $the_options['template'] === 'new_default' ? 132 : (($the_options['template'] === 'default' || $the_options['template'] === 'dark') ? 110 : ($the_options['template'] === 'blue_center_column' ? 280 : 140));
$the_options['button_accept_button_width'] = $the_options['template'] === 'blue_full' ? 'full' : 'fit';
- $the_options['button_accept_button_min_width'] = ($the_options['template'] === 'default' || $the_options['template'] === 'dark') ? 100 : ($the_options['template'] === 'blue_center_column' ? 280 : 140);
+ $the_options['button_accept_button_min_width'] = $the_options['template'] === 'new_default' ? 132 : (($the_options['template'] === 'default' || $the_options['template'] === 'dark') ? 100 : ($the_options['template'] === 'blue_center_column' ? 280 : 140));
$the_options['button_decline_button_width'] = $the_options['template'] === 'blue_full' ? 'full' : 'fit';
- $the_options['button_decline_button_min_width'] = ($the_options['template'] === 'default' || $the_options['template'] === 'dark') ? 100 : 140;
+ $the_options['button_decline_button_min_width'] = $the_options['template'] === 'new_default' ? 132 : (($the_options['template'] === 'default' || $the_options['template'] === 'dark') ? 100 : 140);
$the_options['button_settings_button_width'] = $the_options['template'] === 'blue_full' ? 'full' : 'fit';
- $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width'] = $the_options['template'] === 'new_default' ? 132 : 140;
$the_options['banner_layouts'] = wp_json_encode(
@@ -418,11 +418,11 @@
'direction' => ($the_options['template'] === 'almond' || $the_options['template'] === 'gray' || $the_options['template'] === 'gray_pink' || $the_options['template'] === 'blue_center_column' || $the_options['template'] === 'bold' || $the_options['template'] === 'blue_split') ? 'col' : 'row',
),
'c5' => array(
- 'justify' => ($the_options['template'] === 'default' || $the_options['template'] === 'dark' || $the_options['template'] === 'blue_full') ? 'start' : 'center',
+ 'justify' => ($the_options['template'] === 'default' || $the_options['template'] === 'new_default' || $the_options['template'] === 'dark' || $the_options['template'] === 'blue_full') ? 'start' : 'center',
'direction' => 'row',
),
'c6' => array(
- 'justify' => ($the_options['template'] === 'default' || $the_options['template'] === 'dark' || $the_options['template'] === 'blue_full') ? 'end' : 'center',
+ 'justify' => ($the_options['template'] === 'default' || $the_options['template'] === 'new_default' || $the_options['template'] === 'dark' || $the_options['template'] === 'blue_full') ? 'end' : 'center',
'direction' => 'row',
),
)
@@ -431,6 +431,10 @@
$c6_buttons = array();
$c1_content = array( 'logo', 'heading' );
switch($the_options['template']){
+ case 'new_default':
+ $c5_buttons = array( 'settings', 'accept', 'decline', 'accept_all' );
+ $c6_buttons = array();
+ break;
case 'default':
case 'dark':
case 'blue_center_column':
@@ -551,7 +555,7 @@
if (strpos($template, $prefix) === 0) {
$original_key = substr($template, strlen($prefix));
$mapped_templates = [
- 'default' => 'default',
+ 'default' => 'new_default',
'almond_column' => 'almond',
'navy_blue_center' => 'blue_center',
'gray_column' => 'gray_pink',
@@ -585,13 +589,13 @@
public function gdpr_initialise(){
- // if (!get_option('gdpr_default_template_object')) {
+ if (!get_option('gdpr_default_template_object')) {
$default_json_path = plugin_dir_path(__FILE__) . '../includes/templates/default_template.json';
$json_data = file_get_contents($default_json_path);
$default_template = json_decode($json_data, true);
update_option('gdpr_default_template_object', $default_template);
- // }
+ }
$this->settings = new GDPR_Cookie_Consent_Settings();
// Call the is_connected() method from the instantiated object to check if the user is connected.
@@ -603,14 +607,14 @@
if (!is_wp_error($response) && wp_remote_retrieve_response_code($response) === 200) {
$json_data = wp_remote_retrieve_body($response);
$this -> templates_json = json_decode($json_data, true);
- if(!isset($the_options['selected_template_json']) || json_decode($the_options['selected_template_json'], true)['name'] != $the_options['template']) $the_options['selected_template_json'] = ($the_options['template'] == 'default' ? json_encode(get_option('gdpr_default_template_object')) : json_encode($this -> templates_json[$the_options['template']]));
+ if(!isset($the_options['selected_template_json']) || json_decode($the_options['selected_template_json'], true)['name'] != $the_options['template']) $the_options['selected_template_json'] = ($the_options['template'] == 'new_default' ? json_encode(get_option('gdpr_default_template_object')) : json_encode($this -> templates_json[$the_options['template']]));
} else {
$this -> templates_json = []; // Fallback in case of error
if(!isset($the_options['selected_template_json']) || json_decode($the_options['selected_template_json'], true)['name'] != $the_options['template']) $the_options['selected_template_json'] = json_encode([]);
}
}
else{
- if($the_options['template'] == 'default'){
+ if($the_options['template'] == 'new_default' || $the_options['template'] == 'default' ){
$the_options['selected_template_json'] = json_encode(get_option('gdpr_default_template_object'));
}
else{
@@ -787,7 +791,8 @@
*/
public function wpl_set_default_ab_testing_banner( $the_options, $banner_choice ) {
$the_options['background'] = $the_options[ 'cookie_bar_color' . $banner_choice ];
- $the_options['text'] = $the_options[ 'cookie_text_color' . $banner_choice ];
+ $the_options['cookie_text_color'] = $the_options[ 'cookie_text_color' . $banner_choice ];
+ $the_options['cookie_heading_color'] = $the_options['cookie_heading_color'. $banner_choice];
$the_options['opacity'] = $the_options[ 'cookie_bar_opacity' . $banner_choice ];
$the_options['background_border_width'] = $the_options[ 'cookie_bar_border_width' . $banner_choice ];
$the_options['background_border_style'] = $the_options[ 'border_style' . $banner_choice ];
@@ -2047,7 +2052,7 @@
$args = array(
'id' => 'gdpr-quick-menu',
'title' => 'WPLP Cookie Consent <span class="custom-icon" style="float:right;width:22px !important;height:22px !important;margin: 5px 5px 0 !important;"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.36305 18.2675C7.43268 18.739 8.57557 18.9748 9.79172 18.9748C11.0079 18.9742 12.1508 18.7384 13.2204 18.2675C14.29 17.7965 15.2205 17.1532 16.0117 16.3376C16.8023 15.522 17.4286 14.572 17.8904 13.4877C18.3523 12.4033 18.5832 11.2478 18.5832 10.0211C18.5838 9.85589 18.5803 9.7024 18.5727 9.56058C18.565 9.41875 18.5539 9.26556 18.5392 9.101C17.5728 9.07108 16.844 8.65219 16.3528 7.84433C15.8617 7.03648 15.8066 6.19122 16.1875 5.30856C15.5434 5.53297 14.9172 5.57037 14.3088 5.42077C13.7004 5.27116 13.1764 4.99799 12.7369 4.60124C12.2973 4.20509 11.9676 3.70781 11.7478 3.1094C11.528 2.51099 11.4841 1.87518 11.616 1.20196C11.2789 1.12716 10.9493 1.0748 10.6269 1.04488C10.3046 1.01496 9.98953 1 9.68183 1C8.40707 0.999403 7.23487 1.25732 6.16524 1.77375C5.09561 2.29018 4.17983 2.97087 3.4179 3.81583C2.65597 4.66138 2.06255 5.62273 1.63763 6.69987C1.2127 7.77701 1.00024 8.87659 1.00024 9.99862C1.00083 11.2403 1.23175 12.4072 1.69301 13.4993C2.15427 14.5914 2.78052 15.5414 3.57175 16.3493C4.36299 17.1565 5.29342 17.7959 6.36305 18.2675Z" fill="white"/><ellipse cx="5.10827" cy="6.64684" rx="1.75451" ry="1.79137" fill="#171C1F"/><ellipse cx="7.11088" cy="14.1328" rx="1.40361" ry="1.43309" fill="#171C1F"/><ellipse cx="4.05556" cy="10.8357" rx="0.701803" ry="0.716547" fill="#171C1F"/><circle cx="9.72125" cy="8.8703" r="0.877254" fill="#171C1F"/><ellipse cx="14.9546" cy="10.2109" rx="1.40361" ry="1.43309" fill="#171C1F"/><circle cx="12.5134" cy="14.7998" r="1.31588" fill="#171C1F"/><ellipse cx="9.5458" cy="4.00341" rx="0.701803" ry="0.716547" fill="#171C1F"/></svg></span>',
- 'href' => admin_url( 'admin.php?page=gdpr-cookie-consent' ), // Add your custom URL here
+ 'href' => admin_url( 'admin.php?page=gdpr-cookie-consent#cookie_settings' ), // Add your custom URL here
'meta' => array(
'class' => 'gdpr-quick-menu-item',
'target' => '', // Add target attribute if needed
@@ -2245,7 +2250,7 @@
*/
public function admin_plugin_action_links( $links ) {
$current_url = get_site_url();
- $current_url = $current_url . '/wp-admin/admin.php?page=gdpr-cookie-consent#create_cookie_banner';
+ $current_url = $current_url . '/wp-admin/admin.php?page=gdpr-cookie-consent#cookie_settings';
// fetching the setting for paid plan.
$settings = new GDPR_Cookie_Consent_Settings();
$api_user_plan = $settings->get_plan();
@@ -2259,7 +2264,7 @@
}
$links = array_merge(
array(
- '<a href="' . esc_url( $current_url ) . '" target="_self" rel="noopener noreferrer"><strong style="color: #11967A; display: inline;">' . __( 'Create Cookie Banner', 'gdpr-cookie-consent' ) . '</strong></a>',
+ '<a href="' . esc_url( $current_url ) . '" target="_self" rel="noopener noreferrer"><strong style="color: #11967A; display: inline;">' . __( 'Banner Settings', 'gdpr-cookie-consent' ) . '</strong></a>',
),
$links
);
@@ -2287,9 +2292,9 @@
if ( isset( $prev_gdpr_option['is_on'] ) ) {
unset( $prev_gdpr_option['button_1_selected_text'] );
$prev_gdpr_option['button_1_text'] = 'Accept';
- $prev_gdpr_option['notify_message'] = addslashes( 'This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.' );
+ $prev_gdpr_option['notify_message'] = addslashes( 'We use cookies to optimize your experience, analyze traffic, and personalize ads. Please choose whether you accept our use of non-essential cookies.' );
$prev_gdpr_option['opacity'] = '1';
- $prev_gdpr_option['template'] = 'default';
+ $prev_gdpr_option['template'] = 'new_default';
$prev_gdpr_option['banner_template'] = 'banner-default';
$prev_gdpr_option['popup_template'] = 'popup-default';
$prev_gdpr_option['widget_template'] = 'widget-default';
@@ -2384,7 +2389,7 @@
$prev_gdpr_option['button_donotsell_as_button'] = false;
$prev_gdpr_option['button_donotsell_is_on'] = true;
- $prev_gdpr_option['button_confirm_text'] = 'Confirm';
+ $prev_gdpr_option['button_confirm_text'] = 'Save My Preferences';
$prev_gdpr_option['button_confirm_button_color'] = '#18a300';
$prev_gdpr_option['button_confirm_link_color'] = '#ffffff';
$prev_gdpr_option['button_confirm_as_button'] = 'true';
@@ -2408,7 +2413,7 @@
// cookie usage for.
$prev_gdpr_option['cookie_usage_for'] = 'gdpr';
// ccpa message.
- $prev_gdpr_option['notify_message_ccpa'] = addslashes( 'In case of sale of your personal information, you may opt out by using the link' );
+ $prev_gdpr_option['notify_message_ccpa'] = addslashes( 'We use tracking tools to provide targeted advertising. Under state law, you have the right to opt-out of the sharing or sale of your personal information.' );
update_option( GDPR_COOKIE_CONSENT_SETTINGS_FIELD, $prev_gdpr_option );
delete_option( 'GDPRCookieConsent-4.0' );
}
@@ -2437,7 +2442,7 @@
$prev_gdpr_option['button_readmore_url_type'] = true;
$prev_gdpr_option['button_readmore_wp_page'] = false;
$prev_gdpr_option['button_readmore_page'] = '0';
- $prev_gdpr_option['notify_message_eprivacy'] = addslashes( 'This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.' );
+ $prev_gdpr_option['notify_message_eprivacy'] = addslashes( 'We use cookies to optimize your experience, analyze traffic, and personalize ads. Please choose whether you accept our use of non-essential cookies.' );
update_option( GDPR_COOKIE_CONSENT_SETTINGS_FIELD, $prev_gdpr_option );
delete_option( 'GDPRCookieConsent-7.0' );
}
@@ -3335,7 +3340,7 @@
if ($settings['is_iabtcf_on'] !== "false" && $settings['is_iabtcf_on'] !== false) {
$settings['is_iabtcf_on'] = false;
- $settings['notify_message'] = "This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.";
+ $settings['notify_message'] = "We use cookies to optimize your experience, analyze traffic, and personalize ads. Please choose whether you accept our use of non-essential cookies.";
$settings['about_message'] = "Cookies are small text files that can be used by websites to make a user's experience more efficient. The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.";
$settings = $this->changeLanguage($settings);
$needs_update = true;
@@ -4957,17 +4962,25 @@
* Ajax callback for gcm region form.
*/
public function gdpr_cookie_consent_ajax_save_gcm_region(){
+
+ if ( ! check_ajax_referer( 'wpl_save_script_nonce', '_wpnonce', false ) ) {
+ wp_send_json_error( 'Invalid nonce', 403 );
+ }
+ if ( ! current_user_can( 'manage_options' ) ) {
+ wp_send_json_error( 'Unauthorized', 403 );
+ }
+
$the_options = Gdpr_Cookie_Consent::gdpr_get_settings();
$the_options['gcm_defaults'] = json_encode(json_decode(stripslashes($_POST['regionArray'])));
update_option( GDPR_COOKIE_CONSENT_SETTINGS_FIELD, $the_options );
}
- public function add_every_minute_cron_schedule( $schedules ) {
- if ( ! isset( $schedules['every_minute'] ) ) {
- $schedules['every_minute'] = array(
- 'interval' => 60,
- 'display' => __( 'Every Minute','gdpr-cookie-consent' ),
+ public function add_scan_cron_schedule( $schedules ) {
+ if ( ! isset( $schedules['every_15_seconds'] ) ) {
+ $schedules['every_15_seconds'] = array(
+ 'interval' => 15,
+ 'display' => __( 'Every 15 Seconds','gdpr-cookie-consent' ),
);
}
return $schedules;
@@ -5001,7 +5014,7 @@
$reset_auto_generated = isset($_POST['reset_auto_generated']) ? sanitize_text_field($_POST['reset_auto_generated']) : '0';
$is_template_changed = isset($_POST['is_template_changed']) ? sanitize_text_field($_POST['is_template_changed']) : '0';
$auto_generated_banner = isset($_POST['auto_generated_banner']) ? sanitize_text_field($_POST['auto_generated_banner']) : '0';
- $template = isset($_POST['gdpr-template']) ? sanitize_text_field($_POST['gdpr-template']) : 'default';
+ $template = isset($_POST['gdpr-template']) ? sanitize_text_field($_POST['gdpr-template']) : 'new_default';
// Check if the value of the A/B testing period has changed
if ($current_ab_testing_value !== $updated_ab_testing_value) {
@@ -5121,7 +5134,10 @@
$the_options['notify_animate_show1'] = isset( $_POST['gcc-gdpr-cookie-on-load1'] ) && ( true === $_POST['gcc-gdpr-cookie-on-load1'] || 'true' === $_POST['gcc-gdpr-cookie-on-load1'] ) ? 'true' : 'false';
$the_options['notify_animate_show2'] = isset( $_POST['gcc-gdpr-cookie-on-load2'] ) && ( true === $_POST['gcc-gdpr-cookie-on-load2'] || 'true' === $_POST['gcc-gdpr-cookie-on-load2'] ) ? 'true' : 'false';
$the_options['background'] = isset( $_POST['gdpr-cookie-bar-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-color'] ) ) : '#ffffff';
- $the_options['text'] = isset( $_POST['gdpr-cookie-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-text-color'] ) ) : '#000000';
+ $the_options['cookie_settings_overlay_color'] = isset( $_POST['cookie_settings_overlay_color'] ) ? sanitize_text_field( wp_unslash( $_POST['cookie_settings_overlay_color'] ) ): "#ffffff";
+ $the_options['cookie_settings_border_color'] = isset( $_POST['cookie_settings_border_color'] ) ? sanitize_text_field( wp_unslash( $_POST['cookie_settings_border_color'] ) ): "#ffffff";
+ $the_options['cookie_text_color'] = isset( $_POST['gdpr-cookie-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-text-color'] ) ) : '#000000';
+ $the_options['cookie_heading_color'] = isset( $_POST['gdpr-cookie-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-text-color'] ) ) : '#000000';
$the_options['opacity'] = isset( $_POST['gdpr-cookie-bar-opacity'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-opacity'] ) ) : '1';
$the_options['background_border_width'] = isset( $_POST['gdpr-cookie-bar-border-width'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-border-width'] ) ) : '0';
$the_options['background_border_style'] = isset( $_POST['gdpr-cookie-border-style'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-border-style'] ) ) : 'none';
@@ -5132,6 +5148,7 @@
$the_options['default_cookie_bar'] = isset( $_POST['gdpr-default_cookie_bar'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-default_cookie_bar'] ) ) : true;
$the_options['cookie_bar_color1'] = isset( $_POST['gdpr-cookie-bar-color1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-color1'] ) ) : '#ffffff';
$the_options['cookie_text_color1'] = isset( $_POST['gdpr-cookie-text-color1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-text-color1'] ) ) : '#000000';
+ $the_options['cookie_heading_color1'] = isset( $_POST['gdpr-cookie-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-text-color'] ) ) : '#000000';
$the_options['cookie_bar_opacity1'] = isset( $_POST['gdpr-cookie-bar-opacity1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-opacity1'] ) ) : '0.80';
$the_options['cookie_bar_border_width1'] = isset( $_POST['gdpr-cookie-bar-border-width1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-border-width1'] ) ) : '0';
$the_options['border_style1'] = isset( $_POST['gdpr-cookie-border-style1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-border-style1'] ) ) : 'none';
@@ -5244,6 +5261,9 @@
'label' => array(),
)
) : "This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.";
+ $the_options['heading_is_on'] = isset( $_POST['heading_is_on'] ) && ( true === $_POST['heading_is_on'] || 'true' === $_POST['heading_is_on'] ) ? true : false;
+ $the_options['heading_is_on1'] = isset( $_POST['heading_is_on'] ) && ( true === $_POST['heading_is_on'] || 'true' === $_POST['heading_is_on'] ) ? true : false;
+ $the_options['heading_is_on2'] = isset( $_POST['heading_is_on'] ) && ( true === $_POST['heading_is_on'] || 'true' === $_POST['heading_is_on'] ) ? true : false;
$the_options['bar_heading_text'] = isset( $_POST['bar_heading_text_field'] ) ? sanitize_text_field( wp_unslash( $_POST['bar_heading_text_field'] ) ) : '';
$the_options['bar_heading_lgpd_text'] = isset( $_POST['bar_heading_text_lgpd_field'] ) ? sanitize_text_field( wp_unslash( $_POST['bar_heading_text_lgpd_field'] ) ) : '';
@@ -5298,7 +5318,7 @@
'div' => array(),
'label' => array(),
)
- ) : "This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.";
+ ) : "We use cookies to optimize your experience, analyze traffic, and personalize ads. Please choose whether you accept our use of non-essential cookies.";
$the_options['about_message'] = isset( $_POST['about_message_field'] ) ? sanitize_text_field( wp_unslash( $_POST['about_message_field'] ) ) : "Cookies are small text files that can be used by websites to make a user's experience more efficient. The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.";
$the_options['gcm_about_message'] = isset($_POST['gcm_about_message_field']) ? sanitize_text_field(wp_unslash($_POST['gcm_about_message_field'])) : "For more information on how Google's third party cookies operate and handle your data, see: ";
$the_options['gcm_privacy_policy_text'] = isset($_POST['gcm_privacy_policy_text_field']) ? sanitize_text_field(wp_unslash($_POST['gcm_privacy_policy_text_field'])) : "Google's Privacy Policy";
@@ -5352,7 +5372,7 @@
'div' => array(),
'label' => array(),
)
- ) : 'In case of sale of your personal information, you may opt out by using the link';
+ ) : 'We use tracking tools to provide targeted advertising. Under state law, you have the right to opt-out of the sharing or sale of your personal information.';
if(($the_options['is_iabtcf_on'] == false && $_POST['gcc-iabtcf-enable'] == "true") || ($the_options['is_iabtcf_on'] == true && $_POST['gcc-iabtcf-enable'] == "false")){
$the_options['is_iabtcf_on'] = isset( $_POST['gcc-iabtcf-enable'] ) && ( true === $_POST['gcc-iabtcf-enable'] || 'true' === $_POST['gcc-iabtcf-enable'] ) ? 'true' : 'false';
$the_options = $this->changeLanguage($the_options);
@@ -5391,7 +5411,7 @@
$the_options['is_gcm_advertiser_mode'] = isset( $_POST['gcc-gcm-advertiser-mode'] ) && ( true === $_POST['gcc-gcm-advertiser-mode'] || 'true' === $_POST['gcc-gcm-advertiser-mode'] ) ? 'true' : 'false';
$the_options['is_iabtcf_on'] = isset( $_POST['gcc-iabtcf-enable'] ) && ( true === $_POST['gcc-iabtcf-enable'] || 'true' === $_POST['gcc-iabtcf-enable'] ) ? 'true' : 'false';
$the_options['is_dynamic_lang_on'] = isset( $_POST['gcc-dynamic-lang-enable'] ) && ( true === $_POST['gcc-dynamic-lang-enable'] || 'true' === $_POST['gcc-dynamic-lang-enable'] ) ? 'true' : 'false';
- $the_options['optout_text'] = isset( $_POST['notify_message_ccpa_optout_field'] ) ? sanitize_text_field( wp_unslash( $_POST['notify_message_ccpa_optout_field'] ) ) : 'Do you really wish to opt-out?';
+ $the_options['optout_text'] = isset( $_POST['notify_message_ccpa_optout_field'] ) ? sanitize_text_field( wp_unslash( $_POST['notify_message_ccpa_optout_field'] ) ) : 'We use third-party cookies that help us analyse how you use this website, store your preferences, and provide the content and advertisements that are relevant to you. However, you can opt out of these cookies by checking "Do Not Sell or Share My Personal Information" and clicking the "Save My Preferences" button. Once you opt out, you can opt in again at any time by unchecking "Do Not Sell or Share My Personal Information" and clicking the "Save My Preferences" button.';
$the_options['is_ccpa_iab_on'] = isset( $_POST['gcc-iab-enable'] ) && ( true === $_POST['gcc-iab-enable'] || 'true' === $_POST['gcc-iab-enable'] ) ? 'true' : 'false';
$the_options['show_again'] = isset( $_POST['gcc-revoke-consent-enable'] ) && ( true === $_POST['gcc-revoke-consent-enable'] || 'true' === $_POST['gcc-revoke-consent-enable'] ) ? 'true' : 'false';
$the_options['show_again1'] = isset( $_POST['gcc-revoke-consent-enable1'] ) && ( true === $_POST['gcc-revoke-consent-enable1'] || 'true' === $_POST['gcc-revoke-consent-enable1'] ) ? 'true' : 'false';
@@ -5513,7 +5533,7 @@
$the_options['button_settings_button_opacity1'] = isset( $_POST['gdpr-cookie-settings-opacity1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-settings-opacity1'] ) ) : '1';
$the_options['button_settings_button_border_radius1'] = isset( $_POST['gdpr-cookie-settings-border-radius1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-settings-border-radius1'] ) ) : '0';
$the_options['button_settings_display_cookies1'] = isset( $_POST['gcc-cookie-on-frontend1'] ) && ( true === $_POST['gcc-cookie-on-frontend1'] || 'true' === $_POST['gcc-cookie-on-frontend1'] ) ? 'true' : 'false';
- $the_options['button_confirm_text'] = isset( $_POST['button_confirm_text_field'] ) ? sanitize_text_field( wp_unslash( $_POST['button_confirm_text_field'] ) ) : 'Confirm';
+ $the_options['button_confirm_text'] = isset( $_POST['button_confirm_text_field'] ) ? sanitize_text_field( wp_unslash( $_POST['button_confirm_text_field'] ) ) : 'Save My Preferences';
$the_options['button_confirm_link_color'] = isset( $_POST['gdpr-cookie-confirm-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-text-color'] ) ) : '#ffffff';
$the_options['button_confirm_button_color'] = isset( $_POST['gdpr-cookie-confirm-background-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-background-color'] ) ) : '#18a300';
$the_options['button_confirm_button_opacity'] = isset( $_POST['gdpr-cookie-confirm-opacity'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-opacity'] ) ) : '1';
@@ -5531,7 +5551,7 @@
$the_options['button_cancel_button_border_radius'] = isset( $_POST['gdpr-cookie-cancel-border-radius'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-cancel-border-radius'] ) ) : '0';
$the_options['button_donotsell_text'] = isset( $_POST['button_donotsell_text_field'] ) ? sanitize_text_field( wp_unslash( $_POST['button_donotsell_text_field'] ) ) : 'Do Not Sell My Personal Information';
$the_options['button_donotsell_link_color'] = isset( $_POST['gdpr-cookie-opt-out-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-opt-out-text-color'] ) ) : '#359bf5';
- $the_options['button_confirm_text1'] = isset( $_POST['button_confirm_text_field1'] ) ? sanitize_text_field( wp_unslash( $_POST['button_confirm_text_field1'] ) ) : 'Confirm';
+ $the_options['button_confirm_text1'] = isset( $_POST['button_confirm_text_field1'] ) ? sanitize_text_field( wp_unslash( $_POST['button_confirm_text_field1'] ) ) : 'Save My Preferences';
$the_options['button_confirm_link_color1'] = isset( $_POST['gdpr-cookie-confirm-text-color1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-text-color1'] ) ) : '#ffffff';
$the_options['button_confirm_button_color1'] = isset( $_POST['gdpr-cookie-confirm-background-color1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-background-color1'] ) ) : '#18a300';
$the_options['button_confirm_button_opacity1'] = isset( $_POST['gdpr-cookie-confirm-opacity1'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-opacity1'] ) ) : '1';
@@ -5579,6 +5599,7 @@
$the_options['cookie_bar2_name'] = isset( $_POST['gdpr-cookie_bar2_name'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie_bar2_name'] ) ) : 'Test Banner A';
$the_options['cookie_bar_color2'] = isset( $_POST['gdpr-cookie-bar-color2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-color2'] ) ) : '#ffffff';
$the_options['cookie_text_color2'] = isset( $_POST['gdpr-cookie-text-color2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-text-color2'] ) ) : '#000000';
+ $the_options['cookie_heading_color2'] = isset( $_POST['gdpr-cookie-text-color'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-text-color'] ) ) : '#000000';
$the_options['cookie_bar_opacity2'] = isset( $_POST['gdpr-cookie-bar-opacity2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-opacity2'] ) ) : '0.80';
$the_options['cookie_bar_border_width2'] = isset( $_POST['gdpr-cookie-bar-border-width2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-bar-border-width2'] ) ) : '0';
$the_options['border_style2'] = isset( $_POST['gdpr-cookie-border-style2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-border-style2'] ) ) : 'none';
@@ -5611,7 +5632,7 @@
$the_options['button_settings_button_opacity2'] = isset( $_POST['gdpr-cookie-settings-opacity2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-settings-opacity2'] ) ) : '1';
$the_options['button_settings_button_border_radius2'] = isset( $_POST['gdpr-cookie-settings-border-radius2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-settings-border-radius2'] ) ) : '0';
$the_options['button_settings_display_cookies2'] = isset( $_POST['gcc-cookie-on-frontend2'] ) && ( true === $_POST['gcc-cookie-on-frontend2'] || 'true' === $_POST['gcc-cookie-on-frontend2'] ) ? 'true' : 'false';
- $the_options['button_confirm_text2'] = isset( $_POST['button_confirm_text_field2'] ) ? sanitize_text_field( wp_unslash( $_POST['button_confirm_text_field2'] ) ) : 'Confirm';
+ $the_options['button_confirm_text2'] = isset( $_POST['button_confirm_text_field2'] ) ? sanitize_text_field( wp_unslash( $_POST['button_confirm_text_field2'] ) ) : 'Save My Preferences';
$the_options['button_confirm_link_color2'] = isset( $_POST['gdpr-cookie-confirm-text-color2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-text-color2'] ) ) : '#ffffff';
$the_options['button_confirm_button_color2'] = isset( $_POST['gdpr-cookie-confirm-background-color2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-background-color2'] ) ) : '#18a300';
$the_options['button_confirm_button_opacity2'] = isset( $_POST['gdpr-cookie-confirm-opacity2'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr-cookie-confirm-opacity2'] ) ) : '1';
@@ -5820,8 +5841,332 @@
if ( 'none' !== $template && $saved_options['template'] !== $template ) {
$the_options['template'] = $template;
- if($template != "default" && isset($this->templates_json[$template])) $the_options['selected_template_json'] = json_encode($this->templates_json[$template]);
+ if($template != "new_default" && isset($this->templates_json[$template])) $the_options['selected_template_json'] = json_encode($this->templates_json[$template]);
else $the_options['selected_template_json'] = json_encode(get_option('gdpr_default_template_object'));
+
+
+
+ $banner_layouts = json_decode($the_options['banner_layouts'], true);
+ $banner_structure = json_decode($the_options['banner_structure'], true);
+ if ( ! is_array( $banner_layouts ) ) {
+ $banner_layouts = array();
+ }
+ if ( ! is_array( $banner_structure ) ) {
+ $banner_structure = array();
+ }
+
+ if ( 'new_default' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c5'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'end', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'settings', 'accept', 'decline', 'accept_all' );
+ $banner_structure['c6'] = array();
+
+ $the_options['button_accept_all_btn_min_width'] = 132;
+ $the_options['button_accept_all_btn_min_width1'] = 132;
+ $the_options['button_accept_all_btn_min_width2'] = 132;
+ $the_options['button_accept_button_min_width'] = 132;
+ $the_options['button_accept_button_min_width1'] = 132;
+ $the_options['button_accept_button_min_width2'] = 132;
+ $the_options['button_decline_button_min_width'] = 132;
+ $the_options['button_decline_button_min_width1'] = 132;
+ $the_options['button_decline_button_min_width2'] = 132;
+ $the_options['button_settings_button_min_width'] = 132;
+ $the_options['button_settings_button_min_width1'] = 132;
+ $the_options['button_settings_button_min_width2'] = 132;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ $the_options['cookie_bar_padding'] = 14;
+ $the_options['cookie_bar_padding1'] = 14;
+ $the_options['cookie_bar_padding2'] = 14;
+ $the_options['cookie_bar_horizontal_padding'] = 30;
+ $the_options['cookie_bar_horizontal_padding1'] = 30;
+ $the_options['cookie_bar_horizontal_padding2'] = 30;
+ $the_options['cookie_bar_vertical_padding'] = 14;
+ $the_options['cookie_bar_vertical_padding1'] = 14;
+ $the_options['cookie_bar_vertical_padding2'] = 14;
+ $the_options['cookie_bar_spacing'] = 5;
+ $the_options['cookie_bar_spacing1'] = 5;
+ $the_options['cookie_bar_spacing2'] = 5;
+
+ } elseif ( 'dark' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c5'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'end', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'decline', 'settings' );
+ $banner_structure['c6'] = array( 'accept', 'accept_all' );
+
+ $the_options['button_accept_all_btn_min_width'] = 110;
+ $the_options['button_accept_all_btn_min_width1'] = 110;
+ $the_options['button_accept_all_btn_min_width2'] = 110;
+ $the_options['button_accept_button_min_width'] = 100;
+ $the_options['button_accept_button_min_width1'] = 100;
+ $the_options['button_accept_button_min_width2'] = 100;
+ $the_options['button_decline_button_min_width'] = 100;
+ $the_options['button_decline_button_min_width1'] = 100;
+ $the_options['button_decline_button_min_width2'] = 100;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ } elseif ( 'almond' === $template || 'gray_pink' === $template || 'bold' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c5'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'center', 'direction' => 'row' );
+
+ $banner_structure['c1'] = ( 'bold' === $template ) ? array( 'logo', 'heading' ) : array( 'heading', 'logo' );
+ $banner_structure['c5'] = array( 'accept_all', 'accept' );
+ $banner_structure['c6'] = array( 'decline', 'settings' );
+
+ $the_options['button_accept_all_btn_min_width'] = 140;
+ $the_options['button_accept_all_btn_min_width1'] = 140;
+ $the_options['button_accept_all_btn_min_width2'] = 140;
+ $the_options['button_accept_button_min_width'] = 140;
+ $the_options['button_accept_button_min_width1'] = 140;
+ $the_options['button_accept_button_min_width2'] = 140;
+ $the_options['button_decline_button_min_width'] = 140;
+ $the_options['button_decline_button_min_width1'] = 140;
+ $the_options['button_decline_button_min_width2'] = 140;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ } elseif ( 'blue_full' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c5'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'end', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'accept_all', 'accept' );
+ $banner_structure['c6'] = array( 'decline', 'settings' );
+
+ $the_options['button_accept_all_btn_min_width'] = 140;
+ $the_options['button_accept_all_btn_min_width1'] = 140;
+ $the_options['button_accept_all_btn_min_width2'] = 140;
+ $the_options['button_accept_button_min_width'] = 140;
+ $the_options['button_accept_button_min_width1'] = 140;
+ $the_options['button_accept_button_min_width2'] = 140;
+ $the_options['button_decline_button_min_width'] = 140;
+ $the_options['button_decline_button_min_width1'] = 140;
+ $the_options['button_decline_button_min_width2'] = 140;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'full';
+ $the_options['button_accept_all_btn_width1'] = 'full';
+ $the_options['button_accept_all_btn_width2'] = 'full';
+ $the_options['button_accept_button_width'] = 'full';
+ $the_options['button_accept_button_width1'] = 'full';
+ $the_options['button_accept_button_width2'] = 'full';
+ $the_options['button_decline_button_width'] = 'full';
+ $the_options['button_decline_button_width1'] = 'full';
+ $the_options['button_decline_button_width2'] = 'full';
+ $the_options['button_settings_button_width'] = 'full';
+ $the_options['button_settings_button_width1'] = 'full';
+ $the_options['button_settings_button_width2'] = 'full';
+
+ } elseif ( 'gray' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c5'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'center', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'accept_all', 'accept' );
+ $banner_structure['c6'] = array( 'decline', 'settings' );
+
+ $the_options['button_accept_all_btn_min_width'] = 140;
+ $the_options['button_accept_all_btn_min_width1'] = 140;
+ $the_options['button_accept_all_btn_min_width2'] = 140;
+ $the_options['button_accept_button_min_width'] = 140;
+ $the_options['button_accept_button_min_width1'] = 140;
+ $the_options['button_accept_button_min_width2'] = 140;
+ $the_options['button_decline_button_min_width'] = 140;
+ $the_options['button_decline_button_min_width1'] = 140;
+ $the_options['button_decline_button_min_width2'] = 140;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ } elseif ( 'blue_center' === $template || 'almond_row' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c5'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'center', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'accept_all', 'accept', 'settings', 'decline' );
+ $banner_structure['c6'] = array();
+
+ $the_options['button_accept_all_btn_min_width'] = 140;
+ $the_options['button_accept_all_btn_min_width1'] = 140;
+ $the_options['button_accept_all_btn_min_width2'] = 140;
+ $the_options['button_accept_button_min_width'] = 140;
+ $the_options['button_accept_button_min_width1'] = 140;
+ $the_options['button_accept_button_min_width2'] = 140;
+ $the_options['button_decline_button_min_width'] = 140;
+ $the_options['button_decline_button_min_width1'] = 140;
+ $the_options['button_decline_button_min_width2'] = 140;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ } elseif ( 'blue_center_column' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c5'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'center', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'decline', 'settings' );
+ $banner_structure['c6'] = array( 'accept', 'accept_all' );
+
+ $the_options['button_accept_all_btn_min_width'] = 280;
+ $the_options['button_accept_all_btn_min_width1'] = 280;
+ $the_options['button_accept_all_btn_min_width2'] = 280;
+ $the_options['button_accept_button_min_width'] = 140;
+ $the_options['button_accept_button_min_width1'] = 140;
+ $the_options['button_accept_button_min_width2'] = 140;
+ $the_options['button_decline_button_min_width'] = 135;
+ $the_options['button_decline_button_min_width1'] = 135;
+ $the_options['button_decline_button_min_width2'] = 135;
+ $the_options['button_settings_button_min_width'] = 135;
+ $the_options['button_settings_button_min_width1'] = 135;
+ $the_options['button_settings_button_min_width2'] = 135;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ } elseif ( 'blue_split' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c5'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'center', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'settings', 'accept_all' );
+ $banner_structure['c6'] = array( 'decline', 'accept' );
+
+ $the_options['button_accept_all_btn_min_width'] = 140;
+ $the_options['button_accept_all_btn_min_width1'] = 140;
+ $the_options['button_accept_all_btn_min_width2'] = 140;
+ $the_options['button_accept_button_min_width'] = 140;
+ $the_options['button_accept_button_min_width1'] = 140;
+ $the_options['button_accept_button_min_width2'] = 140;
+ $the_options['button_decline_button_min_width'] = 140;
+ $the_options['button_decline_button_min_width1'] = 140;
+ $the_options['button_decline_button_min_width2'] = 140;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+ }
+
+ $the_options['banner_layouts'] = wp_json_encode( $banner_layouts );
+ $the_options['banner_structure'] = wp_json_encode( $banner_structure );
}
}
// restrict posts when gpdr free is activated.
@@ -5873,33 +6218,360 @@
if ( 'none' !== $template && $saved_options['template'] !== $template ) {
$the_options['template'] = $template;
- if($template != "default") $the_options['selected_template_json'] = json_encode($this->templates_json[$template]);
+ if($template != "new_default") $the_options['selected_template_json'] = json_encode($this->templates_json[$template]);
else $the_options['selected_template_json'] = json_encode(get_option('gdpr_default_template_object'));
+
+
+
+ $banner_layouts = json_decode($the_options['banner_layouts'], true);
+ $banner_structure = json_decode($the_options['banner_structure'], true);
+ if ( ! is_array( $banner_layouts ) ) {
+ $banner_layouts = array();
+ }
+ if ( ! is_array( $banner_structure ) ) {
+ $banner_structure = array();
+ }
+
+ if ( 'new_default' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c5'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'end', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'settings', 'accept', 'decline', 'accept_all' );
+ $banner_structure['c6'] = array();
+
+ $the_options['button_accept_all_btn_min_width'] = 132;
+ $the_options['button_accept_all_btn_min_width1'] = 132;
+ $the_options['button_accept_all_btn_min_width2'] = 132;
+ $the_options['button_accept_button_min_width'] = 132;
+ $the_options['button_accept_button_min_width1'] = 132;
+ $the_options['button_accept_button_min_width2'] = 132;
+ $the_options['button_decline_button_min_width'] = 132;
+ $the_options['button_decline_button_min_width1'] = 132;
+ $the_options['button_decline_button_min_width2'] = 132;
+ $the_options['button_settings_button_min_width'] = 132;
+ $the_options['button_settings_button_min_width1'] = 132;
+ $the_options['button_settings_button_min_width2'] = 132;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ $the_options['cookie_bar_padding'] = 14;
+ $the_options['cookie_bar_padding1'] = 14;
+ $the_options['cookie_bar_padding2'] = 14;
+ $the_options['cookie_bar_horizontal_padding'] = 30;
+ $the_options['cookie_bar_horizontal_padding1'] = 30;
+ $the_options['cookie_bar_horizontal_padding2'] = 30;
+ $the_options['cookie_bar_vertical_padding'] = 14;
+ $the_options['cookie_bar_vertical_padding1'] = 14;
+ $the_options['cookie_bar_vertical_padding2'] = 14;
+ $the_options['cookie_bar_spacing'] = 5;
+ $the_options['cookie_bar_spacing1'] = 5;
+ $the_options['cookie_bar_spacing2'] = 5;
+
+ } elseif ( 'dark' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c5'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'end', 'direction' => 'row' );
+
+ $banner_structure['c1'] = array( 'logo', 'heading' );
+ $banner_structure['c5'] = array( 'decline', 'settings' );
+ $banner_structure['c6'] = array( 'accept', 'accept_all' );
+
+ $the_options['button_accept_all_btn_min_width'] = 110;
+ $the_options['button_accept_all_btn_min_width1'] = 110;
+ $the_options['button_accept_all_btn_min_width2'] = 110;
+ $the_options['button_accept_button_min_width'] = 100;
+ $the_options['button_accept_button_min_width1'] = 100;
+ $the_options['button_accept_button_min_width2'] = 100;
+ $the_options['button_decline_button_min_width'] = 100;
+ $the_options['button_decline_button_min_width1'] = 100;
+ $the_options['button_decline_button_min_width2'] = 100;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit';
+ $the_options['button_accept_button_width2'] = 'fit';
+ $the_options['button_decline_button_width'] = 'fit';
+ $the_options['button_decline_button_width1'] = 'fit';
+ $the_options['button_decline_button_width2'] = 'fit';
+ $the_options['button_settings_button_width'] = 'fit';
+ $the_options['button_settings_button_width1'] = 'fit';
+ $the_options['button_settings_button_width2'] = 'fit';
+
+ } elseif ( 'almond' === $template || 'gray_pink' === $template || 'bold' === $template ) {
+ $banner_layouts['c1'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c2'] = array( 'justify' => 'start', 'direction' => 'row' );
+ $banner_layouts['c4'] = array( 'justify' => 'start', 'direction' => 'col' );
+ $banner_layouts['c5'] = array( 'justify' => 'center', 'direction' => 'row' );
+ $banner_layouts['c6'] = array( 'justify' => 'center', 'direction' => 'row' );
+
+ $banner_structure['c1'] = ( 'bold' === $template ) ? array( 'logo', 'heading' ) : array( 'heading', 'logo' );
+ $banner_structure['c5'] = array( 'accept_all', 'accept' );
+ $banner_structure['c6'] = array( 'decline', 'settings' );
+
+ $the_options['button_accept_all_btn_min_width'] = 140;
+ $the_options['button_accept_all_btn_min_width1'] = 140;
+ $the_options['button_accept_all_btn_min_width2'] = 140;
+ $the_options['button_accept_button_min_width'] = 140;
+ $the_options['button_accept_button_min_width1'] = 140;
+ $the_options['button_accept_button_min_width2'] = 140;
+ $the_options['button_decline_button_min_width'] = 140;
+ $the_options['button_decline_button_min_width1'] = 140;
+ $the_options['button_decline_button_min_width2'] = 140;
+ $the_options['button_settings_button_min_width'] = 140;
+ $the_options['button_settings_button_min_width1'] = 140;
+ $the_options['button_settings_button_min_width2'] = 140;
+
+ $the_options['button_accept_all_btn_width'] = 'fit';
+ $the_options['button_accept_all_btn_width1'] = 'fit';
+ $the_options['button_accept_all_btn_width2'] = 'fit';
+ $the_options['button_accept_button_width'] = 'fit';
+ $the_options['button_accept_button_width1'] = 'fit'