Plugin Directory


Ignore:
Timestamp:
03/03/2023 06:27:06 AM (3 years ago)
Author:
themebeez
Message:

Update to version 1.1.2 from GitHub

Location:
simple-gdpr-cookie-compliance
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • simple-gdpr-cookie-compliance/tags/1.1.2/README.txt

    r2867952 r2874093  
    77Tested up to: 6.1.1
    88Requires PHP: 7.0.0
    9 Stable tag: 1.1.1
     9Stable tag: 1.1.2
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8282== Changelog ==
    8383
     84= 1.1.2 - 03 March, 2023 =
     85
     86- Updated: UDP agent to version 1.0.1.
     87
    8488= 1.1.1 - 20 February, 2023 =
    8589
  • simple-gdpr-cookie-compliance/tags/1.1.2/includes/udp/class-udp-agent.php

    r2867952 r2874093  
    55 * @link       https://creamcode.org/user-data-processing/
    66 * @since      1.0.0
    7  * @author     Cream Code <contact@creamcode.org>
     7 * @author     CreamCode
    88 * @package    Udp_Agent
    99 */
     
    5656    public function __construct( $ver, $agent_root_dir, $engine_url ) {
    5757
    58         $this->version        = $ver;
    5958        $this->engine_url     = $engine_url;
    6059        $this->agent_root_dir = $agent_root_dir;
     
    102101     */
    103102    public function on_admin_init() {
    104 
    105         $this->show_user_tracking_admin_notice();
    106103
    107104        // register and save settings data.
     
    117114        add_settings_field(
    118115            'udp_agent_allow_tracking',
    119             __( 'Allow Anonymous Tracking', 'udp-agent' ),
     116            esc_html__( 'Allow Anonymous Tracking', 'simple-gdpr-cookie-compliance' ),
    120117            array( $this, 'show_settings_ui' ),
    121118            'general',
     
    136133     */
    137134    public function get_settings_field_val( $data ) {
    138         if ( '1' === $data ) {
     135        if ( 1 === (int) $data ) {
    139136            return 'yes';
    140137        } else {
     
    161158        }
    162159        echo '/>';
    163         echo wp_kses_data( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected. <a href="https://creamcode.org/user-data-processing/" target="_blank" >What data do we collect?</a>' ) . ' </p>';
     160        echo esc_html__( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected.', 'simple-gdpr-cookie-compliance' );
     161        echo wp_kses_data( '<a href="https://creamcode.org/user-data-processing/" target="_blank" > ' . esc_html__( ' What data do we collect?', 'simple-gdpr-cookie-compliance' ) . '</a>' );
     162        echo ' </p>';
    164163    }
    165164
     
    168167    // Show admin notice, for collecting user data.
    169168    // ----------------------------------------------
    170 
    171     /**
    172      * Show admin notice to collect user data.
    173      *
    174      * @since    1.0.0
    175      */
    176     public function show_user_tracking_admin_notice() {
    177 
    178         $show_admin_notice = true;
    179         $users_choice      = get_option( 'udp_agent_allow_tracking' );
    180 
    181         if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
    182 
    183             // user has already clicked "yes" or "no" in admin notice.
    184             // do not show this notice.
    185             $show_admin_notice = false;
    186 
    187         } else {
    188 
    189             $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
    190 
    191             if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
    192                 // do not show,
    193                 // if last admin notice was shown less than 1 day ago.
    194                 $show_admin_notice = false;
    195             }
    196         }
    197 
    198         if ( ! $show_admin_notice ) {
    199             return;
    200         }
    201         $content = '<p>' . sprintf(
    202             /* translators: %s: agent name */
    203             __( '%s is asking to allow tracking your non-sensitive WordPress data?', 'udp-agent' ),
    204             $this->find_agent_name( $this->agent_root_dir )
    205         ) . '</p><p>';
    206 
    207         $content .= sprintf(
    208             /* translators: %s: agent allow access link, %s: Allow */
    209             __( '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    210             add_query_arg( 'udp-agent-allow-access', 'yes' ),
    211             'Allow'
    212         );
    213 
    214         $content .= sprintf(
    215             /* translators: %s: agent allow access link, %s: Allow */
    216             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    217             add_query_arg( 'udp-agent-allow-access', 'no' ),
    218             'Do not show again'
    219         );
    220 
    221         $content .= sprintf(
    222             /* translators: %s: agent allow access link, %s: Allow */
    223             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    224             add_query_arg( 'udp-agent-allow-access', 'later' ),
    225             'Later'
    226         );
    227 
    228         $content .= '</p>';
    229         $this->show_admin_notice( 'warning', $content );
    230     }
    231 
    232 
    233169
    234170    /**
     
    257193
    258194    }
    259 
    260 
    261     /**
    262      * A little helper function to show admin notice.
    263      *
    264      * @since    1.0.0
    265      * @param string $error_class Error Class/Type.
    266      * @param string $msg Message.
    267      */
    268     private function show_admin_notice( $error_class, $msg ) {
    269         add_action(
    270             'load-index.php',
    271             function () use ( $error_class, $msg ) {
    272                 add_action(
    273                     'admin_notices',
    274                     function() use ( $error_class, $msg ) {
    275                         $class = 'is-dismissible  notice notice-' . $error_class;
    276                         printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $msg ) );
    277                     }
    278                 );
    279             }
    280         );
    281 
    282     }
    283 
    284195
    285196    // ----------------------------------------------
     
    321232            $dir_names = explode( '\\', $dir_names[ count( $dir_names ) - 1 ] );
    322233        }
    323         $plugin_name           = array_pop( $dir_names );
    324         $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
    325         $data['sender_client'] = $this_plugin_data['Name'];
     234        $plugin_name = array_pop( $dir_names );
     235        if ( file_exists( $plugin_directory . '/' . $plugin_name . '.php' ) ) {
     236            $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
     237            $data['sender_client'] = $this_plugin_data['Name'];
     238        } else {
     239            $theme                 = wp_get_theme();
     240            $data['sender_client'] = $theme->name;
     241        }
    326242
    327243        return $data;
     
    332248
    333249    /**
    334      * Authotrize this agent to send data to engine.
     250     * Authorize this agent to send data to engine.
    335251     * get secret key from engine
    336252     * run on agent activation.
     
    362278        $url                = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/handshake';
    363279
    364         // get secret key from engine.
    365         $secret_key = json_decode( $this->do_curl( $url, $data ) );
    366 
    367         if ( empty( $secret_key ) ) {
    368             error_log( __FUNCTION__ . ' : Cannot get secret key from engine.' ); //phpcs:ignore
    369             return false;
    370         }
    371 
    372         if ( isset( $secret_key->secret_key ) ) {
    373             // save secret_key into db.
    374             update_option( 'udp_agent_secret_key', $secret_key->secret_key );
    375         } else {
    376             error_log( __FUNCTION__ . $secret_key->message ); //phpcs:ignore
    377             return false;
    378         }
     280        $this->do_curl( $url, $data );
    379281
    380282        return true;
    381283
    382284    }
    383 
    384 
    385     /**
    386      * Find agent's parent's name. It can be theme or plugin.
    387      *
    388      * @since    1.0.0
    389      * @param    string $root_dir Path to root folder of the agents parent.
    390      */
    391     private function find_agent_name( $root_dir ) {
    392 
    393         if ( ! empty( $this->agent_name ) ) {
    394             return $this->agent_name;
    395         }
    396 
    397         $agent_name = '';
    398 
    399         if ( file_exists( $root_dir . '/functions.php' ) ) {
    400             // it is a theme
    401             // return get_style.
    402 
    403             $my_theme = wp_get_theme( basename( $root_dir ) );
    404             if ( $my_theme->exists() ) {
    405                 $agent_name = $my_theme->get( 'Name' );
    406             }
    407         } else {
    408             // it is a plugin.
    409             $plugin_file = $this->agent_root_dir . DIRECTORY_SEPARATOR . basename( $this->agent_root_dir ) . '.php';
    410             $plugin_data = get_file_data(
    411                 $plugin_file,
    412                 array(
    413                     'name' => 'Plugin Name',
    414                 )
    415             );
    416 
    417             $agent_name = $plugin_data['name'];
    418         }
    419         $this->agent_name = $agent_name;
    420         return $agent_name;
    421     }
    422 
    423285
    424286    // ------------------------------------------------
     
    462324        $data_to_send['secret_key'] = get_option( 'udp_agent_secret_key' );
    463325        $url                        = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/process-data';
    464         $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     326        // $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     327        $this->do_curl( $url, $data_to_send );
    465328        exit;
    466329
     
    474337     */
    475338    private function write_log( $log ) {
    476         if ( true === WP_DEBUG ) {
     339        if ( true === WP_DEBUG && true === WP_DEBUG_LOG ) {
    477340            if ( is_array( $log ) || is_object( $log ) ) {
    478341                error_log( print_r( $log, true ) ); //phpcs:ignore
  • simple-gdpr-cookie-compliance/tags/1.1.2/includes/udp/init.php

    r2867952 r2874093  
    11<?php
    22/**
    3  * The file that defines the initial plugin functions
     3 * Init file for the UDP agent.
    44 *
    5  * A hooks definition that includes attributes and functions used across both the
    6  * public-facing side of the site and the admin area.
    7  *
    8  * @link       https://themebeez.com/
     5 * @link       https://creamcode.org/user-data-processing/
    96 * @since      1.0.0
    10  *
     7 * @author     CreamCode
    118 * @package    Udp_agent
    129 */
    1310
    14 global $this_agent_ver, $engine_url;
     11// Declared global so they can be used in multiple plugins.
     12// For addressing issues caused by having function declared with same name in multiple plugins.
     13global $this_agent_ver, $engine_url, $root_dir, $udp_admin_notice_displayed;
    1514
    1615// -------------------------------------------
     
    1918
    2019$engine_url     = 'https://udp.creamcode.org/';
    21 $this_agent_ver = '1.0.0';
     20$this_agent_ver = '1.0.1';
    2221
    2322// -------------------------------------------
     
    3635}
    3736
     37if ( ! isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     38    $installed_agents                          = get_option( 'udp_installed_agents', array() );
     39    $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
     40
     41    // register this agent locally.
     42    update_option( 'udp_installed_agents', $installed_agents );
     43}
     44
    3845// load this agent, only if it is the latest version and this agent is installed.
    3946if ( $this_agent_is_latest && isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     
    4148        require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    4249    }
    43     new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    44 }
    45 
    46 if ( ! function_exists( 'cc_udp_agent_initial_handshake' ) ) {
    47     /**
    48      * Does Initial handshake with udp engine.
    49      */
    50     function cc_udp_agent_initial_handshake() {
    51         global $this_agent_ver, $engine_url;
    52         $root_dir = dirname( dirname( __DIR__ ) );
    53 
    54         // authorize this agent with engine.
    55         if ( ! class_exists( 'Udp_Agent' ) ) {
    56             require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    57         }
    58         $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    59         $agent->do_handshake();
    60 
    61         $installed_agents                          = get_option( 'udp_installed_agents', array() );
    62         $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
    63 
    64         // register this agent locally.
    65         update_option( 'udp_installed_agents', $installed_agents );
    66 
    67         // show admin notice if user selected "no" but new agent is installed.
    68         $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
    69         if ( 'no' === $show_admin_notice ) {
    70             $active_agent = get_option( 'udp_active_agent_basename' );
    71             if ( basename( $root_dir ) !== $active_agent ) {
    72                 update_option( 'udp_active_agent_basename', basename( $root_dir ) );
    73                 delete_option( 'udp_agent_allow_tracking' );
    74             }
    75         }
    76     }
    77 }
    78 
    79 if ( empty( (array)$all_installed_agents ) ) { //phpcs:ignore
    80     cc_udp_agent_initial_handshake();
     50    new Udp_Agent( $this_agent_ver, $root_dir, $engine_url, $udp_admin_notice_displayed );
     51    if ( ! isset( $udp_admin_notice_displayed ) || ! $udp_admin_notice_displayed ) {
     52        $udp_admin_notice_displayed = true;
     53        add_action(
     54            'admin_init',
     55            function () {
     56                $root_dir = dirname( dirname( __DIR__ ) );
     57
     58                $show_admin_notice = true;
     59                $users_choice      = get_option( 'udp_agent_allow_tracking' );
     60
     61                if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
     62
     63                    // user has already clicked "yes" or "no" in admin notice.
     64                    // do not show this notice.
     65                    $show_admin_notice = false;
     66
     67                } else {
     68
     69                    $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
     70
     71                    if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
     72                        // do not show,
     73                        // if last admin notice was shown less than 1 day ago.
     74                        $show_admin_notice = false;
     75                    }
     76                }
     77
     78                if ( ! $show_admin_notice ) {
     79                    return;
     80                }
     81                if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     82                    $plugin_file = $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php';
     83                    $plugin_data = get_file_data(
     84                        $plugin_file,
     85                        array(
     86                            'name'       => 'Plugin Name',
     87                            'textdomain' => 'Text Domain',
     88                        )
     89                    );
     90
     91                    $agent_name = $plugin_data['name'];
     92                } else {
     93                    $theme      = wp_get_theme();
     94                    $agent_name = $theme->name;
     95                }
     96
     97                $content = '<p>' . sprintf(
     98                    /* translators: %s: agent name */
     99                    esc_html__( '%s is asking to allow tracking your non-sensitive WordPress data?', 'simple-gdpr-cookie-compliance' ),
     100                    $agent_name
     101                ) . '</p><p>';
     102
     103                $content .= sprintf(
     104                    /* translators: %s: agent allow access link, %s: Allow */
     105                    '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     106                    add_query_arg( 'udp-agent-allow-access', 'yes' ),
     107                    esc_html__( 'Allow', 'simple-gdpr-cookie-compliance' )
     108                );
     109
     110                $content .= sprintf(
     111                    /* translators: %s: agent allow access link, %s: Allow */
     112                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>',
     113                    add_query_arg( 'udp-agent-allow-access', 'no' ),
     114                    esc_html__( 'Do not show again', 'simple-gdpr-cookie-compliance' )
     115                );
     116
     117                $content .= sprintf(
     118                    /* translators: %s: agent allow access link, %s: Allow */
     119                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     120                    add_query_arg( 'udp-agent-allow-access', 'later' ),
     121                    esc_html__( 'Later', 'simple-gdpr-cookie-compliance' )
     122                );
     123
     124                $content .= '</p>';
     125                add_action(
     126                    'load-index.php',
     127                    function () use ( $content ) {
     128                        add_action(
     129                            'admin_notices',
     130                            function() use ( $content ) {
     131                                $class = 'is-dismissible  notice notice-warning';
     132                                printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $content ) );
     133                            }
     134                        );
     135                    }
     136                );
     137            }
     138        );
     139    }
    81140}
    82141
     
    85144// -------------------------------------------
    86145
    87 // for plugin.
    88 register_activation_hook(
    89     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
    90     'cc_udp_agent_initial_handshake'
    91 );
     146if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     147    // for plugin.
     148    register_activation_hook(
     149        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     150        function () use ( $this_agent_ver, $engine_url ) {
     151            $root_dir = dirname( dirname( __DIR__ ) );
     152
     153            // authorize this agent with engine.
     154            if ( ! class_exists( 'Udp_Agent' ) ) {
     155                require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
     156            }
     157            $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
     158            $agent->do_handshake();
     159
     160            // show admin notice if user selected "no" but new agent is installed.
     161            $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
     162            if ( 'no' === $show_admin_notice ) {
     163                $active_agent = get_option( 'udp_active_agent_basename' );
     164                if ( basename( $root_dir ) !== $active_agent ) {
     165                    update_option( 'udp_active_agent_basename', basename( $root_dir ) );
     166                    delete_option( 'udp_agent_allow_tracking' );
     167                }
     168            }
     169        }
     170    );
     171}
    92172
    93173if ( ! function_exists( 'cc_udp_agent_send_data_on_action' ) ) {
     
    164244// -------------------------------------------
    165245
    166 // for plugin.
    167 register_deactivation_hook(
    168     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     246if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     247    // for plugin.
     248    register_deactivation_hook(
     249        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     250        function () use ( $root_dir ) {
     251
     252            $installed_agents = get_option( 'udp_installed_agents', array() );
     253            if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
     254                unset( $installed_agents[ basename( $root_dir ) ] );
     255            }
     256
     257            // remove this agent from the list of active agents.
     258            update_option( 'udp_installed_agents', $installed_agents );
     259            $timestamp = wp_next_scheduled( 'udp_agent_cron' );
     260            wp_unschedule_event( $timestamp, 'udp_agent_cron' );
     261        }
     262    );
     263}
     264
     265// for theme.
     266add_action(
     267    'switch_theme',
    169268    function () use ( $root_dir ) {
    170269
     
    176275        // remove this agent from the list of active agents.
    177276        update_option( 'udp_installed_agents', $installed_agents );
    178         $timestamp = wp_next_scheduled( 'udp_agent_cron' );
    179         wp_unschedule_event( $timestamp, 'udp_agent_cron' );
    180     }
    181 );
    182 
    183 // for theme.
    184 add_action(
    185     'switch_theme',
    186     function () use ( $root_dir ) {
    187 
    188         $installed_agents = get_option( 'udp_installed_agents', array() );
    189         if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
    190             unset( $installed_agents[ basename( $root_dir ) ] );
    191         }
    192 
    193         // remove this agent from the list of active agents.
    194         update_option( 'udp_installed_agents', $installed_agents );
    195     }
    196 );
     277    }
     278);
  • simple-gdpr-cookie-compliance/tags/1.1.2/languages/simple-gdpr-cookie-compliance.pot

    r2662024 r2874093  
    1 # Copyright (C) 2021 Simple GDPR Cookie Compliance
    2 # This file is distributed under the same license as the Simple GDPR Cookie Compliance package.
     1# Copyright (C) 2023 themebeez
     2# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Simple GDPR Cookie Compliance\n"
     5"Project-Id-Version: Simple GDPR Cookie Compliance 1.1.2\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-gdpr-cookie-compliance\n"
     7"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     8"Language-Team: LANGUAGE <LL@li.org>\n"
    69"MIME-Version: 1.0\n"
    710"Content-Type: text/plain; charset=UTF-8\n"
    811"Content-Transfer-Encoding: 8bit\n"
    9 "X-Poedit-Basepath: ..\n"
    10 "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"
    11 "X-Poedit-SearchPath-0: .\n"
    12 "X-Poedit-SearchPathExcluded-0: *.js\n"
    13 "X-Poedit-SourceCharset: UTF-8\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    15 
    16 #: admin/class-simple-gdpr-cookie-compliance-admin.php:115, admin/partials/simple-gdpr-cookie-compliance-admin-page.php:21
     12"POT-Creation-Date: 2023-03-03T06:22:18+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.7.1\n"
     15"X-Domain: simple-gdpr-cookie-compliance\n"
     16
     17#. Plugin Name of the plugin
     18#: admin/class-simple-gdpr-cookie-compliance-admin.php:115
     19#: admin/partials/simple-gdpr-cookie-compliance-admin-page.php:21
    1720msgid "Simple GDPR Cookie Compliance"
     21msgstr ""
     22
     23#. Plugin URI of the plugin
     24msgid "https://themebeez.com/plugins/simple-gdpr-cookie-compliance"
     25msgstr ""
     26
     27#. Description of the plugin
     28msgid "Simple GDPR Cookie Compliance is a simple notifier to inform users that your site uses of cookies and show your complies with EU GDPR cookie law and CCPA regulations."
     29msgstr ""
     30
     31#. Author of the plugin
     32msgid "themebeez"
     33msgstr ""
     34
     35#. Author URI of the plugin
     36msgid "https://themebeez.com/"
    1837msgstr ""
    1938
     
    4665msgstr ""
    4766
    48 #: admin/class-simple-gdpr-cookie-compliance-settings.php:127, public/class-simple-gdpr-cookie-compliance-public.php:146
     67#: admin/class-simple-gdpr-cookie-compliance-settings.php:127
     68#: public/class-simple-gdpr-cookie-compliance-public.php:153
    4969msgid "Our website uses cookies to provide you the best experience. However, by continuing to use our website, you agree to our use of cookies. For more information, read our <a href=\"#\">Cookie Policy</a>."
    5070msgstr ""
     
    158178msgstr ""
    159179
    160 #: admin/class-simple-gdpr-cookie-compliance-settings.php:314, admin/class-simple-gdpr-cookie-compliance-settings.php:333
     180#: admin/class-simple-gdpr-cookie-compliance-settings.php:314
     181#: admin/class-simple-gdpr-cookie-compliance-settings.php:333
    161182msgid "Position"
    162183msgstr ""
     
    222243msgstr ""
    223244
    224 #: admin/class-simple-gdpr-cookie-compliance-settings.php:435, admin/class-simple-gdpr-cookie-compliance-settings.php:445, admin/class-simple-gdpr-cookie-compliance-settings.php:471, admin/class-simple-gdpr-cookie-compliance-settings.php:493
     245#: admin/class-simple-gdpr-cookie-compliance-settings.php:435
     246#: admin/class-simple-gdpr-cookie-compliance-settings.php:445
     247#: admin/class-simple-gdpr-cookie-compliance-settings.php:471
     248#: admin/class-simple-gdpr-cookie-compliance-settings.php:493
    225249msgid "Background"
    226250msgstr ""
     
    234258msgstr ""
    235259
    236 #: admin/class-simple-gdpr-cookie-compliance-settings.php:453, admin/class-simple-gdpr-cookie-compliance-settings.php:479, admin/class-simple-gdpr-cookie-compliance-settings.php:509
     260#: admin/class-simple-gdpr-cookie-compliance-settings.php:453
     261#: admin/class-simple-gdpr-cookie-compliance-settings.php:479
     262#: admin/class-simple-gdpr-cookie-compliance-settings.php:509
    237263msgid "Text"
    238264msgstr ""
     
    250276msgstr ""
    251277
    252 #: admin/class-simple-gdpr-cookie-compliance-settings.php:475, admin/class-simple-gdpr-cookie-compliance-settings.php:497
     278#: admin/class-simple-gdpr-cookie-compliance-settings.php:475
     279#: admin/class-simple-gdpr-cookie-compliance-settings.php:497
    253280msgid "Background - On Hover"
    254281msgstr ""
    255282
    256 #: admin/class-simple-gdpr-cookie-compliance-settings.php:483, admin/class-simple-gdpr-cookie-compliance-settings.php:513
     283#: admin/class-simple-gdpr-cookie-compliance-settings.php:483
     284#: admin/class-simple-gdpr-cookie-compliance-settings.php:513
    257285msgid "Text - On Hover"
    258286msgstr ""
     
    278306msgstr ""
    279307
    280 #: public/class-simple-gdpr-cookie-compliance-public.php:144
     308#: includes/udp/class-udp-agent.php:116
     309msgid "Allow Anonymous Tracking"
     310msgstr ""
     311
     312#: includes/udp/class-udp-agent.php:160
     313msgid "Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected."
     314msgstr ""
     315
     316#: includes/udp/class-udp-agent.php:161
     317msgid " What data do we collect?"
     318msgstr ""
     319
     320#. translators: %s: agent name
     321#: includes/udp/init.php:99
     322msgid "%s is asking to allow tracking your non-sensitive WordPress data?"
     323msgstr ""
     324
     325#: includes/udp/init.php:107
     326msgid "Allow"
     327msgstr ""
     328
     329#: includes/udp/init.php:114
     330msgid "Do not show again"
     331msgstr ""
     332
     333#: includes/udp/init.php:121
     334msgid "Later"
     335msgstr ""
     336
     337#: public/class-simple-gdpr-cookie-compliance-public.php:151
    281338msgid "Notice regarding cookie compliance is not set. Go to %s to set the notice."
    282339msgstr ""
    283340
    284 #: public/class-simple-gdpr-cookie-compliance-public.php:144
     341#: public/class-simple-gdpr-cookie-compliance-public.php:151
    285342msgid "Dashboard > Simple GDPR"
    286343msgstr ""
  • simple-gdpr-cookie-compliance/tags/1.1.2/simple-gdpr-cookie-compliance.php

    r2867952 r2874093  
    55 * Plugin URI:        https://themebeez.com/plugins/simple-gdpr-cookie-compliance
    66 * Description:       Simple GDPR Cookie Compliance is a simple notifier to inform users that your site uses of cookies and show your complies with EU GDPR cookie law and CCPA regulations.
    7  * Version:           1.1.1
     7 * Version:           1.1.2
    88 * Author:            themebeez
    99 * Author URI:        https://themebeez.com/
     
    2424 * Rename this for your plugin and update it as you release new versions.
    2525 */
    26 define( 'SIMPLE_GDPR_COOKIE_COMPLIANCE_VERSION', '1.1.1' );
     26define( 'SIMPLE_GDPR_COOKIE_COMPLIANCE_VERSION', '1.1.2' );
    2727define( 'SIMPLE_GDPR_COOKIE_COMPLIANCE_BASENAME', plugin_basename( __FILE__ ) );
    2828
  • simple-gdpr-cookie-compliance/trunk/README.txt

    r2867952 r2874093  
    77Tested up to: 6.1.1
    88Requires PHP: 7.0.0
    9 Stable tag: 1.1.1
     9Stable tag: 1.1.2
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8282== Changelog ==
    8383
     84= 1.1.2 - 03 March, 2023 =
     85
     86- Updated: UDP agent to version 1.0.1.
     87
    8488= 1.1.1 - 20 February, 2023 =
    8589
  • simple-gdpr-cookie-compliance/trunk/includes/udp/class-udp-agent.php

    r2867952 r2874093  
    55 * @link       https://creamcode.org/user-data-processing/
    66 * @since      1.0.0
    7  * @author     Cream Code <contact@creamcode.org>
     7 * @author     CreamCode
    88 * @package    Udp_Agent
    99 */
     
    5656    public function __construct( $ver, $agent_root_dir, $engine_url ) {
    5757
    58         $this->version        = $ver;
    5958        $this->engine_url     = $engine_url;
    6059        $this->agent_root_dir = $agent_root_dir;
     
    102101     */
    103102    public function on_admin_init() {
    104 
    105         $this->show_user_tracking_admin_notice();
    106103
    107104        // register and save settings data.
     
    117114        add_settings_field(
    118115            'udp_agent_allow_tracking',
    119             __( 'Allow Anonymous Tracking', 'udp-agent' ),
     116            esc_html__( 'Allow Anonymous Tracking', 'simple-gdpr-cookie-compliance' ),
    120117            array( $this, 'show_settings_ui' ),
    121118            'general',
     
    136133     */
    137134    public function get_settings_field_val( $data ) {
    138         if ( '1' === $data ) {
     135        if ( 1 === (int) $data ) {
    139136            return 'yes';
    140137        } else {
     
    161158        }
    162159        echo '/>';
    163         echo wp_kses_data( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected. <a href="https://creamcode.org/user-data-processing/" target="_blank" >What data do we collect?</a>' ) . ' </p>';
     160        echo esc_html__( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected.', 'simple-gdpr-cookie-compliance' );
     161        echo wp_kses_data( '<a href="https://creamcode.org/user-data-processing/" target="_blank" > ' . esc_html__( ' What data do we collect?', 'simple-gdpr-cookie-compliance' ) . '</a>' );
     162        echo ' </p>';
    164163    }
    165164
     
    168167    // Show admin notice, for collecting user data.
    169168    // ----------------------------------------------
    170 
    171     /**
    172      * Show admin notice to collect user data.
    173      *
    174      * @since    1.0.0
    175      */
    176     public function show_user_tracking_admin_notice() {
    177 
    178         $show_admin_notice = true;
    179         $users_choice      = get_option( 'udp_agent_allow_tracking' );
    180 
    181         if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
    182 
    183             // user has already clicked "yes" or "no" in admin notice.
    184             // do not show this notice.
    185             $show_admin_notice = false;
    186 
    187         } else {
    188 
    189             $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
    190 
    191             if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
    192                 // do not show,
    193                 // if last admin notice was shown less than 1 day ago.
    194                 $show_admin_notice = false;
    195             }
    196         }
    197 
    198         if ( ! $show_admin_notice ) {
    199             return;
    200         }
    201         $content = '<p>' . sprintf(
    202             /* translators: %s: agent name */
    203             __( '%s is asking to allow tracking your non-sensitive WordPress data?', 'udp-agent' ),
    204             $this->find_agent_name( $this->agent_root_dir )
    205         ) . '</p><p>';
    206 
    207         $content .= sprintf(
    208             /* translators: %s: agent allow access link, %s: Allow */
    209             __( '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    210             add_query_arg( 'udp-agent-allow-access', 'yes' ),
    211             'Allow'
    212         );
    213 
    214         $content .= sprintf(
    215             /* translators: %s: agent allow access link, %s: Allow */
    216             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    217             add_query_arg( 'udp-agent-allow-access', 'no' ),
    218             'Do not show again'
    219         );
    220 
    221         $content .= sprintf(
    222             /* translators: %s: agent allow access link, %s: Allow */
    223             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    224             add_query_arg( 'udp-agent-allow-access', 'later' ),
    225             'Later'
    226         );
    227 
    228         $content .= '</p>';
    229         $this->show_admin_notice( 'warning', $content );
    230     }
    231 
    232 
    233169
    234170    /**
     
    257193
    258194    }
    259 
    260 
    261     /**
    262      * A little helper function to show admin notice.
    263      *
    264      * @since    1.0.0
    265      * @param string $error_class Error Class/Type.
    266      * @param string $msg Message.
    267      */
    268     private function show_admin_notice( $error_class, $msg ) {
    269         add_action(
    270             'load-index.php',
    271             function () use ( $error_class, $msg ) {
    272                 add_action(
    273                     'admin_notices',
    274                     function() use ( $error_class, $msg ) {
    275                         $class = 'is-dismissible  notice notice-' . $error_class;
    276                         printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $msg ) );
    277                     }
    278                 );
    279             }
    280         );
    281 
    282     }
    283 
    284195
    285196    // ----------------------------------------------
     
    321232            $dir_names = explode( '\\', $dir_names[ count( $dir_names ) - 1 ] );
    322233        }
    323         $plugin_name           = array_pop( $dir_names );
    324         $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
    325         $data['sender_client'] = $this_plugin_data['Name'];
     234        $plugin_name = array_pop( $dir_names );
     235        if ( file_exists( $plugin_directory . '/' . $plugin_name . '.php' ) ) {
     236            $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
     237            $data['sender_client'] = $this_plugin_data['Name'];
     238        } else {
     239            $theme                 = wp_get_theme();
     240            $data['sender_client'] = $theme->name;
     241        }
    326242
    327243        return $data;
     
    332248
    333249    /**
    334      * Authotrize this agent to send data to engine.
     250     * Authorize this agent to send data to engine.
    335251     * get secret key from engine
    336252     * run on agent activation.
     
    362278        $url                = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/handshake';
    363279
    364         // get secret key from engine.
    365         $secret_key = json_decode( $this->do_curl( $url, $data ) );
    366 
    367         if ( empty( $secret_key ) ) {
    368             error_log( __FUNCTION__ . ' : Cannot get secret key from engine.' ); //phpcs:ignore
    369             return false;
    370         }
    371 
    372         if ( isset( $secret_key->secret_key ) ) {
    373             // save secret_key into db.
    374             update_option( 'udp_agent_secret_key', $secret_key->secret_key );
    375         } else {
    376             error_log( __FUNCTION__ . $secret_key->message ); //phpcs:ignore
    377             return false;
    378         }
     280        $this->do_curl( $url, $data );
    379281
    380282        return true;
    381283
    382284    }
    383 
    384 
    385     /**
    386      * Find agent's parent's name. It can be theme or plugin.
    387      *
    388      * @since    1.0.0
    389      * @param    string $root_dir Path to root folder of the agents parent.
    390      */
    391     private function find_agent_name( $root_dir ) {
    392 
    393         if ( ! empty( $this->agent_name ) ) {
    394             return $this->agent_name;
    395         }
    396 
    397         $agent_name = '';
    398 
    399         if ( file_exists( $root_dir . '/functions.php' ) ) {
    400             // it is a theme
    401             // return get_style.
    402 
    403             $my_theme = wp_get_theme( basename( $root_dir ) );
    404             if ( $my_theme->exists() ) {
    405                 $agent_name = $my_theme->get( 'Name' );
    406             }
    407         } else {
    408             // it is a plugin.
    409             $plugin_file = $this->agent_root_dir . DIRECTORY_SEPARATOR . basename( $this->agent_root_dir ) . '.php';
    410             $plugin_data = get_file_data(
    411                 $plugin_file,
    412                 array(
    413                     'name' => 'Plugin Name',
    414                 )
    415             );
    416 
    417             $agent_name = $plugin_data['name'];
    418         }
    419         $this->agent_name = $agent_name;
    420         return $agent_name;
    421     }
    422 
    423285
    424286    // ------------------------------------------------
     
    462324        $data_to_send['secret_key'] = get_option( 'udp_agent_secret_key' );
    463325        $url                        = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/process-data';
    464         $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     326        // $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     327        $this->do_curl( $url, $data_to_send );
    465328        exit;
    466329
     
    474337     */
    475338    private function write_log( $log ) {
    476         if ( true === WP_DEBUG ) {
     339        if ( true === WP_DEBUG && true === WP_DEBUG_LOG ) {
    477340            if ( is_array( $log ) || is_object( $log ) ) {
    478341                error_log( print_r( $log, true ) ); //phpcs:ignore
  • simple-gdpr-cookie-compliance/trunk/includes/udp/init.php

    r2867952 r2874093  
    11<?php
    22/**
    3  * The file that defines the initial plugin functions
     3 * Init file for the UDP agent.
    44 *
    5  * A hooks definition that includes attributes and functions used across both the
    6  * public-facing side of the site and the admin area.
    7  *
    8  * @link       https://themebeez.com/
     5 * @link       https://creamcode.org/user-data-processing/
    96 * @since      1.0.0
    10  *
     7 * @author     CreamCode
    118 * @package    Udp_agent
    129 */
    1310
    14 global $this_agent_ver, $engine_url;
     11// Declared global so they can be used in multiple plugins.
     12// For addressing issues caused by having function declared with same name in multiple plugins.
     13global $this_agent_ver, $engine_url, $root_dir, $udp_admin_notice_displayed;
    1514
    1615// -------------------------------------------
     
    1918
    2019$engine_url     = 'https://udp.creamcode.org/';
    21 $this_agent_ver = '1.0.0';
     20$this_agent_ver = '1.0.1';
    2221
    2322// -------------------------------------------
     
    3635}
    3736
     37if ( ! isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     38    $installed_agents                          = get_option( 'udp_installed_agents', array() );
     39    $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
     40
     41    // register this agent locally.
     42    update_option( 'udp_installed_agents', $installed_agents );
     43}
     44
    3845// load this agent, only if it is the latest version and this agent is installed.
    3946if ( $this_agent_is_latest && isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     
    4148        require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    4249    }
    43     new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    44 }
    45 
    46 if ( ! function_exists( 'cc_udp_agent_initial_handshake' ) ) {
    47     /**
    48      * Does Initial handshake with udp engine.
    49      */
    50     function cc_udp_agent_initial_handshake() {
    51         global $this_agent_ver, $engine_url;
    52         $root_dir = dirname( dirname( __DIR__ ) );
    53 
    54         // authorize this agent with engine.
    55         if ( ! class_exists( 'Udp_Agent' ) ) {
    56             require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    57         }
    58         $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    59         $agent->do_handshake();
    60 
    61         $installed_agents                          = get_option( 'udp_installed_agents', array() );
    62         $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
    63 
    64         // register this agent locally.
    65         update_option( 'udp_installed_agents', $installed_agents );
    66 
    67         // show admin notice if user selected "no" but new agent is installed.
    68         $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
    69         if ( 'no' === $show_admin_notice ) {
    70             $active_agent = get_option( 'udp_active_agent_basename' );
    71             if ( basename( $root_dir ) !== $active_agent ) {
    72                 update_option( 'udp_active_agent_basename', basename( $root_dir ) );
    73                 delete_option( 'udp_agent_allow_tracking' );
    74             }
    75         }
    76     }
    77 }
    78 
    79 if ( empty( (array)$all_installed_agents ) ) { //phpcs:ignore
    80     cc_udp_agent_initial_handshake();
     50    new Udp_Agent( $this_agent_ver, $root_dir, $engine_url, $udp_admin_notice_displayed );
     51    if ( ! isset( $udp_admin_notice_displayed ) || ! $udp_admin_notice_displayed ) {
     52        $udp_admin_notice_displayed = true;
     53        add_action(
     54            'admin_init',
     55            function () {
     56                $root_dir = dirname( dirname( __DIR__ ) );
     57
     58                $show_admin_notice = true;
     59                $users_choice      = get_option( 'udp_agent_allow_tracking' );
     60
     61                if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
     62
     63                    // user has already clicked "yes" or "no" in admin notice.
     64                    // do not show this notice.
     65                    $show_admin_notice = false;
     66
     67                } else {
     68
     69                    $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
     70
     71                    if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
     72                        // do not show,
     73                        // if last admin notice was shown less than 1 day ago.
     74                        $show_admin_notice = false;
     75                    }
     76                }
     77
     78                if ( ! $show_admin_notice ) {
     79                    return;
     80                }
     81                if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     82                    $plugin_file = $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php';
     83                    $plugin_data = get_file_data(
     84                        $plugin_file,
     85                        array(
     86                            'name'       => 'Plugin Name',
     87                            'textdomain' => 'Text Domain',
     88                        )
     89                    );
     90
     91                    $agent_name = $plugin_data['name'];
     92                } else {
     93                    $theme      = wp_get_theme();
     94                    $agent_name = $theme->name;
     95                }
     96
     97                $content = '<p>' . sprintf(
     98                    /* translators: %s: agent name */
     99                    esc_html__( '%s is asking to allow tracking your non-sensitive WordPress data?', 'simple-gdpr-cookie-compliance' ),
     100                    $agent_name
     101                ) . '</p><p>';
     102
     103                $content .= sprintf(
     104                    /* translators: %s: agent allow access link, %s: Allow */
     105                    '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     106                    add_query_arg( 'udp-agent-allow-access', 'yes' ),
     107                    esc_html__( 'Allow', 'simple-gdpr-cookie-compliance' )
     108                );
     109
     110                $content .= sprintf(
     111                    /* translators: %s: agent allow access link, %s: Allow */
     112                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>',
     113                    add_query_arg( 'udp-agent-allow-access', 'no' ),
     114                    esc_html__( 'Do not show again', 'simple-gdpr-cookie-compliance' )
     115                );
     116
     117                $content .= sprintf(
     118                    /* translators: %s: agent allow access link, %s: Allow */
     119                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     120                    add_query_arg( 'udp-agent-allow-access', 'later' ),
     121                    esc_html__( 'Later', 'simple-gdpr-cookie-compliance' )
     122                );
     123
     124                $content .= '</p>';
     125                add_action(
     126                    'load-index.php',
     127                    function () use ( $content ) {
     128                        add_action(
     129                            'admin_notices',
     130                            function() use ( $content ) {
     131                                $class = 'is-dismissible  notice notice-warning';
     132                                printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $content ) );
     133                            }
     134                        );
     135                    }
     136                );
     137            }
     138        );
     139    }
    81140}
    82141
     
    85144// -------------------------------------------
    86145
    87 // for plugin.
    88 register_activation_hook(
    89     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
    90     'cc_udp_agent_initial_handshake'
    91 );
     146if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     147    // for plugin.
     148    register_activation_hook(
     149        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     150        function () use ( $this_agent_ver, $engine_url ) {
     151            $root_dir = dirname( dirname( __DIR__ ) );
     152
     153            // authorize this agent with engine.
     154            if ( ! class_exists( 'Udp_Agent' ) ) {
     155                require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
     156            }
     157            $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
     158            $agent->do_handshake();
     159
     160            // show admin notice if user selected "no" but new agent is installed.
     161            $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
     162            if ( 'no' === $show_admin_notice ) {
     163                $active_agent = get_option( 'udp_active_agent_basename' );
     164                if ( basename( $root_dir ) !== $active_agent ) {
     165                    update_option( 'udp_active_agent_basename', basename( $root_dir ) );
     166                    delete_option( 'udp_agent_allow_tracking' );
     167                }
     168            }
     169        }
     170    );
     171}
    92172
    93173if ( ! function_exists( 'cc_udp_agent_send_data_on_action' ) ) {
     
    164244// -------------------------------------------
    165245
    166 // for plugin.
    167 register_deactivation_hook(
    168     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     246if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     247    // for plugin.
     248    register_deactivation_hook(
     249        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     250        function () use ( $root_dir ) {
     251
     252            $installed_agents = get_option( 'udp_installed_agents', array() );
     253            if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
     254                unset( $installed_agents[ basename( $root_dir ) ] );
     255            }
     256
     257            // remove this agent from the list of active agents.
     258            update_option( 'udp_installed_agents', $installed_agents );
     259            $timestamp = wp_next_scheduled( 'udp_agent_cron' );
     260            wp_unschedule_event( $timestamp, 'udp_agent_cron' );
     261        }
     262    );
     263}
     264
     265// for theme.
     266add_action(
     267    'switch_theme',
    169268    function () use ( $root_dir ) {
    170269
     
    176275        // remove this agent from the list of active agents.
    177276        update_option( 'udp_installed_agents', $installed_agents );
    178         $timestamp = wp_next_scheduled( 'udp_agent_cron' );
    179         wp_unschedule_event( $timestamp, 'udp_agent_cron' );
    180     }
    181 );
    182 
    183 // for theme.
    184 add_action(
    185     'switch_theme',
    186     function () use ( $root_dir ) {
    187 
    188         $installed_agents = get_option( 'udp_installed_agents', array() );
    189         if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
    190             unset( $installed_agents[ basename( $root_dir ) ] );
    191         }
    192 
    193         // remove this agent from the list of active agents.
    194         update_option( 'udp_installed_agents', $installed_agents );
    195     }
    196 );
     277    }
     278);
  • simple-gdpr-cookie-compliance/trunk/languages/simple-gdpr-cookie-compliance.pot

    r2662024 r2874093  
    1 # Copyright (C) 2021 Simple GDPR Cookie Compliance
    2 # This file is distributed under the same license as the Simple GDPR Cookie Compliance package.
     1# Copyright (C) 2023 themebeez
     2# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Simple GDPR Cookie Compliance\n"
     5"Project-Id-Version: Simple GDPR Cookie Compliance 1.1.2\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-gdpr-cookie-compliance\n"
     7"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     8"Language-Team: LANGUAGE <LL@li.org>\n"
    69"MIME-Version: 1.0\n"
    710"Content-Type: text/plain; charset=UTF-8\n"
    811"Content-Transfer-Encoding: 8bit\n"
    9 "X-Poedit-Basepath: ..\n"
    10 "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"
    11 "X-Poedit-SearchPath-0: .\n"
    12 "X-Poedit-SearchPathExcluded-0: *.js\n"
    13 "X-Poedit-SourceCharset: UTF-8\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    15 
    16 #: admin/class-simple-gdpr-cookie-compliance-admin.php:115, admin/partials/simple-gdpr-cookie-compliance-admin-page.php:21
     12"POT-Creation-Date: 2023-03-03T06:22:18+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.7.1\n"
     15"X-Domain: simple-gdpr-cookie-compliance\n"
     16
     17#. Plugin Name of the plugin
     18#: admin/class-simple-gdpr-cookie-compliance-admin.php:115
     19#: admin/partials/simple-gdpr-cookie-compliance-admin-page.php:21
    1720msgid "Simple GDPR Cookie Compliance"
     21msgstr ""
     22
     23#. Plugin URI of the plugin
     24msgid "https://themebeez.com/plugins/simple-gdpr-cookie-compliance"
     25msgstr ""
     26
     27#. Description of the plugin
     28msgid "Simple GDPR Cookie Compliance is a simple notifier to inform users that your site uses of cookies and show your complies with EU GDPR cookie law and CCPA regulations."
     29msgstr ""
     30
     31#. Author of the plugin
     32msgid "themebeez"
     33msgstr ""
     34
     35#. Author URI of the plugin
     36msgid "https://themebeez.com/"
    1837msgstr ""
    1938
     
    4665msgstr ""
    4766
    48 #: admin/class-simple-gdpr-cookie-compliance-settings.php:127, public/class-simple-gdpr-cookie-compliance-public.php:146
     67#: admin/class-simple-gdpr-cookie-compliance-settings.php:127
     68#: public/class-simple-gdpr-cookie-compliance-public.php:153
    4969msgid "Our website uses cookies to provide you the best experience. However, by continuing to use our website, you agree to our use of cookies. For more information, read our <a href=\"#\">Cookie Policy</a>."
    5070msgstr ""
     
    158178msgstr ""
    159179
    160 #: admin/class-simple-gdpr-cookie-compliance-settings.php:314, admin/class-simple-gdpr-cookie-compliance-settings.php:333
     180#: admin/class-simple-gdpr-cookie-compliance-settings.php:314
     181#: admin/class-simple-gdpr-cookie-compliance-settings.php:333
    161182msgid "Position"
    162183msgstr ""
     
    222243msgstr ""
    223244
    224 #: admin/class-simple-gdpr-cookie-compliance-settings.php:435, admin/class-simple-gdpr-cookie-compliance-settings.php:445, admin/class-simple-gdpr-cookie-compliance-settings.php:471, admin/class-simple-gdpr-cookie-compliance-settings.php:493
     245#: admin/class-simple-gdpr-cookie-compliance-settings.php:435
     246#: admin/class-simple-gdpr-cookie-compliance-settings.php:445
     247#: admin/class-simple-gdpr-cookie-compliance-settings.php:471
     248#: admin/class-simple-gdpr-cookie-compliance-settings.php:493
    225249msgid "Background"
    226250msgstr ""
     
    234258msgstr ""
    235259
    236 #: admin/class-simple-gdpr-cookie-compliance-settings.php:453, admin/class-simple-gdpr-cookie-compliance-settings.php:479, admin/class-simple-gdpr-cookie-compliance-settings.php:509
     260#: admin/class-simple-gdpr-cookie-compliance-settings.php:453
     261#: admin/class-simple-gdpr-cookie-compliance-settings.php:479
     262#: admin/class-simple-gdpr-cookie-compliance-settings.php:509
    237263msgid "Text"
    238264msgstr ""
     
    250276msgstr ""
    251277
    252 #: admin/class-simple-gdpr-cookie-compliance-settings.php:475, admin/class-simple-gdpr-cookie-compliance-settings.php:497
     278#: admin/class-simple-gdpr-cookie-compliance-settings.php:475
     279#: admin/class-simple-gdpr-cookie-compliance-settings.php:497
    253280msgid "Background - On Hover"
    254281msgstr ""
    255282
    256 #: admin/class-simple-gdpr-cookie-compliance-settings.php:483, admin/class-simple-gdpr-cookie-compliance-settings.php:513
     283#: admin/class-simple-gdpr-cookie-compliance-settings.php:483
     284#: admin/class-simple-gdpr-cookie-compliance-settings.php:513
    257285msgid "Text - On Hover"
    258286msgstr ""
     
    278306msgstr ""
    279307
    280 #: public/class-simple-gdpr-cookie-compliance-public.php:144
     308#: includes/udp/class-udp-agent.php:116
     309msgid "Allow Anonymous Tracking"
     310msgstr ""
     311
     312#: includes/udp/class-udp-agent.php:160
     313msgid "Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected."
     314msgstr ""
     315
     316#: includes/udp/class-udp-agent.php:161
     317msgid " What data do we collect?"
     318msgstr ""
     319
     320#. translators: %s: agent name
     321#: includes/udp/init.php:99
     322msgid "%s is asking to allow tracking your non-sensitive WordPress data?"
     323msgstr ""
     324
     325#: includes/udp/init.php:107
     326msgid "Allow"
     327msgstr ""
     328
     329#: includes/udp/init.php:114
     330msgid "Do not show again"
     331msgstr ""
     332
     333#: includes/udp/init.php:121
     334msgid "Later"
     335msgstr ""
     336
     337#: public/class-simple-gdpr-cookie-compliance-public.php:151
    281338msgid "Notice regarding cookie compliance is not set. Go to %s to set the notice."
    282339msgstr ""
    283340
    284 #: public/class-simple-gdpr-cookie-compliance-public.php:144
     341#: public/class-simple-gdpr-cookie-compliance-public.php:151
    285342msgid "Dashboard > Simple GDPR"
    286343msgstr ""
  • simple-gdpr-cookie-compliance/trunk/simple-gdpr-cookie-compliance.php

    r2867952 r2874093  
    55 * Plugin URI:        https://themebeez.com/plugins/simple-gdpr-cookie-compliance
    66 * Description:       Simple GDPR Cookie Compliance is a simple notifier to inform users that your site uses of cookies and show your complies with EU GDPR cookie law and CCPA regulations.
    7  * Version:           1.1.1
     7 * Version:           1.1.2
    88 * Author:            themebeez
    99 * Author URI:        https://themebeez.com/
     
    2424 * Rename this for your plugin and update it as you release new versions.
    2525 */
    26 define( 'SIMPLE_GDPR_COOKIE_COMPLIANCE_VERSION', '1.1.1' );
     26define( 'SIMPLE_GDPR_COOKIE_COMPLIANCE_VERSION', '1.1.2' );
    2727define( 'SIMPLE_GDPR_COOKIE_COMPLIANCE_BASENAME', plugin_basename( __FILE__ ) );
    2828
Note: See TracChangeset for help on using the changeset viewer.