Skip to content

Conversation

@kaeizen
Copy link
Contributor

@kaeizen kaeizen commented Oct 13, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of parallel installations to prevent duplicate loading and unexpected overrides, reducing activation and update errors.
    • Strengthened version checks so the plugin initializes only when appropriate, enhancing stability in environments with multiple copies.
    • Results in fewer conflicts and clearer behavior when multiple editions or builds are present, with no changes to existing workflows or settings.

@coderabbitai
Copy link

coderabbitai bot commented Oct 13, 2025

Walkthrough

The 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

Cohort / File(s) Summary of Changes
Plugin guard update
plugin.php
Extended the conditional guard to also check for STACKABLE_BUILD and STACKABLE_VERSION being defined before running the existing detection logic for another Stackable version.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws at constant signs,
Two flags now gate the guard that shines.
If builds and versions both align,
The checker hops—otherwise, recline.
In code burrow snug and tight,
We skip or spring by config light. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title uses the “fix:” prefix and clearly states that the change adds a check for Stackable constants, which directly matches the update in plugin.php extending the guard to require STACKABLE_BUILD and STACKABLE_VERSION. It is concise, focused on the primary fix, and would make sense to anyone reviewing the history. It avoids unnecessary detail while conveying the main purpose of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/php-error-when-activating-plugin

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 and usage tips.

@github-actions
Copy link

🤖 Pull request artifacts

file commit
pr3626-stackable-3626-merge.zip b41c945

github-actions bot added a commit that referenced this pull request Oct 13, 2025
Copy link

@coderabbitai coderabbitai bot left a 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 for STACKABLE_BUILD and STACKABLE_VERSION correctly prevents PHP fatal errors when another Stackable instance has defined STACKABLE_FILE but 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 uses defined('STACKABLE_FILE') while line 30 uses defined( 'STACKABLE_BUILD' ). Aligning the style would improve consistency.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7e3827 and b41c945.

📒 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

@bfintal bfintal merged commit 1e56ba3 into develop Oct 13, 2025
8 of 9 checks passed
@bfintal bfintal deleted the fix/php-error-when-activating-plugin branch October 13, 2025 06:35
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.

3 participants