Plugin Directory

Changeset 3744966


Ignore:
Timestamp:
10/13/2026 10:04:52 PM (13 days ago)
Author:
firepixel
Message:

Release 1.2.2

Location:
firepixel-for-woocommerce/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • firepixel-for-woocommerce/trunk/firepixel-for-woocommerce.php

    r3741526 r3744966  
    44 * Plugin URI: https://firepixel.io
    55 * Description: Boost ROAS by 50% with complete conversion tracking.
    6  * Version: 1.2.1
     6 * Version: 1.2.2
    77 * Author: FirePixel
    88 * License: GPL v2 or later
    … …  
    2020if (!defined('ABSPATH')) exit;
    2121
    22 define('FIREPIXEL_VERSION', '1.2.1');
     22define('FIREPIXEL_VERSION', '1.2.2');
    2323
    2424require_once __DIR__ . '/includes/class-firepixel-identifiers.php';
    … …  
    225225        register_rest_route('firepixel/v1', '/ping', [
    226226            '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'],
    247228            'permission_callback' => '__return_true',
    248229        ]);
    … …  
    261242            'permission_callback' => '__return_true',
    262243        ]);
     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'];
    263283    }
    264284
  • firepixel-for-woocommerce/trunk/readme.txt

    r3741526 r3744966  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.2.1
     7Stable tag: 1.2.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    135135
    136136== 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.
    137141
    138142= 1.2.1 =
    … …  
    181185== Upgrade Notice ==
    182186
     187= 1.2.2 =
     188Keeps your store's key out of server logs during FirePixel's connection check. Recommended for all stores.
     189
    183190= 1.2.1 =
    184191Stops 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.