PHPackages                             ultradev/openmage-mediasync-cloudflare-r2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ultradev/openmage-mediasync-cloudflare-r2

ActiveMagento-module

ultradev/openmage-mediasync-cloudflare-r2
=========================================

Sync Magento/OpenMage media files with Cloudflare R2 and serve via CDN

08↑2900%PHP

Since Apr 3Pushed yesterdayCompare

[ Source](https://github.com/LuizSantos22/openmage-mediasync-cloudflare-r2)[ Packagist](https://packagist.org/packages/ultradev/openmage-mediasync-cloudflare-r2)[ RSS](/packages/ultradev-openmage-mediasync-cloudflare-r2/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

OpenMage Media Sync - Cloudflare R2
===================================

[](#openmage-media-sync---cloudflare-r2)

Synchronize Magento/OpenMage media files with a Cloudflare R2 bucket and serve them via CDN for improved performance.

---

🚀 Overview
----------

[](#-overview)

This module provides a lightweight solution to **sync media files** (primarily product images) from your OpenMage installation to a Cloudflare R2 bucket.

Instead of replacing Magento's storage system, it **keeps local media and syncs it to R2**, allowing you to serve assets through Cloudflare CDN.

---

✨ Features
----------

[](#-features)

- Sync product images on product save
- CLI script to sync all existing media files
- Compatible with Cloudflare R2 (S3 API)
- Secure credential storage (encrypted in admin)
- Retry mechanism for uploads
- Avoids unnecessary uploads (file size comparison)

---

📦 Requirements
--------------

[](#-requirements)

- OpenMage / Magento 1.9+
- PHP 8.1+
- Composer
- Cloudflare R2 bucket

---

📥 Installation
--------------

[](#-installation)

### Option 1 — Composer (recommended)

[](#option-1--composer-recommended)

Install the module:

```
composer require ultradev/openmage-mediasync-cloudflare-r2
```

### Option 2 — Manual

[](#option-2--manual)

Copy files into your Magento root:

```
app/code/local/UltraDev/MediaSync
app/etc/modules/UltraDev_MediaSync.xml
shell/ultradev_media_sync.php

```

Then clear cache.

---

⚙️ Configuration
----------------

[](#️-configuration)

Go to:

```
System > Configuration > UltraDev Media Sync

```

Fill in:

- **Bucket** – Your R2 bucket name
- **Endpoint** – R2 endpoint URL
- **Access Key**
- **Secret Key**

---

☁️ Cloudflare R2 Notes
----------------------

[](#️-cloudflare-r2-notes)

- Do NOT use ACL (`public-read`) — R2 does not support it
- Use **Custom Domain / CDN** via Cloudflare
- Ensure bucket access is properly configured

---

🔄 Usage
-------

[](#-usage)

### Automatic Sync

[](#automatic-sync)

Triggered on:

- Product save (`catalog_product_save_after`)

### Manual Sync (CLI)

[](#manual-sync-cli)

Run:

```
php shell/ultradev_media_sync.php
```

This will sync all files inside `/media`.

---

⚠️ Important Notes
------------------

[](#️-important-notes)

- This module **does NOT replace Magento storage**
- It only syncs files to R2
- Magento still reads from local `/media`
- For CDN usage, configure your media base URL to point to Cloudflare

---

🧠 Best Practice
---------------

[](#-best-practice)

After syncing, set:

```
System > Configuration > Web > Base URLs

```

Change **Base Media URL** to your Cloudflare CDN URL.

---

🛠 Troubleshooting
-----------------

[](#-troubleshooting)

### Files not uploading

[](#files-not-uploading)

- Check logs:

```
var/log/ultradev_mediasync.log

```

- Verify credentials and endpoint

### Class not found (AWS SDK)

[](#class-not-found-aws-sdk)

Run:

```
composer install
```

---

📄 License
---------

[](#-license)

Proprietary — UltraDev

---

👨‍💻 Author
----------

[](#‍-author)

UltraDev

###  Health Score

23

—

LowBetter than 28% of packages

Maintenance65

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/83614706?v=4)[LuizSantos22](/maintainers/LuizSantos22)[@LuizSantos22](https://github.com/LuizSantos22)

---

Top Contributors

[![LuizSantos22](https://avatars.githubusercontent.com/u/83614706?v=4)](https://github.com/LuizSantos22 "LuizSantos22 (29 commits)")

### Embed Badge

![Health badge](/badges/ultradev-openmage-mediasync-cloudflare-r2/health.svg)

```
[![Health](https://phpackages.com/badges/ultradev-openmage-mediasync-cloudflare-r2/health.svg)](https://phpackages.com/packages/ultradev-openmage-mediasync-cloudflare-r2)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
