I’ve had a stab at a WordPress plugin for embedding Wikimedia URLs: https://github.com/samwilson/embed-wikimedia
It’s of course just a draft and proof-of-concept and beta and rough at the moment. It only supports Wikipedia and Wikimedia Commons; I’m going to add Wikidata next, I think, and then Wikisource (although that will mostly be a reformatted version of the Wikidata one, because all relevant metadata about Wikisource items is in Wikidata).
I have no idea if it’s very useful. I mainly want it for Commons photos, and Wikisource books.
Embed Piwigo now has a home on WordPress.org, and I’ve announced it on the Piwigo forum. And you’ll notice it’s got a new name! It seems that WordPress plugins aren’t allowed to begin with a trademark, so
piwigo-embeds was pooh-poohed and
embed-piwigo suggested instead.
Now I want to make sure the caching is okay, and figure out what the captions should contain. There might be other problems too.
I finally closed my Dreamhost account yesterday, after nearly 11 years of hosting my websites, email accounts & lists, Jabber, and code repos with them. Over the last couple of years I’ve been migrating things to other providers: the web stuff to Digital Ocean, email to Fastmail, and a few bits and pieces to Google and Github. It’s a nice feeling to shed this old account! And a bit sad.
I now have just three main computers in my life: my phone, laptop, and VPS.
It’s not because Dreamhost is bad that I’m leaving, not at all: it’s just about simplifying things, gaining control, and feeling confident enough to manage a Linux server on my own. If I wanted a shared hosting account, I’d still use them, and I dare say I’ll carry on recommending them to anyone looking for a place to host their own WordPress, MediaWiki, or Piwigo etc.
I get the impression that self-hosting isn’t as popular as it once was, and that people prefer to hand their data off to firms who will dictate structure and offer reliability and ease. I think that’s partly because of the network effect of it being somtimes better to use the same service as everyone else, and partly because self-hosted software isn’t as easy to use as it should be. The former is hard to fix (see Mastadon etc), but the latter is about building quality software that’s easy to install and maintain. That’s something I want to help with.
Here’s my first draft at making Piwigo sites embeddable in WordPress: github.com/samwilson/piwigo-embeds
‘Embed’ here is what WordPress calls the ability to add a URL of a site on its own line in a post or page, and for a nice rendering of the site at that URL to be provided automatically. It works with core WordPress with sites like Youtube and Flickr, and somewhat for random other sites if they provide the right metadata. Piwigo does not yet provide particularly rich metadata (there are some ideas to do so, though), but anyway it’s nicer to be able to do something more complicated that uses the Piwigo API.
As a first hack at this, my plugin just shows the medium-sized image, with title below and description as the tooltip, and the image linked to the page on the Piwigo site. I plan on introducing caching, and perhaps some nicer display (dates, comment count, etc.). Ideas welcome!
Piwigo has a duplicates-search feature, which allows you to search for duplicate photos by original filename, MD5 checksum, creation date & time, and/or image width & height. It’s slightly annoying though, because although it presents you with the duplicates, it doesn’t sort them so that potential duplicates are displayed next to each other. I’ve attempted to fix this.
Most of the work has finished: people are using the specifications in production and the rate of errata has slowed to a crawl. XQuery, XSLT and EXI ended this year. But just because the specification work is ending doesn’t mean XML is ending! It means XML is at a stage where the technology is mature and widely deployed. People aren’t reporting many new problems because the problems have already been worked out.
—The World Wide Success That Is XML, on the W3C Blog.
There’s a delight in writing documentation, in putting the words down that you wish you could read when first starting to use a project. At that point nothing doesn’t make sense, and everything is going to proceed according to the clear picture you have. Things later change, but when done well I think the earlier documentation serves to get you back on track, and makes later maintenance so much better.
I fixed a bug in Tabulate last night, and released version 2.10.3. I’ve rather been neglecting this project for a while, so it’s been nice to come back to it. There are a few things that I might try to get done on it in the next few days or weeks (starting with more documentation).
The bug was to do with the change in WordPress’ default database character set and how that affected the reports ‘title’ column. Previously, a key length on this column of 200 was okay as it was under MySQL’s maximum of 767 (i.e. 767 bytes / 3 bytes for utf8 = max. 255 characters), but now the default is utf8mb4 each character can use up to 4 bytes instead of 3, and so the length must be reduced to 191 (i.e. 767 bytes / 4 bytes for utf8mb4 = max. 191 characters). WordPress core only does this for sites running on MySQL 5.5 and above, but it seemed easier just to reduce the key length for all Tabulate installations; it doesn’t seem likely to be an annoyance to anyone.
More PHP date weirdness, this time in the Cargo extension for MediaWiki:
+ // 'o' is better than 'Y' because it does not add leading
+ // zeroes to years with fewer than four digits.
+ // For some reason, though, this fails for some years -
+ // returning one year lower than it's supposed to - unless you
+ // add the equivalent of 3 days or more to the number of
+ // seconds. Is that a leap day thing? Weird PHP bug? Who knows.
+ // Anyway, it's easy to get around.
+ $yearString = date( 'o', $seconds + 300000 );
For my own future reference, resizing a Digital Ocean storage volume is (as described in the docs) quite easy:
- Resize the volume in the the DO control panel.
$ sudo resize2fs /dev/disk/by-id/scsi-0DO_Volume_volume-xxxn-nn
(I recommend Digital Ocean for anyone needing a VPS. I’ve been using them for a few years and have found it all quite brilliant.)