Replies: 8 comments
-
Composer just puts the files in the right place (just as you would if you were uploading the files via FTP). You then need to activate the plugin either via the admin interface or using WP-CLI. It is on activation that DB tables are usually set up. |
Beta Was this translation helpful? Give feedback.
-
That's not true. Composer supports custom installers which can be used to run a wp-cli command. I have done this myself. EDIT: To clarify, it does not seem likely that DB tables are always set up on actiavtion. I have stumbled across at least 3 different plugins which did not work by simply putting the files in the right place (upon activation it gave me a white screen of death). This seems to be even more common with non-free (paid) plugins. |
Beta Was this translation helpful? Give feedback.
-
If you manually activate the plugin after Composer installs it, does it not work? I understand that Composer could be configured to activate plugins after install but I'm not sure this should be the default behaviour. If you would like to contribute some documentation on how to achieve this using Composer hooks that would be very much appreciated. |
Beta Was this translation helpful? Give feedback.
-
Nope. Activation itself is not enough. The critical part happens on installation. That is why wp-cli provides both activate and install. Indeed, Composer should not be activating plugins/themes, but it should include them in a way that they are actually usable, and one way to do that is to rely on wp-cli's install function. |
Beta Was this translation helpful? Give feedback.
-
I'm going to have to do some testing to understand what you mean but it won't be before next week. Feel free to nudge me if I forget. |
Beta Was this translation helpful? Give feedback.
-
I've looked at the Anspress plugin and don't see where the installation part lies. I'm trying to understand the difference between installation and activation. What I gather from skimming the EDIT: For completeness, here's the files I looked at in
EDIT 2: |
Beta Was this translation helpful? Give feedback.
-
I've converted this to a Discussion for now as I'm not completely clear on what the enhancement would look like. Please feel free to create a detail enhancement issue with a story on exactly how this should work once we know. |
Beta Was this translation helpful? Give feedback.
-
Some packages in wpackagist do not work because they require initialization code to be run on installation (usually to setup database tables). An example of such plugin is anspress. This is a MAJOR problem. Have you guys considered installing these plugins/themes using wp-cli?
Beta Was this translation helpful? Give feedback.
All reactions