Install Plugin (Composer + Lando)
Install WordPress plugins through Composer only.
Announce at start: "I'm using the install-plugin skill to install this plugin with Composer inside Lando."
Inputs
$ARGUMENTS
Rules
- Never use
wp plugin installfor new plugin installation. - Always run
composerthrough Lando:lando composer .... - Install at project root
composer.json(WordPress/plugin level), not themecomposer.json. - If plugin activation is requested, use
lando wp plugin activate <slug>after Composer install.
Procedure
1) Validate context
- Confirm this is a Lando WordPress project (
.lando.ymland rootcomposer.jsonexist). - Read
skills/sage-lando/references/wordpress-composer.md. - Ensure
wp-packages.orgrepository exists:
lando composer config repositories.wp-packages composer https://repo.wp-packages.org
2) Route by argument type
Case A: Local zip (*.zip)
- Resolve path from
$ARGUMENTS. - If zip is outside project root, copy to
./packages/<filename>.zip. - Derive slug from filename:
plugin-name.zip-> packagelocal/plugin-name, typewordpress-pluginmu-plugin-name.zip-> packagelocal/plugin-name, typewordpress-muplugin
- Add/update a
type: packagerepository entry in rootcomposer.jsonpointing to./packages/<filename>.zip. - Install with Composer:
lando composer require local/plugin-name
Case B: Package name already provided (vendor/name)
- If argument already matches
vendor/name, install directly:
lando composer require vendor/name
- If it starts with
wp-plugin/, no extra conversion is needed.
Case C: Plugin slug or human name
- Normalize to a slug candidate (lowercase, dashes).
- Try package
wp-plugin/<slug>. - If uncertain or missing, search on
https://wp-packages.org/and map to the exact slug. - Install:
lando composer require wp-plugin/<slug>
3) Verify installation
# Composer package installed
lando composer show wp-plugin/<slug>
# WordPress sees plugin
lando wp plugin list
If user requested activation:
lando wp plugin activate <slug>
Failure modes
Package not found
- Cause: wrong slug or package namespace.
- Fix: search
wp-packages.organd retry with exact package.
Composer ran in wrong context
- Cause: command executed in theme folder.
- Fix: run from project root where WordPress
composer.jsonlives.
Zip package installs but plugin not recognized
- Cause: wrong package type (
wordpress-pluginvswordpress-muplugin) or invalid zip structure. - Fix: correct repository metadata and ensure zip contains valid plugin root files.
Completion
Report:
- Which package was required
- Whether repository config was added/updated
- Whether plugin was activated
- Any manual follow-up needed