WP Manifestindependent plugin directory
manifest / media / aws-s3-for-posts-ramalho

RWP - AWS S3 for Posts

WordPress plugin: adds an AWS S3 file selector to Custom Post Type meta boxes, with presigned URL shortcode.

by Raimundo Ramalho · github.com/rairamalho/aws-s3-for-posts-ramalho

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/rairamalho/aws-s3-for-posts-ramalho/archive/refs/heads/master.zip

Readme

RWP - AWS S3 for Posts

A WordPress plugin that integrates AWS S3 with Custom Post Types, enabling content editors to pick files directly from an S3 bucket via a meta box selector.

Features

  • CPT file selector — adds a dropdown meta box to any registered Custom Post Type, populated with objects from your S3 bucket.
  • Year field — optional year meta box for categorizing content by year.
  • Presigned URL shortcode[rwp_s3_url post_id="123"] generates a time-limited, authenticated download link for the selected file.
  • Admin settings — simple settings page to configure which CPTs use S3 and to store AWS credentials.
  • Secure AJAX — all admin actions protected by WordPress nonces and manage_options capability checks.

Requirements

Requirement Version
PHP 8.1+
WordPress 6.5+
AWS SDK PHP ^3.238 (via Composer)

Installation

  1. Clone or download this repository into your wp-content/plugins/ directory.
  2. Install PHP dependencies:
    composer install --no-dev
  3. Activate the plugin from Plugins → Installed Plugins in WordPress admin.
  4. Go to Settings → AWS S3 Options to enter your AWS credentials and choose which CPTs should have the file selector.

Configuration

Option Description
S3 Key Your AWS IAM access key ID
S3 Secret Your AWS IAM secret access key
S3 Bucket Name of the S3 bucket to browse
S3 Region AWS region of your bucket (e.g. us-east-1)

Security note: The IAM user should have the minimum permissions required: s3:ListBucket and s3:GetObject on the target bucket.

Usage

Meta Box

After configuring the plugin, open any post of an enabled CPT. A Select AWS S3 file meta box will appear, listing all objects in the configured bucket. Select a file and save the post.

Shortcode

[rwp_s3_url post_id="42"]

Returns a 20-minute presigned URL for the file attached to post 42. Use it inside a link tag or pass it to a download button.

Development

# Install all dependencies (including dev)
composer install

# PHP lint
php -l plugin.php

License

GPL v2 or later — see LICENSE.

Author

Raimundo Ramalhogithub.com/rairamalho

Read the full README on GitHub →