-
Notifications
You must be signed in to change notification settings - Fork 46
Ensures init action fires before initializing in WP-CLI #86
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
Ensures that the `init` action has fired before initializing the adapter in WP-CLI context. This prevents potential issues where commands might not have access to servers if the adapter initializes too early. It now hooks into the `init` action if it hasn't already fired.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Pull Request Overview
This PR improves WP-CLI initialization timing by ensuring the init action has fired before initializing the adapter, and corrects indentation for a translator comment.
- Adds a check using
did_action('init')to handle WP-CLI initialization at the appropriate time - Fixes indentation of a translator comment to align with WordPress coding standards
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Simplifies the initialization process for the McpAdapter in WP-CLI context by directly hooking into the `init` action without checking if it has already fired.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #86 +/- ##
=========================================
Coverage 79.74% 79.74%
Complexity 858 858
=========================================
Files 46 46
Lines 3080 3080
=========================================
Hits 2456 2456
Misses 624 624
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JasonTheAdams
left a comment
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.
Good catch! LGTM! 🎉
Ensures that the
initaction has fired before initializing the adapter in WP-CLI context.This prevents potential issues where commands might not have access to servers if the adapter initializes too early. It now hooks into the
initaction if it hasn't already fired.