Optimized-image polling calls the SDK before initialization
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 65/100
Línea de trabajo
Start with Optml_Rest::poll_optimized_images() in inc/rest.php and trace its calls into inc/media_offload.php, inc/config.php, and inc/app_replacer.php. Review tests/test-poll-optimized-images.php, especially the nonempty polling setup, then verify the case where the response is nonempty but CDN settings and SDK initialization are absent. Done means the authenticated polling request completes with image results instead of an initialization exception, with coverage for that state.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
When optimized-image polling receives a nonempty image list while the Optimole image SDK is uninitialized, URL generation throws an uncaught runtime exception instead of completing the REST response. This leaves the polling request failed and prevents the dashboard from receiving its image results.
Customer context
- Product / area: Optimole WordPress plugin, optimized-image REST polling
- Version: 4.2.13 and 4.2.14
- Environment: Reported across WordPress 6.9.9–7.1.2 and PHP 8.2–8.5
- Integration / third party: Optimole image SDK; Themeisle SDK versions 3.3.61 and 3.3.62 were also present
- Reported error / symptom:
Please initialize the Optimole SDK first.during REST polling - Impact: The affected polling request terminates before returning image results.
Reproduction notes
Telemetry reports the exception during a REST polling request in versions 4.2.13 and 4.2.14. A source-indicated reproduction condition is a nonempty optimized-image API response when the site is not connected and the image SDK has therefore not been initialized; this condition was not runtime-reproduced. Existing tests cover nonempty results only with CDN connection settings present.
Diagnosis
Conclusion
The product's REST polling callback can reach URL generation without ensuring the image SDK was initialized. Initialization of the media-offload singleton is conditional on the site's connected state, while the polling callback proceeds for a nonempty API response. This is a reachable product-side precondition gap consistent with the reported exception. The exact settings and SDK state on the affected requests were not captured.
Where this likely occurs
inc/rest.php—Optml_Rest::poll_optimized_images(), lines 708–733, calls the API and sends every returned image throughOptml_Media_Offload::instance()->get_media_optimized_url()when the list is nonempty.inc/media_offload.php—Optml_Media_Offload::instance(), lines 154–162, invokes its initialization path only whenOptml_Settings::is_connected()is true.inc/settings.php—Optml_Settings::is_connected(), lines 189–198, requires both CDN key and secret.inc/app_replacer.php—Optml_App_Replacer::get_optimized_image_url(), lines 664–681, callsOptimole::image()for URL generation.inc/config.php—Optml_Config::init(), lines 95–149, initializes the image SDK during the normal connected setup.inc/api.php—Optml_Api::get_optimized_images(), lines 344–355, accepts an API key for the request independently of the connection check above. The telemetry shows that the callback reached image URL generation with a nonempty list.
Engineering notes
The behavior is reported in product versions 4.2.13 and 4.2.14, and the same conditional initialization path is present in the inspected 4.2.14 source. No regression boundary was identified. The exception's source dependency was not present in the workspace; the recorded stack identifies it as coming from codeinwp/optimole-sdk, while the product caller and initialization lifecycle were inspected locally. The REST route uses the default manage_options permission callback in inc/rest.php, lines 189–232, so the reported surface is an authenticated REST request.
Test coverage status
tests/test-poll-optimized-images.php covers successful nonempty polling at lines 188–218, but its setup supplies CDN key and secret at lines 22–33. Error and empty-list cases are also covered. No relevant test was found for a nonempty response with the SDK uninitialized. Tests were not run.
What to verify or explore next
- May be worth verifying polling with a valid API response while CDN connection settings are absent or incomplete.
- If reproducing against a tagged release, checking whether the REST request can occur during or immediately after disconnection would clarify the triggering state.
- The affected sites' saved service data and initialization state are not available in this report.
Unknowns / follow-up
The telemetry does not identify the API-key state, connection settings, or request timing on the affected sites. The actual deployed codeinwp/optimole-sdk source was not available in this workspace for independent inspection.
Confidence
Confidence: 82/100
One product-side initialization precondition gap is confirmed in the REST polling path and no matching open GitHub issue was found. The other three crashes are not confirmed code defects: the reported SDK file and both product classes exist in the reported release with reachable load paths, so the telemetry is consistent with transient or inconsistent runtime files.
Crash telemetry
| Occurrences | 5 |
| Distinct sites | 2 |
| First seen | 2026-09-23 15:21 UTC |
| Last seen | 2026-09-23 19:46 UTC |
| Crash location | product:vendor/codeinwp/optimole-sdk/src/Optimole.php:80 |
| Request context | rest |
| Inside Themeisle SDK | no |
| Product versions | 4.2.13, 4.2.14 |
| WP versions | 6.9.9, 7.1.2 |
| PHP versions | 8.2.15, 8.2.33 |
| SDK versions | 3.3.61, 3.3.62 |
Source: automated crash report — optimole-wp, fingerprint 929319f2cd6aedc1c371f0cdb334d42a
Generated by bug-report-triage (ID: bug-report-triage_6ab60e5e41a8e2.77469449)
- Lenguaje dominante
- PHP
- Estrellas
- 73
- Forks
- 14
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Codeinwp/optimole-wp
-
customer report feature-request-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
Codeinwp/optimole-wp#1161 ·
Los mantenedores suelen responder en 1 día
-
bug-report bug-report-triage customer report regression
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
Codeinwp/optimole-wp#1159 ·
Los mantenedores suelen responder en 1 día
-
customer report feature-request-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Codeinwp/optimole-wp#1151 ·
Los mantenedores suelen responder en 1 día
-
bug-report bug-report-triage crash-report
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Codeinwp/optimole-wp#1139 ·
Los mantenedores suelen responder en 1 día
-
bug-report bug-report-triage customer report
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Codeinwp/optimole-wp#1136 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de Codeinwp/optimole-wp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
521xueweihan/HelloGitHub#3790 ·
-
[Bug] : Main navigation "Upcoming Events" link navigates to /events/ without query parameterAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
benjaminkott/bootstrap_package#1670 ·
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días