Mu-plugins not generating on deploy

After deploy my mu-plugins will not show. I have them definied in my composer.json and it was working before. Now randomly it won’t generate the mu-plugins. What could casue that issue?

Edit: To expand a bit more on the issue, after I deploy to a site there is no mu-plugins tab: https://i.gyazo.com/8cde89b7d6c607aa4c26d7029ff8f8cf.png. that is what my staging site looks like here is my dev site: https://i.gyazo.com/94d48c9eb5ccc56f7869fa395a2e299e.png.

I can delete the mu-plugins file and when I do composer install on the top level of my .com install it will regenerate the mu-plugins with the correct dependencies but not on my deployed site. I’ve never ran into this issue before. Here is my composer.json file:

{
  "name": "roots/bedrock",
  "type": "project",
  "license": "MIT",
  "description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
  "homepage": "https://roots.io/bedrock/",
  "authors": [
    {
      "name": "Scott Walkinshaw",
      "email": "scott.walkinshaw@gmail.com",
      "homepage": "https://github.com/swalkinshaw"
    },
    {
      "name": "Ben Word",
      "email": "ben@benword.com",
      "homepage": "https://github.com/retlehs"
    }
  ],
  "keywords": [
    "bedrock", "roots", "wordpress", "stack", "composer", "vagrant", "wp"
  ],
  "support": {
    "issues": "https://github.com/roots/bedrock/issues",
    "forum": "https://discourse.roots.io/category/bedrock"
  },
  "config": {
    "preferred-install": "dist"
  },
  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org"
    },
    {
      "type": "git",
      "url": "git@github.com:{username}/{theme}.git"
    },
    {
      "type": "git",
      "url": "git@github.com:{username}/{child-theme}.git"
    },
    {
      "type": "git",
      "url": "git@github.com:{username}/{plugin}.git"
    },
    {
      "type":"composer",
      "url":"https://composer.deliciousbrains.com/{not sure if this has private info}"
    },
    {
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.3.2.2",
        "type": "wordpress-muplugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?a=download&p=pro&k={took out key}"
        }
      }
    }
  ],
  "require": {
    "php": ">=5.6",
    "composer/installers": "^1.4",
    "vlucas/phpdotenv": "^2.0.1",
    "johnpbloch/wordpress": ">4.9.5",
    "oscarotero/env": "^1.1.0",
    "roots/wp-password-bcrypt": "1.0.0",
	  "wpackagist-plugin/timber-library": "*",
    "{theme}": "dev-master",
    "{child}": "dev-master",
    "{plugin}": "dev-master",
    "advanced-custom-fields/advanced-custom-fields-pro": "^5.0",
    "wpackagist-plugin/contact-form-7": ">5.0.0",
    "press-bits/media-library-svg-display": "^0.1.0",
    "deliciousbrains-plugin/wp-migrate-db-pro": "^1.8",
    "wpackagist-plugin/svg-support": ">2.0.0",
    "deliciousbrains-plugin/wp-migrate-db-pro-media-files": ">1.0"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^3.0.2"
  },
  "extra": {
    "installer-paths": {
      "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin", "wpackagist-plugin/timber-library"],
      "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
      "web/app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "wordpress-install-dir": "web/wp"
  },
  "scripts": {
    "post-root-package-install": [
      "php -r \"copy('.env.example', '.env');\""
    ],
    "test": [
      "phpcs"
    ]
  }
}

What do you mean when you say “generate”?

Also, sharing your composer.json could be helpful.

Just updated my post for this question, let me know if that clarifies the issue more

Which of the plugins in your composer.json are mu-plugins? I don’t see any of them called out that way specifically.

Advanced custom fields pro and timber library

Gotcha. And when you run composer install in development they appear but when you deploy they don’t? Are you sure you’ve committed your composer json and lock files to Git? Are you deploying the same branch that you’re working on in dev? Trellis will only install plugins in the composer files that are in Git, not the ones that are in your local file system.

yeah in dev I can delete the plugins from the mu-plugins folder and do composer install and it will work. I do have my composer-lock file updated and is committed to github. I’ve been deploying sites for the last 2-3 months and this is an issue that just started happening. Also when I ssh to my host I see a mu-plugins folder but for some reason isn’t showing on the backend of wordpress.

After some testing it looks like my bedrock-autoloaderphp, disallow-indexing.php, and register-theme-direcotyr.php is not being added to the mu-plugins folder. Any ideas why that is?

Are those files in your GitHub repository? If not I’d check your .gitignore

1 Like

Hmm yeah seems like for some reason those files were in my github before but got removed. I guess I changed my gitkeep/gitignore files and didn’t realize that. Committed the autoloader files and the mu-plugins are back :smile: