Pym Shortcode plugin update: version 1.3.1

Last week, NPR released Pym.js version 1.3.0, and earlier this week released 1.3.1. These feature releases introduced optional scroll tracking, allowing the child iframe to know where the browser is on the parent page. You can read more about how that's implemented, and how it can be used, on the NPR Visuals Team blog post announcing Pym 1.3.0. Pym.js version 1.3.1 added a function getParentPositionInfo to the Pym child.

Pym Shortcode version 1.3.1 brings you the latest version of Pym.js, as well as the following improvements:

  • Adds an id="" attribute to allow setting of custom IDs on embeds, for Github issue #21. The id="" attribute is useful if you want to load a new embedded page inside the iframe and maintain Pym functionality.
  • Adds a class="" attribute to allow setting custom of classes on embeds, for Github issues #22 and #23. The class="" attribute allows you to, among other things, add layout classes to embeds so they take a different shape on your page.
  • Adds a default class name pym to all embed-containing <div> elements output by this plugin, and a filter pym_shortcode_default_class to allow changing the default class or removing it.

You can download the new version of the Pym Shortcode plugin through your WordPress dashboard, on the WordPress.org plugin repository, or on Github.

If you have feedback on the plugin or would like to contribute to development of the Pym Shortcode plugin, check out our contributor guidelines and join the conversation in the plugin's GitHub issues or in our Slack.

Office Hours June 30: INN WordPress Plugins

We'd like to hear from users of our WordPress plugins this week during our open office hours. Join us from 2 to 3 p.m. Eastern in our weekly video chat and in the notes to talk about what you want to see from our plugins.

We maintain:

We'd love to hear what feedback you have on the plugins and ideas you have for their future development.


Join us from PC, Mac, Linux, iOS or Android at zoom.us/j/298377456

Or by telephone: +1 408 638 0968 (US Toll) or +1 646 558 8656 (US Toll)
Meeting ID: 298 377 456
International numbers are available.

Notes for this week's office hours will be in this etherpad.

Our ongoing office hours schedule is in this Google Sheet.

More about our office hours: nerds.inn.org/category/office-hours/

News Quiz Shortcode Plugin Now Available On WordPress.org

A little while ago, our apprentice, Will Haynes, released the initial version of what we're now calling the News Quiz Shortcode. We're happy to announce that the plugin is now listed in the WordPress plugin directory.

Built on top of Mother Jones’ NewsQuiz.js library, this WordPress plugin allows you to build a quiz in Google Drive and embed it with a shortcode into a WordPress post.

Screen Shot 2016-06-17 at 1.46.01 PM

This could be used to test readers’ understanding of material, or just to expose them to the questions in an interactive way.

Grading of questions happens inline, at the bottom of the widget. Settings exist to control both the size and flow of the plugin, as documented in the project readme.

Try out the example quiz embedded in this post, or check out how INN member Youth Today is using it to support a piece exploring how the income gap affects scoring on college entrance exams.

To see how to build a quiz of your own using this plugin, how to format your Google spreadsheet, etc. please see Mother Jones’ documentation for the original quiz library.

Here's the sample quiz from the example:

Introducing the Super Cool Ad Inserter Plugin For WordPress

After several months of development, we're pleased to announce the initial release of a plugin that will help publishers automatically insert widgets in the middle of posts: the Super Cool Ad Inserter Plugin (SCAIP, for short).

SCAIP creates widget areas that are inserted programmatically into every post after every Nth paragraph.

A screenshot of the configuration page of the Super Cool Ad Inserter Plugin
Here's the main SCAIP settings page. Read more about these settings in the plugin's documentation.

You can then fill the widget areas that SCAIP creates with ads, newsletter signup forms, donation messages, other calls to action, related posts widgets, or really anything else that fits in a WordPress widget (including the default text/html widget).

To see the plugin in use, check out Religion News Service, which uses another one of our plugins, DoubleClick for WordPress, to insert ads within posts after every few paragraphs. The Cornell Daily Sun uses WordPress text widgets to display ads within posts using another ad network.

Another example is this screenshot, which shows the plugin in use in the WordPress.org Twenty Thirteen theme, inserting image widgets. Anything contained in a WordPress widget can easily be inserted by SCAIP.

