Luigi Cavalieri - Authoring Open Source Software

  1. Deeply Merging Two Objects in ES6+

    While working on a recent JavaScript project, I found myself in need of merging together an object of default values, with a second object of custom values. The complication was that the two objects could contain other objects nested in, and that the operation could not limit itself to shallowly merge those child objects. After a little work, mergeObjectsDeep() was born to be shared.

  2. Registering Multiple Gutenberg Blocks Each Through its Own block.json File

    The development of a block-enabled plugin is a very well documented process in the WordPress Codex, packed with all the information one might need to get started. To date however, the documentation falls quite short in providing details on how a plugin should proceed to register two or more Gutenberg blocks by means of block.json configuration files. As I recently faced this problem first-hand, I thought I'd share what I learnt.

  3. CharWriter.js: Typing-like Animations in Vanilla JavaScript

    A few days ago I opened a public repository on GitHub to share some JavaScript I had just refactored, today I would like to introduce it to you. CharWriter is an unpretentious JavaScript ES6 class whose instances are able to insert, delete and replace text into an HTML tag by animating the task in a typing-like fashion.

  4. Renaming a Shortcode Programmatically

    It does happen to change mind. But when for some reason we change mind on the name of a shortcode become almost ubiquitous amongst our Posts, Pages and Custom Posts, the only reasonable way of renaming all its occurrences is programmatically — writing scripts all the monotonous work can be delegated to is a habit that, trust me, pays off over time.

  5. The Permalinks Cascade Pro Goes Free

    For the course of events to change, it doesn't necessarily have to take place a paradigm shift, sometimes even a decision made to fulfil an ordinary need is enough. But please, let me clear up the vagueness of my words, because I think an explanation, for the users of The Permalinks Cascade Pro and SiteTree, can be as much appreciated as it would be receiving words of gratitude for the trust placed in me.

  6. The Permalinks Cascade Pro 1.0: SiteTree Passes the Baton

    Today SiteTree becomes officially part of the history. Don't worry, I am not going to say my goodbyes to the project, far from it! This post is about a breath of fresh air: I gave the plugin a new name, and from now on it will be distributed in two versions, Pro and Lite. The introduction of the much anticipated Gutenberg Blocks is another big novelty. But let's start from the timeless question: "Why?"

  7. Flock: A Minimalist WordPress Theme for Bloggers

    Flock can easily turn out to be a companion for those just starting out blogging as well as a complete answer for anyone seeking minimalism. Despite its being essential, it offers an acceptable degree of customisability. It is clean, functional and content-centric. Flock is a theme for personal blogs.

  8. RedBrick: Simple Anti-spam Plugin for WordPress Blogs

    Having to deal with spam comments like any other owner of a WordPress blog has to, I said to myself: "Luigi, do you know that the time is ripe for a new project?" Not that the WordPress community was lacking of an anti-spam solution for bloggers, but as you know, freedom comes from the possibility to choose. In other words, there are never too many alternatives. So today I'm happy to introduce you the first version of a plugin that weeks ago blocked its first spam comment on this very site. Welcome RedBrick!

  9. Renaming the Keys of a Multidimensional Associative Array While Preserving Elements' Order

    Renaming a key of an associative array in PHP is not a matter of magic, usually we can do it by assigning to a new key the value associated to the old key, and unsetting the old element. But things complicate slightly when we want to rename a key without causing the elements of the array to shuffle. In such a case, native PHP functions alone aren't enough. Creativity has to absolutely come into play.

  10. SiteTree 7.1 and A Few Changes

    Even though it has been an experience lasted only a few months, developing add-ons for SiteTree has been very pleasant. As we know, sooner or later everything draws to an end, but that isn't always bad. I write this because the last add-on left too, Multilingual Leaf, has been incorporated into SiteTree.