Category Archives: Internet

All blogposts on blog.futtta.be about Internet (browsers, web development and mobile web).

WP YouTube Lyte and YouTube API v2 end of life

The YouTube API v2 is now officially to be shut down soon after April 20th. That’s bad news for WP YouTube Lyte, which uses this version of the API to perform unauthenticated read-only requests to fetch a.o. video title and thumbnail information (example here). The v3 API is supposed to simpler yet more powerful and migrating should not be a big problem, except for that little detail that v3 doesn’t allow unauthenticated requests at all. So I’ll need to add authentication (via an API key) to the mix, leaving me with the dilemma of having to choose between these approaches, none of which I really like:

  1. Tell WP YouTube Lyte users to get their own API key and have them enter it in the plugin’s settings-page. Risk: upsetting users who all of a sudden have to get an API key (“huh, what key?”)
  2. Get an API key myself and hardcode that in WP YouTube Lyte. Risk: abuse of that key (and neither a server key nor a browser key is applicable really), reaching limits, being denied access.
  3. Create and operate a proxy application that sits between the v3 API and each and every WP YouTube Lyte instance, taking care of authentication with an API key. Risk: having to write & install that proxy application, making sure it is available 24/7 (it’s a single point of failure) + obviously the same abuse-risk as in (2).

No, I’m definitively not happy … :-(

Fixing Firefox’ LessChromeHD to reclaim lost screen real estate

I had been happily auto-hiding the Firefox navigation bar on my small-screen netbook for a couple of years already, until that add-on (LessChromeHD from the Prospector series) stopped working after having upgraded to Firefox 35. So I started Firefox from the command-line and spotted this error:

addons.xpi WARN Error loading bootstrap.js for lessChrome.HD@prospector.labs.mozilla: TypeError: redeclaration of variable event (resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/frank/.mozilla/firefox/jy6bws91.default/extensions/lessChrome.HD@prospector.labs.mozilla.xpi!/bootstrap.js:226:8)

A quick look at the source code confirmed “event” was declared twice, once on line 210 and a second time on line 226. The fix, obviously, is simple; on lines 226-228 replace all references to “event” with e.g. “shownEvent”;

let shownEvent = document.createEvent("Event");
shownEvent.initEvent("LessChromeShown", true, false);
trigger.dispatchEvent(shownEvent);

You can do this yourself by unzipping “lessChrome.HD@prospector.labs.mozilla.xpi” in your extenstions-folder, editing boostrap.js and updating the xpi. Or you could wait for the Mozillians to update LessChromeHD.

Uw eigen mobielere deredactie in 5 stappen

openshift configureer uw redactieuwredacie op openshift uwredactie op openshiftOok al kunt ge mijn alternatieve mobiele redactie hier bekijken, dan zout ge toch, om redenen die geheel de uwe zijn, misschien liever uw hoogst persoonlijke redactie hebben?

Wel, dat kan in 5 eenvoudige stappen dankzij Openshift, het freemium PAAS platform van Red Hat en dat gaat ongeveer zo:

  1. Maak een gratis account aan bij Openshift
  2. Klik op “Create your first application now
  3. Vul PHP in in het zoekvenster en selecteer de PHP 5.4 cartridge
  4. Vul een naam in voor de public URL, copy/paste https://github.com/futtta/redactie in het source code veld en klik op “Create application
  5. Even geduld terwijl uw eigenste redactie wordt aangemaakt. In het laatste scherm kunt ge eventueel git access configureren (“Will you be changing the code of this application?”) of direct op “Visit app in the browser” (in mijn geval naar http://mijnredactie-futtta.rhcloud.com/) klikken.

Spreading the news, tiens!

Bye 2014, it was nice knowing ya!

this used to be an animated gif, click to see itWith 2014 finally behind us, we can start dwelling on that past as of yesterday. These are some of my 2014 facts & figures:

About my blog:

My WordPress plugins:

  • Autoptimize
    • 2 major and 7 minor releases
    • 141324 downloads, bringing the total to 241650
    • answered lots of questions and feedback on the support-forum, allowing me to improve both the code and the FAQ.
    • 2015 will bring Autoptimize 2.0 (fixing the occasional WSOD & the cache-size problem) and Autoptimize Power-Ups (extensions for professional & power-users)
  • WP YouTube Lyte:
    • 2 major and 2 minor releases
    • 36507 downloads, now totalling 210285
    • 2015 will see continued improvements and WP YouTube Lyte Power-Ups (you guessed it, extensions for professional & power-users)
  • WP DoNotTrack:
    • 2 minor releases
    • 4312 downloads, now 12009 total
    • 2015 really should see a 1.0 release, which will finally include CSP-enforced protection.

Bye 2014, it was nice knowing ya, but I’m off enjoying 2015 now!

Autoptimize minor update and beyond

I just released an update to Autoptimize, bumping the version to 1.9.2. Main new features;

  • New: support for alternative cache-directory and file-prefix as requested by a.o. Jassi Bacha, Cluster666 and Baris Unver.
  • Improvement: hard-exclude all linked-data json objects (script type=application/ld+json)
  • Improvement: several filters added to the API, e.g. to alter optimized HTML, CSS or JS
  • Some bugfixes
  • Swedish translations updated & Ukrainian added, courtesy of Zanatoly of SebWeo.com

I’m already thinking about version 2.0 (which should fix the 2 big issues some people face; exploding cache size due to page-specific inline code & the rare but nasty white screen of death due to CSS minification issues) and about some powerful new features that could extend Autoptimize for professionals and power-users in need of something more. 2015 is going to be great, hope you guys & girls will be part of that!

Anyway, enjoy the end-of-year festivities and above all, have fun & share some of the happiness!

 

WP YouTube Lyte now parses normal YouTube links as well

I was just being a jealous guy, seeing how normal YouTube embeds (oEmbeds) got previewed nicely in WordPress 4.0 TinyMCE editor. This had been on my wishlist for a long time already and I looked into enabling that for httpv-links and lyte-shortcodes as well, but that turned out not to be that simple.

So I took the alternative approach, enabling WP YouTube Lyte to act on normal YouTube-links (a much requested feature anyhow) and thereby piggy-backing on the TinyMCE-improvement in 4.0. So there you have it; lyte video’s can be inserted using normal YouTube links and that will result in a (non-lyte) preview of the video in the visual editor content box.

1.5 as a number of other improvements and bugfixes, but you can read all about those in the changelog.

Have fun with this small Rick James like party-track to celebrate 1.5.0 (and my birthday, while we’re at it);

Mark Ronson – Uptown Funk ft. Bruno Mars

Watch this video on YouTube or on Easy Youtube.

Verder sleutelen aan mijn m.deredactie.be-alternatief

futtta-redactie-tabs-compressorDat ze daar aan de Reyerslaan niet stilzitten; http://m.deredactie.be/ is nu ook bruikbaar op een JavaScript-loze browser! Dat klinkt misschien onbelangrijk, maar zo een basis-versie die werkt, ongeacht de browser, is een grote stap in wat ik de juiste richting acht. Spijtig genoeg blijft de site voor de rest onder Google’s verwachtingen en de laadtijd en total download size blijven een mobiele site onwaardig. Daar ten gronde iets aan veranderen binnen het kader van de gekozen architectuur (MVC in de browser) zal niet eenvoudig zijn.

Daarom ben ik dus ook niet blijven stilzitten en sleutelde ik verder aan mijn alternatief voor m.deredactie.be. Video werkt nog steeds niet (misschien moet ik eens kijken of ik iets kan doen met de JS-file van de VRT), maar onder andere deze verbeteringen zijn er wel bij:

  • Op de homepage hebben “hoofdpunten”en “laatste nieuws” nu elk een eigen tab (ik ben zelf niet overtuigd van de kleurenkeuze, maar soit).
  • Op de detail-pagina’s kun je artikels delen op sociale media (met lyteshare.js)
  • De html is opgekuist en valideert nu bijna op de W3 validator (bijna maar nog niet helemaal; de imgsrc attributen op placeholder-divs voor image lazyloading mogen niet).

Daarnaast zitten er nog een handvol bugfixes en andere kleine wijzigingen in, cfr de  “done” lijst op Trello. Pagespeed Insights score en webpagetest.org testresultaten zijn nog steeds “up to snuff”. De geüpdate code staat op GitHub en het resultaat (als je het projectje niet zelf wilt/ durft/ kunt installeren) zie je op http://futtta.be/redactie/.