YOURLS 1.9 “Nergal” released

Hello everyone, I’m very excited to announce the release of YOURLS 1.9 \o/

Hail Adam « Nergal » Darski \m/

In our tradition to name a new release after a metal vocalist, I’m dedicating 1.9 to Nergal, front man of Polish heavyweight extreme band Behemoth. Known for his magnetic charisma, insane energy and being a cancer survivor, Nergal also supports several worthy projects fighting censorship and promoting freedom of thought. I completely worship the man and suggest you relax to the sound of one of their sweetest delicacies :-)

Behemoth’s Nergal – photo by Per Ole Hagen

YOURLS 1.9 : why so excited ?

A lot of work went into that release and it’s more than just yet-another-release. On the YOURLS core front, we have improved and fixed and worked on several things, such as :

  • A true foolproof plugin sandbox : if a plugin you activate is PHP garbage with broken code, it won’t break your whole install. Peace of mind! Also, there is now a proper (optional) uninstall procedure for plugins, see for instance the official sample plugin. We have other exciting news about plugins, more on this later.
Broken plugin != broken YOURLS
  • Improved security (mostly to prevent people from hacking themselves in creative ways, not gonna lie)
  • Less annoying bugs, such as : there were sometimes irritating notices or unresponsive interface in particular cases when shortening or editing a URL ; we now deal a lot better with concurrency requests when mass shortening URLs.
  • Hardened test cases for better continuous integration, and implement smarter workflows in the repository.
    For instance, the GeoIP database is now regularly and automatically updated in Github. While that doesn’t change much for users between releases, this really makes our maintainer life easier.
    (On this topic and for you users, I recently made a GeoIP Update plugin, to easily update your GeoIP database if there has been no new YOURLS release in a while)

Note that YOURLS now requires PHP 7.4 as a minimum, and is of course fully tested for PHP 8.0 and 8.1.

Those interested will find more boring details in the CHANGELOG as usual.

I mentioned earlier “on the YOURLS core front” : what else would there be on other fronts?

Sweet documentation now on docs.yourls.org

The whole YOURLS documentation now lives at docs.yourls.org and boy this is neat. Powered by modern and lightning fast Vuepress, this documentation has two nice benefits for users:

  • it’s fully and efficiently searchable : the search box on the top right provides real time and accurate results about whatever you may be looking for:
  • It’s now easier than ever to propose enhancement for the documentation. Notice a typo? Want to suggest a better rewording, or even cover a whole new important topic we’ve overlooked? Simply click on “Edit this page” and file a regular pull request on YOURLS/docs.

Plugin test suite !

This one is for plugin authors : we have released a convenient Test Suite tool for plugins, to make it easier to write and run unit tests for your plugins in a real YOURLS environment.

This is truly a new dawn for YOURLS plugin coders. The typical YOURLS plugin is a simple file with a couple filters and actions performing a simple task, and it’s tempting to just forget about it. The Test suite for plugins makes it easier to write tests, forget about your plugin AND be noticed if, for instance, a future YOURLS release breaks something !

Plugin authors : go ahead, play with the test suite, write some tests and earn the “test icon” 🧪 in the Awesome YOURLS list ! Feel free to ping Ozh if you need some guidance to get started.

Wrapping it up

YOURLS 1.9 is out, right in time to celebrate our 8000th star on Github.

Over the years YOURLS has been consistently in the Top 100 PHP projects on Github and we are really humbled and honoured. From the bottom of our hearts, we’re sending a warm thank you to every people using YOURLS in small personal projects or large corporate environment, to people writing plugins and providing materials that make a vivid ecosystem, to people financially supporting the project, and to everyone telling the world about it !

Now it’s time to do your part !

  • Update YOURLS ! As usual, this would make a nice occasion for a little backup ;)
  • Tweet about this release, make friends know about it and entice them to update
  • Star us on Github if you haven’t already ;-)
  • Plugin author ? Write some tests !
  • Translation maintainer ? Update your translation !

Peace on you !

Short URL to this post: http://yourls.org/fd

YOURLS goodies: forums, nightly builds and hook list.

There are a few things I’ve discreetly mentioned over the past weeks, either on Twitter (follow me!) or through the project wiki pages, that are well worth an official blog post: forums, nightly builds and hook list.

1. Forums!

Some time ago, I’ve setup a few YOURLS forums. There are currently 3 forums:

  1. General discussion: show off your cool public interface or personalized YOURLS index page with stats and stuff, discuss anything, bounce ideas.
  2. Plugins: anything related to plugins. Introduce yours and ask for feedback, suggest plugin ideas.
  3. Help Wanted!: if you have a problem and need someone to lend a hand, try here. The project issue tracker is not suitable for personal support requests (its goals are to report defects or suggest feature requests, not troubleshoot your own unique personal .htaccess issue), but this forum is. Maybe some freelancers will even get a couple paid gigs here too?

If these forums do meet a need and become active, I may ask a few volunteers to help moderate it in the future.

2. Nightly builds!

There are now YOURLS nightly builds generated, well, every night. This is aimed at users who want to update their install (either to code plugins or to fix bugs without waiting for an official package) and don’t know how to update YOURLS with SVN.

For the record, unless stated otherwise the current trunk version of YOURLS is safe to run on a live site. For instance, I run it on yourls.org and also my personal URL shortener, ozh.in, and things have always been fine.

Remember: when coding plugins, it’s recommended to use the latest available, that is either running trunk or installing a nightly build. Which leads to me third point:

3. Hook list!

YOURLS plugin coders will be pleased to know that there is now an exhaustive and always up to date list of YOURLS actions and filters. This list is generated every night against the current trunk version, thanks to the help of a smart user who crafted a neat perl script.

Short URL to this post: http://yourls.org/39

Preventing abuse of your public YOURLS install

A lot of you, beloved users, are using YOURLS to set up public shorteners. Sooner or later you all face the same problem: abuse by spammers, sometimes until your hosting provider shuts down your site. Hopefully, thanks to the plugin API, being abused by spammers is not inevitable destiny and plugins can address that issue.

I know at least 2 plugins on this topic:

If you made a plugin on this topic, be sure to let me know (remember: DON’T MODIFY core, make a plugin instead!!)

Short URL to this post: http://yourls.org/11

YOURLS Plugin Example: Conditional Toolbar

Today a YOURLS users expressed an interesting request:

Hello, I’d like to show a toolbar for, say, http://sho.rt/b when I enter the address http://sho.rt/t/b.
Is there any fast modification I can make on the toolbar sample to make this work?

Of course there is :) Thanks to the plugin API within YOURLS, this is easily feasible, and this would also be an interesting plugin poking with various areas of YOURLS code, so I thought it deserved a little blog post about it.
Continue reading

Short URL to this post: http://yourls.org/f