Plugin Directory

Changeset 3464666


Ignore:
Timestamp:
02/18/2026 10:35:17 PM (6 weeks ago)
Author:
mateuszflowsystems
Message:

Release 1.0.1

Location:
flowsystems-webhook-actions/trunk
Files:
2 added
7 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • flowsystems-webhook-actions/trunk/README.txt

    r3463487 r3464666  
    55Tested up to: 6.9
    66Requires PHP: 8.0
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    139139== Changelog ==
    140140
     141= 1.0.1 =
     142- Fixed preview freezing when mapping fields from objects with numeric string keys (e.g. WooCommerce line_items)
     143- Fixed orphaned pending log entries caused by logPending() silently failing — queue jobs now carry mapping metadata and recover a proper log entry if the original ID was lost
     144- Enhanced normalizeValue to handle Closure, DateTimeInterface, and Traversable types
     145- Removed unnecessary WooCommerce hook patterns from trigger exclusions
     146- Improved log details display with word break for long trigger names and dates
     147
    141148= 1.0.0 =
    142149- Initial release
  • flowsystems-webhook-actions/trunk/admin/dist/.vite/manifest.json

    r3462891 r3464666  
    11{
    22  "src/main.js": {
    3     "file": "assets/main-CaFatvFm.js",
     3    "file": "assets/main-BEzXuheK.js",
    44    "name": "main",
    55    "src": "src/main.js",
     
    77  },
    88  "style.css": {
    9     "file": "assets/style-Bfi0_pVC.css",
     9    "file": "assets/style-DQRXYd6m.css",
    1010    "src": "style.css"
    1111  }
  • flowsystems-webhook-actions/trunk/flowsystems-webhook-actions.php

    r3462891 r3464666  
    44 * Plugin URI: https://flowsystems.pl/wordpress-webhook-actions
    55 * Description: Trigger HTTP webhooks from WordPress actions (do_action). Easily connect WordPress with n8n, Zapier, Make, or custom workflows.
    6  * Version: 1.0.0
     6 * Version: 1.0.1
    77 * Author: Mateusz Skorupa
    88 * Author URI: https://flowsystems.pl
     
    1717defined('ABSPATH') || exit;
    1818
    19 define('FSWA_VERSION', '1.0.0');
     19define('FSWA_VERSION', '1.0.1');
    2020define('FSWA_FILE', __FILE__);
    2121
  • flowsystems-webhook-actions/trunk/src/Api/TriggersController.php

    r3462891 r3464666  
    369369      '/^woocommerce_before/',
    370370      '/^woocommerce_after/',
    371       '/^woocommerce_checkout_/',
    372       '/^woocommerce_cart_/',
    373371      // Filter hooks (usually not useful as triggers)
    374372      '/_filter$/',
  • flowsystems-webhook-actions/trunk/src/Services/Dispatcher.php

    r3462891 r3464666  
    109109      );
    110110
    111       // Enqueue to database queue with log_id for later update
    112111      $this->queueService->enqueue($webhookId, $trigger, [
    113112        'webhook' => $webhook,
    114113        'payload' => $transformedPayload,
    115114        'log_id' => $logId,
     115        'mapping_applied' => $mappingApplied,
     116        'original_payload' => $originalPayload,
    116117      ]);
    117118    }
     
    194195    $trigger = $job['trigger_name'];
    195196    $logId = !empty($jobData['log_id']) ? (int) $jobData['log_id'] : null;
     197    $mappingApplied = (bool) ($jobData['mapping_applied'] ?? false);
     198    $originalPayload = $jobData['original_payload'] ?? null;
     199
     200    if ($logId === null) {
     201      $webhookId = isset($webhook['id']) ? (int) $webhook['id'] : 0;
     202      if ($webhookId > 0) {
     203        $recoveredId = $this->logService->logPending(
     204          $webhookId,
     205          $trigger,
     206          $payload,
     207          $originalPayload ?: null,
     208          $mappingApplied
     209        );
     210        if ($recoveredId) {
     211          $logId = $recoveredId;
     212        }
     213      }
     214    }
    196215
    197216    return $this->sendToWebhook($webhook, $payload, $trigger, $logId);
     
    274293   */
    275294  private function normalizeArgs(array $args): array {
    276     return array_map(function ($arg) {
    277       if (is_scalar($arg) || $arg === null) {
    278         return $arg;
    279       }
    280 
    281       if (is_array($arg)) {
    282         return $arg;
    283       }
    284 
    285       if (is_object($arg)) {
    286         return [
    287           '__type' => get_class($arg),
    288           'id' => $arg->ID ?? null,
    289         ];
    290       }
    291 
    292       return null;
    293     }, $args);
     295    return array_map([$this, 'normalizeValue'], $args);
     296  }
     297
     298  /**
     299   * Recursively normalize a single value for payload serialization
     300   *
     301   * @param mixed $value Value to normalize
     302   * @return mixed Normalized value
     303   */
     304  private function normalizeValue(mixed $value): mixed {
     305    if (is_scalar($value) || $value === null) {
     306      return $value;
     307    }
     308
     309    if (is_array($value)) {
     310      return array_map([$this, 'normalizeValue'], $value);
     311    }
     312
     313    if (is_object($value)) {
     314      if ($value instanceof \Closure) {
     315        return null;
     316      }
     317
     318      if ($value instanceof \DateTimeInterface) {
     319        return $value->format(\DateTime::ATOM);
     320      }
     321
     322      if ($value instanceof \Traversable) {
     323        return array_map([$this, 'normalizeValue'], iterator_to_array($value, false));
     324      }
     325
     326      if (method_exists($value, 'get_data')) {
     327        $data = $value->get_data();
     328      } elseif ($value instanceof \JsonSerializable) {
     329        $data = $value->jsonSerialize();
     330      } else {
     331        $data = get_object_vars($value);
     332      }
     333
     334      $data = is_array($data) ? array_map([$this, 'normalizeValue'], $data) : ['value' => (string) $value];
     335
     336      return array_merge(['__type' => get_class($value)], $data);
     337    }
     338
     339    return null;
    294340  }
    295341
Note: See TracChangeset for help on using the changeset viewer.