PHPackages                             ericmann/dynamic-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ericmann/dynamic-cdn

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

ericmann/dynamic-cdn
====================

Dynamic CDN for front-end assets.

0.4.0(8y ago)361112[1 PRs](https://github.com/ericmann/dynamic-cdn/pulls)GPLv2PHPPHP &gt;5.6

Since Jun 16Pushed 8y ago2 watchersCompare

[ Source](https://github.com/ericmann/dynamic-cdn)[ Packagist](https://packagist.org/packages/ericmann/dynamic-cdn)[ Docs](https://github.com/ericmann/dynamic-cdn/)[ RSS](/packages/ericmann-dynamic-cdn/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

Dynamic CDN # [![Build Status](https://camo.githubusercontent.com/46d3622b5416487be2e931767a3e153c5606eb87f1ce2416c3f0a64ff8a5c2eb/68747470733a2f2f7472617669732d63692e6f72672f657269636d616e6e2f64796e616d69632d63646e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ericmann/dynamic-cdn) [![Coverage Status](https://camo.githubusercontent.com/ae1b518407754640176baad8e6847218917ddd4354c8790e8961c734de880ee5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f657269636d616e6e2f64796e616d69632d63646e2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/ericmann/dynamic-cdn?branch=master)
================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#dynamic-cdn---)

**Contributors:** [ericmann](https://profiles.wordpress.org/ericmann), [10up](https://profiles.wordpress.org/10up)
**Donate link:** **Tags:** CDN, images, performance
**Requires at least:** 3.8.1
**Tested up to:** 4.5.2
**Stable tag:** 0.4.0
**License:** GPLv2 or later
**License URI:**

Dynamic CDN for front-end assets.

Description
-----------

[](#description)

Dynamic solution for rewriting image asset URLs to a hosted content delivery network (CDN) with optional domain sharding for concurrent downloads.

This plugin is based heavily on the CDN dropin from Mark Jaquith's WP\_Stack ().

Installation
------------

[](#installation)

### Manual Installation

[](#manual-installation)

1. Upload the entire `/dynamic-cdn` directory to the `/wp-content/plugins/` directory.
2. Activate Dynamic CDN through the 'Plugins' menu in WordPress.

Frequently Asked Questions
--------------------------

[](#frequently-asked-questions)

### Will this work as a mu-plugin?

[](#will-this-work-as-a-mu-plugin)

Yes. The plugin, as designed, will work just fine in the mu-plugins directory. We highly recommend a second mu-plugin be added to configure the CDN domains used by the system.

### How do I add a domain?

[](#how-do-i-add-a-domain)

In a function wired to `dynamic_cdn_first_loaded`, you'll reference the `->add_domain()` method of the `Dynamic_CDN` object. For example:

```
function my_cdn_domains() {
    $manager = DomainManager::last();
    $manager->add( 'cdn0.mydomain.com' );
    $manager->add( 'cdn1.mydomain.com' );
    $manager->add( 'cdn2.mydomain.com' );
}
add_action( 'dynamic_cdn_first_loaded', 'my_cdn_domains' );

```

### What if I want to add my domains through wp-config.php?

[](#what-if-i-want-to-add-my-domains-through-wp-configphp)

Simply define a DYNCDN\_DOMAINS constant that's a comma-delimited list of your cdn domains. For example:

```
define( 'DYNCDN_DOMAINS', 'cdn0.mydomain.com,cdn1.mydomain.com,cdn2.mydomain.com' );

```

### What if I don't add any domains, will this break my images?

[](#what-if-i-dont-add-any-domains-will-this-break-my-images)

Hopefully not. If you haven't added any domains the plugin will not rewrite anything, bypassing your images entirely.

Screenshots
-----------

[](#screenshots)

None at this time.

Changelog
---------

[](#changelog)

### 0.4.0

[](#040)

- New: Unit tests for core functionality
- Fix: Ensure srcsets don't filter in admin views

### 0.3.0

[](#030)

- New: Add support for WordPress 4.4 srcsets

### 0.2.0

[](#020)

- New: CDN domains can be added with a constant.
- Fix: Make domain mapping multisite aware. props @trepmal

### 0.1.0

[](#010)

- First release

Upgrade Notice
--------------

[](#upgrade-notice)

### 0.4.0

[](#040-1)

Domain management has moved from a general-purpose class to a purpose-built `DomainManager` object. This object is instantiated with your current site's domain name, and can be accessed throught the static `DomainManager::last()` helper. (This method automatically returns the last-instantiated domain manager). If you weren't manipulating CdN domains programmatically, you won't need to change anything at all.

### 0.1.0

[](#010-1)

First Release

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.7% 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 ~184 days

Total

3

Last Release

3253d ago

PHP version history (2 changes)0.3.0PHP &gt;5.3.2

0.4.0PHP &gt;5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/86bb3fa9fcfe57b8d313e527e9e02bde810951b25722b4717b0953a6c8db41b2?d=identicon)[ericmann](/maintainers/ericmann)

---

Top Contributors

[![ericmann](https://avatars.githubusercontent.com/u/605474?v=4)](https://github.com/ericmann "ericmann (44 commits)")[![aaronbrazell](https://avatars.githubusercontent.com/u/725303?v=4)](https://github.com/aaronbrazell "aaronbrazell (10 commits)")[![pdufour](https://avatars.githubusercontent.com/u/1239145?v=4)](https://github.com/pdufour "pdufour (4 commits)")[![cmmarslender](https://avatars.githubusercontent.com/u/1915905?v=4)](https://github.com/cmmarslender "cmmarslender (3 commits)")[![lkwdwrd](https://avatars.githubusercontent.com/u/1895738?v=4)](https://github.com/lkwdwrd "lkwdwrd (2 commits)")[![ParhamG](https://avatars.githubusercontent.com/u/1007718?v=4)](https://github.com/ParhamG "ParhamG (1 commits)")[![TheLastCicada](https://avatars.githubusercontent.com/u/3232332?v=4)](https://github.com/TheLastCicada "TheLastCicada (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ericmann-dynamic-cdn/health.svg)

```
[![Health](https://phpackages.com/badges/ericmann-dynamic-cdn/health.svg)](https://phpackages.com/packages/ericmann-dynamic-cdn)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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