Archive for the ‘plugin’ tag
WP YouTube Lyte; support for playlists (almost) included
Work on the next version of WP YouTube Lyte is almost finished. The main new features you can expect in version 0.8.0 are:
- support for playlists
- support for HD video (if size of the embedded player is big enough)
- updated UI elements & player sizes to match new, dark YouTube player style
- removed support for legacy YouTube embed code
Embedding a playlist will be as simple as adding
httpv://www.youtube.com/playlist?list=<playlist_id>.
The result will look like this documentary about Arcade Fire (4 video’s in one playlist):
Now off to testing this blogpost with an embedded playlist in all browsers I can get my hands on. Your feedback (off course) is always welcome as well! If all goes as planned I’ll push 0.8.0 to the wordpress svn later this week.
WP YouTu.be Lyte: a minor release & some meandering thoughts
Yesterday I pushed WP YouTube Lyte 0.7.3 out the gates. The main trigger for that new release was a bug report about the plugin not behaving as expected when using the youtu.be-links that you get when clicking the “share”-button on YouTube. Being from that TLD mysself I could not but fix this; the new version recognizes and parses both httpv://youtube.com/watch?v=videoid and httpv://youtu.be/videoid links in posts, pages and widgets. Other features: Slovenian translation (thanks Mitja Mihelič @arnes.si) and a small change to the donottrack-inclusion to make it work over https (hat tip; Chris @ campino2k.de).
Speaking of donottrack: I’ve finally started rewriting that privacy-enhancing plugin. It might … No, it WILL take some time, but expect a whitelist-based approach where you’ll be able to get a report of all inclusions of external content (images, css, javascript, …) in your site and where you can just tick a checkbox per domain you want to allow. All other current and future domains that rogue plugins try to smuggle in after you configured, will be stopped. Next to document.write’s I hope to be able to catch innerHTML and DOM methods like insertBefore and appendChild. If you’re a javascript DOM magician, I could sure use your help on those!
Not sure where I’ll be going with WP YouTube Lyte, it feels pretty complete to me. Stuff that might be added at a later stage;
- update of the player GUI to match the style of the new darker YouTube embeds
- support for the embedded YouTube playlists player
- catching the end of video playing and killing it (well, removing it from the DOM, gently yet firmly)
- adding translations (you’re welcome to participate, if you’re not familiar with GetText I can put all strings up in a Google spreadsheet)
Do comment below or contact me if you have other feature requests though! And thanks for all the downloads (36.000 and counting)!!
And as is traditional of WP YouTube Lyte announcements, here’s a small video to celebrate the new release; Intergalactic Lovers, a Belgian band, playing “Delay” live.
Coding for the New Year
Just a quickie before diving into 2011;
- I’m having great fun with jQuery and a templating plugin called jQote2. Not getting into specifics or examples yet, but if you’re into jQuery jQote2 is well worth checking out!
- I’ve created a small plugin, DoNotTrack, to stop the Quantcast tracking that e.g. the WordPress.com Stats plugin introduces. You can download it here to give it a try. If time & my brain permit, this plugin could become a general solution to stop any unwanted tracking by other plugins on your blog.
- There’s a new version of WP YouTube Lyte with some small fixes & tested on WordPress 3.1 RC. We’re rapidly approaching 10.000 downloads, a great way to start a new year!
And this is how I feel about 2011:
Have a great New Year!
The state of WP YouTube Lyte (now with fresh Pomplamoose)
Although it has been a few months since I last wrote about my baby WordPress plugin, time did not stand still between version 0.3.0 and 0.5.2; the player size can now be changed in the options-screen, I’ve replaced my newTube html5-hack with Google’s official (yet experimental) new html5-compatible embed code and I started migrating the CSS from the mess that had become the JavaScript-file. And I almost forgot what may be the most important change; I started searching for blogs that use WP-YouTube-Lyte to see how it behaves in the wild. Some of the bugs I discovered that way;
- WordPress has a lousy “the_excerpt”-function which removes script-tags but not the script itself, which caused my JavaScript to be displayed as normal text in excerpts (typically in category-pages). Fixed with some unpleasant CDATA-tinkering.
- Some blogs allow crawlers to see the contents of a directory if no index.* is in place, so e.g. options.php gets indexed with an ugly (but logical) error-message. Fixed with an index.html.
- There’s a lot of themes and some of those have CSS that impacts the way WP YouTube Lyte is displayed. Most issues should be fixed by better CSS for my plugin, but do let me know if you encounter more weird display-problems (especially the controls that are incorrectly positioned).
But with all those changes you might start to wonder if WP-YouTube-Lyte still reduces download size & rendering time substantially, no? So I ran a couple of new tests for this page on my blog (it has 3 embedded YouTube’s) on webpagetest.org (settings: 5 runs on IE7 via Amsterdam, excluding requests to stats.wordpress.com). The difference is … well, judge for yourself (or see below the tables for the summary)
With normal Flash-based embeds (full results here):
| Document Complete | Fully Loaded | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Load Time | First Byte | Start Render | Time | Requests | Bytes In | Time | Requests | Bytes In | |
| First View | 1.850s | 0.634s | 1.330s | 1.850s | 15 | 343 KB | 5.350s | 22 | 524 KB |
| Repeat View | 1.142s | 0.346s | 0.497s | 1.142s | 5 | 17 KB | 2.455s | 5 | 17 KB |
And with WP YouTube Lyte (full results here):
| Document Complete | Fully Loaded | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Load Time | First Byte | Start Render | Time | Requests | Bytes In | Time | Requests | Bytes In | |
| First View | 1.201s | 0.355s | 0.974s | 1.201s | 10 | 55 KB | 2.065s | 20 | 103 KB |
| Repeat View | 0.605s | 0.352s | 0.473s | 0.605s | 2 | 12 KB | 1.447s | 5 | 14 KB |
Did you see that? Less requests, less data and faster rendering for first and repeat views. Hurray for WP-YouTube-Lyte! But enough with that ego-tripping already, I’ve got an Opera-bug to look into! Or wait, I’ll watch this great new Pomplamoose+Ben Folds+Nick Hornby videosong first:
Protecting wp-contact-form from spam
Ever since I installed WordPress on my (virtual) server, I’ve been using the WP Contact Form plugin to provide me with simple contact form. The plugin isn’t exactly under active development (Last Updated: 2009-8-28), but it got the job done and I was quite happy with it. Until spammers found the page and started abusing it, that is. There’s a bunch of other Contactform-plugins in the wordpress.org plugins repository, but most of them were either too feature-packed or development for them seemed to have stopped.
I considered adding ReCaptcha at first, but why would I want to put my visitors through such an ordeal; the captcha’s seem to have gotten very difficult to decipher. Next possibility; implement Akismet (Mollom would have been a great choice as well)? There’s a great Akismet PHP5-class, you just provide your API-key and off you go. But it seemed kind of inefficient to have to do all that with the official Akismet-plugin already in place?
But wait a minute, why not just piggyback on the Akismet-plugin, as the Clean-contact plugin and wp-contactform-akismet did? Keep it simple stupid and so I just copy/pasted the clean_contact_akismet-function from Clean Contact’s code into my wp-content/plugins/wp-contact-form/wp-contactform.php and on line 142 I changed:
mail($recipient, $subject, $fullmsg, $headers); $results = '<div style="font-weight: bold;">' . $success_msg . '</div>'; echo $results;
into:
$akismet=clean_contact_akismet($msg,$subject,$email,$name);
if (!$akismet) {
mail($recipient, $subject, $fullmsg, $headers);
$results = $success_msg;
} else {
$results = 'If it looks like spam and smells like spam, it must be spam. Leave (or rephrase)!';
}
echo '<div style="font-weight: bold;">'.$results.'</div>';
That was all it took to add Akismet spam-filtering to that KISS-y wp-contact-form plugin. I wonder why this isn’t in the plugin already?
Lovin’ the WordPress plugin ecosystem
I’m a sucker for simple things and in my book, WordPress (the open source software) is a great example of a simple yet powerful solution for publishing on the web. The last few days I experienced their plugin-ecosystem to be just as simple and powerful.
If you have a plugin to share and you:
- register on wordpress.org
- fill out a form to submit your plugin for inclusion in their repository
- after confirmation upload your code (together with a structured readme-file) via svn
Then boom, automatically;
- plugin pages (for description, installation, faq, changelog, …) are created and populated with information from the readme and base php-file
- a zip-file is created containing your stable version
- your plugin is listed on the “new plugins” page
Before you know it, you’ve got a bunch of real users (wp-youtube-lyte was downloaded 128 times in 2 days) who can rate your plugin and provide you with feedback. And every time you upload a new stable version via svn, a new zip-file is created and your users will get a notification in their wp-admin pages, allowing them to upgrade by simply clicking that upgrade link. Don’t you love it when a plan comes together?
But enough raving already, got to go create that admin-page for my plugin now, as requested by a user. I’m a sucker for real users!
Lite YouTube Embeds in WordPress
This 3rd episode in the “High performance YouTube embeds” series brings you yet another way to use LYTE instead of normal YouTube embeds: wp-youtube-lyte. This WordPress-plugin will automatically replace YouTube-links that start with “httpv://” with Lite YouTube Embeds, thereby significantly reducing download size & rendering time.
wp-youtube-lyte plays nice with the great “Smart Youtube” plugin, in which case it will take care of the default embeds (httpv), while Smart Youtube will parse the other types (httpvh, httpvhd, httpvp, …).
You can download the plugin from http://futtta.be/lyte/wp-youtube-lyte.zip.
A quick demo maybe, to finish things off? Owen Pallett performing “Lewis takes action” live in the KCRW studios:


