Enhanced autoloading mechanisms - #3023
Open
girishpanchal30 wants to merge 5 commits into
Open
Conversation
This was
linked to
issues
Aug 31, 2026
Contributor
Bundle Size Diff
|
Contributor
|
Plugin build for 1156d48 is ready 🛎️!
|
Contributor
E2E TestsPlaywright Test Status: See serial and parallel matrix jobs Performance ResultsserverResponse: {"q25":529.59,"q50":567.14,"q75":577.55,"cnt":10}, firstPaint: {"q25":1588.5,"q50":1748.59,"q75":1978.9,"cnt":10}, domContentLoaded: {"q25":4400.85,"q50":4445.1,"q75":4490.61,"cnt":10}, loaded: {"q25":4404.32,"q50":4448.76,"q75":4494.78,"cnt":10}, firstContentfulPaint: {"q25":3254.32,"q50":3309.17,"q75":3368.12,"cnt":10}, firstBlock: {"q25":20733.99,"q50":20810.26,"q75":21145.71,"cnt":10}, type: {"q25":33.04,"q50":35.41,"q75":36.88,"cnt":10}, typeWithoutInspector: {"q25":29.48,"q50":32.69,"q75":36.94,"cnt":10}, typeWithTopToolbar: {"q25":43.89,"q50":48.42,"q75":50.38,"cnt":10}, typeContainer: {"q25":19.06,"q50":21.19,"q75":21.71,"cnt":10}, focus: {"q25":166.96,"q50":174.46,"q75":182.47,"cnt":10}, inserterOpen: {"q25":55.78,"q50":61.05,"q75":64.6,"cnt":10}, inserterSearch: {"q25":34.71,"q50":37.32,"q75":38.73,"cnt":10}, inserterHover: {"q25":5.65,"q50":6.26,"q75":6.6,"cnt":20}, loadPatterns: {"q25":2206.14,"q50":2243.82,"q75":2293.54,"cnt":10}, listViewOpen: {"q25":299.78,"q50":310.47,"q75":316.42,"cnt":10} |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds resilient class loading to prevent missing or broken autoload entries from causing frontend fatal errors.
Changes:
- Introduces a centralized, failure-tolerant
Loader. - Hardens Lite and Pro bootstrap/autoload paths.
- Adds regression coverage for missing and invalid classes.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
inc/class-loader.php |
Adds safe class construction and boot helpers. |
inc/class-main.php |
Routes eager initialization through Loader. |
inc/class-registration.php |
Uses Loader for renderers and AMP classes. |
otter-blocks.php |
Adds a direct Loader fallback and startup gate. |
plugins/otter-pro/autoloader.php |
Skips missing or unreadable class files. |
tests/test-loader.php |
Tests Loader and bootstrap resilience. |
tests/test-main-autoload.php |
Expands invalid-class initialization coverage. |
tests/test-otter-pro-autoloader.php |
Tests Pro autoloader fallback behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Aug 31, 2026
selul
requested changes
Sep 1, 2026
selul
left a comment
Contributor
There was a problem hiding this comment.
The autoloader no longer fatals, but Base_CSS still instantiates the same class list unguarded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2962, #2963, #2964
Summary
Ensure the autoloader is loaded as a required file with proper checks. If the file is missing, unreadable, or the class fails to initialize, log the actual error and prevent a fatal error.
Checklist before the final review