The AWS S3 adapter for the Tribe Storage WordPress plugin. This adapter is meant to be configured and installed by developers.
Note: This also automatically installs the Tribe Storage plugin, ensure you have configured Composer Installers for WordPress plugins.
Add the following to the composer.json repositories
object:
"repositories": [
{
"type": "vcs",
"url": "[email protected]:moderntribe/tribe-storage-aws-s3.git"
},
{
"type": "vcs",
"url": "[email protected]:moderntribe/tribe-storage.git"
},
]
Then run:
composer require moderntribe/tribe-storage-aws-s3
Define the adapter, and your bucket name in wp-config.php
:
define( 'TRIBE_STORAGE_ADAPTER', \Tribe\Storage\Adapters\S3_Adapter::class );
define( 'TRIBE_STORAGE_S3_BUCKET', 'mybucketname' );
Define the minimum S3 options in wp-config.php
:
define( 'TRIBE_STORAGE_S3_OPTIONS', [
'credentials' => [
'key' => 'YOUR-KEY',
'secret' => 'YOUR-SECRET-KEY',
],
'region' => 'us-east-1',
'version' => 'latest',
] );
Define the URL of the CDN or the public URL for your bucket in wp-config.php
:
// Ideally this should be a CDN URL
define( 'TRIBE_STORAGE_URL', 'https://s3-us-east-1.amazonaws.com/bucket/' . TRIBE_STORAGE_S3_BUCKET );
Full S3 client configuration options are available via
AWS documentation.
Additionally, this can be configured with the tribe/storage/s3_client_options
filter.
Testing provided via PHPUnit and the Brain Monkey testing suite.
$ composer install
$ ./vendor/bin/phpunit