Maintainable Plugins Challenge

Ideas for a better maintainable plugin

During this year's fully digital LDSF for the DACH region ("Liferay Digital Solutions Forum") on 22 April 2020, I've had a presentation labelled "Maintainable Plugins". The video is currently being prepared for publication, but it's (currently) in german only.

After presenting some techniques to write maintainable plugins, one of the questions that I got in the Q&A lounge after this presentation was: "How do you come up with ideas on what to change in order to make a plugin maintainable?". My answer was "partly intuition, conversation with others, having somewhat of an overview over the possibilities", but there's no hard and single best answer to it.

Today, I thought of one plugin that I recently wrote, in order to customize RSS-Publisher's output: By default, the RSS-publisher widget can display the description embedded in an RSS feed. However, a feed can also contain full content - but that full content was never displayed by RSS Publisher. The quickest (fire&forget) solution that I came up with - as it was for a demo - was a module-ext.

For years, I've condemned every plugin containing the "ext" name as devilish. Rightly so.

But after yesterday I've wondered: What could I have done differently? For my demo plugin, I didn't care much about maintainability. In fact, it wasn't even under version control until I thought of this challenge. But now I do - and I believe that it's simple enough to quickly understand it and come up with alternative implementations.

Your challenge:

I'm wondering if you can come up with a better maintainable version of my module-ext to implement this challenge. Please provide your reasoning why (or why not), alongside with code suggestions.

Fork or clone https://github.com/olafk/rss-web-ext, check that it does what it should do, then come up with a simpler solution - and then add a link to your implementation in my plugin's README.md, comment here with a link to your implementation, or tweet at me (olafk).

You may use a simple sample RSS feed with a single article at https://www.olafkock.de/pluginchallenge.xml for demonstration purpose. With this feed, you'll get results like this (left: original, right: showing full content - this challenge)

I'm also interested in reasons why a module-ext plugin might be the best choice in this case.

I've made my peace with it, because I don't expect rss-web to be actively and massively being worked on in future releases, so the maintenance effort might stay low enough to dare implementation-level changes. And I was aiming for a quick demo.

But what if I was wrong and there was better use for it?

 

Article's illustration licensed CC by-sa 2.0 Ed Platt - Thanks!

Blogs

Hi Olaf, I came with an alternate solution using a web-fragment instead of an ext; you can find it here: https://github.com/roccogerminario/rss-web-fragment .

I have less code duplication and an hot deployable solution.

However my conclusion is that, in this particular case, the "ext" module is more maintainable because it's simpler to understand.