Codeinwp / Codeinwp/otter-blocks

AMP initialization fatals when Slider_Block cannot be autoloaded

Open Beginner friendly
#2,992 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug-report bug-report-triage crash-report
Dominant language
JavaScript
Stars
198
Forks
36
Avg merge
3d 4h
Merged PRs (30d)
30

Description

Summary

Otter Blocks can terminate a frontend request during AMP block initialization when the Slider renderer class is unavailable to the autoloader.

Expected behavior: AMP initialization tolerates an unavailable optional renderer and the request continues.

Actual behavior: initialization throws Error: Class ".../Slider_Block" not found.

Impact: affected frontend requests return a fatal error instead of rendering the page.

Customer context

  • Product / area: Otter Blocks AMP block initialization
  • Version: 3.2.2 and 3.2.3
  • Environment: WordPress 7.0.4; PHP 8.1.34 and 8.5.9
  • Integration / third party: Not provided
  • Reported error / symptom: Error: Class ".../Slider_Block" not found during a frontend request
  • Impact: 2 telemetry occurrences across 2 distinct production sites between 2026-08-18 and 2026-08-20.

Reproduction notes

  1. Use Otter Blocks 3.2.2 or 3.2.3.
  2. Arrange for the plugin's Composer autoloader not to resolve ThemeIsle\GutenbergBlocks\Render\AMP\Slider_Block while the plugin source remains installed.
  3. Load a frontend request so WordPress fires init.

Observed in production: the request fails from Registration::init_amp_blocks() with the reported missing-class error. The specific autoload-map condition was not included in telemetry.

Diagnosis

Conclusion

Production telemetry identifies an uncaught exception at Registration::init_amp_blocks() while creating Slider_Block. This is confirmed by both affected tags: the method lists the Slider AMP renderer and instantiates each listed name directly, with no loadability check. If Composer's classmap cannot resolve that class, the direct instantiation produces the reported fatal.

Where this likely occurs
  • inc/class-registration.phpRegistration::init() lines 103–107 registers init_amp_blocks() on WordPress init, so this runs during normal frontend bootstrap.
  • inc/class-registration.phpRegistration::init_amp_blocks() lines 997–1010 includes ThemeIsle\GutenbergBlocks\Render\AMP\Slider_Block and directly evaluates new $classname at line 1005.
  • inc/render/amp/class-slider-block.phpThemeIsle\GutenbergBlocks\Render\AMP\Slider_Block lines 8–15 defines the class expected by the registration path.
  • composer.jsonautoload lines 61–65 exposes inc/ through Composer's generated classmap; the runtime failure indicates the deployed autoloader did not resolve the class despite the source file being present.
  • Tags v3.2.2 and v3.2.3 contain the same unguarded AMP initialization sequence. A related later autoload-resilience commit, 2036d0c2, guarded the separate Main::autoload_classes() list but does not cover Registration::init_amp_blocks().
Engineering notes

The telemetry location is product code, not the Themeisle SDK, so the issue belongs in Codeinwp/otter-blocks. The class source exists in the repository; the failure is specifically the registration path's assumption that the class can be loaded. The exact condition making the class unavailable on the affected installations is not captured by telemetry. The unguarded path runs regardless of whether an AMP request or a Slider block is present, because it is registered on init.

Test coverage status

tests/test-registration.php contains tests for dynamic renderer registration and unavailable dynamic renderer classes, including classmap-like missing-file scenarios at lines 172–245. No relevant coverage was found during inspection for Registration::init_amp_blocks() or an unavailable AMP renderer. tests/test-main-autoload.php covers the separate Main::autoload_classes() list, not this AMP list.

What to verify or explore next
  • Reproduce with an Otter installation whose Composer autoload map lacks the Slider renderer entry, then trigger a frontend request.
  • Run the PHP unit suite containing tests/test-registration.php after exercising the AMP initialization path.
  • Check whether deployed artifacts for the affected releases can contain a stale or incomplete Composer classmap after update or cache conditions.
Unknowns / follow-up
  • Telemetry does not include the deployed classmap or the preceding update state, so the source of the missing autoload entry remains unverified.
  • It is unknown whether the Circle Counter or Lottie AMP renderer classes can encounter the same unavailable-class condition.

Confidence

Confidence: 97/100

Production telemetry records the same uncaught frontend exception on two sites running Otter Blocks 3.2.2–3.2.3, and both affected release tags instantiate the AMP Slider class without verifying that it is loadable.

Crash telemetry

Occurrences 2
Distinct sites 2
First seen 2026-08-18 00:45 UTC
Last seen 2026-08-20 19:46 UTC
Crash location product:inc/class-registration.php:1005
Request context frontend
Inside Themeisle SDK no
Product versions 3.2.2, 3.2.3
WP versions 7.0.4
PHP versions 8.1.34, 8.5.9
SDK versions 3.3.58, 3.3.59

Source: automated crash report — otter-blocks, fingerprint 55f383e45f58cecbd63a002e8ec6c72a
Generated by bug-report-triage (ID: bug-report-triage_6a8a8c91024290.22743109)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in inc/class-registration.php at Registration::init_amp_blocks() and compare the AMP renderer definition in inc/render/amp/class-slider-block.php. Add coverage in tests/test-registration.php for an unavailable AMP renderer, then run the relevant PHP unit tests and verify frontend initialization continues without the missing-class fatal.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.