Premium Third Party Plugins

I’m having issues adding third party premium plugins. I’ll use the Yoast premium plugin as an example.

Here’s their instructions: How to install Yoast SEO plugins for Wordpress using Composer • Yoast

The instructions say to setup the auth token, then add the repository:

composer config repositories.my-yoast composer https://my.yoast.com/packages/

Then run composer require yoast/wordpress-seo-premium.

If I do that, I see the Yoast plugin installed, but I am not able to activate it. If I try wp plugin activate wordpress-seo-premium I get the following error:

Fatal error: Uncaught TypeError: Yoast\WP\Lib\Dependency_Injection\Container_Registry::register(): Argument #2 ($container) must be of type YoastSEO_Vendor\Symfony\Component\DependencyInjection\ContainerInterface, null given, called in /nas/content/live/bedrocktestdev/wp-content/plugins/wordpress-seo/lib/abstract-main.php on line 45 and defined in /nas/content/live/bedrocktestdev/wp-content/plugins/wordpress-seo/lib/dependency-injection/container-registry.php:28

Other plugins get different but similar errors. Am I missing something as far as loading the dependencies for these plugins?

I don’t use this plugin, but since you’re paying for it, I’d recommend reaching out to their support team for answers

Totally get that, but this isn’t specific to this one plugin. I haven’t been able to install any other premium plugins through the same process, so wanted some input on if I’m missing something in the process.

My best guess is that there needs to be an install of the dependencies for the plugin, but running composer install or composer dump-autoload --no-interaction --optimize in the plugin directory doesn’t seem to do it.

What other premium plugins have you tried, and what exact process did you use?

This may be helpful:

1 Like

If this helps, I am using that plugin with Bedrock and wp plugin activate wordpress-seo-premium works as expected after composer install. Not using Trellis, but have (manually) added an auth.json in the project root directory with the following stucture:

{
  "http-basic": {
  "my.yoast.com": {
      "username": "token",
      "password": "<token>"
    }
  }
}

A possibly irrelevant note: I was having trouble getting a clean wordpress-seo-premium install when the free plugin, wordpress-seo, was listed in composer.json. The premium plugin installs that automatically when it is installed.

2 Likes

I do have the auth setup in auth.json. The plugin was installing just fine, just not activating.

Turns out my deploy script was ignoring anything in .gitignore which included the vendors folders. Working now that I’ve included those folders in the deploy- all good, thanks everyone!

1 Like