Code Revisions

WordPress end-users mainly are interested in doing quick changes to integrate a plugin into their theme (main support question for my featured video plugin) or implement a bug fix they read about in the support forums for a not so well updated plugin. They should not need to know how to use FTP or external editors. Developers won’t, no matter how highly the WordPress integrated code editors are extended, rely on those for their daily development routine. Therefore I do not think it is necessary to blow up the code editor with features like GIT/SVN functionality or other fancy stuff full featured editors ship with. The WordPress editors should be quickly accessible for small changes and act as launch pad for to-be developers.

There are already awesome plugins out there to enhance the functionality of the code editors. Code highlighting, line numbers etc. But something, which is part of WordPress core since version 2.6 (according to wp-includes/revision.php), is not available for the code editors yet. Code revisions would be of high interest when something breaks after editing a file. This is one reason many users do not try editing code directly. When being able to smoothly go back to an older revision this concern would be arbitrary. Post revisions got much attention in the WordPress 3.6 release cycle. I think it is time to bring them to the code editors.

Everything I propose here should be able to start off as a plugin. But I also think my approach to this would smoothly fit into core and would not add much new complexity because I want to stick to already available workflows.

My approach is to stick to the new revision viewer with a custom post type. When a file is modified the first time the plugin will add a new post to the database containing the current (new) state of the file. Furthermore a revision from before the file save is created. WordPress already ships with plenty of functions which should be also usable for a code revision system, as soon as we associate a file with a post in the database. A problem here is to associate a post in the database with a specific file on the server. This requires the creation of a UID from filename + theme/plugin slug + author for connecting posts with their corresponding files.

The new revision viewer uses backbone.js – while I am not native coding backbone I feel comfortable reading it. From what I got until now the new revision viewer code seems very flexible and should be nicely portable to a new code revision page.

A mentor native with the new revision management and backbone would be awesome. Other than that, I do not have any preferences here. I think nacin initially suggested the idea..?

Update: I got accepted to GSoC with this project! Follow the progress on make/core!

Featured Video Plus 1.7: More AJAX
Featured Video Play Icon

Featured Video Plus 1.7: More AJAX

I just released 1.7 of my featured video plugin. This brings two big new features to make the plugin more flexible and cut load times: Instead of replacing featured images with their corresponding featured video directly you can now make them clickable to either open a lightbox (using jQuery DOM Window) or replace and autoplay the image just then. Both of these features rely on AJAX and therefore lower the initial load time of the page. This is especially interesting with blog index pages where plenty of posts + videos need to be loaded.

Also Jinson Abraham just released a beautiful video blogging theme called Garvan which relies on my plugin! Get Featured Video Plus 1.7 now at the WordPress Plugin Repository.

Next releases will focus on enhancing Shortcodes and supporting more video providers. Furthermore I will add a overlay for featured images to indicate that they link to featured videos. If you have any requests leave a note in the comments or in the support forum.

Widget Collections

 
34 Kudos
Don't
move!
This is my main proposal for the Google Summer of Code. Depending on the feedback I would also like and consider working on the Template Versioning project. However I think that this here proposed Widget Collections project is of higher interest for a bigger part of the WordPress community.

I already sent an email to the wp-hackers mailing list, but there were plenty of GSOC requests (I think I was like the 3rd of 15+) and not many got feedback other than that they should attend in a certain IRC meeting. So I thought – because this would have been the next step anyway – I would just write my proposal down in a blog post.

The initial input for the following comes from WordPress Ideas and Jesse Friedman’s blog post about the topic. While the idea will give you an overview of the problem which this project targets to solve, I here will start off describing it shortly.

Problem

With WordPress evolving from a blogging tool to a full featured content management system widgets got more important than ever before. They no longer hold just lists of categories or a blogroll. With 3.5 the blogroll and with it the links even got disabled by default. Widgets now often hold an important part of the website. But still – the widget functionality did not get a rework like other sections of the CMS in the recent releases. When changing themes often the whole widget layout is messed up and needs to be redone. Hopefully the site administrator remembers the widget setup from before to redo it one by one. Managing widgets can be quite a pain when they are a big part of your website.

Concept

This is where Widget Collections shall hook into the process.Widget Collections Mockup Widgets no longer stand on their own, but are part of collections.  Widget Collections do not change anything in the way themes display widgets – they are only displayed as containers around certain widgets in the backend. They are a combination of sidebars and widgets: They hold widgets like sidebars do. Drag and drop widgets into their borders and they will enhance around them. They also can be named for better differentiability. But still – they are them self drag and drop able and snap into sidebars. When assigned to a sidebar Widget Collections do not occupy it for their own – a sidebar can hold multiple Widget Collections and collection-free widgets. For the user this changes nothing at first. He as always assigns widgets to his sidebars. When hovering a sidebar with widgets assigned to a light grey border is shown which suggests the manual creation of a collection. When the theme is changed the contents of a sidebar (if before collection-free) are auto grouped in their own Widget Collection so that the user can quickly reassign them to the new sidebars in their old combinations. Also stackable Widget Collections (e.g. 2 layers: One widget collection holds multiple small ones) might be worth considering. 

Implementation

