Changeset 3464666
- Timestamp:
- 02/18/2026 10:35:17 PM (6 weeks ago)
- Location:
- flowsystems-webhook-actions/trunk
- Files:
-
- 2 added
- 7 deleted
- 5 edited
-
README.txt (modified) (2 diffs)
-
admin/dist/.vite/manifest.json (modified) (2 diffs)
-
admin/dist/assets/main-BEzXuheK.js (added)
-
admin/dist/assets/main-CaFatvFm.js (deleted)
-
admin/dist/assets/style-Bfi0_pVC.css (deleted)
-
admin/dist/assets/style-DQRXYd6m.css (added)
-
admin/package-lock.json (deleted)
-
admin/package.json (deleted)
-
admin/src (deleted)
-
admin/tailwind.config.js (deleted)
-
admin/vite.config.js (deleted)
-
flowsystems-webhook-actions.php (modified) (2 diffs)
-
src/Api/TriggersController.php (modified) (1 diff)
-
src/Services/Dispatcher.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flowsystems-webhook-actions/trunk/README.txt
r3463487 r3464666 5 5 Tested up to: 6.9 6 6 Requires PHP: 8.0 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 139 139 == Changelog == 140 140 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 141 148 = 1.0.0 = 142 149 - Initial release -
flowsystems-webhook-actions/trunk/admin/dist/.vite/manifest.json
r3462891 r3464666 1 1 { 2 2 "src/main.js": { 3 "file": "assets/main- CaFatvFm.js",3 "file": "assets/main-BEzXuheK.js", 4 4 "name": "main", 5 5 "src": "src/main.js", … … 7 7 }, 8 8 "style.css": { 9 "file": "assets/style- Bfi0_pVC.css",9 "file": "assets/style-DQRXYd6m.css", 10 10 "src": "style.css" 11 11 } -
flowsystems-webhook-actions/trunk/flowsystems-webhook-actions.php
r3462891 r3464666 4 4 * Plugin URI: https://flowsystems.pl/wordpress-webhook-actions 5 5 * Description: Trigger HTTP webhooks from WordPress actions (do_action). Easily connect WordPress with n8n, Zapier, Make, or custom workflows. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Mateusz Skorupa 8 8 * Author URI: https://flowsystems.pl … … 17 17 defined('ABSPATH') || exit; 18 18 19 define('FSWA_VERSION', '1.0. 0');19 define('FSWA_VERSION', '1.0.1'); 20 20 define('FSWA_FILE', __FILE__); 21 21 -
flowsystems-webhook-actions/trunk/src/Api/TriggersController.php
r3462891 r3464666 369 369 '/^woocommerce_before/', 370 370 '/^woocommerce_after/', 371 '/^woocommerce_checkout_/',372 '/^woocommerce_cart_/',373 371 // Filter hooks (usually not useful as triggers) 374 372 '/_filter$/', -
flowsystems-webhook-actions/trunk/src/Services/Dispatcher.php
r3462891 r3464666 109 109 ); 110 110 111 // Enqueue to database queue with log_id for later update112 111 $this->queueService->enqueue($webhookId, $trigger, [ 113 112 'webhook' => $webhook, 114 113 'payload' => $transformedPayload, 115 114 'log_id' => $logId, 115 'mapping_applied' => $mappingApplied, 116 'original_payload' => $originalPayload, 116 117 ]); 117 118 } … … 194 195 $trigger = $job['trigger_name']; 195 196 $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 } 196 215 197 216 return $this->sendToWebhook($webhook, $payload, $trigger, $logId); … … 274 293 */ 275 294 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; 294 340 } 295 341
Note: See TracChangeset
for help on using the changeset viewer.