PHPackages                             nyco/wp-open-data-transients - 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. [Caching](/categories/caching)
4. /
5. nyco/wp-open-data-transients

ActiveWordpress-plugin[Caching](/categories/caching)

nyco/wp-open-data-transients
============================

Interface for saving Open Data endpoints as WordPress Transients.

0.1.3(4y ago)1127[2 PRs](https://github.com/CityOfNewYork/nyco-wp-open-data-transients/pulls)GPL-3.0+PHP

Since Oct 2Pushed 3y ago13 watchersCompare

[ Source](https://github.com/CityOfNewYork/nyco-wp-open-data-transients)[ Packagist](https://packagist.org/packages/nyco/wp-open-data-transients)[ Docs](https://github.com/cityofnewyork/nyco-wp-open-data-transients)[ RSS](/packages/nyco-wp-open-data-transients/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependencies (2)Versions (11)Used By (0)

NYCO WP Open Data Transients
============================

[](#nyco-wp-open-data-transients)

This WordPress Plugin will provide an interface in the WP Admin to save saving external Open Data as WordPress transients and a developer API to interact with them. You can read more about the [WordPress Transients API](https://codex.wordpress.org/Transients_API) in the Codex.

Features
--------

[](#features)

- Admin Interface (Settings &gt; Open Data Transients) for adding new transients and adding an Open Data token.
- Transients can be updated manually in the Admin, but they are set to expire weekly (using the WordPress constant `WEEK_IN_SECONDS`).
- Developer API for getting the transient data, and updating it automatically if it is expired.

Usage
-----

[](#usage)

### Installation

[](#installation)

It uses `composer/installers` to install it to the plugin directly using Composer. Just run:

```
composer require nyco/wp-open-data-transients

```

You can also download the package and add it manually to your plugin directory.

### App Token

[](#app-token)

A token will be sent in the header (`X-App-Token`) to the Open Data endpoint to authenticate your application for for saving data. This can be set in the same admin or as an environment variable `$_ENV['OPEN_DATA_APP_TOKEN']`. The [NYCO WP Config](https://github.com/cityofnewyork/nyco-wp-config) plugin can be used to manage environment variables.

### Saved Transients

[](#saved-transients)

Transients can be saved by adding a valid name (letters and underscores only) and valid url. Clicking "Save Transient" will save the transient and cache the request. Once it is saved, the developer API can be used to get the data. The developer API also exposes the save and set methods used by the admin interface.

Typing the name of an already saved transient and clicking "Save Transient" will update the transient data cache.

### Developer API

[](#developer-api)

Once the plugin is installed, you can reference the name space to use it;

```
use NYCO\Transients as Transients;

```

#### Save

[](#save)

The transient needs to be saved with a valid name (letters and underscores only) and valid url before it can be exposed to the [`set`](#set) or [`get`](#get) methods.

```
Transients::save('your_transient_name', 'https://opendata.com/endpoint');

```

#### Set

[](#set)

Uses WordPress' `wp_remote_get` and `set_transient` methods to retrieve the saved endpoint and save the response body. It will expect a JSON response and will be saved as a PHP Object.

```
Transients::set('your_transient_name');

```

#### Get

[](#get)

Returns a saved transient. If the transient is empty (expired) it will use the [`set`](#set) method to re-cache it.

```
Transients::get('your_transient_name');

```

### Potential Improvements

[](#potential-improvements)

This plugin only provides a small interface for saving external Open Data as WordPress Transients and external data and is not a fully fledged transient manager.

- Method to delete saved transients.
- Option to set the expiration of transients.

About NYCO
==========

[](#about-nyco)

NYC Opportunity is the [New York City Mayor's Office for Economic Opportunity](http://nyc.gov/opportunity). We are committed to sharing open source software that we use in our products. Feel free to ask questions and share feedback. Follow @nycopportunity on [Github](https://github.com/orgs/CityOfNewYork/teams/nycopportunity), [Twitter](https://twitter.com/nycopportunity), [Facebook](https://www.facebook.com/NYCOpportunity/), and [Instagram](https://www.instagram.com/nycopportunity/).

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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 ~186 days

Recently: every ~323 days

Total

8

Last Release

1570d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64423478?v=4)[NYC Opportunity](/maintainers/nycopportunity)[@NYCOpportunity](https://github.com/NYCOpportunity)

---

Top Contributors

[![devowhippit](https://avatars.githubusercontent.com/u/3826974?v=4)](https://github.com/devowhippit "devowhippit (10 commits)")

---

Tags

civic-techcomposerdatanycopportunityopen-dataplugintransientswordpresswordpressdataopen datatransients

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/nyco-wp-open-data-transients/health.svg)

```
[![Health](https://phpackages.com/badges/nyco-wp-open-data-transients/health.svg)](https://phpackages.com/packages/nyco-wp-open-data-transients)
```

###  Alternatives

[wp-media/wp-rocket

Performance optimization plugin for WordPress

7591.4M4](/packages/wp-media-wp-rocket)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.6k10](/packages/helsingborg-stad-municipio)[rhubarbgroup/redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.

536103.2k1](/packages/rhubarbgroup-redis-cache)[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.

23617.1k1](/packages/rtcamp-nginx-helper)[pressbooks/pressbooks-book

This theme is named after Canadian media theorist Marshall McLuhan, who coined the phrase “the medium is the message.” It is designed for academic writing and is also suitable for fiction. Headings are set in Cormorant Garamond, and body type is set in Lora.

226.7k](/packages/pressbooks-pressbooks-book)

PHPackages © 2026

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