Ads are normally inserted automatically, but the plugin also supports shortcodes to allow manual placement of the widget areas within posts, and per-post overrides to disable automatic ad placement.

To learn more about what the plugin is capable of, check out the docs or download the plugin and try it out! We're eager for your suggestions, bug reports and pull requests on GitHub or in the open tech channel on the INN Slack.

Developers will be happy to learn that the plugin is easy to integrate with themes. Our Largo WordPress theme required no changes to support SCAIP, and we believe that is the case with other themes.

New WordPress Plugin: Pym Shortcode

We're pleased to announce the release of yet another new WordPress plugin: Pym Shortcode.

If you often find yourself embedding iframes in your WordPress posts, you've probably encountered the hassle involved in making an iframe responsive to the width of its containing element.

To address this problem, NPR Visuals Team released Pym.js, a JavaScript library that goes on the embedding page and the embedded page. The parent page tells the child page what the width of the iframe is, and the child page tells the parent how tall the iframe should be. The iframe, resized, now fits its content and the page. The embed code required is pretty simple:

<div id="example"></div>
<script type="text/javascript" src="pym.js"></script>
<script>
 var pymParent = new pym.Parent('example', 'child.html', {});
</script>

But WordPress' default configuration strips <script> tags from posts, meaning that you can't normally use Pym in WordPress sites.

Enter the pym shortcode. This simple plugin is designed to allow users to place Pym embeds without having to use <script> tags.

Here's an example of how the shortcode would be used:

pym src="http://blog.apps.npr.org/pym.js/examples/table/child.html"

In the goal of making it as useful as possible, we've given the shortcode a couple of other attributes, pymsrc and pymoptions, which are explained in the plugin's docs on GitHub.

If you feel so inclined, you can contribute to the plugin by forking the code on GitHub.

May this help all your interactives to be responsive!

resizing
Tiago Franco's classic "resizing the browser" gif.

New WordPress Plugin: Google Analytics Popular Posts

Another day, another plugin. Get excited! We're announcing the release of our Google Analytics Popular Posts plugin.

The plugin (previously called Analytic Bridge) queries Google Analytics for pageview data for your site and uses an algorithm – based on publish date and total number of pageviews – to determine a weighted popularity score for a post.

Using this scoring mechanism, the plugin generates a list of the most popular posts for a given site.

ga-2

The list of popular posts can be displayed on the front end of your site using the included "Google Analytics Popular Posts" widget.

ga-3

We hope to make this the start of a suite of tools to improve the connection between your site and Google Analytics. Stay tuned!

The plugin is available now in the WordPress plugin directory and you can check out the code on Github and create a fork to contribute!

New WordPress Plugin: Term Debt Consolidator

We're pleased to announce the release of a new WordPress plugin: Term Debt Consolidator.

We've all been there. You have an older WordPress site with thousands of tags. Mixed up in there you have misspellings, singular and plural version of the same term, similar terms applied to only a single post and more.

Our new Term Debt Consolidator plugin examines your site's tags and categories and groups them by similarity, allowing you to consolidate groups of similar terms down to a single term of your choosing:

tdc-2

This is useful for sites that have tons of messy tags, some of which are technically unique due to differences in capitalization or minor typos in the term title.

tdc-1

Using Term Debt Consolidator, you can identify and fix these issues quickly.

You can also use the `tdc_enabled_taxonomies` filter to enable the TDC to work with your site's custom taxonomies (it supports the built-in WordPress categories and tags taxonomies by default).

If you feel so inclined, you can contribute to the plugin by forking the code on Github.

Nerd Alert 38: Bert’s Pancake ‘n’ Pizza World

nerdalertfinal

Our thoughts are with everyone who loved Alison Parker and Adam Ward. #WeStandWithWDBJ7

HOT LINKS

What we're reading this week

  Adam: News sites have gotten a bad reputation for being pretty miserable to use by overloading their pages with ads, popups, social buttons and other gadgets. Designer Brad Frost has documented a number of anti-patterns to avoid (make sure to turn on the bullshit).

  Ben: Don’t use .dev for development domains - it’s a real top-level domain now: http://nic.dev.

  David: This post explores the WordPress Transients API and use cases for leveraging it. Here's a great tutorial using them to push plugin updates from GitHub via the GitHub API.

  Kaeti: Why it’s important that we design tools with emotional intelligence.

  Bert: Would you patronize Bert's Pancake 'n' Pizza World?

