A collection of tools for publishing from and to NPR's Content Distribution Service. Find this plugin on the Wordpress.org Plugin Repository.
- Contributors: jwcounts, tamw-wnet, bdivver
- Original developers: NPRDS, INN Labs
- Requires at least: 4.0
- Tested up to: 6.6
- Requires PHP: 8.0
- Version: 1.3.1
- Stable tag: 1.3.1
- Author: Open Public Media
- Author URI: https://github.com/OpenPublicMedia/
- License: GPLv2
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
The NPR Content Distribution System (CDS) Plugin provides push and pull functionality with the NPR CDS along with a user-friendly administrative interface.
NPR's CDS is a content API, which essentially provides a structured way for other computer applications to get NPR stories in a predictable, flexible and powerful way. The content that is available includes audio from most NPR programs dating back to 1995 as well as text, images and other web-only content from NPR and NPR member stations. This archive consists of over 250,000 stories that are grouped into more than 5,000 different aggregations.
This plugin also allows you to push your content to the NPR CDS, so that it can be republished by NPR or other NPR member stations.
Access to the NPR CDS requires a bearer token, provided by NPR. If you are an NPR member station or are working with an NPR member station and do not know your key, please ask NPR station relations for help.
Usage of this plugin is governed by NPR's Terms of Use, and more specifically their API Usage terms.
The WordPress plugin was originally developed as an Open Source plugin by NPR and is now supported by developers with NPR member stations working within the Open Public Media group. If you would like to suggest features or bug fixes, or better yet if you would like to contribute new features or bug fixes please visit our GitHub repository and post an issue or contribute a pull request.
- Upload the plugin files to the
/wp-content/plugins/plugin-name
directory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress
- Use the Settings -> NPR CDS screen to configure the plugin. Begin by entering your CDS token, then add your Push URL and Org ID.
If you are an NPR member station or are working with an NPR member station and do not know your key, please ask NPR station relations for help.
Push requires an Organization ID in the NPR CDS, which is typically given out to only NPR stations and approved content providers. If that's you, you probably already have an Organization ID.
There is documentation in the NPR's Github site.
You can find it in the Docs folder.
NPR CDS Plugin General Settings screen
NPR CDS multiple get settings
Get NPR Stories link in the dashboard
Getting an NPR Story by CDS ID
NPR Stories having been retrieved
- Fixed a bug where the service ID was not being set properly on uploaded articles
- "Org ID" renamed to "Service ID" in various places to try to better reflect the guidance from NPR
- Service IDs in
settings.php
can now be a comma-separated list, if all posts will be co-owned - Added
npr_cds_push_service_ids_filter
so ownership can be modified on an ad-hoc basis, if needed - Fixed a bug where, under certain conditions, checking audio enclosures for the premium value can trigger an exception (h/t @areynold)
- Laying groundwork for potential WP-JSON endpoint
- Minor formatting and bug fixes
- Setting the
npr_has_layout
flag for imported articles to help with backwards compatibility (h/t @tamw-wnet) - Fixed a potential fatal error in
NPR_CDS_WP
when passing promo card rels
- Fixed a bug where audio files were getting attached to stories without the proper profiles, leading to push errors
npr_cds_show_message()
only echoes in admin dashboard- Promo cards without valid
webPages
array are ignored
- Fixed error logging bug which was causing blank errors on failed uploads
- Changed the activation function to fully remove all of the old NPR Story API options after migrating them
- Changed the deactivation function to save all of the previous settings into a site option and delete the individual options
- Added functions to allow for restoring settings from a previous install or deleting those stored settings
- Updated a bunch of stray references to the old Story API
- Documentation updates
NPR_CDS_WP
has been updated to block/ignore stories and assets that have been marked as restricted in the CDS (meaning they are not eligible for syndication)
profileIds
can now be sent toNPR_CDS_WP
as a comma-separated string (OR), or as multiple entries (AND)- Fixed a bug in
NPR_CDS_WP
where$this->request->params
was not being properly populated
- Updated the
NPR_CDS_WP->get_image_url()
function to handle image URLs from NPR's new CDN - Fixed an issue where featured images were not downloading properly on imported NPR articles because a proper filename was not being provided
- When generating the article layout, if not using feature images, imported articles will have the primary image at the top of the layout (if one exists)
- NPR frequently inserts the primary image as the first asset in the layout, while Grove stations typically don't. I don't know if this is intended or not, but this is an attempt to normalize the output across the board
- Thanks to Iris Vandenham at Flower Web Design for bringing these issues to our attention
- Fixed a bug that broke the Update link in the admin dashboards
- Fixed a potentially fatal error caused by malformed audio embeds in imported articles
- Fixed a bug where the cron schedules were not being set or updated after an initial error
- Fixed a potentially fatal error caused by importing articles with nonexistent teasers
- Thanks to @tamw-wnet for the assist on all above
- Adding a setting to skip ingesting promo cards from NPR (h/t @davidmpurdy)
- Updated formatting support for promo cards
- Fixed a bug in how the plugin was handling
$image->hrefTemplates
- Reworked the
load_page_hook()
function inget_stories.php
to account for NPR's updated ID structure now that they have also moved to Grove
- Fixed a bug that was preventing media credits from being appended to image captions
- Added a setting to append an attribution line at the end of imported articles (default 'no')
- Added a setting to import an article's tags from the CDS (default 'yes')
- Removed a filter from the documentation since it had already been removed from the code
- Consolidating get_stories_ui.php into the NPR_CDS class in get_stories.php
- Fixing a bug that was preventing NPR_CDS::load_page_hook() from firing on custom post types
- Removing old TODOs
- Added check to avoid downloading or inserting images that cannot be distributed via the CDS
- Increased the timeout for cURL requests when pushing stories
- Fixed a bug where unticking the 'Send to NPR CDS' checkbox in the editor would result in the article being pushed anyway
- Fixed a bug that was causing article metadata to be saved using an invalid key when ingesting articles
- Breaking the settings screens into 3 separate pages
- Adding the ability to select the pull post type for each query (leave blank to use the default)
- Fixing labels on NPR Story custom post type
- NPR CDS metabox now appears higher in the sidebar by default
- Added setting for whether or not you want the "Send to NPR CDS" checkbox checked by default
- Bug fixes related to bylines: plugin now saves bylines under the proper metadata key, no longer ignore non-reference bylines, and doesn't write empty bylines when the Co-Authors Plus plugin is present (h/t Andrew Reynolds at WAMU)
- 'Get NPR Stories' menu option now aligns to whichever
pull_post_type
is selected in settings (h/t Kaym Yusuf at WAMU) - Fixed a couple of typos that were preventing the 'Theme Uses Featured Image' settings from being honored (h/t David Purdy)
- Adding documentation for all of the filters that are available in the plugin
npr_cds_push()
: lack of publishing rights exits the function instead of killing the process
- Default cron job timing is now 1 hour (was previously a minute because it wasn't properly being converted into seconds)
- Cron jobs are no longer scheduled if there are no queries configured
- Fixing a problem where Get Multi queries run via WP_Cron would silently fail because
npr_cds_push()
would check if the current user had publishing rights and executewp_die()
. WP_Cron doesn't run as a specific user, therefore it doesn't technically have publishing rights.npr_cds_push()
now checks if the post was retrieved from the CDS first before checking publishing rights.
- Fixing warnings and a few fatal errors in
NPR_CDS_WP.php
- Fixing improperly escaped HTML in post editor meta boxes
- Fixing a bunch of warnings in
classes/NPR_CDS_WP.php
- Changing the behavior the
Get Multi
settingRun the queries on saving changes
so that it runs once and then turns off. That way, it doesn't run every time you save changes on the page. - Fixed issue where updates to bulk actions dropdowns were being duplicated
- Overhaul to enable pulling from NPR's Content Distribution Service, which is the next generation of the Story API.
- Previous version notes can be found in the NPR Story API plugin repository