Giter Site home page Giter Site logo

mattrude / cdn-linker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mark-kubacki/cdn-linker

0.0 2.0 0.0 437 KB

Rewrites links to static files so they point to your own CDN network. For Wordpress.

Home Page: http://mark.ossdl.de/2009/08/rewriting-urls-for-wordpress-and-cdn/

PHP 100.00%

cdn-linker's Introduction

CDN Linker - Wordpress Plugin

Info

See github for the latest source.

Author

W-Mark Kubacki <[email protected]>

Tags

CDN,links,cloudfront,simplecdn,media,performance,distribution,accelerator,content,speed,cloud

Requires at least

2.7

Tested up to

3.3.1

Rewrites links to static files to your own CDN network.

Description

Replaces the blog URL by another for all files under wp-content and wp-includes. That way static content can be handled by a CDN by origin pull. (The origin is your blog address.)

You could upload your static files to S3, CloudFront or just any site, too. For S3/Cloudfront, see this script to help you with uploading/synchronizing your blog files.

The lite version of the plugin works like the regular version but is not supported. You can get the regular version at Github which:

  • Is free of charge, open source and without any ads.
  • Supported. Here is the bug tracker if you encounter any issues.
  • Has more and advanced features.
  • Is updated more frequently. See downloads.
  • Quality assurance.

License

Licensed under the Reciprocal Public License, Version 1.5, for Personal Use as defined in 1.11 therein (http://www.opensource.org/licenses/rpl1.5).

Else please contact me by email for an individual license.

Installation

  1. Setup your CDN: Either configure an origin pull, mirror bucket or upload your static files somewhere.
  2. Upload the plugin to your /wp-content/plugins/ directory.
  3. Activate the plugin through the 'Plugins' menu in WordPress.
  4. Provide the URL, where your static files can be found, under Settings.

Frequently Asked Questions

How to uninstall?

Either deactivate the plugin or delete the plugin's directory.

Why another such plugin?

As many WP plugins don't correctly include JS and CSS files most of the current CDN plugins cannot rewrite links correctly. They rely on the high-level WP API.

This plugin does its rewriting on the lowest level possible - PHP itself.

How does it work?

After your blog pages have been rendered but before sending them to the visitor, it will rewrite links pointing to wp-content and wp-includes. That rewriting will simply replace your blog URL with that you have entered in settings screen.

Thus files are pulled from the other site.

Is it compatible to plugin XY?

Yes, by design it is compatible to all plugins. It hooks into a PHP function ob_start and there does the string replacement. Therefore, no Wordpress function is altered, overwritten or modified in any way.

Indeed, you could even copy this plugin's rewriter into any arbitrary PHP software.

Will it work with my CDN?

Yes, if it supports origin pull (aka mirror bucket, some sort of caching). Or if you upload your files manually.

What about Amazon's S3?

Right, S3 doesn't support origin pull. You will have to upload your files by hand. I've written a script for this, too, so it is just a matter of running it. It is linked on the bottom of my blog post about copying files to S3.

Amazon's CloudFront does support origin pull. Just create a distribution as usual and set your blog's URL as origin.

What other plugins do you recommend?

Now that you can offload all the files such as images, music or CSS, you should serve your blog posts as static files to decrease load on your server. I recommend SuperCache-Plus as it will maintain, update and create that static files from dynamic content for you. The off-linker is compatible.

I discovered a bug!

If you are using the lite version, please upgrade. The following applies only to the regular version which you can find at Github:

Share it with me! The rarer a species, the more interesting. But I will need its habitat, too. Therefore, please send me at least one page with the plugin turned off and on, as attachment. For that please click at view source in your browser and copy the contents to notepad and send me the two resulting text files.

Troubleshooting

Disqus

Either uncheck rewrite root-relative refs or add count.js to exclude if substring.

Livefyre, IntenseDebate, and Juvia

No issues.

cdn-linker's People

Contributors

mark-kubacki avatar mattrude avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.