Changeset 3656274
- Timestamp:
- 08/20/2026 08:48:38 AM (2 months ago)
- Location:
- ga-connector-crm-ga-integration
- Files:
-
- 2 added
- 6 edited
- 1 copied
-
tags/0.9.1 (copied) (copied from ga-connector-crm-ga-integration/trunk )
-
tags/0.9.1/ga-connector-crm-ga-integration.php (modified) (2 diffs)
-
tags/0.9.1/readme.txt (modified) (1 diff)
-
tags/0.9.1/src/Rest/PageviewController.php (modified) (2 diffs)
-
tags/0.9.1/src/Support/ClientIp.php (added)
-
trunk/ga-connector-crm-ga-integration.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/Rest/PageviewController.php (modified) (2 diffs)
-
trunk/src/Support/ClientIp.php (added)
Legend:
- Unmodified
- Added
- Removed
-
ga-connector-crm-ga-integration/tags/0.9.1/ga-connector-crm-ga-integration.php
r3635428 r3656274 3 3 * Plugin Name: GA Connector – CRM & GA integration 4 4 * Description: Connect your CRM with Google Analytics and find out where your sales are really coming from. 5 * Version: 0.9. 05 * Version: 0.9.1 6 6 * Requires at least: 5.7 7 7 * Requires PHP: 7.4 … … 24 24 } 25 25 26 define( 'GA_CONNECTOR_VERSION', '0.9. 0' );26 define( 'GA_CONNECTOR_VERSION', '0.9.1' ); 27 27 define( 'GA_CONNECTOR_PLUGIN_FILE', __FILE__ ); 28 28 define( 'GA_CONNECTOR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
ga-connector-crm-ga-integration/tags/0.9.1/readme.txt
r3635428 r3656274 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 0.9. 07 Stable tag: 0.9.1 8 8 License: GPLv2 or later 9 9 License 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 12 12 13 13 use GA_Connector\Api\TrackingApiClient; 14 use GA_Connector\Support\ClientIp; 14 15 use GA_Connector\Support\Options; 15 16 use WP_REST_Request; … … 83 84 84 85 /** 85 * Pulls the visitor's IP from request headers, preferring a single86 * well-formed address from common reverse-proxy headers, falling back87 * 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). 88 89 */ 89 90 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(); 117 92 } 118 93 } -
ga-connector-crm-ga-integration/trunk/ga-connector-crm-ga-integration.php
r3635428 r3656274 3 3 * Plugin Name: GA Connector – CRM & GA integration 4 4 * Description: Connect your CRM with Google Analytics and find out where your sales are really coming from. 5 * Version: 0.9. 05 * Version: 0.9.1 6 6 * Requires at least: 5.7 7 7 * Requires PHP: 7.4 … … 24 24 } 25 25 26 define( 'GA_CONNECTOR_VERSION', '0.9. 0' );26 define( 'GA_CONNECTOR_VERSION', '0.9.1' ); 27 27 define( 'GA_CONNECTOR_PLUGIN_FILE', __FILE__ ); 28 28 define( 'GA_CONNECTOR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
ga-connector-crm-ga-integration/trunk/readme.txt
r3635428 r3656274 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 0.9. 07 Stable tag: 0.9.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
ga-connector-crm-ga-integration/trunk/src/Rest/PageviewController.php
r3635428 r3656274 12 12 13 13 use GA_Connector\Api\TrackingApiClient; 14 use GA_Connector\Support\ClientIp; 14 15 use GA_Connector\Support\Options; 15 16 use WP_REST_Request; … … 83 84 84 85 /** 85 * Pulls the visitor's IP from request headers, preferring a single86 * well-formed address from common reverse-proxy headers, falling back87 * 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). 88 89 */ 89 90 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(); 117 92 } 118 93 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)