Skip to content

Bug with get_plugins() #3282

@ermalkonjufca1

Description

@ermalkonjufca1

Description

There is a bug within the Updates Class where is not correctly retrieving plugins from the mu-plugins directory when calling get_plugins(). This causes issues with plugin functionality and prevents some plugins from being recognized or loaded.
I think it is necessary to get also the list of mu-plugins with get_mu_plugins() and merge with the list of plugins.
get_plugins function only gets the plugins that are on /plugins path (Reference: https://developer.wordpress.org/reference/functions/get_plugins/), or don't even check for updates if the plugin is into Must Use.

Steps to reproduce

  1. Set up a Bedrock-based WordPress project:
    Follow the Bedrock installation steps if you haven't already, which involves using Composer to manage WordPress setup.
    composer create-project roots/bedrock my-project cd my-project

  2. Put the "wp-graphql/wp-graphql": "^1.29.3" inside required dependencies on composer.json

  3. The plugin needs to be passed into mu-plugins this way:

"extra": {
  "installer-paths": {
    "web/app/mu-plugins/{$name}/": [
      "type:wordpress-muplugin",
      "wp-graphql/wp-graphql"
    ],
  }
}
  1. Run composer install

Additional context

No response

WPGraphQL Version

^1.29.3

WordPress Version

6.7.1

PHP Version

=8.1

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugIssue that causes incorrect or unexpected behavior

    Type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions