-
Notifications
You must be signed in to change notification settings - Fork 67
fix: check if Stackable constants are defined #3626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe conditional guard in plugin.php was updated to additionally require STACKABLE_BUILD and STACKABLE_VERSION to be defined before executing the existing detection block for another Stackable version. If these constants are not defined, the prior behavior persists with the block not executing. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant WP as WordPress Loader
participant Plugin as plugin.php
WP->>Plugin: Load plugin
rect rgba(225, 245, 254, 0.6)
note right of Plugin: Updated guard
Plugin->>Plugin: Check constants: STACKABLE_BUILD && STACKABLE_VERSION (plus existing checks)
alt All required constants defined
Plugin->>Plugin: Execute "another version detected" block
else Missing constants
Plugin->>Plugin: Skip detection block (no change)
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
🤖 Pull request artifacts
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
plugin.php (1)
29-30: LGTM! Critical fix prevents fatal errors.The addition of
defined()checks forSTACKABLE_BUILDandSTACKABLE_VERSIONcorrectly prevents PHP fatal errors when another Stackable instance has definedSTACKABLE_FILEbut not these constants. This guards against the usage of these constants at line 37.Minor style note (optional): Consider consistent spacing after
defined- line 29 usesdefined('STACKABLE_FILE')while line 30 usesdefined( 'STACKABLE_BUILD' ). Aligning the style would improve consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
plugin.php(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: PHP 8.2 and WP 6.7.2
- GitHub Check: PHP 8.2 and WP latest
- GitHub Check: PHP 8.2 and WP 6.6.2
- GitHub Check: PHP 8.2 and WP 6.5.5
- GitHub Check: PHP 7.3 and WP latest
- GitHub Check: PHP 7.3 and WP 6.5.5
- GitHub Check: build
Summary by CodeRabbit