Summary
Generating attachment metadata for an SVG can terminate the background image-regeneration request with Call to a member function attributes() on bool.
Expected behavior: An SVG whose metadata cannot be parsed does not crash attachment metadata generation.
Actual behavior: The metadata-generation callback dereferences a boolean parser result and throws an uncaught error.
Impact: The affected WooCommerce background image-regeneration job stops for the attachment that reaches this path.
Customer context
- Product / area: Otter Blocks SVG attachment metadata generation
- Version: 3.2.1
- Environment: WordPress 7.0.3, PHP 8.2.33
- Integration / third party: WooCommerce background image regeneration
- Reported error / symptom:
Call to a member function attributes() on bool during cron
- Impact: 2 telemetry occurrences across 1 production site in the query window.
Reproduction notes
- Use Otter Blocks 3.2.1 in a non-VIP environment with SVG uploads enabled.
- Trigger
wp_generate_attachment_metadata for an SVG attachment lacking width and height metadata, such as through WooCommerce image regeneration.
- If XML parsing yields a boolean rather than an XML object, the reported
attributes() on bool error occurs.
Production reproduction evidence: 2 cron occurrences across 1 site. The exact SVG input and parser failure condition were not retained in the telemetry report.
Diagnosis
Conclusion
Production telemetry records an uncaught error at Main::generate_svg_attachment_metadata() when it invokes attributes() on a boolean. In the inspected 3.2.1 source, simplexml_load_file() is assigned to $svg and immediately dereferenced with no result validation. This directly explains the reported receiver type when parsing does not produce an XML object.
Where this likely occurs
- User-visible surface: attachment metadata generation reached from WooCommerce's background image-regeneration cron workflow.
inc/class-main.php — Main::init() lines 42-48 registers Main::generate_svg_attachment_metadata() on wp_generate_attachment_metadata at PHP_INT_MAX for non-VIP environments.
inc/class-main.php — Main::generate_svg_attachment_metadata() lines 515-536 limits the path to image/svg+xml attachments without existing dimensions, then calls simplexml_load_file() at line 528 and $svg->attributes() at line 529 without checking the returned value.
- Git history attributes lines 515-535 to commit
23f2f9b8 (feat: generate SVG metadata); the same code is present at tag v3.2.1.
Engineering notes
- The crash report locates the failure in Otter code, not the bundled Themeisle SDK, so the issue routes to
Codeinwp/otter-blocks.
- The reported request is cron-driven and originates through WooCommerce's regeneration worker, but the callback is registered globally for WordPress attachment metadata generation in the inspected non-VIP path.
- The triggering SVG content or filesystem condition is unavailable. PHP XML parser behavior was not independently verified from framework or PHP source in this workspace; the telemetry-confirmed boolean receiver and the unguarded dereference establish the observed failing branch.
Test coverage status
tests/test-svg-upload.php contains upload sanitization and MIME-type tests, including Test_SVG_Upload::test_svg_upload_sanitization() at lines 35-54.
- No relevant coverage was found during inspection for
Main::generate_svg_attachment_metadata() when XML parsing does not yield an object.
What to verify or explore next
- Reproduce attachment metadata generation with an SVG that causes the parser to yield a non-object result.
- Run the PHP SVG upload test suite and a WooCommerce image-regeneration workflow after reproducing the reported path.
- Check whether unreadable attachment files and malformed SVG payloads reach the same callback branch.
Unknowns / follow-up
- The telemetry payload does not include the source SVG or attachment-file accessibility state.
- The occurrence count is limited to one observed site in the supplied query window; broader prevalence is unknown.
Confidence
Confidence: 99/100
The production stack trace resolves directly to Otter's SVG metadata callback, and the version 3.2.1 source dereferences the result of simplexml_load_file() without validating it. The reported boolean receiver exactly matches that unguarded path.
Crash telemetry
|
|
| Occurrences |
2 |
| Distinct sites |
1 |
| First seen |
2026-08-07 01:06 UTC |
| Last seen |
2026-08-07 04:52 UTC |
| Crash location |
product:inc/class-main.php:529 |
| Request context |
cron |
| Inside Themeisle SDK |
no |
| Product versions |
3.2.1 |
| WP versions |
7.0.3 |
| PHP versions |
8.2.33 |
| SDK versions |
3.3.58 |
Source: automated crash report — otter-blocks, fingerprint 4c4c2c69d7a73241f48f90c9db4635a5
Generated by bug-report-triage (ID: bug-report-triage_6a757493e67d31.05918158)
Summary
Generating attachment metadata for an SVG can terminate the background image-regeneration request with
Call to a member function attributes() on bool.Expected behavior: An SVG whose metadata cannot be parsed does not crash attachment metadata generation.
Actual behavior: The metadata-generation callback dereferences a boolean parser result and throws an uncaught error.
Impact: The affected WooCommerce background image-regeneration job stops for the attachment that reaches this path.
Customer context
Call to a member function attributes() on boolduring cronReproduction notes
wp_generate_attachment_metadatafor an SVG attachment lacking width and height metadata, such as through WooCommerce image regeneration.attributes() on boolerror occurs.Production reproduction evidence: 2 cron occurrences across 1 site. The exact SVG input and parser failure condition were not retained in the telemetry report.
Diagnosis
Conclusion
Production telemetry records an uncaught error at
Main::generate_svg_attachment_metadata()when it invokesattributes()on a boolean. In the inspected 3.2.1 source,simplexml_load_file()is assigned to$svgand immediately dereferenced with no result validation. This directly explains the reported receiver type when parsing does not produce an XML object.Where this likely occurs
inc/class-main.php—Main::init()lines 42-48 registersMain::generate_svg_attachment_metadata()onwp_generate_attachment_metadataatPHP_INT_MAXfor non-VIP environments.inc/class-main.php—Main::generate_svg_attachment_metadata()lines 515-536 limits the path toimage/svg+xmlattachments without existing dimensions, then callssimplexml_load_file()at line 528 and$svg->attributes()at line 529 without checking the returned value.23f2f9b8(feat: generate SVG metadata); the same code is present at tagv3.2.1.Engineering notes
Codeinwp/otter-blocks.Test coverage status
tests/test-svg-upload.phpcontains upload sanitization and MIME-type tests, includingTest_SVG_Upload::test_svg_upload_sanitization()at lines 35-54.Main::generate_svg_attachment_metadata()when XML parsing does not yield an object.What to verify or explore next
Unknowns / follow-up
Confidence
Confidence: 99/100
The production stack trace resolves directly to Otter's SVG metadata callback, and the version 3.2.1 source dereferences the result of
simplexml_load_file()without validating it. The reported boolean receiver exactly matches that unguarded path.Crash telemetry
product:inc/class-main.php:529Source: automated crash report — otter-blocks, fingerprint
4c4c2c69d7a73241f48f90c9db4635a5Generated by bug-report-triage (ID: bug-report-triage_6a757493e67d31.05918158)