PHPackages                             moderntribe/tribe-storage-statically-cdn - 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. moderntribe/tribe-storage-statically-cdn

ActiveLibrary

moderntribe/tribe-storage-statically-cdn
========================================

Tribe Storage Plugin to add statically.io CDN support

v3.0.0(2y ago)0304PHPPHP &gt;=7.4

Since Jun 21Pushed 2y ago14 watchersCompare

[ Source](https://github.com/moderntribe/tribe-storage-statically-cdn)[ Packagist](https://packagist.org/packages/moderntribe/tribe-storage-statically-cdn)[ RSS](/packages/moderntribe-tribe-storage-statically-cdn/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (6)Versions (10)Used By (0)

Tribe Storage Plugin: Statically.io
===================================

[](#tribe-storage-plugin-staticallyio)

[![PHPCS + Unit Tests](https://github.com/moderntribe/tribe-storage-statically-cdn/actions/workflows/pull-request.yml/badge.svg)](https://github.com/moderntribe/tribe-storage-statically-cdn/actions/workflows/pull-request.yml)[![php 7.3+](https://camo.githubusercontent.com/11631c2c60bece747ff2e22f4878246cf4a174bce03dbcdc1282b3c8a6b77442/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d6d696e253230372e332d7265642e737667)](https://camo.githubusercontent.com/11631c2c60bece747ff2e22f4878246cf4a174bce03dbcdc1282b3c8a6b77442/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d6d696e253230372e332d7265642e737667)

Provides dynamic image sizing and optimization via [statically.io](https://statically.io/) and only creates WordPress thumbnails for images that require hard cropping.

Installation Composer v1
------------------------

[](#installation-composer-v1)

Add the following to the composer.json `repositories` object:

```
  "repositories": [
      {
        "type": "vcs",
        "url": "git@github.com:moderntribe/tribe-storage-statically-cdn.git"
      }
  ]
```

Then run:

```
composer require moderntribe/tribe-storage-statically-cdn
```

Configuration
-------------

[](#configuration)

There are two ways to configure this plugin, either directly using the `cdn.statically.io` directly, or proxying to that domain via Nginx.

### Use statically.io URLs directly

[](#use-staticallyio-urls-directly)

Ensure you have defined the `TRIBE_STORAGE_URL` constant in `wp-config.php` to your cloud provider's publicly accessible URL and it will be replaced to use Statically's CDN for images only:

> **NOTE:** Image URLs are cached, ensure your flush your object cache if you make any changes to the following defines.

```
// Azure example
define( 'TRIBE_STORAGE_URL', 'https://account.blob.core.windows.net/container' );
```

URL rewriting would look as follows:

- Original: `https://account.blob.core.windows.net/container/sites/4/2021/06/image.jpg`
- Rewritten: `https://cdn.statically.io/img/account.blob.core.windows.net/f=auto,w=1024,h=1024/container/sites/4/2021/06/image.jpg`

### Use statically.io as a proxy via Nginx

[](#use-staticallyio-as-a-proxy-via-nginx)

Ensure you **do not** have `TRIBE_STORAGE_URL` defined, and define the following in `wp-config.php`:

```
define( 'TRIBE_STORAGE_STATICALLY_PROXY', true );
```

**Sample Nginx Proxy**

> Replace `account.blob.core.windows.net` below with your cloud provider's hostname. Using the example from above it would be: `account.blob.core.windows.net/container`

```
# Root site and sub sites
location ~* ^/(.+)?wp-content/uploads {
    try_files $uri $uri/ @statically;
}

# Check statically first
location @statically {
    # adjust the /container below to your actual container name
    rewrite "^/(.+)?wp-content/uploads/(.*=.*?[\/])?(.+)$" /$2container/$3 break;

    proxy_http_version 1.1;
    resolver 1.1.1.1;

    proxy_set_header Connection '';
    proxy_set_header Authorization '';
    proxy_set_header Host cdn.statically.io;

    proxy_hide_header Set-Cookie;
    proxy_ignore_headers Set-Cookie;

    proxy_intercept_errors on;
    recursive_error_pages on;
    error_page 400 404 500 = @uploads;

    add_header X-Image-Path "$uri" always;

    proxy_pass https://cdn.statically.io/img/account.blob.core.windows.net$uri;
}

# Fallback to check Azure directly
location @uploads {
    # remove any statically.io params, e.g f=auto,w=518,h=291/
    rewrite ^/(.*=.*?[\/])?(.+)$ /$2 break;
    proxy_http_version 1.1;
    resolver 1.1.1.1;

    proxy_set_header Connection '';
    proxy_set_header Authorization '';
    proxy_set_header Host account.blob.core.windows.net;

    proxy_hide_header x-ms-blob-type;
    proxy_hide_header x-ms-lease-status;
    proxy_hide_header x-ms-request-id;
    proxy_hide_header x-ms-version;
    proxy_hide_header Set-Cookie;
    proxy_ignore_headers Set-Cookie;

    proxy_intercept_errors on;
    recursive_error_pages on;
    error_page 400 404 500 = @imageerror;

    add_header X-Image-Path "$uri" always;
    add_header Cache-Control max-age=31536000;

    proxy_pass https://account.blob.core.windows.net$uri;
}

# If both the above fail, show the default Nginx 404 error page
location @imageerror {
    add_header X-Error-Uri "$uri" always;
    return 404;
}
```

URL rewriting would look as follows, and proxied to Statically behind the scenes:

- Original: `https://example.com/wp-content/uploads/sites/4/2021/06/image.jpg`
- Rewritten: `https://example.com/wp-content/uploads/f=auto,w=1024,h=1024/sites/4/2021/06/image.jpg`
- Proxied URL: `https://cdn.statically.io/img/account.blob.core.windows.net/f=auto,w=1024,h=1024/container/sites/4/2021/06/image.jpg`

Disable WordPress thumbnail creation
------------------------------------

[](#disable-wordpress-thumbnail-creation)

If you're not concerned with exact cropping, you can let statically.io resize your image based with keeping the same dimension ratio and disable thumbnail creation to see a large performance boost when uploading new images.

For this you have two options:

Option 1: Add this define to `wp-config.php`

```
define( 'TRIBE_STORAGE_STATICALLY_CREATE_THUMBNAILS', false );
```

Option 2: Make the `tribe/storage/plugin/statically/create_thumbnails` filter return false, e.g.

```
add_filter( 'tribe/storage/plugin/statically/create_thumbnails', '__return_false' );
```

> NOTE: Don't forget to clear object caching and regenerate thumbnails each time this option is swapped.

Automated Testing
-----------------

[](#automated-testing)

Testing provided via [PHPUnit](https://phpunit.de/) and the [Brain Monkey](https://brain-wp.github.io/BrainMonkey/)testing suite.

#### Run Unit Tests

[](#run-unit-tests)

```
$ composer install
$ ./vendor/bin/phpunit
```

More Resources:
---------------

[](#more-resources)

- [Tribe Storage Documentation](https://github.com/moderntribe/tribe-storage)
- [Modern Tribe](https://tri.be/)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~122 days

Recently: every ~244 days

Total

9

Last Release

798d ago

Major Versions

v1.1.2 → v2.0.02021-07-19

v2.0.2 → v3.0.02024-03-01

PHP version history (2 changes)v1.0.0PHP ^7.3

v3.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a11f5bee6606989680c8f81b921f8a8e2e75bfd5190cb001812ed615d032a5e?d=identicon)[tribejustin](/maintainers/tribejustin)

![](https://www.gravatar.com/avatar/7f24821ddc28f26fff6b85940d5c65cf179e7487695383944b80f2e5257db6a0?d=identicon)[nickpelton](/maintainers/nickpelton)

---

Top Contributors

[![defunctl](https://avatars.githubusercontent.com/u/1066195?v=4)](https://github.com/defunctl "defunctl (21 commits)")

---

Tags

wordpressproxynginxcdnmoderntribestatically.iotribe-storagetribe-storage-plugin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moderntribe-tribe-storage-statically-cdn/health.svg)

```
[![Health](https://phpackages.com/badges/moderntribe-tribe-storage-statically-cdn/health.svg)](https://phpackages.com/packages/moderntribe-tribe-storage-statically-cdn)
```

###  Alternatives

[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23817.0k1](/packages/rtcamp-nginx-helper)[infinum/eightshift-libs

WordPress libs developed by Eightshift team to use in modern WordPress.

63118.9k3](/packages/infinum-eightshift-libs)[b13/proxycachemanager

TYPO3 Extension that automatically flushes cached URLs within a proxy / CDN.

10100.7k](/packages/b13-proxycachemanager)[ndigitals/wp-local-media-proxy

Proxy images on a local development WordPress site from a remote server.

1443.5k](/packages/ndigitals-wp-local-media-proxy)[x-wp/di

The dependency injection container for WordPress

301.1k10](/packages/x-wp-di)

PHPackages © 2026

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