Viewport lazy-load CSS crashes when profile data contains stdClass
メンテナーはふだん 1 日以内に返信
@girishpanchal30 がすでに取り組んでいます。
2026年8月12日 から。
評価
この issue はまだ評価されていません。
説明
Summary
Generating personalized background lazy-load CSS can terminate a frontend response when stored per-device profile data is an object rather than the expected array. The CSS generation path is expected to tolerate unavailable or malformed profile data and continue rendering. Instead, it raises Cannot use object of type stdClass as array, preventing the response from completing for the affected request.
Customer context
- Product / area: Optimole viewport lazy loading and personalized background CSS
- Version: 4.2.10
- Environment: WordPress 7.0.2; PHP 8.3.17 and 8.3.31
- Integration / third party: A Nextend Smart Slider output-buffer frame appears in the captured stack, but the exception location is Optimole code.
- Reported error / symptom:
Error: Cannot use object of type stdClass as arrayduring a frontend request - Impact: Telemetry recorded 2 occurrences across 2 sites between 2026-08-02 and 2026-08-05.
Reproduction notes
- Enable viewport lazy loading so frontend output reaches personalized background CSS generation.
- Load current profile data with a mobile or desktop device payload represented as
stdClassinstead of the documented associative array. - Render a non-partial frontend response.
Observed production result: the request raises Cannot use object of type stdClass as array at the personalized CSS generation step. The telemetry does not include the profile payload that led to the object value.
Diagnosis
Conclusion
Production telemetry identifies inc/v2/BgOptimizer/Lazyload.php:37 as the exception location. The inspected 4.2.10 code indexes each per-device profile payload as an array without verifying its runtime type. A local PHP 8.3 check of the equivalent expression with a stdClass payload produces the reported fatal error. This confirms the crash behavior when malformed object-shaped profile data reaches this path.
Where this likely occurs
inc/manager.php—Optml_Manager::replace_content()lines 495-501 invokesLazyload::get_current_personalized_css()for non-partial frontend output when viewport lazy loading is enabled.inc/v2/BgOptimizer/Lazyload.php—Lazyload::get_current_personalized_css()lines 21-22 passes the current profile data into the CSS generator.inc/v2/BgOptimizer/Lazyload.php—Lazyload::get_personalized_css()lines 31-38 accesses$data[$device]['bg']and$data[$device]['lcp']; astdClassvalue at a device key produces the telemetry error at line 37.inc/v2/PageProfiler/Profile.php—Profile::set_current_profile_data()lines 336-352 places raw storage results for mobile and desktop into the current profile array without a runtime shape check.- The array-offset path was introduced by commit
6830ea91eand is present from tagv4.0.0through inspected tagv4.2.10.
Engineering notes
Profile::store()writes the expected per-device associative-array shape ininc/v2/PageProfiler/Profile.phplines 183-218.Profileselects its backing storage through theoptml_page_profiler_storagefilter ininc/v2/PageProfiler/Profile.phplines 89-105. The built-in transient reader returnsmixedininc/v2/PageProfiler/Storage/Transients.phplines 64-72, so the current-profile load boundary has no enforced array contract.- The telemetry stack establishes the frontend path and error location. It does not identify how the affected object-shaped value entered storage. The Nextend frame closes output buffers after the Optimole call and does not establish that Nextend created the malformed profile value.
Test coverage status
tests/test-lazyload-viewport.php — test_profile_data_storage_and_retrieval() lines 211-247 covers normal array-shaped profile storage and retrieval. No direct tests for Lazyload::get_personalized_css(), Lazyload::get_current_personalized_css(), malformed per-device profile data, or the background-CSS marker were found during inspection.
What to verify or explore next
- Reproduce the frontend viewport-lazy-load workflow with one mobile or desktop profile storage value represented as
stdClass. - Run the relevant viewport lazy-load suite, including
tests/test-lazyload-viewport.php, after exercising the personalized CSS branch. - Check whether persistent object-cache implementations, profile-storage filters, or migrated profile values can return object-shaped data for this storage key.
Unknowns / follow-up
- The source of the object-shaped profile value is unknown from the telemetry and inspected repository code.
- The affected sites' object-cache configuration, profile-storage filter usage, and stored profile values were not available.
Confidence
Confidence: 96/100
Production telemetry records the exact frontend exception at the same array-offset expression present in the inspected 4.2.10 source; a local PHP check confirms that expression throws when a per-device profile value is stdClass.
Crash telemetry
| Occurrences | 2 |
| Distinct sites | 2 |
| First seen | 2026-08-02 11:48 UTC |
| Last seen | 2026-08-05 14:13 UTC |
| Crash location | product:inc/v2/BgOptimizer/Lazyload.php:37 |
| Request context | frontend |
| Inside Themeisle SDK | no |
| Product versions | 4.2.10 |
| WP versions | 7.0.2 |
| PHP versions | 8.3.17, 8.3.31 |
| SDK versions | 3.3.58 |
Source: automated crash report — optimole-wp, fingerprint f86795f5fedc77801fff1ed1af50b8e4
Generated by bug-report-triage (ID: bug-report-triage_6a76c5ff5e3406.21193513)
- 主要言語
- PHP
- スター
- 73
- フォーク
- 14
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeinwp/optimole-wp のほかの issue
-
bug-report bug-report-triage crash-report
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
Codeinwp/optimole-wp#1162 ·
メンテナーはふだん 1 日以内に返信
-
customer report feature-request-triage
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
Codeinwp/optimole-wp#1161 ·
メンテナーはふだん 1 日以内に返信
-
bug-report bug-report-triage customer report regression
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
Codeinwp/optimole-wp#1159 ·
メンテナーはふだん 1 日以内に返信
-
customer report feature-request-triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
Codeinwp/optimole-wp#1151 ·
メンテナーはふだん 1 日以内に返信
-
bug-report bug-report-triage crash-report
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Codeinwp/optimole-wp#1139 ·
メンテナーはふだん 1 日以内に返信
Codeinwp/optimole-wp の issue をすべて見る
似ている issue
-
domain/crm-after-sales Platform(Default) priority/high
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 2 日以内に返信
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
Перевод устарел
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
component/code document/settings documents duplicate integration/wc/pages/cart integration/woocommerce mod* mod/b* mod/c* mod/d* mod/e* mod/i* product/pro status/needs-feedback
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elementor/elementor#37475 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信