Widgets and little add ons are great for your web site. But know that when they depend on connecting to an outside server, and no one answers… well your site might be toast.

Being an organization that sets up online events for people around the world, for Virtually Connecting, a key aid is setting up things so people in one part of the world know what time a session is when it takes place on the other side.

Ever since I was planning things for NMC I relied totally on the Timeanddate.com Time Announcer to create a link for event pages and messaging for “check for local time”. Try it!

The big event is happening at 1:00pm here (check for your local time)

But it does send visitor away, and we switched maybe a year or two to the widgets from World Time Buddy, which provide all the info in the page (and look nice. Like this:

Time converter at worldtimebuddy.com

That’s nice, eh?

Ah, but an issue cropped up for the Virtually Connecting site… it’s WordPress multisite, and because the widget code has javascript in it, for non-administrative users (we have many authors who create event posts), it gets stripped out when saved.

So I dug unto the code hole a bit and came up with a shortcode for displaying the widget. It was still a bit geeky to use so I came up with a tool that adds a button to the WordPress editor. It pops a window where authors paste in the embed code, the tool parses it, and generates the expected shortcode in the post.

It works really well, in the editor it looks something like

[timebuddy params="h=2163355&md=9/15/2020&mt=13.00&ml=1.00&sts=0&sln=0&wt=ew-ltc"]

(Yikes, I thought I had uploaded it as a plugin to GitHub but could not find it there… now it is, see Timebuddy Buddy).

We’ve been going fine with that for a while… then 2 days ago in Slack, someone noticed that the World Time Buddy site was down. For like 20 hours. For all our pages with code making requests to https://www.worldtimebuddy.com/event_widget.js they just broke at that point.

Things were toasted. Their twitter account had no updates since 2016. Their Facebook one was empty. People in Slack are asking what we should do. Find another widget? But woah, 20 hours is not good, but most likely it will come back on.

Let’s put the webz to work. Company info in Crunchbase says they have $10million in revenue and are based in the San Francisco bay area. Found a contact email but if their web site is down, likely to is email. Looking at site in the Wayback machine we can see that the company name is “Helloka LLC “. Some searching that gets to a founder’s profile in LinkedIn. is Slava Romanovsky found in LinkedIn https://www.linkedin.com/in/slava-romanovsky-7381055/ A message there was sent (not answered).

But I had an idea. Because all of our uses of the script that was not working were being generated via a plugin, all I needed to do was to comment out the usual code, and just have the plugin put out a brief “widget not working” message. This means the web pages would load normally.

I thought I had a copy of the message, but it got lost in the wash. Not important.

By this morning we saw the World Time Buddy site was back, so it just meant reverting the plugin, and all is kosher.

It was almost a happy accident that the end around I created to make authoring of the widgets easier provided a way to put a detour around a broken web site. That’s a big problem looming if you have web pages relying on various external scripts. I remember it back to the Feed2JS service which suffered the same issue (but is still running now at almost 15 years old). I coded some kind of JavaScript timeout event into the Flickr CC Attribution Helper that at least warns the user if the flickr API does not respond in a certain amount of time.

But it is a thing to consider building in to sites/tools if you can- what happens if any external library, code, service poops out on you? I am sometimes leery in WordPress of having depends on shortcodes, but in this case, it made dealing with the issue easier. I might think about that in the future if developing something that depends on a third party script/service.

The web can be so fragile and marvelous at once.

Featured Image:

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Leave a Reply

Your email address will not be published. Required fields are marked *