Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Allows sites to serve and track changes of root level XML, JSON, and other data files without directly uploading files to the server
PHP JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
css
img
js
templates
datafiles.php
readme.md

readme.md

Datafiles WordPress Plugin

Allows machine-readable files like JSON or XML file to be versioned inside WordPress as a custom post type, and be properly cached and served without directly uploading them to the server.

How it works

The plugin registers a custom post type "datafile" which functions nearly identically to normally WordPress posts, except in how they are served to users. When a datafile is viewed, the proper content-type header is served to the user's browser, and the file content is served raw (without any header or footer) ensuring it renders properly. This allows WordPress sites to curate and host machine-readable static files, creating light-weight pseudo-APIs.

History

Created as a proof-of-concept to show how a machine-readable files could be served by a CMS in conjunction with the President's Digital Strategy.

Note

This plugin allows users to serve unfiltered content to visitors. By default, only administrators have access to edit datafiles. Additional capabilities can be granted via third-party plugins such as the Members plugin.

License

Something went wrong with that request. Please try again.