Community Plugins

Install, Extend, Share

Introduction

You're a great developer. You know that, right? Unfortunately, it hasn't always been easy to show your skills off to everybody else. The Community Plugins feature will change that.

Since 2009 Jomres has had the Jomres Plugin Manager. This feature allows me to create and maintain Jomres plugins, and site admins download these plugins at a single click of the button. It's a fast, effective, reliable method of rolling out new features, and improvements to existing features that aren't dependant on big new releases of the Core, and it's a significant advantage when using Jomres.

In the summer of 2023 I will be introducing a new version of the Plugin Manager which has a number of new features. These features allow third party developers to upload their own plugins to a central hub, and all site managers, regardless of whether or not they have a license for Jomres Core, will be able to download these plugins.

This article is slightly technical, as it is written for developers who use Jomres. It discusses the Community Plugins feature and how you can use it to share your work with the Jomres community. I hope to encourage developers who have built their own Jomres functionality to share those changes back to the community. This will serve as an advertisement of your coding skills, and provide you with a route to new customers that you haven't had before, and for Jomres users to take advantage of solutions that I simply haven't thought of yet.

Community Plugins

Jomres Core allows you to have different plugins in different places in your CMS's installation. Those are /jomres/core-plugin, /jomres/remote_plugins and the template override directory.

Most developers will probably use the template override directory as this is specific to their individual sites and it follows the convention that most developers use. While this is fine, a better way to organise your Jomres functionality is to put code that addresses specific problems into different directories in the /jomres/remote_plugins directory. This makes them more portable, you simply copy the contents of that directory to a server and rebuild the registry. Voila, you're building a library of Jomres features. Wouldn't it be great though if you didn't have to do the fiddly FTPing and remembering to rebuild the registry?

A simple plugin

Before you can upload plugins, you need to have a plugin to upload.

Here we'll create a simple minicomponent to output a username, and then use that script in a Jomres template shortcode.

First, we'll create a new directory in /jomres/remote_plugins/ called output_username.


In that directory we'll create a minicomponent

called j06000output_username.class.php and set the contents to the following :

defined('_JOMRES_INITCHECK') or die('');

#[AllowDynamicProperties]
class j06000output_username
{
function __construct()
    {
        $MiniComponents = jomres_singleton_abstract::getInstance('mcHandler');
        if ($MiniComponents->template_touch){$this->template_touchable = false; return; }
        $username = "Uknown user";
        $thisJRUser = jomres_singleton_abstract::getInstance('jr_user');
        if ($thisJRUser->id >0) {
            $username = $thisJRUser->username;
        }
        echo $username;
    }

function getRetVals()
    {
    return null;
    }
}

 

When a new jnnnnnxxxxx.class.php script is added or copied, you need to rebuild the registry in Administrator > Jomres > Tools > Rebuild Registry to tell Jomres that it exists.

Now you can add the following shortcode to any Jomres template file and you'll see the user's username in the template file's output.

{jomres_script output_username}

 

Upload to the Community Hub

That's great. Now, how do you distribute this plugin to the wider Jomres community?

Version 6 of the Jomres Plugin Manager includes a number of new features that allow you to upload your plugins to the Community Hub. You can then use the Jomres Plugin Manager to download those changes to other Jomres installations you run, and other users can also download them to their sites.

If you're a developer who wants to make a living distributing Jomres plugins, then you can use this feature to demonstrate your Jomres coding skills by developing and sharing plugins in the Community Hub. Offer a working plugin on the Hub, and in the plugin's documentation you can showcase enhanced versions of the plugin's features with images and videos and links to your site where other Jomres users can buy and download that plugin.

Uploading a plugin

To upload a plugin, first you need to ensure that you're running the most recent version of Jomres. Visit the Jomres Plugin Mananager and double check, to make sure.

Once it has been installed, go to the Control Panel in Jomres, and click on the Dashboard section. You will see two new menu items (Note, you will not see this on Joomla 3 installations. It will only work on WordPress and Joomla 4). These menu options are "Upload plugins" and "Your Community Plugins".



When you first visit "Upload plugins", if you haven't already saved your license server username and password in Site Configuration you'll be prompted to do that.



Go to Site Settings and save your license server username and password. If you don't have one yet, you can register for free. You do not need to have a license to use this feature.

Once that's done, you can go back to the "Upload plugins" page. If you don't have any plugins there yet, you can create one using the example above.Until you do, you'll see a message like this.

When you have a plugin that you would like to distribute, visit that page again. It will scan the /jomres/remote_plugins directory. Any subdirectories it finds, it will assume that each subdirectory is a plugin directory and it will build a form for each directory/plugin. This form is used to create the plugin's plugin_info.php file and upload the plugin to the Hub.

Here you can see an example set of form fields (this feature is being actively developed, so the fields won't be exactly the same, but you'll get the gist).



 

Populate these form fields with the information you'd like to share about your plugin, and when you're ready, hit the button to upload it to the Hub.



That's it! That's all you need to do! The plugin is now available at the bottom of the Jomres Plugin Manager's Core Plugin's tab. Any other Jomres user can install it to their sites if they want, and you can install it on your other Jomres installations.

ABOUT US

vince picDeveloped and maintained by Vince Wooll, Jomres was initially conceived in early 2005 as a Mambo based solution to a client’s hotel management needs. While it wasn't originally expected to be an online booking system it quickly morphed into one as users requested more and more features.

As the number of feature requests grew Vince knew that he would need to dedicate more time to the project and in July 2005 Jomres was released as a commercial project. Since then Jomres has become the world's oldest online booking plugin for any PHP CMS. It has been used in Joomla 1.0, 1.5, 2.5, 3 & 4 and WordPress 4, 5 & 6.

Aladar joined the project in 2010 after using Jomres for his own projects. He was active on the forum, helping other members of the community and eventually Vince invited him to join the team. Between 2010 and 2018 he was an integral part of the project and made many significant contributions.

Whilst not formally part of the Jomres project, Rodrigo Rocco and Vince have become firm friends. Rod is a freelancer who specialises in doing custom work for Jomres users and developing custom plugins for the system that take advantage of it's modular design. He has built many useful extensions including his fabulous Valentina Template Override Package.

Jomres and the Jomres Logo is trademarked and can't be used without written consent from the owner.

www.jomres.net is not affiliated with or endorsed by the Joomla! Project, Open Source Matters or the WordPress project. The Joomla! & WordPress names and logos are used under a limited license granted by Open Source Matters and the WordPress Projects.

© Copyright 2005 - 2022 Vince Wooll