I have the plugin Password Protected installed correctly on my staging and on my composer.json file.
unfortunaltely I noticed that everytime that I deploy to the staging, the plugin is not there, if i check the wp-admin, i can see this message “The plugin password-protected/password-protected.php has been deactivated due to an error: Plugin file does not exist.”
if I run composer update on the staging, I can see the plugin in the admin area, but i need active it and re-configure the settings.
my default deploy-hooks seems ok, I followed what I usually do with the trellis/bedrock projects, I always use the “Password Protected” plugin to protect my staging website, but I don’t know why this time I have this problem.
Am I missing something?
I noticed that it is doing the same thing with another plugin (ACF Pro).
I followed this guide > https://roots.io/guides/acf-pro-as-a-composer-dependency-with-encrypted-license-key/
but it seems that every time that I deploy, it remove the plugins installed on my staging, so I need to re-run composer update on staging, but then I need to active and re-set up the plugin settings.
I am pretty sure that I am missing a step, do you have any idea?
When you use composer packages there’s two files composer reads
composer.lock file stores exact versions of dependancies. This is always read first by a
composer install command - which is the same command executed on a deploy to staging / production.
When you run a
composer update it reads from the
composer.json and generates a new
.lock file acts as a screenshot of dependancies, allowing your environments to have a consistent dependancy list. Or allowing everyone using this codebase to have matching dependancies.
See how composer works here: https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies. This is also similar to how yarn and npm work with
package.lock / yarn.lock.
To fix your issue:
composer update locally, this will generate a new
- Commit your
composer.lock files to your repository
- Deploy to staging
thanks @craigpearson it works, now it is clear, I noted this step for the next time.
thanks a lot
This topic was automatically closed after 42 days. New replies are no longer allowed.