Plugin Directory

Changeset 3067755


Ignore:
Timestamp:
04/09/2024 03:04:04 PM (2 years ago)
Author:
schweizersolutions
Message:

2.3

  • Fixed: Analytify - Detection of whether IP anonymization is activated
  • Updated: CSStidy library to v2.1.0
  • Updated: Support for WordPress 6.5
  • Updated: readme.txt
Location:
opt-out-for-google-analytics/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • opt-out-for-google-analytics/trunk/inc/utils.class.php

    r2896199 r3067755  
    411411            elseif ( $data[ 'ga_plugin' ] == 'analytify' && class_exists( 'WP_Analytify' ) ) {
    412412                $analytify        = WP_Analytify::get_instance();
    413                 $anonymip_enabled = $analytify->settings->get_option( 'anonymize_ip', 'wp-analytify-advanced' );
     413                $anonymip_enabled = ( 'on' == $analytify->settings->get_option( 'anonymize_ip', 'wp-analytify-advanced' ) );
    414414                $anonymip_url     = admin_url( 'admin.php?page=analytify-settings#wp-analytify-advanced' );
    415415                $uacode_url       = admin_url( 'admin.php?page=analytify-settings#wp-analytify-authentication' );
  • opt-out-for-google-analytics/trunk/lib/csstidy/class.csstidy.php

    r2787042 r3067755  
    5252 * @version 1.1.0
    5353 */
    54 require('class.csstidy_print.php');
     54require(__DIR__ . DIRECTORY_SEPARATOR . 'class.csstidy_print.php');
    5555
    5656/**
     
    5959 * @version 1.0
    6060 */
    61 require('class.csstidy_optimise.php');
     61require(__DIR__ . DIRECTORY_SEPARATOR . 'class.csstidy_optimise.php');
    6262
    6363/**
     
    7171 * @package csstidy
    7272 * @author Florian Schmitz (floele at gmail dot com) 2005-2006
    73  * @version 2.0.0
     73 * @version 2.1.0
    7474 */
    7575class csstidy {
     
    124124     * @access private
    125125     */
    126     public $version = '1.7.3';
     126    public $version = '2.0.3';
    127127    /**
    128128     * Stores the settings
     
    258258    public $data = array();
    259259
     260    public $template;
     261
    260262    /**
    261263     * Loads standard template and sets default settings
     
    265267    public function __construct() {
    266268        $data = array();
    267         include('data.inc.php');
     269        include(__DIR__ . DIRECTORY_SEPARATOR . 'data.inc.php');
    268270        $this->data = $data;
    269271
  • opt-out-for-google-analytics/trunk/lib/csstidy/class.csstidy_optimise.php

    r2787042 r3067755  
    4848     */
    4949    public $parser;
     50    public $css;
     51    public $sub_value;
     52    public $at;
     53    public $selector;
     54    public $property;
     55    public $value;
    5056
    5157    /**
     
    310316
    311317        /* expressions complexes de type gradient */
    312         if (strpos($color, '(') !== false && strncmp($color, 'rgb(' ,4) != 0) {
     318        if (strpos($color, '(') !== false
     319            && (strncasecmp($color, 'rgb(' ,4) !== 0 and strncasecmp($color, 'rgba(' ,5) !== 0)) {
    313320            // on ne touche pas aux couleurs dans les expression ms, c'est trop sensible
    314321            if (stripos($color, 'progid:') !== false)
    315322                return $color;
    316             preg_match_all(",rgb\([^)]+\),i", $color, $matches, PREG_SET_ORDER);
     323            preg_match_all(",rgba?\([^)]+\),i", $color, $matches, PREG_SET_ORDER);
    317324            if (count($matches)) {
    318325                foreach ($matches as $m) {
     
    330337
    331338        // rgb(0,0,0) -> #000000 (or #000 in this case later)
    332         if (strncasecmp($color, 'rgb(', 4)==0) {
    333             $color_tmp = substr($color, 4, strlen($color) - 5);
    334             $color_tmp = explode(',', $color_tmp);
    335             for ($i = 0; $i < count($color_tmp); $i++) {
    336                 $color_tmp[$i] = trim($color_tmp[$i]);
    337                 if (substr($color_tmp[$i], -1) === '%') {
    338                     $color_tmp[$i] = round((255 * $color_tmp[$i]) / 100);
    339                 }
    340                 if ($color_tmp[$i] > 255)
    341                     $color_tmp[$i] = 255;
     339        if (
     340            // be sure to not corrupt a rgb with calc() value
     341            (strncasecmp($color, 'rgb(', 4)==0 and strpos($color, '(', 4) === false)
     342            or (strncasecmp($color, 'rgba(', 5)==0 and strpos($color, '(', 5) === false)
     343        ){
     344            $color_tmp = explode('(', $color, 2);
     345            $color_tmp = rtrim(end($color_tmp), ')');
     346            if (strpos($color_tmp, '/') !== false) {
     347                $color_tmp = explode('/', $color_tmp, 2);
     348                $color_parts = explode(' ', trim(reset($color_tmp)), 3);
     349                while (count($color_parts) < 3) {
     350                    $color_parts[] = 0;
     351                }
     352                $color_parts[] = end($color_tmp);
     353            }
     354            else {
     355                $color_parts = explode(',', $color_tmp, 4);
     356            }
     357            for ($i = 0; $i < count($color_parts); $i++) {
     358                $color_parts[$i] = trim($color_parts[$i]);
     359                if (substr($color_parts[$i], -1) === '%') {
     360                    $color_parts[$i] = round((255 * intval($color_parts[$i])) / 100);
     361                } elseif ($i>2) {
     362                    // 4th argument is alpga layer between 0 and 1 (if not %)
     363                    $color_parts[$i] = round((255 * floatval($color_parts[$i])));
     364                }
     365                $color_parts[$i] = intval($color_parts[$i]);
     366                if ($color_parts[$i] > 255){
     367                    $color_parts[$i] = 255;
     368                }
    342369            }
    343370            $color = '#';
    344             for ($i = 0; $i < 3; $i++) {
    345                 if ($color_tmp[$i] < 16) {
    346                     $color .= '0' . dechex($color_tmp[$i]);
     371            // 3 or 4 parts depending on alpha layer
     372            $nb = min(max(count($color_parts), 3),4);
     373            for ($i = 0; $i < $nb; $i++) {
     374                if (!isset($color_parts[$i])) {
     375                    $color_parts[$i] = 0;
     376                }
     377                if ($color_parts[$i] < 16) {
     378                    $color .= '0' . dechex($color_parts[$i]);
    347379                } else {
    348                     $color .= dechex($color_tmp[$i]);
     380                    $color .= dechex($color_parts[$i]);
    349381                }
    350382            }
     
    361393            if ($color_temp[0] === '#' && $color_temp[1] == $color_temp[2] && $color_temp[3] == $color_temp[4] && $color_temp[5] == $color_temp[6]) {
    362394                $color = '#' . $color[1] . $color[3] . $color[5];
     395            }
     396        }
     397        // #aabbccdd -> #abcd
     398        elseif (strlen($color) == 9) {
     399            $color_temp = strtolower($color);
     400            if ($color_temp[0] === '#' && $color_temp[1] == $color_temp[2] && $color_temp[3] == $color_temp[4] && $color_temp[5] == $color_temp[6] && $color_temp[7] == $color_temp[8]) {
     401                $color = '#' . $color[1] . $color[3] . $color[5] . $color[7];
    363402            }
    364403        }
     
    421460                    $number[1] = 'px';
    422461                }
    423                         } elseif ($number[1] != 's' && $number[1] != 'ms') {
    424                                 $number[1] = '';
    425                         }
     462            } elseif ($number[1] != 's' && $number[1] != 'ms') {
     463                $number[1] = '';
     464            }
    426465
    427466            $temp[$l] = $number[0] . $number[1];
  • opt-out-for-google-analytics/trunk/lib/csstidy/class.csstidy_print.php

    r2787042 r3067755  
    6666     */
    6767    public $output_css_plain = '';
     68
     69    public $css;
     70    public $template;
     71    public $tokens;
     72    public $charset;
     73    public $import;
     74    public $namespace;
    6875
    6976    /**
  • opt-out-for-google-analytics/trunk/readme.txt

    r2896199 r3067755  
    33Tags: google analytics, opt-out, dsgvo, gdpr, analytics
    44Requires at least: 3.5
    5 Tested up to: 6.2
     5Tested up to: 6.5
    66Requires PHP: 7.0
    7 Stable tag: 2.2
     7Stable tag: 2.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2525* Compatible with Google Tag Manager.
    2626* **NO other plugin needed** to use the Google Analytics code on the website. This can be integrated directly by this plugin.
    27 * Site visitors can deactivate the Google Analytics tracking for themselves and also activate it again afterwards.
     27* Site visitors can deactivate the Google Analytics tracking for themselves and also activate it again afterward.
    2828* Link text for the activation and deactivation link can be changed individually.
    2929* A popup can be set up, which appears after clicking the link.
    30 * The UA-Code can be entered manually or read out automatically by a Google Analytics tracking plugin (see compatible plugins).
     30* The UA-Code or GA4-Code can be entered manually or read out automatically by a Google Analytics tracking plugin (see compatible plugins).
    3131* HTML5 Local Storage Fallback: If a user deletes his cookies, the opt-out cookie can be restored if the local storage was not additionally deleted by the browser.
    3232* WordPress Multisite compatible.
     
    6060* [MonsterInsights Pro](https://www.monsterinsights.com/?utm_source=wordpressorg&utm_medium=opt-out-for-google-analytics)
    6161* [MonsterInsights – Google Analytics Dashboard for WordPress (Website Stats Made Easy)](https://wordpress.org/plugins/google-analytics-for-wordpress/)
    62 * [ExactMetrics – Google Analytics Dashboard for WordPress (Website Stats Plugin)](https://wordpress.org/plugins/google-analytics-dashboard-for-wp/)
     62* [Google Analytics Dashboard for WP (GADWP)](https://wordpress.org/plugins/google-analytics-dashboard-for-wp/)
    6363* [Analytify – Google Analytics Dashboard Plugin For WordPress](https://wordpress.org/plugins/wp-analytify/)
    6464* [GA Google Analytics](https://wordpress.org/plugins/ga-google-analytics/)
     
    1001004. Save changes, done!
    101101
    102 **Note on UA-Code:**
    103 
    104 If you have entered the Google Analytics tracking code manually, e.g. with a WordPress theme, then you must enter the UA-Code in the input field.
    105 If you have activated one of the three compatible plugins, then this item is also selectable. This will automatically read the current UA-Code from this plugin and you do not have to enter it in the input field.
     102**Note on UA-Code & GA4-Code:**
     103
     104If you have entered the Google Analytics tracking code manually, e.g. with a WordPress theme, then you must enter the tracking code in the input field.
     105If you have activated one of the compatible Google Analytics plugins, then this item is also selectable. This will automatically read the current tracking code from this plugin, and you do not have to enter it in the input field.
    106106
    107107== Frequently Asked Questions ==
     
    156156add_action( 'gaoo_before_shortcode', 'my_before_shortcode', 10, 2);
    157157
    158 function my_before_shortcode( $ua_code, $current_status ) {
    159     // $ua_code - Der verwendete UA-Code "UA-XXXXX-Y"
    160     // $current_status - Der aktuelle Status vom Seitenbesucher: activate oder deactivate
     158function my_before_shortcode( $tracking_code, $current_status ) {
     159    // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX"
     160    // $current_status - The current status of the page visitor: activate or deactivate
    161161}
    162162
     
    164164add_action( 'gaoo_after_shortcode', 'my_after_shortcode', 10, 2);
    165165
    166 function my_after_shortcode( $ua_code, $current_status ) {
    167     // $ua_code - The used UA-Code "UA-XXXXX-Y"
     166function my_after_shortcode( $tracking_code, $current_status ) {
     167    // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX"
    168168    // $current_status - The current status of the page visitor: activate or deactivate
    169169}
     
    172172add_action( 'gaoo_before_head_script', 'my_before_script', 10, 1);
    173173
    174 function my_before_script( $ua_code ) {
    175     // $ua_code - The used UA-Code "UA-XXXXX-Y"
     174function my_before_script( $tracking_code ) {
     175    // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX"
    176176}
    177177
     
    179179add_action( 'gaoo_after_head_script', 'my_after_script', 10, 1);
    180180
    181 function my_after_script( $ua_code ) {
    182     // $ua_code - The used UA-Code "UA-XXXXX-Y"
     181function my_after_script( $tracking_code ) {
     182    // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX"
    183183}
    184184
    185185// The UA-Code used
    186 add_filter( 'gaoo_get_ua_code', 'my_ua_code', 10, 2 );
    187 
    188 function my_ua_code( $ua_code, $ga_plugin ) {
    189     // $ua_code - The used UA-Code "UA-XXXXX-Y"
    190     // $ga_plugin - Selected source for the UA-Code
     186add_filter( 'gaoo_get_ua_code', 'my_ga_tracking_code', 10, 2 );
     187
     188function my_ga_tracking_code( $tracking_code, $ga_plugin ) {
     189    // $tracking_code - The current used tracking code "UA-XXXXX-Y" OR "G-XXXXXXXXXX"
     190    // $ga_plugin - Selected source for the tracking code
    191191}
    192192
     
    265265The opt-out has only taken place if the value "true" is returned.
    266266
    267 Specific cookie, with the corresponding UA-Code: ga-disable-UA-XXXXX-YY
     267Specific cookie, with the corresponding tracking code: ga-disable-UA-XXXXX-YY or ga-disable-G-XXXXXXXXX
    268268Generic Cookie: ga-opt-out
    269269
    270 Specific entry in the HTML5 Local Storage:  ga-disable-UA-XXXXX-YY
     270Specific entry in the HTML5 Local Storage:  ga-disable-UA-XXXXX-YY or ga-disable-G-XXXXXXXXX
    271271Generic entry in the HTML5 Local Storage: ga-opt-out
    272272
     
    287287
    288288== Changelog ==
     289
     290= 2.3 =
     291* Fixed: Analytify - Detection of whether IP anonymization is activated
     292* Updated: CSStidy library to v2.1.0
     293* Updated: Support for WordPress 6.5
     294* Updated: readme.txt
    289295
    290296= 2.2 =
Note: See TracChangeset for help on using the changeset viewer.