This week we bid farewell to our summer apprentice Dani Litovsky Alcala who did great work with INN members on data projects! All the best, Dani!

You could be our next apprentice this fall or spring. Our apprentices are paid, trained, appreciated and awesome!

 

WE MADE A THING

c7196044-fa06-49b0-90f5-63fef3d7c579

 

Many sites we work with collect links from around the web and then either present this feed of links on their sites in a widget or turn them into roundup posts and email newsletters.

To improve the workflow for curating and publishing these roundups, we've created a new WordPress plugin called Link Roundups. Now available on WordPress.org.

SOME OTHER STUFF

LISTEN: Stand by each other. Be excellent to one another.

COOK: Go crave these Quinoa lunch bowls. Not a joke.

WATCH: We always *knew* Android versions are delicious but...

GIF: Explore the world, bring a friend!

CatsRedCarFun

 

New WordPress Plugin: Link Roundups

Many sites we work with collect links from around the web and then either present this feed of links on their sites in a widget or turn them into daily (or weekly) roundup posts and email newsletters.

To improve the workflow for curating and publishing these roundups, we've created a new WordPress plugin called Link Roundups.

The plugin borrows some patterns and a bit of the original code from a plugin called Argo Links, but has been almost completely rewritten with a number of new features added (if you are a current Argo Links user, we've included an update script to help you migrate).

Features

Some of the key features of the plugin include:

bookmarklet-popup

A browser bookmarklet to collect links as you browse, add your own description, tags and then save the link directly to your WordPress site, all without having to leave the site you're on. This bookmarklet will also attempt to automatically pull in the title, source and a featured image for the links so you don't have to populate these fields manually.

Widgets for saved links and link roundups to display the links you've saved or your recently published roundups in any WordPress widget area.

published-roundupA WordPress custom post type called Link Roundups with a way to browse your saved links and compile roundup posts to be published on your site.

Integration with MailChimp to simplify the process of sending the roundup posts to your newsletter subscribers.

Plugin options to control the display of saved links in roundups, manually specify the anchor text to be used and a number of other nice enhancements to give you the flexibility to format link roundups the way you want.

Installation

You can find documentation and installation instructions on GitHub and the plugin is also now available from the WordPress.org plugin directory.

What's Next?

In our next release we plan to add the ability to share links you save directly to Facebook/Twitter at the same time as they are saved to your site, improve documentation and add a number of other features.

You can submit feature requests and see our plans for future releases on the project's GitHub repository. Feedback, bug reports and questions are most welcome!

Thanks!

Finally, we want to thank INN member Fresh Energy who funded some of the development of this plugin as part of our recent redesign of their Midwest Energy News site. Thanks also to Aspen Journalism for offering some helpful feedback.

Quiz Your Readers: Our New WordPress Plugin To Create Simple Quizzes

Today we're excited to announce a new embeddable interactive quiz tool built using Mother Jones' handy quiz tool but adapted specifically for the Largo platform and available now for any WordPress site.

[quiz key="0AvfAWkLLRik_dGtjRVNUamJwbE1wRWxtVVRURG1UU0E" layout="sidebar" answerstyle="alpha" align="alignright" title="Take the Quiz!" description="Think you've got what it takes?" source="Wikipedia" byline="Will Haynes/INN"]

Built on top of Mother Jones’ NewsQuiz.js library, this WordPress plugin allows you to build a quiz in Google Drive and embed it with a shortcode into a WordPress post. This could be used to test readers’ understanding of material, or just to expose them to the questions in an interactive way.

Grading of questions happens inline, at the bottom of the widget. Settings exist to control both the size and flow of the plugin, as documented in the project readme.

Try out the example quiz embedded in this post, or check out how INN member Youth Today is using it to support a piece exploring how the income gap affects scoring on college entrance exams.

To see how to build a quiz of your own using this plugin, how to format your Google spreadsheet, etc. please see Mother Jones’ documentation for the original quiz library.

We’re hoping to build more interactive features for Largo in the future.

So if you have an idea for what we should build next or suggestions for how to improve this tool, let us know in the comments or email us anytime at nerds@inn.org.