docs(installation): rewrite Composer install guide#397
Open
enricobattocchi wants to merge 2 commits into
Open
Conversation
The previous page told integrators to run `composer require` from inside the `plugins/` directory (which produces an incorrect install path) and claimed the package "installs all necessary dependencies". In practice the published artifact is source-style and relies on the consumer registering a project-level Composer autoloader. Restructure the page around that requirement, separate the free and Premium flows, document the MyYoast token + repository setup for Premium, and move the contributor-only `yarn` / `grunt build` steps out of the install guide into a single link to the contributor setup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying yoast-developer with
|
| Latest commit: |
857284b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://58e4750f.yoast-developer.pages.dev |
| Branch Preview URL: | https://22545-improve-composer-insta.yoast-developer.pages.dev |
Refer to Yoast SEO by name throughout, distinguishing it from Yoast SEO Premium where context requires. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
There was a problem hiding this comment.
Pull request overview
Updates the Composer installation documentation for Yoast SEO to reflect how the Composer-distributed packages are actually consumed in Composer-managed WordPress projects, with emphasis on the project-level autoloader requirement and separate free vs Premium install flows.
Changes:
- Rewrites the page to make the Composer autoloader requirement explicit before installation steps.
- Updates free install instructions to run from the project root and clarifies expected install location.
- Adds Premium installation steps including MyYoast token authentication and private repository configuration, plus a streamlined updating section.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Installing Yoast SEO via Composer | ||
| To install Yoast SEO via Composer, run the following command in your `plugins` directory: | ||
| The Composer-distributed Yoast SEO package does not ship its own `vendor/autoload.php`. Yoast SEO's classes are loaded through your project's root autoloader, which must be registered before WordPress loads plugins. In practice this means a line equivalent to: |
| require_once __DIR__ . '/vendor/autoload.php'; | ||
| ``` | ||
|
|
||
| before `require ABSPATH . 'wp-settings.php';` runs. Most Composer-managed WordPress stacks already do this; if yours doesn't, add it (in `wp-config.php`, in your scaffold's pre-WP bootstrap file, or via a small must-use plugin). |
|
|
||
| before `require ABSPATH . 'wp-settings.php';` runs. Most Composer-managed WordPress stacks already do this; if yours doesn't, add it (in `wp-config.php`, in your scaffold's pre-WP bootstrap file, or via a small must-use plugin). | ||
|
|
||
| If no autoloader is registered, Yoast SEO will detect this on the first admin request, display a *"plugin installation is incomplete"* notice and self-deactivate. |
| Premium is distributed via Yoast's private Composer repository at `https://my.yoast.com/packages/`. You will need a Composer install token from your MyYoast account. | ||
|
|
||
| ```shell | ||
| composer config -g http-basic.my.yoast.com token <your-token> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs Yoast/wordpress-seo#22545
Summary
The current Composer install page tells integrators to run
composer requirefrom inside theplugins/directory (which produces an incorrect install path throughcomposer/installers) and claims the published package "installs all necessary dependencies". In practice the Composer-distributed artifact is source-style: it does not includevendor/autoload.php, and Yoast SEO's classes are reached through the consumer project's root autoloader. Composer-managed WP setups that don't register an autoloader before plugins load (a common case on stacks wherewp-config.phpis platform-supplied) end up with a broken install — see Yoast/wordpress-seo#22545.This rewrite restructures the page around that requirement, separates the free and Premium flows, documents the MyYoast token + repository setup for Premium, and folds the contributor-only
yarn/grunt buildsteps out of the install guide into a single link to the contributor setup.Relevant technical choices
require_once __DIR__ . '/vendor/autoload.php';line, without prescribing where to put it (intentionally stack-agnostic).id: using-composer, sidebar label, and headings file slug, so deep links and the sidebar entry remain unchanged.Yoast/wordpress-seo-premium); if this PR ships first, the sentence may need to be softened to acknowledge that Premium currently fatals rather than deactivates.Test instructions
This PR can be acceptance tested by following these steps:
yarn buildlocally (or wait for CI's preview deploy) and opendocs/development/installation/using-composer.mdin the rendered Docusaurus site./development/environment/setup.Quality assurance
_redirectsfile in the root of the project.