As discussed on the wp-hackers mailing list not many GSOC projects make their way into core. For a fully accessible enhancement of widgets.php through widget collections this would need core changes I guess. But the part which will be used by most users (JS/jQuery based) is also possible to implement using a plugin. The plugin would basically dequeue wp-admin/js/widget.js (handle: ‚admin-widgets‘) and enqueue a version of it which includes the new functionality. The second layer would be to represent the current state if the collections in WordPress options. So widgets.php won’t be edited and load all widgets as normal. When finished loading the Widgets Collections JavaScript would come in wrap the widgets in their corresponding groups etc.

There would be two different layers of collections. The first one is visible to the user and was before created by the user or by a recent theme change. The second is invisible to the user and just remembers which widgets are assigned to which sidebar. Further the plugin keeps track of which theme is active at the moment. On every load of widgets.php the plugin checks whether the theme has changed. When this is the case the invisible collections are upgraded to visible ones and named after the sidebar they were assigned to before.

Due to not being able to replace widgets.php from an plugin this implementation won’t be usable without javascript enabled. This then would need core changes I also would be keen to work on if requested.

Extension

A further extension would be visibility options for assigned widgets. This would have a similar use case to the inactive widgets area but won’t require widgets to be removed from their collections and sidebars. This could be nicely implemented using a small eye icon next to the widget title and expand arrow as seen in Adobe Photoshop for layer visibility: photoshop-visibility-eye.

Another possible addition which would come in handy in combination with widget collections would be a supercharged text widget. The text widgets hold all kind of content today, so it would be a nice move to make them full featured. I do not think this would make it’s way into core. It would need plenty of testing because of all the different use cases of the current text widget in order to replace it. So I would again propose this as a plugin or to directly ship with Widget Collections. My idea for this one would be for the supercharged text widgets to rely on a custom post type, but not the full post.php editor. A small button in the textarea would bring up a thickbox powered editor with basic tinyMCE, media and revision capabilities.

I hereby hope to get some feedback, especially from potential mentors. I did not contribute to core yet so I can not name anybody I would like to work with particularly. It would be good to have a mentor who took part in the creation of the Widgets API – especially if this project might be interesting for core integration. Elsewise this project will require much jQuery coding – so someone with experience there would be awesome! I guess my three plugins in the WordPress.org Repository are the best reference for this proposal.

Custom Shortlink Structure

Another WordPress plugin of mine just got approved by the WordPress.org team. Custom Shortlink Structure enables you to specify your own style for your WordPress blog’s shortlinks. By default these shorlinks look like http://yrnxt.com/?p=153, for this blog I now changed them to http://yrnxt.com/~153. This might be a small change, but then, for some the small things might matter at last.

When the plugin is activated you get some additions to your permalinks settings screen with new radios for defining the shortlink structure:

Custom Shortlink Structure Settings

The second category, old but still active shortlink structures, is only displayed when you changed the shortlink structure a second time. Through not disabling old rewrite rules directly the plugin ensures that no hyperlinks to your site break. If you still want to kill those rules: Uncheck them. Go get the plugin at the WordPress plugin repository or at GitHub.

Featured Video Plus 1.6
Featured Video Play Icon

Featured Video Plus 1.6

Today I release Version 1.6 of the Featured Video Plus plugin. While this update does not bring any major new features, it fixes quite some annoying glitches which makes it bigger than just a quick bugfix release as 1.5.1.

On the settings page there is one addition each to the YouTube and local video player options: enablejsapi (which on the backend also adds an playerapiid when enabled) and use featured image as video thumbnail. For developers there is now also an unique id for the YouTube Player iframe (fvpid + {$post_id}). Also you can now retrieve the url for the video using get_the_post_video_url and filter the get_the_post_video output using get_the_post_video_filter. Furthermore I resolved some glitches reported in the support forums, thanks!

It is now also possible to embed YouTube videos which might be blocked in your webserver’s country. I am looking at you, Gema. While the featured video input field will have a red background (which signals that it could not access the API for the specified video), the video will still be embeded – only without some meta informations and no pulled video thumbnail.

WordPress: Kudos

 
603 Kudos
Don't
move!

This new WordPress Plugin, Kudos, brings a new unobtrusive alternative to Facebook’s like button to your WordPress blog. Kudos, as seen on the svbtle.com blogging network, are an unobtrusive and playful way for your readers to show their appreciation. To give kudos for a post the visitor simply hovers the Kudo-Button: A small animation starts for as long as the visitor does leave his cursor on the Kudo. When the animation is finished and the Kudo-Button is filled the count goes up by one. By clicking the then filled button the visitor can take his Kudo off the post again.

You can see the plugin in action on the top left of this post. Dustin Curtis, creator of svbtle.com and inventor of Kudos, describes Kudos like this:

Each post has one unusual feedback mechanism which has no external repercussions: Kudos

– source: dcurt.is

Beside the default automatic insert into your posts you can make use of the PHP-Functions and shortcode to display the Kudos more individually. Take a look into the description on the plugin repository for more information.

This plugin makes use of Masukomi’s Kudos implementationIf you like Kudos and the overall look of Svbtle take a look at wp-svbtle. This plugin is also hosted on github.

Future updates are planned to bring more customizability: Different speeds and images, more positions in your blog etc.