YOOtheme Starter Plugin – The Easiest Way to Extend YOOtheme Pro

  • Sascha
  • Company

Today we are happy to introduce the YOOtheme Starter Plugin. It is a ready-to-use starter kit that makes extending YOOtheme Pro easier than ever. It takes care of all the tedious tasks, like the integration into Joomla or WordPress, and helps with distribution, versioning and updating of your YOOtheme Pro extension, so you can focus on the actual features. Let's go into details.

Make sure to subscribe to our YouTube channel and join our Discord Chat Server for all news and discussions.

Challenges Extending YOOtheme Pro

What does it actually take to create and maintain a YOOtheme Pro extension? First, you need to create a Joomla or WordPress plugin to integrate it into your website. Next comes the actual feature development. Once done, you have to build installation files to distribute them to your customers. Of course, you need to maintain the plugin metadata, such as author, license and version. Finally, to offer 1-click updates, you need to create update server files. And… all these steps are different depending on whether it's a Joomla or a WordPress plugin.

That’s quite a workload and can be overwhelming, but with the YOOtheme Starter Plugin, we’ve removed this entry barrier so you can start with your extension features right away.

Create Your Plugin

But how does the YOOtheme Starter Plugin work? It uses Composer to create a new project in your plugins directory in WordPress or Joomla via Composer's create-project command. You will also be asked to add your plugin metadata, like title and author. This will create your new plugin directory with all required plugin files.

composer create-project yootheme/starter-plugin PLUGIN_NAME

To assist you, the Starter Plugin provides a number of helpful commands that you can execute at the root of your plugin directory.

Set up the Plugin

First, there is a command to make your plugin available in your WordPress or Joomla site. It will copy the necessary plugin files to the plugin root folder.

task setup-wordpress
task setup-joomla

Add Code Examples

Next are two commands to add code examples which extend different parts of YOOtheme Pro with new functionality.

There is a command to create a YOOtheme Pro module, which is a package of code that extends the functionality of YOOtheme Pro. You will be asked to configure the module and choose from a number of code examples, for example, add a custom source or custom assets to your extension. Usually modules are used to structure your code, for example, you can have one module for your elements and another one for your new content source.

composer create:module MODULE_NAME

There is another command to create a new YOOtheme Pro element, add it to your module and configure it.

composer create:element ELEMENT_NAME

These are good starting points to develop your features.

Build Distribution Files

Once done, the Starter Plugin provides a task to create an installable zip archive of the plugin for WordPress and Joomla. The created zip files are located in the dist folder.

task build

Versioning and Publishing

Of course, there is also a .env file where you can raise the version of your plugin and change its metadata, like title or description.

TITLE='My Plugin'
NAME='myplugin'
VERSION='0.0.1'
DESCRIPTION='Lorem ipsum'
DATE='{{ now | date "2006-01-02" }}'
COPYRIGHT='Copyright (C)'
LICENSE='GNU General Public License'
AUTHOR='My Company'
AUTHOREMAIL='me@example.com'
AUTHORURL='https://example.com'

After changing the metadata, you need to re-run the corresponding Joomla or WordPress setup task to update the plugin files.

Update Server

Finally, to enable 1-click updates in WordPress and Joomla, run the build task to generate the necessary update server files for WordPress dist/update.json and Joomla dist/update.xml. These files are configured based on the package information in the .env file.

# Update server
UPDATEURI='https://example.com/updates'

# Package information
STABILITY='stable'
DOWNLOADURL='https://example.com/downloads'
PHPMINIMUM='7.4'
JOOMLAMINIMUM='(5\.[01]|4\.[01234]|3\.10)\.'
WORDPRESSMINIMUM='6.2'

By the way, you can make your plugin a Git repository with git init -b main and push it to GitHub. And if it is open-source, you can even provide the update files as well as the download files there.

With all these commands, the Starter Plugin will significantly speed up your YOOtheme Pro extension development by taking care of all the repetitive tasks around it.

YOOtheme Pro Child Themes

If you are currently using a YOOtheme Pro child theme to extend YOOtheme Pro, we strongly recommend to create your own Joomla and WordPress plugin instead. You will not only benefit from the plugin management but also from all the tools we integrated into the YOOtheme Starter Plugin.

Why create a plugin?

There are many reasons to develop your own plugin. For example, if you often use the same modifications across different client projects, you can create your own company plugin which adds the functionality you need. Or for heavier customizations, you can have a separate client plugin. If you are thinking about sharing your plugin with the YOOtheme community or even selling it as a commercial plugin, send us an email, and get listed on our Extensions page. We will promote your plugin to our customers, and you will get access to our dedicated #developers Discord channel where you can connect with other 3rd-party developers and the YOOtheme team.

Next Steps

You can find the YOOtheme Starter Plugin on GitHub, including step-by-step instructions and necessary commands in the readme.md file. Here you can report issues or even make pull requests to contribute to the project. We will update the plugin with more commands and examples in the future, so let us know if anything is missing.

We’re so excited to see what you will build with the YOOtheme Starter Plugin. And now go ahead and take it for a test drive. As always, we are looking forward to your feedback, so let us know what you think in the comments bellow.

Related



Join Now
Documentation