Fatal error: Interface ‘AmpProject\Optimizer\Transformer’ not found in app/code/Plumrocket/AmpComponent/Model/RemoveUnusedExtensionsTransformer.php.
Exception (ReflectionException): Class AmpProject\Optimizer\ErrorCollectionFactory does not exist
Most likely, you are experiencing this fatal error after installing the AMP extension via FTP and running
In this case, you probably missed installing the AMP Toolbox, which is a crucial and required tool for the AMP extension to work properly. It helps increase Core Web Vitals score on AMP pages and convert CMS content to AMP HTML format.
Solution 1 (using Composer)
It is likely that you have not installed all the composer packages, so follow the next steps to fix it.
composer require ampproject/amp-toolbox ^0.9 composer require google/recaptcha ^1.2
Step 2 (optional)
We also recommend you to install the WebP Convert composer package for the built-in support of WebP:
composer require rosell-dk/webp-convert
Solution 2 (using FTP)
If you cannot use Composer to install the missing library, you should follow the next steps:
- Go to the Magento root directory
- Download autoloader by running the following command
git clone https://github.com/plumrocket/amp-toolbox-php-loader.git lib/internal/Plumrocket/AmpProject
- Download AMP Toolbox for PHP:
git clone https://github.com/ampproject/amp-toolbox-php.git lib/internal/Plumrocket/AmpProject/amp-toolbox-php