Plugin Directory

Changeset 3656274


Ignore:
Timestamp:
08/20/2026 08:48:38 AM (2 months ago)
Author:
gaconnector
Message:

Update to version 0.9.1 from GitHub

Location:
ga-connector-crm-ga-integration
Files:
2 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ga-connector-crm-ga-integration/tags/0.9.1/ga-connector-crm-ga-integration.php

    r3635428 r3656274  
    33 * Plugin Name:       GA Connector – CRM & GA integration
    44 * Description:       Connect your CRM with Google Analytics and find out where your sales are really coming from.
    5  * Version:           0.9.0
     5 * Version:           0.9.1
    66 * Requires at least: 5.7
    77 * Requires PHP:      7.4
    … …  
    2424}
    2525
    26 define( 'GA_CONNECTOR_VERSION', '0.9.0' );
     26define( 'GA_CONNECTOR_VERSION', '0.9.1' );
    2727define( 'GA_CONNECTOR_PLUGIN_FILE', __FILE__ );
    2828define( 'GA_CONNECTOR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • ga-connector-crm-ga-integration/tags/0.9.1/readme.txt

    r3635428 r3656274  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 0.9.0
     7Stable tag: 0.9.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • ga-connector-crm-ga-integration/tags/0.9.1/src/Rest/PageviewController.php

    r3635428 r3656274  
    1212
    1313use GA_Connector\Api\TrackingApiClient;
     14use GA_Connector\Support\ClientIp;
    1415use GA_Connector\Support\Options;
    1516use WP_REST_Request;
    … …  
    8384
    8485        /**
    85          * Pulls the visitor's IP from request headers, preferring a single
    86          * well-formed address from common reverse-proxy headers, falling back
    87          * to REMOTE_ADDR, and using `-` as the last resort sentinel.
     86         * Pulls the visitor's IP using the same algorithm as the PHP library's
     87         * Request::clientIp() (CDN headers in priority order, then public
     88         * REMOTE_ADDR, else the shared default IP).
    8889         */
    8990        public static function resolve_client_ip(): string {
    90                 $candidates = array();
    91 
    92                 if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
    93                         $forwarded    = (string) wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    94                         $parts        = explode( ',', $forwarded );
    95                         $candidates[] = trim( (string) reset( $parts ) );
    96                 }
    97                 if ( ! empty( $_SERVER['HTTP_X_REAL_IP'] ) ) {
    98                         $candidates[] = trim( (string) wp_unslash( $_SERVER['HTTP_X_REAL_IP'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    99                 }
    100                 if ( ! empty( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
    101                         $candidates[] = trim( (string) wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    102                 }
    103                 if ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
    104                         $candidates[] = trim( (string) wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    105                 }
    106 
    107                 foreach ( $candidates as $candidate ) {
    108                         if ( '' === $candidate ) {
    109                                 continue;
    110                         }
    111                         if ( false !== filter_var( $candidate, FILTER_VALIDATE_IP ) ) {
    112                                 return $candidate;
    113                         }
    114                 }
    115 
    116                 return '-';
     91                return ClientIp::resolve();
    11792        }
    11893}
  • ga-connector-crm-ga-integration/trunk/ga-connector-crm-ga-integration.php

    r3635428 r3656274  
    33 * Plugin Name:       GA Connector – CRM & GA integration
    44 * Description:       Connect your CRM with Google Analytics and find out where your sales are really coming from.
    5  * Version:           0.9.0
     5 * Version:           0.9.1
    66 * Requires at least: 5.7
    77 * Requires PHP:      7.4
    … …  
    2424}
    2525
    26 define( 'GA_CONNECTOR_VERSION', '0.9.0' );
     26define( 'GA_CONNECTOR_VERSION', '0.9.1' );
    2727define( 'GA_CONNECTOR_PLUGIN_FILE', __FILE__ );
    2828define( 'GA_CONNECTOR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • ga-connector-crm-ga-integration/trunk/readme.txt

    r3635428 r3656274  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 0.9.0
     7Stable tag: 0.9.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • ga-connector-crm-ga-integration/trunk/src/Rest/PageviewController.php

    r3635428 r3656274  
    1212
    1313use GA_Connector\Api\TrackingApiClient;
     14use GA_Connector\Support\ClientIp;
    1415use GA_Connector\Support\Options;
    1516use WP_REST_Request;
    … …  
    8384
    8485        /**
    85          * Pulls the visitor's IP from request headers, preferring a single
    86          * well-formed address from common reverse-proxy headers, falling back
    87          * to REMOTE_ADDR, and using `-` as the last resort sentinel.
     86         * Pulls the visitor's IP using the same algorithm as the PHP library's
     87         * Request::clientIp() (CDN headers in priority order, then public
     88         * REMOTE_ADDR, else the shared default IP).
    8889         */
    8990        public static function resolve_client_ip(): string {
    90                 $candidates = array();
    91 
    92                 if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
    93                         $forwarded    = (string) wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    94                         $parts        = explode( ',', $forwarded );
    95                         $candidates[] = trim( (string) reset( $parts ) );
    96                 }
    97                 if ( ! empty( $_SERVER['HTTP_X_REAL_IP'] ) ) {
    98                         $candidates[] = trim( (string) wp_unslash( $_SERVER['HTTP_X_REAL_IP'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    99                 }
    100                 if ( ! empty( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
    101                         $candidates[] = trim( (string) wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    102                 }
    103                 if ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
    104                         $candidates[] = trim( (string) wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    105                 }
    106 
    107                 foreach ( $candidates as $candidate ) {
    108                         if ( '' === $candidate ) {
    109                                 continue;
    110                         }
    111                         if ( false !== filter_var( $candidate, FILTER_VALIDATE_IP ) ) {
    112                                 return $candidate;
    113                         }
    114                 }
    115 
    116                 return '-';
     91                return ClientIp::resolve();
    11792        }
    11893}
Note: See TracChangeset for help on using the changeset viewer.