Skip to content

Improved: added a service loader which makes sure requests succeed during updates. - #317

Merged
Dan0sz merged 1 commit into
developfrom
improve_conditional_class_loading
Jul 28, 2026
Merged

Improved: added a service loader which makes sure requests succeed during updates.#317
Dan0sz merged 1 commit into
developfrom
improve_conditional_class_loading

Conversation

@Dan0sz

@Dan0sz Dan0sz commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Busy sites running OPCache can sometimes trigger uncaught errors due to temporarily missing files during updates and/or fresh installs. So, I added a service loader which properly logs the missing class, but allows the request to properly finish without errors.

Summary by CodeRabbit

  • Bug Fixes

    • Improved plugin stability during WordPress updates by safely skipping unavailable services instead of triggering fatal errors.
    • Added debug-only logging when a required service cannot be loaded.
  • Tests

    • Added coverage verifying that missing services are skipped and available services load correctly.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8cfe80ff-d9c8-4cfa-ae32-820c55a1d3f3

📥 Commits

Reviewing files that changed from the base of the PR and between 7de082a and 6317cf0.

📒 Files selected for processing (2)
  • src/Plugin.php
  • tests/integration/PluginTest.php

📝 Walkthrough

Walkthrough

Plugin now loads services through a class-existence check, conditionally logs missing classes in debug mode, updates service registration paths, and adds integration coverage for missing and available service classes.

Changes

Service loading

Layer / File(s) Summary
Guarded service loader
src/Plugin.php
Adds guarded service instantiation and conditional debug logging for missing classes.
Service wiring and validation
src/Plugin.php, tests/integration/PluginTest.php
Routes integrations, provisioning, settings, setup, and registered services through the guarded loader, with tests covering missing and available classes.

Poem

A rabbit checks each class in line,
“If absent, no crash this time!”
Debug logs softly mark the trail,
While present services still prevail.
Hop, hop—safe loading joins the tale.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a guarded service loader to keep requests working during updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve_conditional_class_loading

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.2.5)

Composer install failed: this project depends on private packages that require authentication (e.g. GitLab/GitHub, Laravel Nova, etc.).
CodeRabbit tooling environment cannot access private registries.
If your project requires private packages, disable the PHPStan tool in your coderabbit settings.

Instead, run PHPStan in a CI/CD pipeline where you can use custom packages — our pipeline remediation tool can use the PHPStan output from your CI/CD pipeline.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dan0sz
Dan0sz merged commit 3b8ef72 into develop Jul 28, 2026
7 checks passed
@Dan0sz
Dan0sz deleted the improve_conditional_class_loading branch July 28, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant