Changeset 3744966
- Timestamp:
- 10/13/2026 10:04:52 PM (13 days ago)
- Location:
- firepixel-for-woocommerce/trunk
- Files:
-
- 2 edited
-
firepixel-for-woocommerce.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
firepixel-for-woocommerce/trunk/firepixel-for-woocommerce.php
r3741526 r3744966 4 4 * Plugin URI: https://firepixel.io 5 5 * Description: Boost ROAS by 50% with complete conversion tracking. 6 * Version: 1.2. 16 * Version: 1.2.2 7 7 * Author: FirePixel 8 8 * License: GPL v2 or later … … 20 20 if (!defined('ABSPATH')) exit; 21 21 22 define('FIREPIXEL_VERSION', '1.2. 1');22 define('FIREPIXEL_VERSION', '1.2.2'); 23 23 24 24 require_once __DIR__ . '/includes/class-firepixel-identifiers.php'; … … 225 225 register_rest_route('firepixel/v1', '/ping', [ 226 226 'methods' => 'GET', 227 'callback' => function ($request) { 228 $key = $request->get_param('key'); 229 if (!is_string($key)) { 230 return new \WP_Error('forbidden', 'Forbidden', ['status' => 403]); 231 } 232 $key = rawurldecode($key); 233 234 $settings = self::get_settings(); 235 $secret = (string) ($settings['secret'] ?? ''); 236 237 if ($secret === '' || !hash_equals($secret, $key)) { 238 return new \WP_Error('forbidden', 'Forbidden', ['status' => 403]); 239 } 240 241 if (empty($settings['access_token']) || empty($settings['kid'])) { 242 return new \WP_Error('forbidden', 'Forbidden', ['status' => 403]); 243 } 244 245 return ['status' => 'ok']; 246 }, 227 'callback' => [__CLASS__, 'ping_remotely'], 247 228 'permission_callback' => '__return_true', 248 229 ]); … … 261 242 'permission_callback' => '__return_true', 262 243 ]); 244 } 245 246 /** 247 * `GET /wp-json/firepixel/v1/ping`: the FirePixel server checks the store is connected and 248 * reachable. Authenticated with the shared secret; requires kid+access_token so it only 249 * passes post-connect. 250 * 251 * @param WP_REST_Request $request The ping request from the FirePixel server. 252 * 253 * @return array<string, string>|WP_Error 254 */ 255 public static function ping_remotely($request) { 256 // DEV-22: the secret comes from the X-FirePixel-Key header first, so it stays out of the 257 // access logs a query string ends up in. The `?key=` fallback exists only so an API that 258 // predates the header keeps working; remove it once the API no longer sends `?key=`. 259 // A header that is present wins outright: a wrong header is not rescued by the query. 260 $key = is_object($request) && method_exists($request, 'get_header') 261 ? $request->get_header('x_firepixel_key') 262 : null; 263 if (!is_string($key) || $key === '') { 264 $key = $request->get_param('key'); 265 if (!is_string($key)) { 266 return new \WP_Error('forbidden', 'Forbidden', ['status' => 403]); 267 } 268 $key = rawurldecode($key); 269 } 270 271 $settings = self::get_settings(); 272 $secret = (string) ($settings['secret'] ?? ''); 273 274 if ($secret === '' || !hash_equals($secret, $key)) { 275 return new \WP_Error('forbidden', 'Forbidden', ['status' => 403]); 276 } 277 278 if (empty($settings['access_token']) || empty($settings['kid'])) { 279 return new \WP_Error('forbidden', 'Forbidden', ['status' => 403]); 280 } 281 282 return ['status' => 'ok']; 263 283 } 264 284 -
firepixel-for-woocommerce/trunk/readme.txt
r3741526 r3744966 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 136 136 == Changelog == 137 138 = 1.2.2 = 139 * FirePixel's connection check now passes your store's key in a request header instead of the URL, so the key no longer appears in server logs. 140 * Various bug fixes and improvements. 137 141 138 142 = 1.2.1 = … … 181 185 == Upgrade Notice == 182 186 187 = 1.2.2 = 188 Keeps your store's key out of server logs during FirePixel's connection check. Recommended for all stores. 189 183 190 = 1.2.1 = 184 191 Stops sending events for search engine crawlers, other bots, and non-page requests such as robots.txt, feeds and sitemaps.
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)