bedrock-autoloader icon indicating copy to clipboard operation
bedrock-autoloader copied to clipboard

countPlugins returning wrong number

Open Rahe opened this issue 5 years ago • 0 comments

Description

Hello,

The method \Roots\Bedrock\Autoloader::countPlugins is returning a wrong number of mu-plugins if the mu-plugin isn't one. Because the way of WordPress is counting mu-plugin is not the same as yours, the number can be wrong in the case of the folder on mu-plugins doesn't contains a php file with WordPress headers.

Steps to reproduce

  1. Add humanmade/mercator dependency
  2. Follow the installation process https://github.com/humanmade/Mercator#installation
  3. Load WordPres 2 times
  4. The updateCache method is called on every page

Expected behavior: That only the real mu-plugins loaded by WordPress are effectively counted with get_plugins function.

Actual behavior: The glob only counts the folders.

Reproduces how often: 100%

Versions

1.0.1, but the code haven't changed since.

Maybe strip away the mu-plugins without header to have the right count ?

Rahe avatar Jan 22 '21 16:01 Rahe