Файловый менеджер - Редактировать - /home/bean7936/perfect-community.com/442aa3/uncode-privacy.tar
Назад
includes/views/admin/tmpl-consents.php 0000755 00000003350 15174671617 0014141 0 ustar 00 <script type="text/html" id="tmpl-consents"> <div class="postbox" id="consent-type-content-{{data.key}}"> <h2 class="hndle">{{data.name}} <span>(id: {{data.key}})</span><button class="notice-dismiss" type="button"><span class="screen-reader-text"><?php esc_html_e( 'Unregister this consent.', 'uncode-privacy' ); ?></span></button></h2> <input type="hidden" name="{{data.option_name}}[{{data.key}}][name]" value="{{data.name}}" /> <input type="hidden" name="{{data.option_name}}[{{data.key}}][id]" value="{{data.id}}" /> <div class="inside"> <table class="form-table"> <tr> <th><label for="required-{{data.key}}"><?php esc_html_e( 'Required', 'uncode-privacy' ); ?></label></th> <td> <label class="uncode-privacy-switch"> <input class="uncode-privacy-switch-checkbox" type="checkbox" name="{{data.option_name}}[{{data.key}}][required]" id="required-{{data.key}}"> <span class="uncode-privacy-slider round"></span> </label> </td> </tr> <tr> <th><label for="default-state-{{data.key}}"><?php esc_html_e( 'Active by default', 'uncode-privacy' ); ?></label></th> <td> <label class="uncode-privacy-switch"> <input type="checkbox" name="{{data.option_name}}[{{data.key}}][state]" id="default-state-{{data.key}}"> <span class="uncode-privacy-slider round"></span> </label> </td> </tr> <tr> <th><label for="consent-description-{{data.key}}"><?php esc_html_e( 'Consent description', 'uncode-privacy' ); ?></label></th> <td><textarea name="{{data.option_name}}[{{data.key}}][description]" id="consent-description-{{data.key}}" cols="53" rows="3" required></textarea></td> </tr> </table> </div><!-- .inside --> </div><!-- .postbox --> </script> includes/views/admin/settings.php 0000755 00000017714 15174671617 0013204 0 ustar 00 <div class="wrap uncode-privacy-wrap"> <h1><?php esc_html_e( 'Settings', 'uncode-privacy' ); ?></h1> <div class="nav-tab-wrapper"> <?php foreach ( $tabs as $tab => $value ) : ?> <a href="<?php echo '#' . $tab; ?>" class="nav-tab"> <?php echo esc_html( $value ); ?> </a> <?php endforeach; ?> </div> <?php settings_errors(); ?> <form action="options.php" method="post" class="uncode-privacy-settings-form"> <?php settings_fields( 'uncode-privacy' ); ?> <div class="uncode-privacy-tab hidden" data-id="general"> <h2><?php esc_html_e( 'General', 'uncode-privacy' ) ?></h2> <table class="form-table" data-id="general"> <tbody> <tr> <th scope="row"> <label for="uncode_privacy_privacy_policy_page"><?php esc_html_e( 'Privacy Policy Page', 'uncode-privacy' ) ?></label> </th> <td> <?php $pages = get_pages(); ?> <select name="uncode_privacy_privacy_policy_page" id="uncode_privacy_privacy_policy_page"> <option value=""><?php esc_html_e( '-- Select --', 'uncode-privacy' ) ?></option> <?php foreach ( $pages as $page ): ?> <option value="<?php echo esc_attr( $page->ID ) ?>" <?php selected( $privacy_policy_page, $page->ID ); ?>><?php echo esc_html( $page->post_title ); ?></option> <?php endforeach ?> </select> </td> </tr> <tr> <th scope="row"> <label for="uncode_privacy_privacy_banner_style"><?php esc_html_e( 'Privacy Banner Style', 'uncode-privacy' ) ?></label> </th> <td> <?php $privacy_banner_style = get_option( 'uncode_privacy_banner_style', '' ); ?> <select name="uncode_privacy_banner_style" id="uncode_privacy_banner_style"> <option value=""><?php esc_html_e( 'Default', 'uncode-privacy' ) ?></option> <option value="float" <?php selected( $privacy_banner_style, "float" ); ?>><?php esc_html_e( 'Float Style', 'uncode-privacy' ) ?></option> </select> </td> </tr> </tbody> </table> <h2 class="title"><?php esc_html_e( 'Privacy Center', 'uncode-privacy' ); ?></h2> <p> <?php esc_html_e( 'This section handles the Privacy Banner and Privacy Prefences main text.', 'uncode-privacy' ) ?><br> <strong><?php esc_html_e( 'Important:', 'uncode-privacy' ); ?></strong> <?php esc_html_e( 'If the Privacy Banner text is not filled out, the Privacy Banner will not show up.', 'uncode-privacy' ) ?> </p> <table class="form-table" data-id="general"> <tbody> <tr> <th scope="row"> <label for="uncode_privacy_cookie_banner_content"><?php esc_html_e( 'Privacy Banner Text', 'uncode-privacy' ) ?></label> </th> <td> <?php $privacy_bar_content = get_option( 'uncode_privacy_cookie_banner_content', '' ); ?> <textarea name="uncode_privacy_cookie_banner_content" id="uncode_privacy_cookie_banner_content" cols="80" rows="6"><?php echo esc_html( $privacy_bar_content ); ?></textarea> </td> </tr> <tr> <th scope="row"> <label for="uncode_privacy_cookie_privacy_excerpt"><?php esc_html_e( 'Privacy Text', 'uncode-privacy' ) ?></label> </th> <td> <?php $privacy_excerpt = get_option( 'uncode_privacy_cookie_privacy_excerpt', '' ); ?> <textarea name="uncode_privacy_cookie_privacy_excerpt" id="uncode_privacy_cookie_privacy_excerpt" cols="80" rows="6"><?php echo esc_html( $privacy_excerpt ); ?></textarea> <p class="description"><?php esc_html_e( 'This will appear in the consent section of the privacy preference window.', 'uncode-privacy' ); ?></p> </td> </tr> </tbody> </table> <h2 class="title"><?php esc_html_e( 'Consent Notice', 'uncode-privacy' ); ?></h2> <p> <?php esc_html_e( 'This section handles the fallback text that will appear when a consent hasn\'t been approved yet.', 'uncode-privacy' ) ?><br> <strong><?php esc_html_e( 'Important:', 'uncode-privacy' ); ?></strong> <?php echo wp_kses( __( 'No HTML code is allowed. Use the shortcode <code>[uncode_privacy_box]Your Text[/uncode_privacy_box]</code> to print a link that opens the preferences box.', 'uncode-privacy' ), array( 'code' => array() ) ); ?> </p> <table class="form-table" data-id="general"> <tbody> <tr> <th scope="row"> <label for="uncode_privacy_fallback"><?php esc_html_e( 'Consent Notice Text', 'uncode-privacy' ) ?></label> </th> <td> <?php $privacy_bar_content = get_option( 'uncode_privacy_fallback', ( esc_html__('This content is blocked. Please review your [uncode_privacy_box]Privacy Settings[/uncode_privacy_box].', 'uncode-privacy' ) ) ); ?> <textarea name="uncode_privacy_fallback" id="uncode_privacy_fallback" cols="80" rows="6"><?php echo esc_html( $privacy_bar_content ); ?></textarea> </td> </tr> </tbody> </table> </div> <div class="uncode-privacy-tab hidden" data-id="consents"> <h2><?php esc_html_e( 'Consents', 'uncode-privacy' ) ?></h2> <input type="text" id="type-of-consent" class="regular-text" placeholder="<?php esc_attr_e( 'Type of consent', 'uncode-privacy' ); ?>"> <button class="button button-primary add-consent"><?php esc_html_e( 'Add consent', 'uncode-privacy' ); ?></button> <div id="consent-tabs"> <?php $consent_types = uncode_toolkit_privacy_get_consent_types(); ?> <?php if ( ! empty( $consent_types ) ) : ?> <?php foreach ( $consent_types as $consent_key => $consent ) : ?> <div class="postbox" id="consent-type-content-<?php echo esc_attr( $consent_key ); ?>"> <h2 class="hndle"><?php echo esc_html( $consent['name'] ); ?> <span>(id: <?php echo esc_html( $consent_key ); ?>)</span><button class="notice-dismiss" type="button"><span class="screen-reader-text"><?php esc_html_e( 'Unregister this consent.', 'uncode-privacy' ) ?></span></button></h2> <input type="hidden" name="<?php echo esc_attr( 'uncode_privacy_consent_types' ); ?>[<?php echo esc_attr( $consent_key ); ?>][name]" value="<?php echo esc_attr( $consent['name'] ); ?>" /> <div class="inside"> <table class="form-table"> <tr> <th><label for="required-<?php echo esc_attr( $consent_key ); ?>"><?php esc_html_e( 'Required', 'uncode-privacy' ); ?></label></th> <td> <label class="uncode-privacy-switch"> <input type="checkbox" class="uncode-privacy-switch-checkbox" name="<?php echo esc_attr( 'uncode_privacy_consent_types' ); ?>[<?php echo esc_attr( $consent_key ); ?>][required]" <?php checked( esc_attr( $consent['required'] ), 1 ); ?> id="required-<?php echo esc_attr( $consent_key ); ?>"> <span class="uncode-privacy-slider round"></span> </label> </td> </tr> <tr> <th><label for="default-state-<?php echo esc_attr( $consent_key ); ?>"><?php esc_html_e( 'Active by default', 'uncode-privacy' ); ?></label></th> <td> <label class="uncode-privacy-switch"> <?php $state_checked = isset( $consent['state'] ) && $consent['state'] ? true : false; ?> <input type="checkbox" name="<?php echo esc_attr( 'uncode_privacy_consent_types' ); ?>[<?php echo esc_attr( $consent_key ); ?>][state]" <?php checked( $state_checked, 1 ); ?> id="default-state-<?php echo esc_attr( $consent_key ); ?>"> <span class="uncode-privacy-slider round"></span> </label> </td> </tr> <tr> <th><label for="consent-description-<?php echo esc_attr( $consent_key ); ?>"><?php esc_html_e( 'Consent description', 'uncode-privacy' ); ?></label></th> <td><textarea name="<?php echo esc_attr( 'uncode_privacy_consent_types' ); ?>[<?php echo esc_attr( $consent_key ); ?>][description]" id="consent-description-<?php echo esc_attr( $consent_key ); ?>" cols="53" rows="3" required><?php echo esc_html( $consent['description'] ); ?></textarea></td> </tr> </table> </div><!-- .inside --> </div><!-- .postbox --> <?php endforeach ?> <?php endif ?> </div> </div> <?php submit_button(); ?> </form> </div> includes/views/public/privacy-bar.php 0000755 00000001201 15174671617 0013731 0 ustar 00 <div class="gdpr gdpr-privacy-bar <?php echo $style ? 'limit-width gdpr-privacy-bar--' . $style : 'gdpr-privacy-bar--default'; ?>" style="display:none;" data-nosnippet="true"> <div class="gdpr-wrapper"> <div class="gdpr-content"> <p> <?php echo nl2br( wp_kses_post( $content ) ); ?> </p> </div> <div class="gdpr-right"> <button class="gdpr-preferences" type="button"><?php esc_html_e( 'Privacy Preferences', 'uncode-privacy' ); ?></button> <button class="gdpr-agreement <?php echo $style ? '' . $style : 'btn-accent'; ?> btn-flat" type="button"><?php echo esc_html( $button_text ); ?></button> </div> </div> </div> includes/views/public/privacy-preferences-modal.php 0000755 00000006643 15174671617 0016577 0 ustar 00 <div class="gdpr gdpr-privacy-preferences" data-nosnippet="true"> <div class="gdpr-wrapper"> <form method="post" class="gdpr-privacy-preferences-frm" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>"> <input type="hidden" name="action" value="uncode_privacy_update_privacy_preferences"> <?php wp_nonce_field( 'uncode-privacy-update_privacy_preferences', 'update-privacy-preferences-nonce' ); ?> <header> <div class="gdpr-box-title"> <h3><?php esc_html_e( 'Privacy Preference Center', 'uncode-privacy' ); ?></h3> <span class="gdpr-close"></span> </div> </header> <div class="gdpr-content"> <div class="gdpr-tab-content"> <div class="gdpr-consent-management gdpr-active"> <header> <h4><?php esc_html_e( 'Privacy Preferences', 'uncode-privacy' ); ?></h4> </header> <div class="gdpr-info"> <p><?php echo nl2br( esc_html( $cookie_privacy_excerpt ) ); ?></p> <?php if ( ! empty( $consent_types ) ) : ?> <?php foreach ( $consent_types as $consent_key => $type ) : ?> <div class="gdpr-cookies-used"> <div class="gdpr-cookie-title"> <p><?php echo esc_html( $type['name'] ); ?></p> <?php if ( $type['required'] ) : ?> <span class="gdpr-always-active"><?php esc_html_e( 'Required', 'uncode-privacy' ); ?></span> <input type="hidden" name="user_consents[]" value="<?php echo esc_attr( $consent_key ); ?>" style="display:none;"> <?php else : ?> <?php if ( isset( $type[ 'state' ] ) && $type[ 'state' ] ) : ?> <?php $has_consent_off = in_array( $consent_key . '-off', $user_consents ) ? true : false; ?> <input type="hidden" name="consents_default_on_list[]" value="<?php echo esc_attr( $consent_key ); ?>"> <label class="gdpr-switch"> <input id="gdpr-consent-<?php echo esc_attr( $consent_key ); ?>" class="gdpr-consent-switch" type="checkbox" name="user_consents[]" value="<?php echo esc_attr( $consent_key ); ?>" <?php echo checked( ! $has_consent_off , 1, false ); ?> data-default-on="true"> <span class="gdpr-slider round"></span> </label> <?php else: ?> <label class="gdpr-switch"> <input id="gdpr-consent-<?php echo esc_attr( $consent_key ); ?>" class="gdpr-consent-switch" type="checkbox" name="user_consents[]" value="<?php echo esc_attr( $consent_key ); ?>" <?php echo ! empty( $user_consents ) ? checked( in_array( $consent_key, $user_consents, true ), 1, false ) : ''; ?> data-default-on="false"> <span class="gdpr-slider round"></span> </label> <?php endif; ?> <?php endif; ?> </div> <div class="gdpr-cookies"> <span><?php echo wp_kses( $type['description'], $this->allowed_html ); ?></span> </div> </div> <?php endforeach; ?> <?php endif; ?> </div> </div> </div> </div> <footer> <input type="submit" class="btn-accent btn-flat" value="<?php esc_attr_e( 'Save Preferences', 'uncode-privacy' ); ?>"> <?php if ( $privacy_policy_page ) : ?> <span><a href="<?php echo esc_url( apply_filters( 'uncode_privacy_policy_page_link', get_permalink( $privacy_policy_page ) ) ); ?>" target="_blank"><?php esc_html_e( 'Privacy Policy', 'uncode-privacy' ); ?></a></span> <?php endif ?> </footer> </form> </div> </div> includes/class-uncode-toolkit-privacy-public.php 0000755 00000015721 15174671617 0016105 0 ustar 00 <?php /** * Public related functions. */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( ! class_exists( 'Uncode_Toolkit_Privacy_Public' ) ) : /** * Uncode_Toolkit_Privacy_Public Class */ class Uncode_Toolkit_Privacy_Public { /** * The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. */ private $version; /** * Allowed HTML for wp_kses. */ private $allowed_html; /** * Get things going */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; $this->allowed_html = array( 'a' => array( 'href' => true, 'title' => true, 'target' => true, ), ); } /** * Register the stylesheets for the frontend. */ public function enqueue_styles() { // add_thickbox(); wp_enqueue_style( $this->plugin_name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/css/uncode-privacy-public.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the frontend. */ public function enqueue_scripts() { $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( 'js-cookie', plugin_dir_url( dirname( __FILE__ ) ) . 'assets/js/js-cookie' . $suffix . '.js', array(), '2.2.0', true ); wp_enqueue_script( $this->plugin_name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/js/uncode-privacy-public' . $suffix . '.js', array( 'jquery', 'js-cookie' ), $this->version, true ); $accent_color = false; if ( function_exists( 'ot_options_id' ) ) { if ( is_multisite() ) { $uncode_option = get_blog_option( get_current_blog_id(), ot_options_id() ); } else { $uncode_option = get_option( ot_options_id() ); } global $front_background_colors; if ( $front_background_colors && isset( $uncode_option[ '_uncode_accent_color' ] ) && isset ( $front_background_colors[ $uncode_option[ '_uncode_accent_color' ] ] ) ) { $accent_color = $front_background_colors[ $uncode_option[ '_uncode_accent_color' ] ]; } } $accent_color = $accent_color ? $accent_color : '#006cff'; $privacy_parameters = array( 'accent_color' => $accent_color ); wp_localize_script( $this->plugin_name, 'Uncode_Privacy_Parameters', $privacy_parameters ); } /** * Set plugin cookies */ public function set_plugin_cookies() { $user_id = get_current_user_id(); $secure_cookie = is_ssl(); if ( ! isset( $_COOKIE['uncode_privacy']['consent_types'] ) ) { if ( ! $user_id ) { setcookie( 'uncode_privacy[consent_types]', '[]', $this->get_cookies_conf() ); } else { $user_consents = get_user_meta( $user_id, 'uncode_privacy_consents' ); setcookie( "uncode_privacy[consent_types]", json_encode( $user_consents ), $this->get_cookies_conf() ); } } else { if ( $user_id ) { $user_consents = (array) get_user_meta( $user_id, 'uncode_privacy_consents' ); $cookie_consents = (array) json_decode( wp_unslash( $_COOKIE['uncode_privacy']['consent_types'] ) ); $intersect = array_intersect( $user_consents, $cookie_consents ); $diff = array_merge( array_diff( $user_consents, $intersect ), array_diff( $cookie_consents, $intersect ) ); if ( ! empty( $diff ) ) { setcookie( "uncode_privacy[consent_types]", json_encode( $user_consents ), $this->get_cookies_conf() ); } } } } /** * Append overlay */ public function overlay() { echo '<div class="gdpr-overlay"></div>'; } /** * Print privacy */ public function privacy_bar() { $style = get_option( 'uncode_privacy_banner_style', '' ); $content = get_option( 'uncode_privacy_cookie_banner_content', '' ); $button_text = apply_filters( 'uncode_privacy_privacy_bar_button_text', esc_html__( 'I Agree', 'uncode-privacy' ) ); if ( empty( $content ) ) { return; } include plugin_dir_path( __FILE__ ) . 'views/public/privacy-bar.php'; } /** * Output privacy preferences modal. */ public function privacy_preferences_modal() { $cookie_privacy_excerpt = get_option( 'uncode_privacy_cookie_privacy_excerpt', '' ); $consent_types = uncode_toolkit_privacy_get_consent_types(); $privacy_policy_page = get_option( 'uncode_privacy_privacy_policy_page', 0 ); $user_consents = isset( $_COOKIE['uncode_privacy']['consent_types'] ) ? json_decode( wp_unslash( $_COOKIE['uncode_privacy']['consent_types'] ) ) : array(); include plugin_dir_path( __FILE__ ) . 'views/public/privacy-preferences-modal.php'; } /** * Update the user allowed types of consent. * If the user is logged in, we also save consent to user meta. */ public function update_privacy_preferences() { if ( ! isset( $_POST[ 'update-privacy-preferences-nonce' ] ) || ( apply_filters( 'uncode_privacy_enable_nonce_privacy_preferences', true ) && ! wp_verify_nonce( sanitize_key( $_POST[ 'update-privacy-preferences-nonce' ] ), 'uncode-privacy-update_privacy_preferences' ) ) ) { wp_die( esc_html__( 'We could not verify the the security token. Please try again.', 'uncode-privacy' ) ); } $consents_default_on_list = isset( $_POST[ 'consents_default_on_list' ] ) ? $_POST[ 'consents_default_on_list' ] : array(); $consents_default_on_list = array_map( 'sanitize_text_field', (array) $consents_default_on_list ); $consents = isset( $_POST[ 'user_consents' ] ) ? $_POST[ 'user_consents' ] : array(); $consents = array_map( 'sanitize_text_field', (array) $consents ); $consents_to_save = array(); // First save all consents that are on by default to off (if unchecked) foreach ( $consents_default_on_list as $consents_on ) { if ( ! in_array( $consents_on, $consents ) ) { $consents_to_save[] = $consents_on . '-off'; } } // Then save the other consents foreach ( $consents as $consent_id ) { if ( in_array( $consent_id, $consents_default_on_list ) ) { $consents_to_save[] = $consent_id . '-on'; } else { $consents_to_save[] = $consent_id; } } $consents_as_json = json_encode( $consents_to_save ); setcookie( "uncode_privacy[consent_types]", $consents_as_json, $this->get_cookies_conf() ); if ( is_user_logged_in() ) { $user = wp_get_current_user(); if ( apply_filters( 'uncode_privacy_save_privacy_preferences_in_user_meta', true ) ) { if ( ! empty( $consents_to_save ) ) { delete_user_meta( $user->ID, 'uncode_privacy_consents' ); foreach ( $consents_to_save as $consent ) { $consent = sanitize_text_field( wp_unslash( $consent ) ); add_user_meta( $user->ID, 'uncode_privacy_consents', $consent ); } } } } $url = esc_url_raw( wp_get_referer() ); $url = add_query_arg( 'privacy', 'updated', $url ); wp_safe_redirect( $url ); exit; } /** * Get cookies conf */ public function get_cookies_conf() { $arr_cookie_options = array ( 'expires' => time() + YEAR_IN_SECONDS, 'path' => '/', 'secure' => is_ssl(), 'samesite' => 'Strict' ); return apply_filters( 'uncode_privacy_get_cookies_req_options', $arr_cookie_options ); } } endif; includes/class-uncode-toolkit-privacy-admin.php 0000755 00000007302 15174671617 0015713 0 ustar 00 <?php /** * Admin related functions. */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( ! class_exists( 'Uncode_Toolkit_Privacy_Admin' ) ) : /** * Uncode_Toolkit_Privacy_Admin Class */ class Uncode_Toolkit_Privacy_Admin { /** * The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. */ private $version; /** * Allowed HTML for wp_kses. */ private $allowed_html; /** * Get things going */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; $this->allowed_html = array( 'a' => array( 'href' => true, 'title' => true, 'target' => true, ), ); } /** * Register the stylesheets for the admin area. */ public function enqueue_styles() { // add_thickbox(); wp_enqueue_style( $this->plugin_name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/css/uncode-privacy-admin.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the admin area. */ public function enqueue_scripts() { $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( $this->plugin_name, plugin_dir_url( dirname( __FILE__ ) ) . 'assets/js/uncode-privacy-admin' . $suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-sortable' ), $this->version, true ); } /** * Adds a menu page for the plugin. */ public function add_menu() { add_submenu_page( 'uncode-system-status', esc_html__( 'Privacy', 'uncode-privacy' ), esc_html__( 'Privacy', 'uncode-privacy' ), 'edit_theme_options', 'uncode-privacy-settings', array( $this, 'settings_page_template' ) ); } /** * Register settings. */ public function register_settings() { $settings = array( 'uncode_privacy_privacy_policy_page' => 'intval', 'uncode_privacy_banner_style' => 'sanitize_text_field', 'uncode_privacy_cookie_banner_content' => array( $this, 'sanitize_with_links' ), 'uncode_privacy_cookie_privacy_excerpt' => 'sanitize_textarea_field', 'uncode_privacy_fallback' => 'sanitize_textarea_field', 'uncode_privacy_consent_types' => array( $this, 'sanitize_consents' ), ); foreach ( $settings as $option_name => $sanitize_callback ) { register_setting( 'uncode-privacy', $option_name, array( 'sanitize_callback' => $sanitize_callback ) ); } } /** * Settings Page */ public function settings_page_template() { $privacy_policy_page = get_option( 'uncode_privacy_privacy_policy_page', 0 ); $tabs = array( 'general' => esc_html__( 'General', 'uncode-privacy' ), 'consents' => esc_html__( 'Consents', 'uncode-privacy' ), ); include_once plugin_dir_path( __FILE__ ) . 'views/admin/tmpl-consents.php'; include plugin_dir_path( __FILE__ ) . 'views/admin/settings.php'; } /** * Sanitize content but allow links. */ public function sanitize_with_links( $string ) { return wp_kses( $string, $this->allowed_html ); } /** * Sanitize the consents option when saving. */ public function sanitize_consents( $consents ) { $output = array(); if ( ! is_array( $consents ) ) { return $consents; } foreach ( $consents as $key => $props ) { if ( '' === $props[ 'name' ] || '' === $props[ 'description' ] ) { unset( $consents[ $key ] ); continue; } $output[ $key ] = array( 'name' => sanitize_text_field( wp_unslash( $props[ 'name' ] ) ), 'required' => isset( $props[ 'required' ] ) ? boolval( $props[ 'required' ] ) : 0, 'state' => isset( $props[ 'state' ] ) ? boolval( $props[ 'state' ] ) : 0, 'description' => wp_kses( wp_unslash( $props[ 'description' ] ), $this->allowed_html ), ); } return $output; } } endif; includes/class-uncode-toolkit-privacy.php 0000755 00000006161 15174671617 0014627 0 ustar 00 <?php /** * Main Class. */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } if ( ! class_exists( 'Uncode_Toolkit_Privacy' ) ) : /** * Uncode_Toolkit_Privacy Class */ class Uncode_Toolkit_Privacy { /** * The unique identifier of this plugin. */ protected $plugin_name; /** * Plugin's version. */ protected $version; /** * Get things going */ public function __construct() { if ( defined( 'UNCODE_TOOLKIT_PRIVACY_VERSION' ) ) { $this->version = UNCODE_TOOLKIT_PRIVACY_VERSION; } else { $this->version = '1.0.0'; } $this->plugin_name = 'uncode-privacy'; $this->load_dependencies(); $this->admin_hooks(); $this->public_hooks(); if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) OR ( defined( 'DOING_CRON' ) && DOING_CRON ) OR ( defined( 'DOING_AJAX' ) && DOING_AJAX ) OR ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) ) { return; } } /** * Load the required dependencies for this plugin. */ private function load_dependencies() { /** * Admin related fucntions. */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-uncode-toolkit-privacy-admin.php'; /** * Frontend related fucntions. */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-uncode-toolkit-privacy-public.php'; } /** * Admin related hooks */ private function admin_hooks() { $plugin_admin = new Uncode_Toolkit_Privacy_Admin( $this->get_plugin_name(), $this->get_version() ); add_action( 'plugins_loaded', array( $this, 'set_locale' ) ); add_action( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ) ); add_action( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ) ); add_action( 'admin_menu', array( $plugin_admin, 'add_menu' ), 89 ); add_action( 'admin_init', array( $plugin_admin, 'register_settings' ) ); } /** * Frontend related hooks */ private function public_hooks() { $plugin_public = new Uncode_Toolkit_Privacy_Public( $this->get_plugin_name(), $this->get_version() ); add_action( 'wp_enqueue_scripts', array( $plugin_public, 'enqueue_styles' ) ); add_action( 'wp_enqueue_scripts', array( $plugin_public, 'enqueue_scripts' ) ); add_action( 'init', array( $plugin_public, 'set_plugin_cookies' ) ); add_action( 'wp_footer', array( $plugin_public, 'overlay' ) ); add_action( 'wp_footer', array( $plugin_public, 'privacy_bar' ) ); add_action( 'wp_footer', array( $plugin_public, 'privacy_preferences_modal' ) ); add_action( 'admin_post_uncode_privacy_update_privacy_preferences', array( $plugin_public, 'update_privacy_preferences' ) ); add_action( 'admin_post_nopriv_uncode_privacy_update_privacy_preferences', array( $plugin_public, 'update_privacy_preferences' ) ); } /** * Load Text Domain */ public function set_locale() { load_plugin_textdomain( 'uncode-privacy', false, plugin_dir_url( dirname( __FILE__ ) ) . 'languages/' ); } /** * The name of the plugin */ public function get_plugin_name() { return $this->plugin_name; } /** * Retrieve the version number of the plugin. */ public function get_version() { return $this->version; } } endif; includes/uncode-toolkit-privacy-helper-functions.php 0000755 00000006344 15174671617 0017012 0 ustar 00 <?php /** * Helper Functions. */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * Gets an array of consent types. */ function uncode_toolkit_privacy_get_consent_types() { $consent_types = is_array( get_option( 'uncode_privacy_consent_types' ) ) ? get_option( 'uncode_privacy_consent_types' ) : array(); $consent_types = apply_filters( 'uncode_privacy_get_consent_types', $consent_types ); return $consent_types; } /** * Checks if a user gave consent. */ function uncode_toolkit_privacy_has_consent( $consent ) { if ( apply_filters( 'uncode_privacy_skip_consent_check', false, $consent ) ) { return true; } $is_consent_on_by_default = uncode_toolkit_privacy_is_consent_on_by_default( $consent ); if ( is_user_logged_in() ) { $user = wp_get_current_user(); $consents = (array) get_user_meta( $user->ID, 'uncode_privacy_consents' ); } else if ( isset( $_COOKIE[ 'uncode_privacy' ][ 'consent_types' ] ) && ! empty( $_COOKIE[ 'uncode_privacy' ][ 'consent_types' ] ) ) { $consents = array_map( 'sanitize_text_field', (array) json_decode( wp_unslash( $_COOKIE[ 'uncode_privacy' ][ 'consent_types' ] ) ) ); } if ( isset( $consents ) && ! empty( $consents ) ) { // Handle default enabled consents. Consent is disabled only if is set to off // (ie. we have the record 'consent_id-off'). Otherwise is always enabled. if ( $is_consent_on_by_default && ! in_array( $consent . '-off', $consents ) ) { return true; } if ( in_array( $consent, $consents ) ) { return true; } } else if ( $is_consent_on_by_default ) { // Empty consents but consent enabled by default = allowed return true; } return false; } /** * Create consent shortcode. */ function uncode_toolkit_privacy_consent_shortcode( $atts, $content = null ) { $atts = shortcode_atts( array( 'id' => '', 'logic' => 'include', ), $atts, 'uncode_privacy_consent' ); if ( ! function_exists( 'uncode_privacy_check_needed' ) || ! function_exists( 'uncode_privacy_has_consent' ) ) { return; // ??? } if ( $atts['id'] !== '' && uncode_privacy_check_needed( $atts['id'] ) ) { uncode_privacy_check_needed($atts['id']); if ( $atts['logic'] == 'include' && ! uncode_privacy_has_consent( $atts['id'] ) ) { return; } else if ( $atts['logic'] == 'exclude' && uncode_privacy_has_consent( $atts['id'] ) ) { return; } } return do_shortcode( $content ); } add_shortcode( 'uncode_privacy_consent', 'uncode_toolkit_privacy_consent_shortcode' ); /** * Create privacy box shortcode. */ function uncode_toolkit_privacy_box_shortcode( $atts, $content = null ) { $atts = shortcode_atts( array( 'class' => '', 'content' => esc_html__( 'Privacy Preferences', 'uncode-privacy' ), ), $atts, 'uncode_privacy_box' ); return '<a href="#" class="gdpr-preferences ' . esc_attr( $atts[ 'class' ] ) . '">' . esc_html( $atts[ 'content' ] ) . '</a>'; } add_shortcode( 'uncode_privacy_box', 'uncode_toolkit_privacy_box_shortcode' ); /** * Checks if a consent is on by default. */ function uncode_toolkit_privacy_is_consent_on_by_default( $consent_id ) { $consent_types = uncode_toolkit_privacy_get_consent_types(); if ( array_key_exists( $consent_id, $consent_types ) && $consent_types[ $consent_id ][ 'state' ] ) { return true; } return false; } wpml-config.xml 0000755 00000000400 15174671617 0007524 0 ustar 00 <wpml-config> <admin-texts> <key name="uncode_privacy_cookie_banner_content" /> <key name="uncode_privacy_cookie_privacy_excerpt" /> <key name="uncode_privacy_fallback" /> <key name="uncode_privacy_consent_types" /> </admin-texts> </wpml-config> uncode-privacy.php 0000755 00000001703 15174671617 0010230 0 ustar 00 <?php /** * Plugin Name: Uncode Privacy * Plugin URI: https://undsgn.com/ * Description: Privacy toolkit for Undsgn themes. * Version: 2.1.3 * Author: Undsgn * Author URI: https://undsgn.com/ * Requires at least: 4.0 * Tested up to: 5.4 * License: GPLv3 * License URI: http://www.gnu.org/licenses/gpl-3.0.html * Text Domain: uncode-privacy * Domain Path: languages * * Uncode Privacy is based on GDPR https://wordpress.org/plugins/gdpr/ * GDPR is distributed under the terms of the GNU GPL v2 or later. */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * Plugin version. */ define( 'UNCODE_TOOLKIT_PRIVACY_VERSION', '2.1.3' ); require plugin_dir_path( __FILE__ ) . 'includes/class-uncode-toolkit-privacy.php'; require plugin_dir_path( __FILE__ ) . 'includes/uncode-toolkit-privacy-helper-functions.php'; new Uncode_Toolkit_Privacy(); languages/uncode-privacy.pot 0000755 00000010544 15174671617 0012214 0 ustar 00 # Copyright (C) 2021 Uncode Privacy # This file is distributed under the same license as the Uncode Privacy package. msgid "" msgstr "" "Project-Id-Version: Uncode Privacy\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language-Team: Undsgn\n" "Report-Msgid-Bugs-To: https://undsgn.com/\n" "X-Poedit-Basepath: ..\n" "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPathExcluded-0: *.js\n" "X-Poedit-SourceCharset: UTF-8\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../includes/class-uncode-toolkit-privacy-admin.php:68, ../includes/class-uncode-toolkit-privacy-admin.php:68 msgid "Privacy" msgstr "" #: ../includes/class-uncode-toolkit-privacy-admin.php:95, ../includes/views/admin/settings.php:19 msgid "General" msgstr "" #: ../includes/class-uncode-toolkit-privacy-admin.php:96, ../includes/views/admin/settings.php:106 msgid "Consents" msgstr "" #: ../includes/class-uncode-toolkit-privacy-public.php:132 msgid "I Agree" msgstr "" #: ../includes/class-uncode-toolkit-privacy-public.php:159 msgid "We could not verify the the security token. Please try again." msgstr "" #: ../includes/uncode-toolkit-privacy-helper-functions.php:88, ../includes/views/public/privacy-bar.php:9, ../includes/views/public/privacy-preferences-modal.php:16 msgid "Privacy Preferences" msgstr "" #: ../includes/views/admin/settings.php:2 msgid "Settings" msgstr "" #: ../includes/views/admin/settings.php:24 msgid "Privacy Policy Page" msgstr "" #: ../includes/views/admin/settings.php:31 msgid "-- Select --" msgstr "" #: ../includes/views/admin/settings.php:40 msgid "Privacy Banner Style" msgstr "" #: ../includes/views/admin/settings.php:45 msgid "Default" msgstr "" #: ../includes/views/admin/settings.php:46 msgid "Float Style" msgstr "" #: ../includes/views/admin/settings.php:53 msgid "Privacy Center" msgstr "" #: ../includes/views/admin/settings.php:56 msgid "This section handles the Privacy Banner and Privacy Prefences main text." msgstr "" #: ../includes/views/admin/settings.php:57, ../includes/views/admin/settings.php:88 msgid "Important:" msgstr "" #: ../includes/views/admin/settings.php:57 msgid "If the Privacy Banner text is not filled out, the Privacy Banner will not show up." msgstr "" #: ../includes/views/admin/settings.php:64 msgid "Privacy Banner Text" msgstr "" #: ../includes/views/admin/settings.php:73 msgid "Privacy Text" msgstr "" #: ../includes/views/admin/settings.php:78 msgid "This will appear in the consent section of the privacy preference window." msgstr "" #: ../includes/views/admin/settings.php:84 msgid "Consent Notice" msgstr "" #: ../includes/views/admin/settings.php:87 msgid "This section handles the fallback text that will appear when a consent hasn't been approved yet." msgstr "" #: ../includes/views/admin/settings.php:88 msgid "No HTML code is allowed. Use the shortcode <code>[uncode_privacy_box]Your Text[/uncode_privacy_box]</code> to print a link that opens the preferences box." msgstr "" #: ../includes/views/admin/settings.php:94 msgid "Consent Notice Text" msgstr "" #: ../includes/views/admin/settings.php:97 msgid "This content is blocked. Please review your [uncode_privacy_box]Privacy Settings[/uncode_privacy_box]." msgstr "" #: ../includes/views/admin/settings.php:108 msgid "Type of consent" msgstr "" #: ../includes/views/admin/settings.php:110 msgid "Add consent" msgstr "" #: ../includes/views/admin/settings.php:119, ../includes/views/admin/tmpl-consents.php:3 msgid "Unregister this consent." msgstr "" #: ../includes/views/admin/settings.php:124, ../includes/views/admin/tmpl-consents.php:9, ../includes/views/public/privacy-preferences-modal.php:26 msgid "Required" msgstr "" #: ../includes/views/admin/settings.php:133, ../includes/views/admin/tmpl-consents.php:18 msgid "Active by default" msgstr "" #: ../includes/views/admin/settings.php:143, ../includes/views/admin/tmpl-consents.php:27 msgid "Consent description" msgstr "" #: ../includes/views/public/privacy-preferences-modal.php:8 msgid "Privacy Preference Center" msgstr "" #: ../includes/views/public/privacy-preferences-modal.php:61 msgid "Save Preferences" msgstr "" #: ../includes/views/public/privacy-preferences-modal.php:63 msgid "Privacy Policy" msgstr "" assets/css/uncode-privacy-admin.css 0000755 00000005504 15174671617 0013414 0 ustar 00 .uncode-privacy-wrap .uncode-privacy-settings-form #tabs, .uncode-privacy-wrap .uncode-privacy-settings-form #consent-tabs { margin-top: 20px; } .uncode-privacy-wrap .uncode-privacy-settings-form #tabs .hndle, .uncode-privacy-wrap .uncode-privacy-settings-form #consent-tabs .hndle { font-size: 16px; padding: 8px 12px; margin: 0; line-height: 1.4; } .uncode-privacy-wrap .uncode-privacy-settings-form #tabs .hndle span, .uncode-privacy-wrap .uncode-privacy-settings-form #consent-tabs .hndle span { font-size: 12px; } .uncode-privacy-wrap .uncode-privacy-switch { position: relative; display: inline-block; width: 45px; height: 24px; } .uncode-privacy-wrap .uncode-privacy-switch input { display: none; } .uncode-privacy-wrap .uncode-privacy-switch .uncode-privacy-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; } .uncode-privacy-wrap .uncode-privacy-switch .uncode-privacy-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; } .uncode-privacy-wrap .uncode-privacy-switch .uncode-privacy-slider.round { border-radius: 34px; } .uncode-privacy-wrap .uncode-privacy-switch .uncode-privacy-slider.round:before { border-radius: 50%; } .uncode-privacy-wrap .uncode-privacy-switch input:checked + .uncode-privacy-slider { background-color: #00b9eb; } .uncode-privacy-wrap .uncode-privacy-switch input:checked + .uncode-privacy-slider:before { transform: translateX(21px); } .uncode-privacy-wrap .uncode-privacy-switch input:focus + .uncode-privacy-slider { box-shadow: 0 0 1px #00b9eb; } .uncode-privacy-wrap #TB_ajaxContent pre { white-space: pre-wrap; word-wrap: break-word; } .uncode-privacy-wrap .uncode-privacy-hidden { display: none; } .uncode-privacy-wrap .uncode-privacy .spinner { display: none; visibility: visible; } .uncode-privacy-wrap #tabs .postbox .inside { margin: 0 !important; padding: 0 20px 20px 20px; } .uncode-privacy-wrap #tabs .postbox .inside .form-table { margin-top: 0; } .uncode-privacy-wrap #tabs .postbox .inside .tab-hosts .postbox { margin-bottom: 0; } .uncode-privacy-wrap #tabs .postbox .inside .tab-hosts .postbox .inside { padding-bottom: 0; background-color: #f9f9f9; } @media screen and (max-width: 1024px) { .uncode-privacy-wrap .form-table td { padding-right: 0; } .uncode-privacy-wrap .form-table td .button { margin-top: 5px; margin-bottom: 10px; } } @media screen and (max-width: 640px) { .uncode-privacy-wrap .postbox { width: 100%; } .uncode-privacy-wrap .postbox .notice-dismiss { padding: 8px; } .uncode-privacy-wrap .inside .regular-text { width: 100%; } .uncode-privacy-wrap .inside .button { margin-top: 5px; } } assets/css/uncode-privacy-public.css 0000755 00000042703 15174671617 0013604 0 ustar 00 .gdpr-hidden { display: none; } .gdpr-overlay { background: #141618; display: none; height: 100%; left: 0; opacity: .6; position: fixed; top: 0; width: 100%; z-index: 99999999; } .gdpr * { font-family: inherit !important; } .gdpr input[type="submit"], .gdpr button { border-radius: 2px; border-width: 0; box-shadow: none; font-family: inherit !important; font-size: 12px !important; font-weight: 600 !important; letter-spacing: -0.3px; line-height: 22px; padding: 9px 27px 9px 27px; text-shadow: none; text-transform: none; } .gdpr input[type="submit"].btn-accent.gdpr-agreement:focus, .gdpr input[type="submit"].btn-accent:focus, .gdpr button.btn-accent.gdpr-agreement:focus, .gdpr button.btn-accent:focus { color: #fff !important; } .gdpr img { width: 100%; } .gdpr-privacy-bar { background: rgba(0, 0, 0, 0.9); bottom: 0; color: #fff; left: 0; position: fixed; width: 100%; z-index: 9999999; } .gdpr-privacy-bar.gdpr-hide-bar { transition: bottom 1s ease-in-out; bottom: -999px; } .gdpr-privacy-bar.gdpr-privacy-bar--float.gdpr-hide-bar { transition: none; bottom: -999px; } .gdpr-privacy-bar .gdpr-wrapper { overflow: hidden; padding: 18px 27px; } .gdpr-privacy-bar .gdpr-wrapper p { font-size: 13px; margin: 0 0 18px; } .gdpr-privacy-bar .gdpr-wrapper a { color: #006cff; } .gdpr-privacy-bar .gdpr-preferences { background-color: transparent !important; color: #fff !important; } body:not(.rtl) .gdpr-privacy-bar .gdpr-preferences { padding: 0 27px 0 0 !important; } body.rtl .gdpr-privacy-bar .gdpr-preferences { padding: 0 0 0 27px !important; } .gdpr-privacy-bar.gdpr-privacy-bar--float { background: #000; border-radius: 4px; bottom: 18px; left: 5%; right: 5%; width: auto; margin-left: auto; margin-right: auto; } .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-wrapper { padding: 18px; } .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-wrapper p { font-size: 12px; font-weight: 500; } .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-agreement { background-color: #fff !important; color: #000 !important; font-weight: 500 !important; padding-bottom: 5px; padding-top: 5px; } .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-agreement:hover { background-color: #fff !important; color: #000 !important; } .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-preferences { font-weight: 500 !important; } body:not(.rtl) .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-preferences { padding: 0 18px 0 0 !important; } body.rtl .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-preferences { padding: 0 0 0 18px !important; } .gdpr-privacy-preferences .gdpr-wrapper, .gdpr-general-confirmation .gdpr-wrapper { border-radius: 2.5px; box-sizing: border-box; display: none; height: 100%; left: 50%; max-height: 700px; max-width: 1000px; overflow: hidden; overflow: visible; padding: 15px; position: fixed; top: 50%; transform: translate(-50%, -50%); width: 100%; z-index: 999999999; padding: 36px; } .gdpr-privacy-preferences form, .gdpr-general-confirmation form { box-shadow: 0 50px 50px -30px rgba(0, 0, 0, 0.2), 0 30px 50px 0 rgba(0, 0, 0, 0.15); height: 100%; position: relative; } .gdpr-privacy-preferences .gdpr-box-title, .gdpr-general-confirmation .gdpr-box-title { height: 0; position: relative; } .gdpr-privacy-preferences .gdpr-box-title h3, .gdpr-general-confirmation .gdpr-box-title h3 { display: none; } .gdpr-privacy-preferences .gdpr-close, .gdpr-general-confirmation .gdpr-close { color: #fff; cursor: pointer; line-height: 0; position: absolute; top: 50%; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-close, body:not(.rtl) .gdpr-general-confirmation .gdpr-close { right: -27px; } body.rtl .gdpr-privacy-preferences .gdpr-close, body.rtl .gdpr-general-confirmation .gdpr-close { left: -27px; } .gdpr-privacy-preferences .gdpr-close:before, .gdpr-general-confirmation .gdpr-close:before { content: '\e117'; font-family: uncodeicon !important; font-size: 18px; transition: all 400ms cubic-bezier(0.785, 0.135, 0.15, 0.86); display: inline-block; } .gdpr-privacy-preferences .gdpr-close:hover:before, .gdpr-general-confirmation .gdpr-close:hover:before { transform: rotate(180deg); } .gdpr-privacy-preferences footer, .gdpr-general-confirmation footer { background-color: #f7f7f7; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; border-top: 1px solid #eaeaea; bottom: 0; height: 96px; left: 0; margin-left: 0; overflow: hidden; padding: 18px 36px; position: absolute; right: 0; width: auto; } .gdpr-privacy-preferences footer input, .gdpr-general-confirmation footer input { margin-top: 0; } .gdpr-privacy-preferences footer span, .gdpr-general-confirmation footer span { margin-top: 9px; display: block; text-align: center; } .gdpr-privacy-preferences footer a, .gdpr-general-confirmation footer a { color: #555d66; display: inline-block; font-size: 12px; text-decoration: none; } .gdpr-privacy-preferences .gdpr-content, .gdpr-general-confirmation .gdpr-content { background: #fff; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; bottom: 0; left: 0; overflow: hidden; position: absolute; right: 0; top: 0; } .gdpr-privacy-preferences .gdpr-tab-content, .gdpr-general-confirmation .gdpr-tab-content { background-color: #fff; bottom: 76px; display: block; left: 0; overflow: hidden; position: absolute; right: 0; top: 0; } .gdpr-privacy-preferences .gdpr-tab-content header, .gdpr-general-confirmation .gdpr-tab-content header { padding: 36px 36px 0; } .gdpr-privacy-preferences .gdpr-tab-content h4, .gdpr-general-confirmation .gdpr-tab-content h4 { color: #303133; font-family: inherit !important; font-size: 16px; margin-bottom: 18px; margin-top: 0; } .gdpr-privacy-preferences .gdpr-tab-content > div, .gdpr-general-confirmation .gdpr-tab-content > div { max-height: 100%; overflow-y: auto; } .gdpr-privacy-preferences .gdpr-tab-content .gdpr-active, .gdpr-general-confirmation .gdpr-tab-content .gdpr-active { display: block; } .gdpr-privacy-preferences .gdpr-info, .gdpr-general-confirmation .gdpr-info { color: #72777c; font-size: 14px; font-weight: 400; padding: 0 36px 36px; } .gdpr-privacy-preferences .gdpr-info p, .gdpr-general-confirmation .gdpr-info p { color: #72777c; font-size: 13px; font-weight: 400; margin-bottom: 27px; margin-top: 0; } .gdpr-privacy-preferences .gdpr-info a, .gdpr-general-confirmation .gdpr-info a { color: #72777c; font-weight: 700; text-decoration: underline; } .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title p, .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title p { color: #303133; font-weight: 600; line-height: 1.1; margin-bottom: 0; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title p, body:not(.rtl) .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title p { padding-right: 100px; } body.rtl .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title p, body.rtl .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title p { padding-left: 100px; } .gdpr-privacy-preferences .gdpr-info .gdpr-cookies, .gdpr-general-confirmation .gdpr-info .gdpr-cookies { font-size: 12px; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-info .gdpr-cookies, body:not(.rtl) .gdpr-general-confirmation .gdpr-info .gdpr-cookies { padding-right: 100px; } body.rtl .gdpr-privacy-preferences .gdpr-info .gdpr-cookies, body.rtl .gdpr-general-confirmation .gdpr-info .gdpr-cookies { padding-left: 100px; } .gdpr-privacy-preferences .gdpr-info .gdpr-cookies-used, .gdpr-general-confirmation .gdpr-info .gdpr-cookies-used { border-top: 1px solid #eaeaea; margin-top: 18px; padding-top: 18px; position: relative; } .gdpr-privacy-preferences .gdpr-info .gdpr-cookies-used a, .gdpr-general-confirmation .gdpr-info .gdpr-cookies-used a { font-size: 12px; } .gdpr-privacy-preferences .gdpr-info .gdpr-always-active, .gdpr-general-confirmation .gdpr-info .gdpr-always-active { color: #303133; display: inline-block; font-size: 11px; font-weight: 700; padding: 5px 0; position: absolute; text-transform: uppercase; top: 15px; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-info .gdpr-always-active, body:not(.rtl) .gdpr-general-confirmation .gdpr-info .gdpr-always-active { right: 0; } body.rtl .gdpr-privacy-preferences .gdpr-info .gdpr-always-active, body.rtl .gdpr-general-confirmation .gdpr-info .gdpr-always-active { left: 0; } .gdpr-privacy-preferences .gdpr-info .gdpr-button, .gdpr-general-confirmation .gdpr-info .gdpr-button { position: absolute; top: 15px; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-info .gdpr-button, body:not(.rtl) .gdpr-general-confirmation .gdpr-info .gdpr-button { right: 0; } body.rtl .gdpr-privacy-preferences .gdpr-info .gdpr-button, body.rtl .gdpr-general-confirmation .gdpr-info .gdpr-button { left: 0; } .gdpr-switch { display: inline-block; height: 24px; margin-bottom: 0; min-width: 45px; position: absolute; top: 15px; } body:not(.rtl) .gdpr-switch { right: 0; } body.rtl .gdpr-switch { left: 0; } .gdpr-switch input { display: none !important; } .gdpr-switch .gdpr-slider { background-color: #ccc; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; } .gdpr-switch .gdpr-slider:before { background-color: white; bottom: 4px; content: ""; height: 16px; position: absolute; transition: .4s; width: 16px; } body:not(.rtl) .gdpr-switch .gdpr-slider:before { left: 4px; } body.rtl .gdpr-switch .gdpr-slider:before { right: 4px; } .gdpr-switch .gdpr-slider.round { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-radius: 34px; } .gdpr-switch .gdpr-slider.round:before { border-radius: 50%; } body:not(.rtl) .gdpr-switch input:checked + .gdpr-slider:before { transform: translateX(21px); } body.rtl .gdpr-switch input:checked + .gdpr-slider:before { transform: translateX(-21px); } /* ---------------------------------------------------------- #GDPR ---------------------------------------------------------- */ .tmb-consent-blocked:not(.tmb-lightbox) .t-entry-visual-overlay, .tmb-consent-blocked:not(.tmb-lightbox) .t-overlay-wrap { display: none; } .tmb-consent-blocked .pushed { margin-top: 0; } .tmb-consent-blocked .uncode-single-media-wrapper .pushed { display: table; height: 0; position: relative; width: 100%; } .tmb-consent-blocked .uncode-single-media-wrapper .pushed .uncode-noconsent-gdpr-poster img { height: auto !important; } .tmb-consent-blocked .uncode-single-media-wrapper .pushed .uncode-noconsent-gdpr-wrap-no-poster { height: 0; padding-top: 66.7%; } .uncode-noconsent-gdpr-wrap { background-size: cover; height: 100%; position: relative; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-poster { height: 100%; left: 0; position: absolute; top: 0; width: 100%; z-index: 0; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-poster, .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-poster img { transform: none !important; transition: none !important; } .uncode-single-media-wrapper .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-poster img { position: relative !important; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-overlay { background: #141618; height: 100%; left: 0; opacity: .5; position: absolute; top: 0; width: 100%; z-index: 1; } .uncode-noconsent-gdpr-wrap.uncode-noconsent-gdpr-wrap-no-poster .uncode-noconsent-gdpr-overlay { opacity: 1; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-holder { bottom: 0; display: table; height: 100%; left: 0; position: absolute; right: 0; top: 0; width: 100%; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap { color: #ffffff; display: table-cell; padding: 0 36px; position: relative; text-align: center; vertical-align: middle; width: 100%; z-index: 2; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap .uncode-noconsent-gdpr-icon, .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap .uncode-noconsent-gdpr-text { display: block; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap .uncode-noconsent-gdpr-icon { padding-bottom: 10px; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap .uncode-noconsent-gdpr-icon i.fa { font-size: 30px; margin-bottom: 18px; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap .uncode-noconsent-gdpr-text { display: block; font-size: 14px; font-weight: 400; line-height: 1.5; margin-top: 0; vertical-align: middle; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap .uncode-noconsent-gdpr-text .gdpr-preferences { color: #ffffff; font-weight: 600; text-decoration: underline; } .uncode-noconsent-gdpr-wrap .uncode-noconsent-gdpr-content-wrap .uncode-noconsent-gdpr-text .gdpr-preferences:hover { text-decoration: none; } .uncode_consent_notice { text-align: center; } .uncode_consent_notice i.fa { display: block; font-size: 30px; margin-bottom: 18px; } .uncode_consent_notice a { color: #ffffff !important; text-decoration: underline; } .uncode_consent_notice a:hover { text-decoration: none; } .wpcf7-acceptance .wpcf7-list-item-label { font-size: 13px; font-weight: 400; } body:not(.rtl) .wpcf7-acceptance .wpcf7-list-item-label { padding-left: 12px; } body.rtl .wpcf7-acceptance .wpcf7-list-item-label { padding-right: 12px; } .wpcf7-acceptance .wpcf7-list-item-label::after, .wpcf7-acceptance .wpcf7-list-item-label::before { display: none; } .comment-form-cookies-consent label { font-size: 13px; font-weight: 400; } body:not(.rtl) .comment-form-cookies-consent label { padding-left: 12px; } body.rtl .comment-form-cookies-consent label { padding-right: 12px; } @media (min-width: 320px) { .gdpr-privacy-bar .gdpr-right .gdpr-preferences { line-height: 40px; } body:not(.rtl) .gdpr-privacy-bar .gdpr-right .gdpr-agreement { float: right; } body.rtl .gdpr-privacy-bar .gdpr-right .gdpr-agreement { float: left; } } @media (min-width: 480px) { .gdpr-privacy-preferences footer, .gdpr-general-confirmation footer { height: 76px; } .gdpr-privacy-preferences footer input, .gdpr-general-confirmation footer input { width: auto !important; } .gdpr-privacy-preferences footer span, .gdpr-general-confirmation footer span { margin-top: 0; position: absolute; top: 50%; transform: translateY(-50%); } body:not(.rtl) .gdpr-privacy-preferences footer span, body:not(.rtl) .gdpr-general-confirmation footer span { right: 36px; } body.rtl .gdpr-privacy-preferences footer span, body.rtl .gdpr-general-confirmation footer span { left: 36px; } } @media (min-width: 570px) { .gdpr-privacy-preferences .gdpr-content, .gdpr-general-confirmation .gdpr-content { border-radius: 2px; } .gdpr-privacy-preferences .gdpr-tab-content, .gdpr-general-confirmation .gdpr-tab-content { display: block; } } @media (min-width: 768px) { .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title, .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title { display: inline-block; vertical-align: top; width: 180px; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title, body:not(.rtl) .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title { padding-right: 27px; } body.rtl .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title, body.rtl .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title { padding-left: 27px; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title p, body:not(.rtl) .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title p { padding-right: 0; } body.rtl .gdpr-privacy-preferences .gdpr-info .gdpr-cookie-title p, body.rtl .gdpr-general-confirmation .gdpr-info .gdpr-cookie-title p { padding-left: 0; } .gdpr-privacy-preferences .gdpr-info .gdpr-cookies, .gdpr-general-confirmation .gdpr-info .gdpr-cookies { display: inline-block; vertical-align: top; width: 330px; } body:not(.rtl) .gdpr-privacy-preferences .gdpr-info .gdpr-cookies, body:not(.rtl) .gdpr-general-confirmation .gdpr-info .gdpr-cookies { padding-right: 0 !important; } body.rtl .gdpr-privacy-preferences .gdpr-info .gdpr-cookies, body.rtl .gdpr-general-confirmation .gdpr-info .gdpr-cookies { padding-left: 0 !important; } } @media (min-width: 960px) { .gdpr-privacy-bar .gdpr-wrapper { padding-bottom: 27px; padding-top: 27px; } .gdpr-privacy-bar .gdpr-wrapper p { margin: 0; } body:not(.rtl) .gdpr-privacy-bar .gdpr-wrapper p { padding-right: 250px; } body.rtl .gdpr-privacy-bar .gdpr-wrapper p { padding-left: 250px; } .gdpr-privacy-bar .gdpr-right { position: absolute; top: 50%; transform: translateY(-50%); } body:not(.rtl) .gdpr-privacy-bar .gdpr-right { right: 36px; } body.rtl .gdpr-privacy-bar .gdpr-right { left: 36px; } .gdpr-privacy-bar .gdpr-right .gdpr-preferences { line-height: 22px; } body:not(.rtl) .gdpr-privacy-bar .gdpr-right .gdpr-agreement, body.rtl .gdpr-privacy-bar .gdpr-right .gdpr-agreement { float: none; } body:not(.rtl) .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-right { right: 18px; } body.rtl .gdpr-privacy-bar.gdpr-privacy-bar--float .gdpr-right { left: 18px; } .gdpr-privacy-preferences .gdpr-info .gdpr-cookies, .gdpr-general-confirmation .gdpr-info .gdpr-cookies { width: 550px; } } assets/js/uncode-privacy-public.min.js 0000755 00000005663 15174671617 0014042 0 ustar 00 (function($){"use strict";var query_args=location.search,base_url=location.protocol+"//"+location.host+location.pathname;if(-1!==query_args.indexOf("notify=1")){window.history.replaceState({},document.title,base_url)}window.uncode_toolkit_privacy_has_consent=function(consent){var consentSwitch=$("#gdpr-consent-"+consent);if(consentSwitch.length){if(consentSwitch.attr("data-default-on")==="true"&&consentSwitch.prop("checked")){return true}}if(Cookies.get("uncode_privacy[consent_types]")){var consentArray=JSON.parse(Cookies.get("uncode_privacy[consent_types]"));if(consentArray.indexOf(consent)>-1){return true}}return false};$(function(){if(!Cookies.get("uncode_privacy[privacy_bar]")){if($(".gdpr.gdpr-privacy-bar").hasClass("gdpr-privacy-bar--float")){$(".gdpr.gdpr-privacy-bar").show()}else{$(".gdpr.gdpr-privacy-bar").delay(1e3).slideDown(600)}}$(document).on("click",".gdpr.gdpr-privacy-bar .gdpr-agreement",function(){var secureFlag=location.protocol==="https:"?true:false;$(".gdpr.gdpr-privacy-bar").addClass("gdpr-hide-bar");Cookies.set("uncode_privacy[privacy_bar]",1,{expires:365,secure:secureFlag})});$(document).on("submit",".gdpr-privacy-preferences-frm",function(){var secureFlag=location.protocol==="https:"?true:false;Cookies.set("uncode_privacy[privacy_bar]",1,{expires:365,secure:secureFlag})});$(document).on("click",".gdpr-preferences",function(){var type=$(this).data("type");$(".gdpr-overlay").fadeIn();$("body").addClass("gdpr-noscroll");$(".gdpr.gdpr-privacy-preferences .gdpr-wrapper").fadeIn()});$(document).on("click",".gdpr.gdpr-privacy-preferences .gdpr-close, .gdpr-overlay",function(){$(".gdpr-overlay").fadeOut();$("body").removeClass("gdpr-noscroll");$(".gdpr.gdpr-privacy-preferences .gdpr-wrapper").fadeOut()});$("body").on("click",".gdpr-preferences",function(e){e.preventDefault();$(window).trigger("gdprOpen")}).on("click",".gdpr.gdpr-privacy-preferences .gdpr-close, .gdpr-overlay",function(){$(window).trigger("gdprClose")});var switches=$(".gdpr-switch").find("input");function add_active_color(el){el.next().css("background",Uncode_Privacy_Parameters.accent_color)}function add_default_color(el){el.next().css("background","#ccc")}switches.each(function(){var _this=$(this);if($("body").hasClass("logged-in")){if(_this.prop("checked")){add_active_color(_this)}}_this.on("change",function(){if(_this.prop("checked")){add_active_color(_this)}else{add_default_color(_this)}})});if(!$("body").hasClass("logged-in")){switches.each(function(){var _this=$(this);var type=_this.attr("name")=="user_consents[]"?"consent":"cookie";if(type=="consent"){var is_allowed=uncode_toolkit_privacy_has_consent(_this.val());if(is_allowed){_this.prop("checked",true);add_active_color(_this)}else{_this.prop("checked",false);add_default_color(_this)}}})}var banner_links=$(".gdpr-privacy-bar .gdpr-content").find("a");banner_links.each(function(){add_link_color($(this))});function add_link_color(el){el.css("color",Uncode_Privacy_Parameters.accent_color)}})})(jQuery); assets/js/js-cookie.js 0000755 00000007456 15174671617 0010741 0 ustar 00 /*! * JavaScript Cookie v2.2.0 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license */ ;(function (factory) { var registeredInModuleLoader = false; if (typeof define === 'function' && define.amd) { define(factory); registeredInModuleLoader = true; } if (typeof exports === 'object') { module.exports = factory(); registeredInModuleLoader = true; } if (!registeredInModuleLoader) { var OldCookies = window.Cookies; var api = window.Cookies = factory(); api.noConflict = function () { window.Cookies = OldCookies; return api; }; } }(function () { function extend () { var i = 0; var result = {}; for (; i < arguments.length; i++) { var attributes = arguments[ i ]; for (var key in attributes) { result[key] = attributes[key]; } } return result; } function init (converter) { function api (key, value, attributes) { var result; if (typeof document === 'undefined') { return; } // Write if (arguments.length > 1) { attributes = extend({ path: '/' }, api.defaults, attributes); if (typeof attributes.expires === 'number') { var expires = new Date(); expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); attributes.expires = expires; } // We're using "expires" because "max-age" is not supported by IE attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; try { result = JSON.stringify(value); if (/^[\{\[]/.test(result)) { value = result; } } catch (e) {} if (!converter.write) { value = encodeURIComponent(String(value)) .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); } else { value = converter.write(value, key); } key = encodeURIComponent(String(key)); key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); key = key.replace(/[\(\)]/g, escape); var stringifiedAttributes = ''; for (var attributeName in attributes) { if (!attributes[attributeName]) { continue; } stringifiedAttributes += '; ' + attributeName; if (attributes[attributeName] === true) { continue; } stringifiedAttributes += '=' + attributes[attributeName]; } return (document.cookie = key + '=' + value + stringifiedAttributes); } // Read if (!key) { result = {}; } // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. Also prevents odd result when // calling "get()" var cookies = document.cookie ? document.cookie.split('; ') : []; var rdecode = /(%[0-9A-Z]{2})+/g; var i = 0; for (; i < cookies.length; i++) { var parts = cookies[i].split('='); var cookie = parts.slice(1).join('='); if (!this.json && cookie.charAt(0) === '"') { cookie = cookie.slice(1, -1); } try { var name = parts[0].replace(rdecode, decodeURIComponent); cookie = converter.read ? converter.read(cookie, name) : converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent); if (this.json) { try { cookie = JSON.parse(cookie); } catch (e) {} } if (key === name) { result = cookie; break; } if (!key) { result[name] = cookie; } } catch (e) {} } return result; } api.set = api; api.get = function (key) { return api.call(api, key); }; api.getJSON = function () { return api.apply({ json: true }, [].slice.call(arguments)); }; api.defaults = {}; api.remove = function (key, attributes) { api(key, '', extend(attributes, { expires: -1 })); }; api.withConverter = init; return api; } return init(function () {}); })); assets/js/uncode-privacy-admin.min.js 0000755 00000005202 15174671617 0013641 0 ustar 00 (function($){"use strict";$(function(){$(document).on("click",".uncode-privacy-settings-form .notice-dismiss",function(){$(this).parent().parent().remove()});function string_to_slug(str){str=str.replace(/^\s+|\s+$/g,"");str=str.toLowerCase();var from="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";var to="aaaaeeeeiiiioooouuuunc------";for(var i=0,l=from.length;i<l;i++){str=str.replace(new RegExp(from.charAt(i),"g"),to.charAt(i))}str=str.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");return str}$(".add-consent").click(function(e){e.preventDefault();var field=$("#type-of-consent");if(field.val()===""){return}var consentID=string_to_slug(field.val());var consentName=field.val();var template=wp.template("consents");$("#consent-tabs").append(template({key:consentID,name:consentName,option_name:"uncode_privacy_consent_types"}));field.val("")});$("#consent-tabs, #tabs").sortable();$(document).on("click","#tabs .notice-dismiss",function(e){e.preventDefault();$(this).closest(".postbox").remove()});$(document).on("click",".uncode-privacy-wrap .nav-tab-wrapper a",function(e){var target=$(this).attr("href");target=target.replace("#","");$(this).addClass("nav-tab-active");$(this).siblings().removeClass("nav-tab-active");$(".uncode-privacy-wrap .uncode-privacy-tab").addClass("hidden");$(".uncode-privacy-wrap .uncode-privacy-tab[data-id="+target+"]").removeClass("hidden");if(-1!==location.search.indexOf("page=uncode-privacy-settings")){var referer=$('.uncode-privacy-wrap form input[name="_wp_http_referer"]');var cleanReferer=referer.val().split("#")[0];referer.val(cleanReferer+"#"+target)}});var hash=window.location.hash;if(hash){$('.uncode-privacy-wrap .nav-tab-wrapper a[href="'+hash+'"]').addClass("nav-tab-active");$('.uncode-privacy-wrap .uncode-privacy-tab[data-id="'+hash.replace("#","")+'"]').removeClass("hidden");if(-1!==location.search.indexOf("page=uncode-privacy-settings")){var referer=$('.uncode-privacy-wrap form input[name="_wp_http_referer"]');var cleanReferer=referer.val().split("#")[0];referer.val(cleanReferer+hash)}}else{$(".uncode-privacy-wrap .nav-tab-wrapper a:eq(0)").addClass("nav-tab-active");$(".uncode-privacy-wrap .uncode-privacy-tab:eq(0)").removeClass("hidden")}$(".uncode-privacy-switch-checkbox").each(function(){var checkbox=$(this);var stateControl=checkbox.closest("tr").next();if(checkbox.prop("checked")){stateControl.hide()}else{stateControl.show()}});$(document).on("click",".uncode-privacy-switch-checkbox",".uncode-privacy-settings-form",function(){var checkbox=$(this);var stateControl=checkbox.closest("tr").next();if(checkbox.prop("checked")){stateControl.hide()}else{stateControl.show()}})})})(jQuery); assets/js/uncode-privacy-admin.js 0000755 00000006376 15174671617 0013074 0 ustar 00 (function( $ ) { 'use strict'; $(function() { $(document).on('click', '.uncode-privacy-settings-form .notice-dismiss', function() { $(this).parent().parent().remove(); }); function string_to_slug (str) { str = str.replace(/^\s+|\s+$/g, ''); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; var to = "aaaaeeeeiiiioooouuuunc------"; for (var i=0, l=from.length ; i<l ; i++) { str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); } str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars .replace(/\s+/g, '-') // collapse whitespace and replace by - .replace(/-+/g, '-'); // collapse dashes return str; } $('.add-consent').click(function(e) { e.preventDefault(); var field = $('#type-of-consent'); if ( field.val() === '' ) { return; } var consentID = string_to_slug( field.val() ); var consentName = field.val(); var template = wp.template( 'consents' ); $('#consent-tabs').append( template( { key: consentID, name: consentName, option_name: 'uncode_privacy_consent_types' } ) ); field.val(''); }); $('#consent-tabs, #tabs').sortable(); $(document).on('click', '#tabs .notice-dismiss', function(e) { e.preventDefault(); $(this).closest('.postbox').remove(); }); $(document).on('click', '.uncode-privacy-wrap .nav-tab-wrapper a', function(e) { var target = $(this).attr('href'); target = target.replace('#', ''); $(this).addClass('nav-tab-active'); $(this).siblings().removeClass('nav-tab-active'); $('.uncode-privacy-wrap .uncode-privacy-tab').addClass('hidden'); $('.uncode-privacy-wrap .uncode-privacy-tab[data-id='+ target +']').removeClass('hidden'); if ( -1 !== location.search.indexOf( 'page=uncode-privacy-settings' ) ) { var referer = $('.uncode-privacy-wrap form input[name="_wp_http_referer"]'); var cleanReferer = referer.val().split('#')[0]; referer.val( cleanReferer + '#' + target ); } }); var hash = window.location.hash; if ( hash ) { $('.uncode-privacy-wrap .nav-tab-wrapper a[href="'+ hash +'"]').addClass('nav-tab-active'); $('.uncode-privacy-wrap .uncode-privacy-tab[data-id="'+ hash.replace('#', '') +'"]').removeClass('hidden'); if ( -1 !== location.search.indexOf( 'page=uncode-privacy-settings' ) ) { var referer = $('.uncode-privacy-wrap form input[name="_wp_http_referer"]'); var cleanReferer = referer.val().split('#')[0]; referer.val( cleanReferer + hash); } } else { $('.uncode-privacy-wrap .nav-tab-wrapper a:eq(0)').addClass('nav-tab-active'); $('.uncode-privacy-wrap .uncode-privacy-tab:eq(0)').removeClass('hidden'); } $('.uncode-privacy-switch-checkbox').each(function() { var checkbox = $(this); var stateControl = checkbox.closest('tr').next(); if (checkbox.prop('checked')) { stateControl.hide(); } else { stateControl.show(); } }); $(document).on('click', '.uncode-privacy-switch-checkbox', '.uncode-privacy-settings-form', function() { var checkbox = $(this); var stateControl = checkbox.closest('tr').next(); if (checkbox.prop('checked')) { stateControl.hide(); } else { stateControl.show(); } }); }); })( jQuery ); assets/js/js-cookie.min.js 0000755 00000005050 15174671617 0011507 0 ustar 00 (function(factory){var registeredInModuleLoader=false;if(typeof define==="function"&&define.amd){define(factory);registeredInModuleLoader=true}if(typeof exports==="object"){module.exports=factory();registeredInModuleLoader=true}if(!registeredInModuleLoader){var OldCookies=window.Cookies;var api=window.Cookies=factory();api.noConflict=function(){window.Cookies=OldCookies;return api}}})(function(){function extend(){var i=0;var result={};for(;i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes){result[key]=attributes[key]}}return result}function init(converter){function api(key,value,attributes){var result;if(typeof document==="undefined"){return}if(arguments.length>1){attributes=extend({path:"/"},api.defaults,attributes);if(typeof attributes.expires==="number"){var expires=new Date;expires.setMilliseconds(expires.getMilliseconds()+attributes.expires*864e5);attributes.expires=expires}attributes.expires=attributes.expires?attributes.expires.toUTCString():"";try{result=JSON.stringify(value);if(/^[\{\[]/.test(result)){value=result}}catch(e){}if(!converter.write){value=encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)}else{value=converter.write(value,key)}key=encodeURIComponent(String(key));key=key.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent);key=key.replace(/[\(\)]/g,escape);var stringifiedAttributes="";for(var attributeName in attributes){if(!attributes[attributeName]){continue}stringifiedAttributes+="; "+attributeName;if(attributes[attributeName]===true){continue}stringifiedAttributes+="="+attributes[attributeName]}return document.cookie=key+"="+value+stringifiedAttributes}if(!key){result={}}var cookies=document.cookie?document.cookie.split("; "):[];var rdecode=/(%[0-9A-Z]{2})+/g;var i=0;for(;i<cookies.length;i++){var parts=cookies[i].split("=");var cookie=parts.slice(1).join("=");if(!this.json&&cookie.charAt(0)==='"'){cookie=cookie.slice(1,-1)}try{var name=parts[0].replace(rdecode,decodeURIComponent);cookie=converter.read?converter.read(cookie,name):converter(cookie,name)||cookie.replace(rdecode,decodeURIComponent);if(this.json){try{cookie=JSON.parse(cookie)}catch(e){}}if(key===name){result=cookie;break}if(!key){result[name]=cookie}}catch(e){}}return result}api.set=api;api.get=function(key){return api.call(api,key)};api.getJSON=function(){return api.apply({json:true},[].slice.call(arguments))};api.defaults={};api.remove=function(key,attributes){api(key,"",extend(attributes,{expires:-1}))};api.withConverter=init;return api}return init(function(){})}); assets/js/uncode-privacy-public.js 0000755 00000010220 15174671617 0013241 0 ustar 00 (function( $ ) { 'use strict'; var query_args = location.search, base_url = location.protocol + '//' + location.host + location.pathname; if ( -1 !== query_args.indexOf( 'notify=1' ) ) { window.history.replaceState( {}, document.title, base_url ); } window.uncode_toolkit_privacy_has_consent = function( consent ) { // Check consents that are on by default first var consentSwitch = $('#gdpr-consent-' + consent); if (consentSwitch.length) { if (consentSwitch.attr('data-default-on') === 'true' && consentSwitch.prop('checked')) { return true; } } // Check saved cookies if ( Cookies.get('uncode_privacy[consent_types]') ) { var consentArray = JSON.parse( Cookies.get('uncode_privacy[consent_types]') ); if ( consentArray.indexOf( consent ) > -1 ) { return true; } } return false; } $(function() { if ( ! Cookies.get('uncode_privacy[privacy_bar]') ) { if ($('.gdpr.gdpr-privacy-bar').hasClass('gdpr-privacy-bar--float')) { $('.gdpr.gdpr-privacy-bar').show(); } else { $('.gdpr.gdpr-privacy-bar').delay(1000).slideDown(600); } }; /** * This runs when user clicks on privacy preferences bar agree button. * It submits the form that is still hidden with the cookies and consent options. */ $(document).on('click', '.gdpr.gdpr-privacy-bar .gdpr-agreement', function() { var secureFlag = location.protocol === 'https:' ? true : false; $('.gdpr.gdpr-privacy-bar').addClass('gdpr-hide-bar'); Cookies.set('uncode_privacy[privacy_bar]', 1, { expires: 365, secure: secureFlag }); }); /** * Set the privacy bar cookie after privacy preference submission. * This hides the privacy bar from showing after saving privacy preferences. */ $(document).on('submit', '.gdpr-privacy-preferences-frm', function() { var secureFlag = location.protocol === 'https:' ? true : false; Cookies.set('uncode_privacy[privacy_bar]', 1, { expires: 365, secure: secureFlag }); }); /** * Display the privacy preferences modal. */ $(document).on('click', '.gdpr-preferences', function() { var type = $(this).data('type'); $('.gdpr-overlay').fadeIn(); $('body').addClass('gdpr-noscroll'); $('.gdpr.gdpr-privacy-preferences .gdpr-wrapper').fadeIn(); }); /** * Close the privacy preferences modal. */ $(document).on('click', '.gdpr.gdpr-privacy-preferences .gdpr-close, .gdpr-overlay', function() { $('.gdpr-overlay').fadeOut(); $('body').removeClass('gdpr-noscroll'); $('.gdpr.gdpr-privacy-preferences .gdpr-wrapper').fadeOut(); }); /** * Trigger events */ $('body').on('click', '.gdpr-preferences', function(e){ e.preventDefault(); $(window).trigger('gdprOpen'); }).on('click', '.gdpr.gdpr-privacy-preferences .gdpr-close, .gdpr-overlay', function(){ $(window).trigger('gdprClose'); }); /** * Check switch via JS */ var switches = $('.gdpr-switch').find('input'); function add_active_color(el) { el.next().css('background', Uncode_Privacy_Parameters.accent_color); } function add_default_color(el) { el.next().css('background', '#ccc'); } switches.each(function() { var _this = $(this); if ($('body').hasClass('logged-in')) { if (_this.prop('checked')) { add_active_color(_this); } } _this.on('change', function() { if (_this.prop('checked')) { add_active_color(_this); } else { add_default_color(_this); } }); }); if (!$('body').hasClass('logged-in')) { switches.each(function() { var _this = $(this); var type = _this.attr('name') == 'user_consents[]' ? 'consent' : 'cookie'; if (type == 'consent') { var is_allowed = uncode_toolkit_privacy_has_consent(_this.val()); if (is_allowed) { _this.prop('checked', true); add_active_color(_this); } else { _this.prop('checked', false); add_default_color(_this); } } }); } /** * Change link color in banner text */ var banner_links = $('.gdpr-privacy-bar .gdpr-content').find('a'); banner_links.each(function() { add_link_color($(this)); }); function add_link_color(el) { el.css('color', Uncode_Privacy_Parameters.accent_color); } }); })( jQuery );
| ver. 1.6 |
Github
|
.
| PHP 8.3.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка