Plugin Directory

Changeset 2832242 for wp-slimstat


Ignore:
Timestamp:
12/12/2022 09:58:00 AM (3 years ago)
Author:
mostafa.s1990
Message:

Update to version 4.9.3 from GitHub

Location:
wp-slimstat
Files:
4 added
16 deleted
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-slimstat/tags/4.9.3/admin/view/addons.php

    r2158767 r2832242  
    4242    if ( empty( $_GET[ 'force_refresh' ] ) ) {
    4343        echo ' ';
    44         printf( __( 'This list is refreshed once daily: <a href="%s&amp;force_refresh=true" class="noslimstat">click here</a> to clear the cache.', 'wp-slimstat' ), $_SERVER[ 'REQUEST_URI' ] );
     44        printf( __( 'This list is refreshed once daily: <a href="%s&amp;force_refresh=true" class="noslimstat">click here</a> to clear the cache.', 'wp-slimstat' ), esc_url($_SERVER[ 'REQUEST_URI' ]) );
    4545    }
    4646
  • wp-slimstat/tags/4.9.3/admin/view/right-now.php

    r2173722 r2832242  
    191191        }
    192192
    193         $results[ $i ][ 'resource' ] = "<a class='slimstat-font-logout slimstat-tooltip-trigger' target='_blank' title='" . htmlentities( __( 'Open this URL in a new window', 'wp-slimstat' ), ENT_QUOTES, 'UTF-8' ) . "' href='" . htmlentities( $results[$i][ 'resource' ], ENT_QUOTES, 'UTF-8' ) . "'></a> <a class='slimstat-filter-link' href='" . wp_slimstat_reports::fs_url( 'resource equals ' . $results[ $i ][ 'resource' ] ) . "'>" . $resource_title . '</a>';
     193        $results[ $i ][ 'resource' ] = "<a class='slimstat-font-logout slimstat-tooltip-trigger' target='_blank' title='" . htmlentities( __( 'Open this URL in a new window', 'wp-slimstat' ), ENT_QUOTES, 'UTF-8' ) . "' href='" . htmlentities( $results[$i][ 'resource' ], ENT_QUOTES, 'UTF-8' ) . "'></a> <a class='slimstat-filter-link' href='" . wp_slimstat_reports::fs_url( 'resource equals ' . esc_url($results[ $i ][ 'resource' ]) ) . "'>" . esc_html($resource_title) . '</a>';
    194194    }
    195195    else {
  • wp-slimstat/tags/4.9.3/admin/view/wp-slimstat-reports.php

    r2695016 r2832242  
    17381738        }
    17391739
    1740         return $request_uri;
     1740        return esc_url($request_uri);
    17411741    }
    17421742
  • wp-slimstat/tags/4.9.3/readme.txt

    r2818802 r2832242  
    66Requires PHP: 7.4+
    77Tested up to: 6.1
    8 Stable tag: 4.9.2
     8Stable tag: 4.9.3
    99
    1010== Description ==
     
    3232== Installation ==
    33331. In your WordPress admin, go to Plugins > Add New
    34 2. Search for limstat Analytics
     342. Search for Slimstat Analytics
    35353. Click on **Install Now** next to Slimstat Analytics and then activate the plugin
    36364. Make sure your template calls `wp_footer()` or the equivalent hook somewhere (possibly just before the `</body>` tag)
     
    5050
    5151== Changelog ==
     52= 4.9.3 =
     53* [Update] New logo and icon for the plugin!
     54* [Fix] Hardened plugin security and sanitization of user input and escaped output
     55
    5256= 4.9.2 =
    5357* [Fix] Fixed tweak notice errors while activating the plugin in fresh installation
  • wp-slimstat/tags/4.9.3/wp-slimstat.php

    r2818802 r2832242  
    44Plugin URI: https://wp-slimstat.com/
    55Description: The leading web analytics plugin for WordPress
    6 Version: 4.9.2
     6Version: 4.9.3
    77Author: Jason Crouse, VeronaLabs
    88Text Domain: wp-slimstat
    99Domain Path: /languages
     10Author URI: https://wp-slimstat.com/
    1011Requires PHP: 7.4
    1112*/
     
    361362                }
    362363            }
    363        
     364
    364365            $cookie_found = false;
    365366            foreach ( $cookie_names as $a_name => $a_value ) {
     
    570571        }
    571572
    572         // Geolocation 
     573        // Geolocation
    573574        include_once( plugin_dir_path( __FILE__ ) . 'vendor/maxmind.php' );
    574575        try {
     
    705706
    706707        if ( isset( $_SERVER[ 'REQUEST_URI' ] ) ) {
    707             return urldecode( $_SERVER[ 'REQUEST_URI' ] );
     708            return urldecode( sanitize_url(wp_unslash($_SERVER['REQUEST_URI'])) );
    708709        }
    709710        else if ( isset( $_SERVER[ 'SCRIPT_NAME' ] ) ) {
     
    854855                                    $output[ $result_idx ][ $a_column ] .=  $a_result[ 'username' ];
    855856                                }
    856                                
     857
    857858                                break;
    858859
     
    13531354
    13541355        $update_checker_objects = array();
    1355        
     1356
    13561357        // This is only included if add-ons are installed
    13571358        include_once( plugin_dir_path( __FILE__ ) . 'vendor/update-checker/plugin-update-checker.php' );
     
    13591360        foreach ( self::$update_checker as $a_slug ) {
    13601361            $a_clean_slug = str_replace( array( 'wp_slimstat_', '_' ), array( '', '-' ), $a_slug );
    1361            
     1362
    13621363            if ( !empty( self::$settings[ 'addon_licenses' ][ 'wp-slimstat-' . $a_clean_slug ] ) ) {
    13631364                $update_checker_objects[ $a_clean_slug ] = Puc_v4_Factory::buildUpdateChecker( 'https://www.wp-slimstat.com/update-checker/?slug=' . $a_clean_slug . '&key=' . urlencode( self::$settings[ 'addon_licenses' ][ 'wp-slimstat-' . $a_clean_slug ] ), dirname( dirname( __FILE__ ) ) . '/wp-slimstat-' . $a_clean_slug . '/index.php', 'wp-slimstat-' . $a_clean_slug );
     
    14581459        }
    14591460
    1460         // Remove unwanted characters (SQL injections, anyone?)
     1461        // Remove unwanted characters from keys (SQL injections, anyone?)
    14611462        $data_keys = array();
    14621463        foreach ( array_keys( $_data ) as $a_key ) {
    14631464            $data_keys[] = sanitize_key( $a_key );
    14641465        }
     1466
     1467        // Remove unwanted characters from data (SQL injections, anyone?)
     1468        foreach ($_data as $key => $value) {
     1469            $_data[$key] = sanitize_text_field($value);
     1470        }
    14651471
    14661472        self::$wpdb->query( self::$wpdb->prepare( "
     
    19511957     */
    19521958    protected static function _base64_url_encode( $_input = '' ) {
    1953         return strtr( base64_encode( $_input ), '+/=', '._-' ); 
    1954     } 
     1959        return strtr( base64_encode( $_input ), '+/=', '._-' );
     1960    }
    19551961    protected static function _base64_url_decode( $_input = '' ) {
    19561962        return strip_tags( trim( base64_decode( strtr( $_input, '._-', '+/=' ) ) ) );
     
    19651971     */
    19661972    public function __construct() {
    1967         parent::__construct( 'slimstat_widget', 'Slimstat', array( 
     1973        parent::__construct( 'slimstat_widget', 'Slimstat', array(
    19681974            'classname' => 'slimstat_widget',
    19691975            'description' => 'Add a Slimstat report to your sidebar',
     
    20182024
    20192025        <p>
    2020         <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_id' ) ); ?>"><?php _e( 'Report', 'wp-slimstat' ) ?></label> 
     2026        <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_id' ) ); ?>"><?php _e( 'Report', 'wp-slimstat' ) ?></label>
    20212027        <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_id' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'slimstat_widget_id' ) ); ?>">
    20222028            <option value="">Select a widget</option>
     
    20262032
    20272033        <p>
    2028         <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_title' ) ); ?>"><?php _e( 'Title', 'wp-slimstat' ) ?></label> 
     2034        <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_title' ) ); ?>"><?php _e( 'Title', 'wp-slimstat' ) ?></label>
    20292035        <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'slimstat_widget_title' ) ); ?>" value="<?php echo trim( strip_tags( $slimstat_widget_title ) ) ?>">
    20302036        </p>
    20312037
    20322038        <p>
    2033         <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_filters' ) ); ?>"><?php _e( 'Optional filters', 'wp-slimstat' ); ?></label> 
     2039        <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_filters' ) ); ?>"><?php _e( 'Optional filters', 'wp-slimstat' ); ?></label>
    20342040        <a href="https://slimstat.freshdesk.com/solution/articles/5000631833-what-is-the-syntax-of-a-slimstat-shortcode-#slimstat-operators" target="_blank">[?]</a>
    20352041        <textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_filters' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'slimstat_widget_filters' ) ); ?>"><?php echo trim( strip_tags( $slimstat_widget_filters ) ) ?></textarea>
  • wp-slimstat/trunk/admin/view/addons.php

    r2158767 r2832242  
    4242    if ( empty( $_GET[ 'force_refresh' ] ) ) {
    4343        echo ' ';
    44         printf( __( 'This list is refreshed once daily: <a href="%s&amp;force_refresh=true" class="noslimstat">click here</a> to clear the cache.', 'wp-slimstat' ), $_SERVER[ 'REQUEST_URI' ] );
     44        printf( __( 'This list is refreshed once daily: <a href="%s&amp;force_refresh=true" class="noslimstat">click here</a> to clear the cache.', 'wp-slimstat' ), esc_url($_SERVER[ 'REQUEST_URI' ]) );
    4545    }
    4646
  • wp-slimstat/trunk/admin/view/right-now.php

    r2173722 r2832242  
    191191        }
    192192
    193         $results[ $i ][ 'resource' ] = "<a class='slimstat-font-logout slimstat-tooltip-trigger' target='_blank' title='" . htmlentities( __( 'Open this URL in a new window', 'wp-slimstat' ), ENT_QUOTES, 'UTF-8' ) . "' href='" . htmlentities( $results[$i][ 'resource' ], ENT_QUOTES, 'UTF-8' ) . "'></a> <a class='slimstat-filter-link' href='" . wp_slimstat_reports::fs_url( 'resource equals ' . $results[ $i ][ 'resource' ] ) . "'>" . $resource_title . '</a>';
     193        $results[ $i ][ 'resource' ] = "<a class='slimstat-font-logout slimstat-tooltip-trigger' target='_blank' title='" . htmlentities( __( 'Open this URL in a new window', 'wp-slimstat' ), ENT_QUOTES, 'UTF-8' ) . "' href='" . htmlentities( $results[$i][ 'resource' ], ENT_QUOTES, 'UTF-8' ) . "'></a> <a class='slimstat-filter-link' href='" . wp_slimstat_reports::fs_url( 'resource equals ' . esc_url($results[ $i ][ 'resource' ]) ) . "'>" . esc_html($resource_title) . '</a>';
    194194    }
    195195    else {
  • wp-slimstat/trunk/admin/view/wp-slimstat-reports.php

    r2695016 r2832242  
    17381738        }
    17391739
    1740         return $request_uri;
     1740        return esc_url($request_uri);
    17411741    }
    17421742
  • wp-slimstat/trunk/readme.txt

    r2818802 r2832242  
    66Requires PHP: 7.4+
    77Tested up to: 6.1
    8 Stable tag: 4.9.2
     8Stable tag: 4.9.3
    99
    1010== Description ==
     
    3232== Installation ==
    33331. In your WordPress admin, go to Plugins > Add New
    34 2. Search for limstat Analytics
     342. Search for Slimstat Analytics
    35353. Click on **Install Now** next to Slimstat Analytics and then activate the plugin
    36364. Make sure your template calls `wp_footer()` or the equivalent hook somewhere (possibly just before the `</body>` tag)
     
    5050
    5151== Changelog ==
     52= 4.9.3 =
     53* [Update] New logo and icon for the plugin!
     54* [Fix] Hardened plugin security and sanitization of user input and escaped output
     55
    5256= 4.9.2 =
    5357* [Fix] Fixed tweak notice errors while activating the plugin in fresh installation
  • wp-slimstat/trunk/wp-slimstat.php

    r2818802 r2832242  
    44Plugin URI: https://wp-slimstat.com/
    55Description: The leading web analytics plugin for WordPress
    6 Version: 4.9.2
     6Version: 4.9.3
    77Author: Jason Crouse, VeronaLabs
    88Text Domain: wp-slimstat
    99Domain Path: /languages
     10Author URI: https://wp-slimstat.com/
    1011Requires PHP: 7.4
    1112*/
     
    361362                }
    362363            }
    363        
     364
    364365            $cookie_found = false;
    365366            foreach ( $cookie_names as $a_name => $a_value ) {
     
    570571        }
    571572
    572         // Geolocation 
     573        // Geolocation
    573574        include_once( plugin_dir_path( __FILE__ ) . 'vendor/maxmind.php' );
    574575        try {
     
    705706
    706707        if ( isset( $_SERVER[ 'REQUEST_URI' ] ) ) {
    707             return urldecode( $_SERVER[ 'REQUEST_URI' ] );
     708            return urldecode( sanitize_url(wp_unslash($_SERVER['REQUEST_URI'])) );
    708709        }
    709710        else if ( isset( $_SERVER[ 'SCRIPT_NAME' ] ) ) {
     
    854855                                    $output[ $result_idx ][ $a_column ] .=  $a_result[ 'username' ];
    855856                                }
    856                                
     857
    857858                                break;
    858859
     
    13531354
    13541355        $update_checker_objects = array();
    1355        
     1356
    13561357        // This is only included if add-ons are installed
    13571358        include_once( plugin_dir_path( __FILE__ ) . 'vendor/update-checker/plugin-update-checker.php' );
     
    13591360        foreach ( self::$update_checker as $a_slug ) {
    13601361            $a_clean_slug = str_replace( array( 'wp_slimstat_', '_' ), array( '', '-' ), $a_slug );
    1361            
     1362
    13621363            if ( !empty( self::$settings[ 'addon_licenses' ][ 'wp-slimstat-' . $a_clean_slug ] ) ) {
    13631364                $update_checker_objects[ $a_clean_slug ] = Puc_v4_Factory::buildUpdateChecker( 'https://www.wp-slimstat.com/update-checker/?slug=' . $a_clean_slug . '&key=' . urlencode( self::$settings[ 'addon_licenses' ][ 'wp-slimstat-' . $a_clean_slug ] ), dirname( dirname( __FILE__ ) ) . '/wp-slimstat-' . $a_clean_slug . '/index.php', 'wp-slimstat-' . $a_clean_slug );
     
    14581459        }
    14591460
    1460         // Remove unwanted characters (SQL injections, anyone?)
     1461        // Remove unwanted characters from keys (SQL injections, anyone?)
    14611462        $data_keys = array();
    14621463        foreach ( array_keys( $_data ) as $a_key ) {
    14631464            $data_keys[] = sanitize_key( $a_key );
    14641465        }
     1466
     1467        // Remove unwanted characters from data (SQL injections, anyone?)
     1468        foreach ($_data as $key => $value) {
     1469            $_data[$key] = sanitize_text_field($value);
     1470        }
    14651471
    14661472        self::$wpdb->query( self::$wpdb->prepare( "
     
    19511957     */
    19521958    protected static function _base64_url_encode( $_input = '' ) {
    1953         return strtr( base64_encode( $_input ), '+/=', '._-' ); 
    1954     } 
     1959        return strtr( base64_encode( $_input ), '+/=', '._-' );
     1960    }
    19551961    protected static function _base64_url_decode( $_input = '' ) {
    19561962        return strip_tags( trim( base64_decode( strtr( $_input, '._-', '+/=' ) ) ) );
     
    19651971     */
    19661972    public function __construct() {
    1967         parent::__construct( 'slimstat_widget', 'Slimstat', array( 
     1973        parent::__construct( 'slimstat_widget', 'Slimstat', array(
    19681974            'classname' => 'slimstat_widget',
    19691975            'description' => 'Add a Slimstat report to your sidebar',
     
    20182024
    20192025        <p>
    2020         <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_id' ) ); ?>"><?php _e( 'Report', 'wp-slimstat' ) ?></label> 
     2026        <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_id' ) ); ?>"><?php _e( 'Report', 'wp-slimstat' ) ?></label>
    20212027        <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_id' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'slimstat_widget_id' ) ); ?>">
    20222028            <option value="">Select a widget</option>
     
    20262032
    20272033        <p>
    2028         <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_title' ) ); ?>"><?php _e( 'Title', 'wp-slimstat' ) ?></label> 
     2034        <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_title' ) ); ?>"><?php _e( 'Title', 'wp-slimstat' ) ?></label>
    20292035        <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'slimstat_widget_title' ) ); ?>" value="<?php echo trim( strip_tags( $slimstat_widget_title ) ) ?>">
    20302036        </p>
    20312037
    20322038        <p>
    2033         <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_filters' ) ); ?>"><?php _e( 'Optional filters', 'wp-slimstat' ); ?></label> 
     2039        <label for="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_filters' ) ); ?>"><?php _e( 'Optional filters', 'wp-slimstat' ); ?></label>
    20342040        <a href="https://slimstat.freshdesk.com/solution/articles/5000631833-what-is-the-syntax-of-a-slimstat-shortcode-#slimstat-operators" target="_blank">[?]</a>
    20352041        <textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'slimstat_widget_filters' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'slimstat_widget_filters' ) ); ?>"><?php echo trim( strip_tags( $slimstat_widget_filters ) ) ?></textarea>
Note: See TracChangeset for help on using the changeset viewer.