Fix duplicate curl_setopt_array calls and undefined variable bugs in 4 service plugins #139

Closed
opened 2026-06-21 15:56:06 +00:00 by jmiller · 0 comments
Owner

Summary

Four service plugins have duplicate curl_setopt_array() calls, and two of them reference undefined variables. These are runtime bugs that will cause PHP warnings/errors when publishing to these platforms.

Affected plugins

1. SendGrid (CRITICAL — undefined variable)

File: source/packages/plg_mokosuitecross_sendgrid/src/Extension/SendgridService.php

  • Lines 67-83: Two identical curl_setopt_array() calls
  • Line 80: References undefined $token — should be $apiKey

2. Reddit (CRITICAL — undefined variable)

File: source/packages/plg_mokosuitecross_reddit/src/Extension/RedditService.php

  • Lines 61-80: Two identical curl_setopt_array() calls
  • Line 77: References undefined $token — should be $accessToken

3. TikTok

File: source/packages/plg_mokosuitecross_tiktok/src/Extension/TiktokService.php

  • Lines 67-84: Two identical curl_setopt_array() calls

4. Pinterest

File: source/packages/plg_mokosuitecross_pinterest/src/Extension/PinterestService.php

  • Lines 66-82: Two identical curl_setopt_array() calls

Fix

For each plugin:

  1. Remove the duplicate curl_setopt_array() call
  2. Fix undefined variable references (SendGrid: $token$apiKey, Reddit: $token$accessToken)

Acceptance Criteria

  • Each plugin has exactly one curl_setopt_array() call
  • No undefined variable references ($token)
  • SendGrid publish works with valid API key
  • Reddit publish works with valid access token
## Summary Four service plugins have duplicate `curl_setopt_array()` calls, and two of them reference undefined variables. These are **runtime bugs** that will cause PHP warnings/errors when publishing to these platforms. ## Affected plugins ### 1. SendGrid (CRITICAL — undefined variable) **File**: `source/packages/plg_mokosuitecross_sendgrid/src/Extension/SendgridService.php` - Lines 67-83: Two identical `curl_setopt_array()` calls - **Line 80**: References undefined `$token` — should be `$apiKey` ### 2. Reddit (CRITICAL — undefined variable) **File**: `source/packages/plg_mokosuitecross_reddit/src/Extension/RedditService.php` - Lines 61-80: Two identical `curl_setopt_array()` calls - **Line 77**: References undefined `$token` — should be `$accessToken` ### 3. TikTok **File**: `source/packages/plg_mokosuitecross_tiktok/src/Extension/TiktokService.php` - Lines 67-84: Two identical `curl_setopt_array()` calls ### 4. Pinterest **File**: `source/packages/plg_mokosuitecross_pinterest/src/Extension/PinterestService.php` - Lines 66-82: Two identical `curl_setopt_array()` calls ## Fix For each plugin: 1. Remove the duplicate `curl_setopt_array()` call 2. Fix undefined variable references (SendGrid: `$token` → `$apiKey`, Reddit: `$token` → `$accessToken`) ## Acceptance Criteria - [ ] Each plugin has exactly one `curl_setopt_array()` call - [ ] No undefined variable references (`$token`) - [ ] SendGrid publish works with valid API key - [ ] Reddit publish works with valid access token
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#139