Skip to content

Conversation

@jasonbahl
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This fixes a bug where wp-graphql can't be found in the array of plugins when WPGraphQL is active as an mu-plugin.

Does this close any currently open issues?

Closes #3282

Any relevant logs, error output, GraphiQL screenshots, etc?

BEFORE

Error shown when WPGraphQL is active as an MU plugin

CleanShot 2025-01-27 at 15 51 28

AFTER

No error:

CleanShot 2025-01-27 at 15 53 05

Any other comments?

I haven't done thorough testing yet to ensure this change doesn't accidentally cause unpredicted side-effects. The get_plugins function that we were using does use get_plugin_data under the hood, so I think this more direct call to get_plugin_data should do what we need with the added flexibility of working when WPGraphQL is a "regular" or "mu" plugin.

Would love @justlevine to confirm this change doesn't cause any unintended side effects.

@jasonbahl jasonbahl requested a review from justlevine January 27, 2025 22:55
@jasonbahl jasonbahl self-assigned this Jan 27, 2025
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit d54d4d0 and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Coverage Status

coverage: 83.19% (+0.001%) from 83.189%
when pulling d54d4d0 on jasonbahl:fix/3282-plugin-updater-mu-plugin-conflict
into f053fc3 on wp-graphql:develop.

@justlevine
Copy link
Collaborator

justlevine commented Jan 27, 2025

Would love @justlevine to confirm this change doesn't cause any unintended side effects.

I should have time to look this over this weekend, but probably won't have time before. Just glancing at the diff, and it's a smart solve.

@jasonbahl
Copy link
Collaborator Author

I've done some tests and everything seems to work as expected with this change and all of the wpunit tests pass with this change as well.

One thing to note is that much of the admin notice UI work won't show anywhere when WPGraphQL is an mu-plugin due to the fact that:

Plugins in the must-use directory will not appear in the update notifications nor show their update status on the plugins page, so you are responsible for learning about and performing updates on your own.

(source: https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/#caveats)

@jasonbahl jasonbahl merged commit e75dfb8 into wp-graphql:develop Jan 28, 2025
36 checks passed
@jasonbahl jasonbahl mentioned this pull request Jan 28, 2025
@justlevine
Copy link
Collaborator

One thing to note is that much of the admin notice UI work won't show anywhere when WPGraphQL is an mu-plugin due to the fact that:

Plugins in the must-use directory will not appear in the update notifications nor show their update status on the plugins page, so you are responsible for learning about and performing updates on your own.

(source: https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/#caveats)

Curious how woo handles it 🧐

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.

Bug with get_plugins()

3 participants