No longer can install plugins or themes in wordpress GUI

I am using radicle stack. And on my last deploy I must have done something because in wordpress on the server there is no options to add plugins or themes. I am syncing the whole public folder in my pipeline. Maybe that is the wrong way to do things.

image: node:20

pipelines:
  branches:
    staging:
      - step:
          name: Build and Deploy
          deployment: Staging
          caches:
            - node
          script:
            - yarn
            - yarn build
            - apt-get update
            - apt-get install -y rsync
            # Copy env.sample to .env
            - cp .convert_to_env .env
            # Modify .env file
            - sed -i "s/^DB_NAME=.*/DB_NAME='$DB_NAME_STAGING'/" .env
            - sed -i "s/^DB_USER=.*/DB_USER='$DB_USER_STAGING'/" .env
            - sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD='$DB_PASSWORD_STAGING'/" .env
            - sed -i "s/^WP_SMTP_PASSWORD=.*/WP_SMTP_PASSWORD='$WP_SMTP_PASSWORD_STAGING'/" .env
            # Transfer .env to server
            # - rsync -avz .env admin@redacted:~/public_html/
            - rsync -avz -e "ssh -v" .env admin@redacted:~/public_html/
            # Transfer updated composer.json and composer.lock
            - rsync -avz composer.json composer.lock admin@redacted:~/public_html/
            # Transfer other necessary files
            - rsync -avz --delete public/ admin@redacted:~/public_html/public/
            # Run commands on the server
            - ssh admin@redacted "cd public_html && export COMPOSER_CACHE_DIR=.cache/composer && composer update && composer install --no-dev --optimize-autoloader && wp acorn optimize && wp acorn icons:cache"

I just wanted to install woocommerce, and when I tried composer require woocommerce/woocomerce it gave me this error

  Problem 1
    - woocommerce/woocommerce[dev-add/skip-activate-if-connected-to-jetpack, 2.7.0-beta-2, ..., 2.7.0-RC1, 3.0.0-rc.1, ..., 3.5.10] require composer/installers ~1.2 -> found composer/installers[v1.2.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.2).
    - woocommerce/woocommerce[dev-try/define-doing-ajax-sooner, dev-update/unit-tests, dev-revert-23859-master, dev-add/get_tax_rate_classes_filter, 3.6.0-beta1, ..., 3.8.0.x-dev] require composer/installers 1.6.0 -> found composer/installers[v1.6.0] but it conflicts with your root composer.json require (^2.2).
    - woocommerce/woocommerce[dev-update/detect-queries-with-non-registered-status, ..., dev-proof-of-concept/replace-functions-with-classes, 3.4.x-dev, ..., 3.9.5, 4.0.0-beta.1, ..., 4.7.4] require composer/installers 1.7.0 -> found composer/installers[v1.7.0] but it conflicts with your root composer.json require (^2.2).
    - woocommerce/woocommerce[dev-update/deprecated-jquery-code, dev-remove-more-unused-jquery, dev-woo-mobile/add-product-image-get-order-api, dev-update/artifact-build, dev-master, dev-renovate/pin-dependencies, dev-poc/attribute-filtering-with-lookup-table] require psr/container 1.0.0 -> found psr/container[1.0.0] but the package is fixed to 2.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - woocommerce/woocommerce[dev-remove/legacy-code-in-shipping, ..., dev-poc/graphql-api, 4.8.0-beta.1, ..., 4.9.5, 5.0.0-beta.1, ..., 5.9.1] require composer/installers ~1.7 -> found composer/installers[v1.7.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.2).
    - woocommerce/woocommerce[2.6.3, ..., 2.7.0-beta-1] require composer/installers ~1.0 -> found composer/installers[v1.0.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.2).
    - woocommerce/woocommerce 3.7.0-beta.1 requires php ^5.6|^7.0 -> your php version (8.1.19; overridden via config.platform, actual: 8.2.14) does not satisfy that requirement.
    - Root composer.json requires woocommerce/woocommerce * -> satisfiable by woocommerce/woocommerce[dev-update/detect-queries-with-non-registered-status, ..., dev-poc/attribute-filtering-with-lookup-table, 2.6.3, ..., 2.7.0-RC1, 3.0.0-rc.1, ..., 3.9.5, 4.0.0-beta.1, ..., 4.9.5, 5.0.0-beta.1, ..., 5.9.1].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require woocommerce/woocommerce:*" to figure out if any version is installable, or "composer require woocommerce/woocommerce:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Any help would be greatly appreciated

Installing plugins is disabled by default on production from Bedrock’s config. It gets overridden for development.

For managing non-premium plugins with Composer, I suggest using https://wpackagist.org/

composer require wpackagist-plugin/woocommerce
2 Likes

Definitely install WooCommerce and other WP plugins as @Log1x suggested :+1:

Also take a look at the error message — Radicle ships with the platform defined in composer.json’s config key and is expecting a specific PHP version (8.1.x), which is conflicting with your actual PHP version (8.2.x)

Make sure to update that platform version based on what PHP version you want to use on all of your environments

1 Like

What about for the smtp package that is MU plugin? Should it be managed by composer somehow or should I sync the MU plugin folder in the pipeline?

Which package?

For mu-plugins you can follow the Bedrock autoloader docs.

In the example, it shows how to force a plugin to install as mu-plugin by specifying it in the composer.json mu-plugin installer-paths array.

1 Like

Does this still apply for a plugin I built myself (or was given code from @ben ) in a previous post. Just called smtp.php in the MU folder?

For that in particular, I would just commit it to your repo.

1 Like