WordPress Simple Gist embed

Simple Gist Embed

Yesterday was a WordPress holiday in Israel, We had WordCamp in Jerusalem. Someone (Sorry I'm very bad with names) approached me and asked me about syntax highlighting in posts, then he came up with the Idea of using external sites like pastebin or gist which let you embed syntax highlighted snippets and said that using it is a time save for so many reasons except he hates going back and forth from his WordPress admin to Github just to create a Gist and then back to paste the embed code, and another issue he pointed out is that each embedded Gist would be called every page load by JavaScript and that's a BIG NO NO in terms of page speed.
So being the nice guy that I am i decided to take a crack at this and this is what i came up with Simple Gist Embed
  

Screenshots:

Custom TinyMCE button TinyMCE popup
WordPress Gist creation panel Simple Gist Embed in action

  

What does it do?

This Plugin allows to embed GitHub Gist to your posts/pages/custom using a simple shortcode and even simpler using a built-in Tinymce button. I know there are other plugins which do that already but this plugin also lets you create a GitHub Gist From within your WordPress admin. Other then the option to create Gists from your admin this plugin is faster then the others because of it's built-in caching of Gists to the database.

  

How does it work?

This plugin works with the Github Gist API V3 using the WordPress HTTP API to create and get Gists, and once you got a Gist embedded in your post it is stored as post meta so next time that post is called the Gist will be pulled strait from the database instead of calling the Gist embed JavaScript.
  

Features:

  • Updated to the latest GitHub API V3
  • Create Gists from your WordPress Admin panel
  • Internal cache built-in
  • Built in Tinymce (editor) button.
  • Works with all posts types (post,page,custom).
  • Can be used as a Template Tag

  

Download:

Download the latest Version from WordPress.org

Simple Installation steps:

  1. Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation.
  2. Then activate the Plugin from Plugins page.
  3. Done!

  

Usage:

Shortcode -
Simply create or edit post/page and click the newly added TinyMCE button (the one with the GitHub cat icon) and the rest is simple.
or watch this video:

this is it for now, enjoy and any feedback is welcome, also make sure to submit bug if you find any.
  

Change Log:

  • 1.0
    • Initial release

Ohad Raz

WordPress Consultant, a WordPress Developer and a WordPress Freelancer With over 10 years experience in architecting web sites and applications. WordPress Development moderator and somethimes Plugin Developer.