cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 49 forks source link

SatisPress is missing required dependencies. #112

Closed nelsonamaya82 closed 4 years ago

nelsonamaya82 commented 4 years ago

Hi, after installing this plugin I see this error in the dashboard:

"SatisPress is missing required dependencies."

How can I debug it or get more information on how to solve this?

Thank you.

bradyvercher commented 4 years ago

It sounds like you downloaded the source code directly without running the build process. You'll need to be sure to download the compiled release asset instead (the current version is named satispress-0.5.0.zip).

cbirdsong commented 4 years ago

Is it possible to install/update the release version via Github Updater?

bradyvercher commented 4 years ago

@cbirdsong I'm not sure if you can do the initial install via GitHub Updater, but subsequent updates should work fine.

cbirdsong commented 4 years ago

I can confirm you can't, which was confusing to me – it might be worth making a note in the docs.

wonkeythemonkey commented 3 years ago

I am getting this error when installing with composer as well.

bradyvercher commented 3 years ago

@wonkeythemonkey What steps are you taking to install SatisPress? If you're using Composer, it should automatically install all the dependencies.

wonkeythemonkey commented 3 years ago

@bradyvercher That's what I would have assumed, too.

To install, I am running composer require cedaro/satispress

I am using the johnpblock/wordpress library to manage WordPress, which takes care of placing the plugin into the correct directory.

Are there any dependencies that should not live inside the satispress plugin directory?

bradyvercher commented 3 years ago

@wonkeythemonkey If you're managing the whole site with Composer, then the dependencies should live in the vendor directory. You probably just need to require the autoloader in wp-config.php to load the dependencies.

dashaluna commented 1 year ago

@bradyvercher I've got a question:

I've installed the SatisPress plugin via composer require cedaro/satispress As I understand it, that installs the source code of the plugin (the dev version with dependencies, tests, ect). The releases on this repo contain only compiled versions (i.e. the stand-alone version that does not depend on anything and is self-contained in a single plugin folder).

In my case, I'd like the fully contained WP plugin version only (that does not depend on anything) as I don't want to keep the vendor folder outside of the main plugin folder. However, I still want to manage plugin updates easily via composer.

I hope that makes sense.

I'm pretty new to composer, so please bear with me :) Thank you.

bradyvercher commented 1 year ago

Hi @dashaluna,

SatisPress doesn't actually require a build step so it can be run after installing with Composer. The packaged releases just have a language file and all the dev dependencies are removed, otherwise it's pretty much the same. Since Composer is being run from the plugin directory the vendor directory is located there instead of outside.

I'm not sure it'd make sense to manage plugins with Composer that way, though. Typically you'd manage your entire site and its dependencies with a single composer.json, so all the site and plugin dependencies would live in a single vendor directory in the root or wherever you configure Composer to put it. Otherwise, you would need to run Composer separately from each plugin directory that you're wanting to manage with Composer and you could run into conflicts if multiple plugins install non-compatible dependencies.

I hope that helps, but let me know if I've misunderstood what you're trying to accomplish.

dashaluna commented 1 year ago

Hello @bradyvercher

Thank you for getting back to me. Feels like I'm doing something not quite right then. I have the following WP setup:

Here is my setup for where dependencies should be saved:

    "extra": {
        "wordpress-install-dir": "wp",
        "wordpress-content-dir": "wp-content",
        "installer-paths": {
            "wp-content/mu-plugins/{$name}/": [
                "type:wordpress-muplugin"
            ],
            "wp-content/plugins/{$name}/": [
                "type:wordpress-plugin"
            ],
            "wp-content/themes/{$name}/": [
                "type:wordpress-theme"
            ]
        }
    }

When I run composer require cedaro/satispress I can see the plugin in the right directory: wp-content/plugins/satispress and also this is the screenshots of the vendor folder:

Screenshot 2022-10-29 at 10 17 11

I would assume that having the wp-content/plugins/satispress should work similar as if I downloaded the latest version of the plugin from the github. However, when I got to my WP admin I get the following error: SatisPress is missing required dependencies.

Screenshot 2022-10-29 at 10 21 17

I'm not sure what I'm doing wrong. I assumed the plugin was not compiled and wanted to access the main vendor folder as I don't include the main vendor folder autoloader.php in the loading process because I assume WP plugins are self-contained and have all they need in the wp-content/plugins/<plugin_name> folder.

I'd appreciate any pointers :) Thank you.

bradyvercher commented 1 year ago

@dashaluna Sorry for the delay.

The release asset on GitHub is self-contained. It contains a /vendor subdirectory and autoloader for the dependencies that SatisPress requires. So in that sense, there is a sort of build/compile step that bundles everything together.

That's not what Composer installs, though. Composer manages dependencies across multiple packages and allows for shared dependencies between them. So with your setup, you would need to include the root /vendor directory in your deployments and require the autoloader.