44,39 €
Joomla 3 is the first of the major open source content management systems that was meant to be mobile friendly by default. Joomla uses object-oriented principles, is database agnostic, and has the best mix of functionality, extensibility, and user friendliness. Add to that the fact that Joomla is completely community driven, and you have a winning combination that is available to everyone, and is the perfect platform to build your own custom applications.
"Learning Joomla! 3 Extension Development" is an integrated series of practical, hands-on tutorials that guide you through building and extending Joomla plugins, modules, and components. With Joomla having been downloaded well over 35 million times, there is a huge market for Joomla extensions, so you could potentially earn some extra cash in your spare time using your newly acquired Joomla extension development skills.
We will start with developing simple plugins and modules, and then progress to more complex backend and frontend component development. Then we will try our hand at ethical hacking, so you will learn about common security vulnerabilities and what you can do to avoid them. After that we will look at how you can prepare your extensions for distribution and updates, as well as how you can extend your components with various plugins and modules. Finally, you will end up with a fully functioning package of extensions that you can use on your own site or share with others.
If you want to build your own custom applications in Joomla, then "Learning Joomla! 3 Extension Development" will teach you everything you need to know in a practical, hands-on manner.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 377
Veröffentlichungsjahr: 2013
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2007
Second edition: December 2008
Third edition: July 2013
Production Reference: 1200713
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-837-9
www.packtpub.com
Cover image by Tim Plummer (<[email protected]>)
Author
Tim Plummer
Reviewers
Alex Andreae
Alan Langford
Acquisition Editor
Antony Lowe
Lead Technical Editor
Neeshma Ramakrishnan
Technical Editors
Aniruddha Vanage
Dennis John
Vrinda Nitesh Bhosale
Jeeten Handu
Nitee Shetty
Project Coordinator
Navu Dhillon
Proofreaders
Ting Baker
Lauren Harkins
Lucy Rowland
Indexers
Hemangini Bari
Tejal Soni
Production Coordinators
Aparna Bhagat
Arvindkumar Gupta
Adonia Jones
Cover Work
Aparna Bhagat
Tim Plummer is a Joomla! enthusiast and extension developer who has been building websites for over ten years, and specializing in Joomla! since 2008. Tim has developed and maintained several popular components, modules, and plugins, which are listed on the Joomla! Extension Directory, in addition to his day job in IT for a multinational manufacturer. Tim lives in Sydney, Australia, with his wife, Tamlyn, who runs her own design agency and two kids, Zane and Ava-Lily, who keep Tim very busy. At university Tim studied Engineering, and he has a Bachelor of Engineering in Telecommunications Engineering degree, however his passion in IT has been his career focus.
Tim is very active in the Joomla! community; in January 2012 Tim took on the convener role for the Sydney Joomla! User Group (JUG), and he has been co-organizer for the annual Joomla!Day Sydney conference since 2011, taking on the coordinator role in 2013. Tim has run Joomla! development workshops at Joomla! Day conferences and various JUG groups throughout Australia, and is a regular presenter at the Sydney JUG.
I would like to thank everyone in the Joomla! community for contributing and working together to make such great software that is available to everyone, without your efforts this book would not be possible.
A big thanks to Andrew Eddie, who since I met him in 2009, has been so generous in sharing his knowledge and expertise with me at the various Joomla! events throughout Australia.
Thanks to Packt Publishing for giving me the opportunity to write this book. All the feedback and suggestions provided by the editorial team have really helped to make this book even better.
I would like to thank the technical reviewers of this book, Alan Langford and Alex Andreae, both of whom have provided valuable suggestions and feedback.
Finally, I'd like to thank the thousands of people worldwide who have used my Joomla! extensions, without your encouragement I may never have acquired my addiction to Joomla!.
Alex Andreae holds a Master's degree in Electrical Engineering. He first worked in the semi-conductor industry for nearly a decade before discovering Joomla!. Once found, he immediately fell in love with the development environment and community. Shortly thereafter, he co-founded SourceCoast Web Development in 2008.
SourceCoast (www.sourcecoast.com) develops extensions for integrating your Joomla! powered website with popular social networks. Their primary products are JFBConnect for Facebook integration and JLinked for LinkedIn integration with Joomla! and they are used on tens-of-thousands of websites.
Alex has spoken at more than a dozen different Joomla! events in the United States covering topics ranging from Joomla! development, to running a business around Joomla! extensions, and, of course, social networking with Joomla!. He is hoping to attend more international venues in the future.
I'd like to thank my wonderful wife and business partner, Melissa, for all the support she provides in everything we do.
To Alexis, I'll always love you, my sweet 3-year-old princess.
To Sebastian, our crazy 1-year-old, thank you for finally letting us sleep at night. I love you too.
Alan Langford is an innovator, marketer, developer, and entrepreneur. He has held senior positions in both technology and marketing organizations, and has served as a director and adviser for several technology companies.
Alan has four decades of software development experience, and has been contributing to open source projects for more than 20 years. He first started working with Joomla! in 2007 and has been a member of the Development Team and the Bug Squad. He is a founding member of the Joomla! Security Team and continues to make contributions to the Joomla! community. His Joomla! blog can be found at http://torontojoomla.ca.
You can follow Alan on Twitter as @FxNxRL.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
This book will give you a step-by-step introduction with practical examples of how to develop plugins, modules, and components for Joomla! 3. It may also be useful for people who wish to make minor modifications to existing components, rather than creating their own extensions from scratch.
Joomla! is one of the world's most popular open source content management systems (CMS), which currently powers approximately 2.7 percent of the websites on the Internet. Joomla! has been downloaded over 35 million times, and has thousands of add-on extensions (apps). Joomla! 3 is the first major CMS to be mobile friendly by default.
Unlike the other two popular open source CMS projects, Joomla! is completely community driven; there is no controlling company or paid staff. Joomla! uses object oriented principles, and is database agnostic. Joomla! is the best mix of functionality, extensibility, and user friendliness.
Developing extensions for Joomla! allows you to harness the full power of Joomla! and build some really great websites and applications. This book is going to give you all the knowledge you need to get started with Joomla! extension development, with lots of practical examples that you can follow along with and learn by doing.
There are many ways that you can get involved with the Joomla! community and contribute to make it better. There is no minimum time commitment; you can contribute as much or as little as you like.
Most major cities have a Joomla! User Group (JUG) that meets regularly to share Joomla! knowledge, which I encourage you to join. Many JUG groups run annual Joomla!Day conferences, which are definitely worth going to, and are a great opportunity to network and pick up some great tips. You can find out about JUG groups and Joomla!Day events at http://events.joomla.org/.
Joining the bug squad is a great way for developers to contribute, and it is also a good place to learn more about the Joomla! codebase and to improve your coding skills. You don't even need to contribute code to be part of the bug squad; you can test other people's patches and make sure they work, and at the same time get a better understanding of how it all works. The Joomla! Developer Network site has links to the issue tracker and other information that will help you get started http://developer.joomla.org/.
Got a few spare minutes? Jump onto the Joomla! forums and answer a few questions; there are many people who are just starting out with Joomla! and could do with a helping hand http://forum.joomla.org/.
Developing extensions is a great way to encourage the use of Joomla! and your individual effort can make a big difference. I know many people who made the decision to use Joomla! due to the availability of just one specific third-party extension that solved the problem they had in an efficient and cost-effective way. So I encourage you to get involved full stop I'm sure you'll have fun along the way and make some new friends at the same time.
Chapter 1, Before you Start, contains some information that you should know before you start developing Joomla! extensions. It will give you a brief introduction to the extension types in Joomla! as well as highlight some new features of Joomla! 3 compared with previous versions. We will also look at licensing, business models, and coding standards, and touch on upgrading Joomla! 2.5 components to Joomla! 3.
Chapter 2, Getting Started with Plugin Development, is where you will create your first plugin for Joomla!. This chapter will introduce some basic concepts such as how the installation XML file works and how to create an installable extension for Joomla!. We will use this plugin later in conjunction with our component.
Chapter 3, Getting Started with Module Development, covers module development, both frontend and backend. We will also look at template overrides and alternative layouts, and how to make your module responsive using Bootstrap.
Chapter 4, Getting Started with Component Development, covers component development and by the end of this chapter you will have built a very simple component that we will make more complex in the following three chapters. It also explores the numerous JForm field types.
Chapter 5, Backend Component Development – Part 1, continues development of our component, but focusing on the backend. Specifically you will learn how to add columns to your view, implement drag and drop ordering, add toolbar buttons and view filters.
Chapter 6, Backend Component Development – Part 2, is where you will finish the backend of your component. You will learn about pagination, submenus, ACL, and how to make your component support multiple database types.
Chapter 7, Frontend Component Development, covers the development of the frontend of your component. You will learn how to add CSS files, menu item parameters, and how to translate your component. We will also look at how your component can interact with other extensions such as Captcha and a third-party comments component.
Chapter 8, Security – Avoiding Common Vulnerabilities, contains some hands-on ethical hacking to teach you about common vulnerabilities and how to avoid them in your extensions.
Chapter 9, Packing Everything Together, covers how you can prepare your extensions for distribution, as well as managing changes. It also shows how you could set up an update server, and some tips for getting listed on the Joomla! Extension Directory.
Chapter 10, Extending your Component with Plugins and Modules, contains a few plugins and modules that extend the functionality of your component, including a smart search plugin. We will also take a look at the new tags feature in Joomla! 3.1 and how you can integrate this into your component.
You will need Joomla! 3 installed either locally or on a server you have access to. Ideally you should have a local development environment, which should have a web server, PHP and MySQL, with Joomla! 3 installed. For Joomla! 3 you will need PHP Version 5.3.1 or greater and MySQL Version 5.1 or greater. For more information on Joomla!'s technical requirements, visit http://www.joomla.org/technical-requirements.html.
For the Multi-database support section in Chapter 6, Backend Component Development – Part 2, you will need Microsoft SQL Server 2008 or greater. You can use the free Express edition; there is no need to have the purchased version.
This book is for developers who want to create their own Joomla! extensions. It is assumed you will have some basic PHP, HTML, and CSS knowledge, but you don't need any prior Joomla! programming experience.
Although this book starts out from scratch, it builds up to some more advanced topics that will interest experienced developers, such as integrating a third-party comments extension, so it is not just for beginners.
This book may also be useful to people that just want to make minor customizations to existing Joomla! extensions and build on the work of others in the open source spirit.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
This book guides you through creating Joomla!® 3 extensions, including plugins, modules, and components. You will end up with a fully functioning package of extensions that you either can use on your own site or share with others. It is assumed you will have some basic PHP, HTML, and CSS knowledge, but you don't need any prior Joomla! programming experience.
We will start out developing simple plugins and modules, and then progress to more complex backend and frontend component development. Then we will do a bit of white hat hacking, so you will learn about common security vulnerabilities and what you can do to avoid them. After that, we will look at how you can prepare your extensions for distribution and updates, as well as how you can extend your components with various plugins and modules.
In this chapter, you will learn the difference between a plugin, a module, and a component, as well as seeing the other extension types available. You will get some advice as to the tools you will need to develop extensions, and other things you should consider such as licensing and business models. We are also going to take a look at how you could upgrade a Joomla! 2.5 extension to make it Joomla! 3 compatible. You will learn the following things in this chapter:
There are many ways to extend the functionality of Joomla! using add-on software called extensions. Extensions can be installed on your Joomla! site and they add new functionality, in some cases they change the way your website behaves by overriding the core code.
The three main extension types we are going to cover in this book are plugins, modules, and components, and we will also create a package extension.
Plugins are code that run in the background and are triggered by events. When you log onto your Joomla! website, an authentication plugin checks your login credentials and decides whether you should have access to the site or not. Plugins can be used to transform content, such as replacing a tag in an article with a Google map, or cloaking an email address and protecting it from spammers. Plugins can be very powerful, you can also use plugins to override core code and change how Joomla! works.
The following screenshots demonstrate how a plugin replaces an address in an article with an actual Google map.
As you can see, the address has been transformed into a Google map showing where the Sydney Opera House is located.
Modules are used to display content at a particular place on your website. Your site template defines various module positions that determine where these modules are displayed. The menu of your website is a module, and if you have a small login form, that would also be a module. You might even have a social media module to display your Facebook or Twitter news feed. There are both frontend and backend modules, and often modules work in conjunction with components to display information on your website. Some developers use modules as a workaround to bring library code in, for example, RocketTheme's RokNavMenu, but that is not really what they should be used for. The following screenshot is of a login module:
Components are the apps of the Joomla! world and the most complex extension type. Components are displayed in the main content area of the site, which is often the largest area in the template. Most menu items load a page with a component and there is only one component displayed on the page at a time. Most components have database tables to store or retrieve information. Components generally have a frontend and a backend just like Joomla!, although there are some tools that focus on the backend with nothing displayed on the frontend of the site, for example, Akeeba Admin Tools. You can enhance components using modules and plugins; for instance, you may have a search plugin that allows you to search for the content stored in your component, or a module that displays the latest items for the component. The following screenshot shows one of the core components called com_content; you will see this screen when you are creating an article from the front end of your site:
Joomla! is used worldwide by many people whose first language is not English. Many websites need to be displayed in the local language of the audience and some even need to support multiple languages. A language pack includes the files necessary to translate the text used on the site. This translates predefined language strings used by core Joomla! or its extensions; it does not translate the article text, on the fly, into another language. We are not going to cover language packs in this book, but we will see how we can translate your extension into multiple languages. The following screenshot shows the control panel menu when the Dutch (NL) language is installed:
We don't want all our websites to look the same, so Joomla! has a powerful template engine that allows you to install additional templates to change the look and feel of the site. Since the content is separated from the presentation, it is easy to give your site a facelift by simply changing the template, assuming the new template has the same module position names. Every Joomla! website uses at least two templates, a site template for the frontend, and an admin template for the backend. It is also possible to have different pages on the same website using different templates. We are not going to cover templates in this book, as there are plenty of books already dedicated to this subject.
The following screenshot shows the default Joomla! 3 template protostar:
The next screenshot shows exactly the same content with a different template applied, in this case, Beez3, and you can see that this looks very different than the Protostar template.
Reusable code libraries, which are a collection of classes, can now be installed in the libraries folder. This is a better way of creating reusable code than putting it in a plugin, as this way the code is only used when needed rather than running in the background waiting for an event trigger. Libraries extension type was introduced in Joomla! 1.6. We are not going to cover the library extension in this book.
Joomla! allows you to bundle related extensions together into a package, so that you can install multiple extensions in one go. It allows you to install your component and any associated plugins and modules all in one go, rather than the user having to install each one individually.
What Joomla! version should I develop for? The short answer is definitely Joomla! 3, but probably Joomla! 2.5 as well, while it remains the current long term release.
If you want your extension to have the longest possible shelf life, then supporting Joomla! 3 is essential as its expiry is scheduled for September 2016, compared to Joomla! 2.5 which will have its expiry in September 2014. At the time of writing this book, the Joomla! 2.5 series is the current long term release, which is what most people should be using on their sites, and the long term release of the Joomla! 3 series is to be due out in March 2014.
Joomla! 1.5, while it is still widely in use, has already reached its official end of life which means there will be no more security releases, bug fixes, or improvements added. The Joomla! Extension Directory unpublished all extensions which only support Joomla! 1.5 in March 2013, although they can still be accessed for now at http://archive.extensions.joomla.org/.
Most developers choose to support both Joomla! 2.5 and Joomla! 3, however you need to make the decision as to whether you are going to keep these as separate packages, or just have one code base that supports both versions. There are advantages and disadvantages of both approaches. If you keep separate code bases for different Joomla! versions, then you can take full advantage of any new feature in the newer version and there will be less repetitive code, however, whenever you add a new feature or bug fix, you will need to apply these in two places. If you choose to support both the versions in the same code base, then you need to do more testing to make sure that a feature added for one version doesn't break something in the other version, or that you have a bit of repeated code that does one thing for Joomla! 2.5 and something else for Joomla! 3 – but new features and bug fixes are easier.
The differences between Joomla! 1.5 and Joomla! 2.5 are very dramatic, it was practically a rewrite and people who chose to support both Joomla! 1.5 and Joomla! 2.5 in the same code base were just making it hard on themselves. They either had to dumb down their Joomla! 2.5 versions, making them only use the features from Joomla! 1.5, or they had to rewrite massive chunks of code to backport the functionality. In comparison, the changes between Joomla! 2.5 and Joomla! 3 are relatively minor, and the good news is that since Joomla! 2.5.5, the Joomla! Platform version has been updated which added forward compatibility for some of the new stuff in Joomla! 3, and this makes it easier to support both these versions.
Anyone who wants to support Joomla! 1.5, Joomla! 2.5, and Joomla! 3 in the same code base is just asking for trouble. My advice to you is to start out developing for Joomla! 3 only, and get that functioning perfectly. Then if you choose to also support Joomla! 2.5, you can add in the appropriate code, but don't even bother with Joomla! 1.5.
There are many new features included in Joomla! 3, but some that are particularly of interest to an extension developer are:
Joomla! 3 is the first of the major open source content management systems to be mobile-friendly by default. This is due to the introduction of Twitter Bootstrap which takes a lot of the hard work out of making a website look good and making it responsive. Bootstrap relies on jQuery and LESS CSS, both of which have been added to the Joomla! core, which is great for us extension developers as it gives us some more toys to play with. You can choose not to use Bootstrap at all, just because a feature is present does not mean that you are forced to use it. In the case of Bootstrap, I would encourage you to take advantage of it, as it will make your life easier by adding responsiveness to your extensions which will make your site look good.
JavaScript libraries are used to simplify the client-side scripting of HTML, and allow you to perform common tasks in a single line of code which would be significantly more complex if you were using JavaScript alone. Two popular JavaScript libraries are jQuery and MooTools. Although jQuery has been added, MooTools is still available for those that want to use it, and some of the core Joomla! still relies on MooTools. jQuery has been used by extension developers for a long time but since it wasn't in the core phase, there were many different ways to implement it and different incompatible versions used. Some template developers even went as far as disabling MooTools which caused problems for extension developers who chose to use MooTools. Now that jQuery is in the core Joomla! and loads with no conflict by default, we can avoid many of the problems in the past. For a long time people have debated which is better, MooTools or jQuery, and there have been passionate arguments from both sides. It's great now in Joomla! 3 that you have a choice, so you can use whichever suits your needs or personal preference.
However, it should be noted that currently there are discussions on the development lists about removing MooTools entirely in the Joomla! 4.0 release, so it may be wise to opt for jQuery unless you are already familiar with MooTools.
LESS CSS is a new way of writing CSS files that allow you to reduce code repetition by using variables and other tricks not available in regular CSS. It's becoming popular with template developers, and some extension developers are also using it. We are not going to cover LESS in this book, as the extensions we are creating only require very simple CSS code.
At the time of writing this book, Joomla! 3.1 has just been released with a new tagging feature, and we expect more features to be added in Joomla! 3.2 in September 2013, such as Content Versioning which is likely to be the major new feature in that release. There will be a few more features that will slip into Joomla! 3.5 which is the long term release in the Joomla! 3 series, due to be out in March 2014. Any code that was marked for deprecation was removed in Joomla! 3.0, so although there might be some nice new features added, the underlying framework is not expected to change dramatically until Joomla! 4.0, so all the examples in this book will continue to work throughout the Joomla! 3 series. The Joomla! CMS has committed to backwards compatibility between the long term release and the previous short term releases, so any code written for Joomla! 3.0 should continue to work on Joomla! 3.5, and anything that stops working should be reported as a bug.
Joomla! has been working towards becoming database agnostic for a while now, so unlike some other CMS systems, you can run it on whichever database type you choose rather than being forced to use MySQL or MySQLi. Joomla! 2.5 introduced the Microsoft SQL Server drivers, which is supported by the core extensions and some third-party extensions, however the uptake with the extension developers has been a bit slow. Joomla! 3 now introduces another database driver, PostgreSQL, which is a popular alternative to MySQL. There are people working on implementing additional database drivers in the future, including Oracle, SQLLite, and PDO. You may be thinking that MySQL is great, and wondering why you would want to support these other databases. Well, many people are tied to using other database types due to applications they use, or they may just prefer those databases. This is particularly important for enterprise Joomla! users who may want to develop tighter integration with their existing systems and who may already have heavily invested in a particular database type. Supporting multiple database types in your Joomla! 3 extensions is not that hard. We will discuss it in detail in Chapter 6, Backend Component Development Part – 2, and I encourage you to make the extra effort.
When developing extensions, it is important to consider the license that you will release the software under. Joomla! is licensed under GNU GPL, which is a popular open source license (http://www.gnu.org/licenses/gpl.html). The GPL license delivers the "four freedoms", that is, to use, study, modify, and distribute software for any purpose.
The GNU GPL is often misunderstood, many people don't understand how something that is free and open source can actually cost money since Joomla! is GPL and doesn't cost anything. You may have heard the explanation for "free" as in freedom as opposed to "free" as in free beer. The GPL allows you to charge for your software if you wish, providing that you make available full unencrypted source code. Of course you can choose to give away your extensions for free if you want to, it is entirely up to you.
GPL gives the user the freedom to make whatever changes they like to the software and it even allows them to distribute the software to other people. The GPL also allows people to fork your extension and potentially even charge other people for this modified version. Hang on a second, why would I want to make my commercial extension GPL if people are just going to give it away or fork it? Well, the simple answer is that if you want your extension to be listed on the Joomla! Extension Directory (JED), then you must license your extension under GPL. Many extension developers receive over 60 percent of their traffic from the JED, so it is quite an incentive. Another major benefit of using the GPL license is that it clearly states that the software has no warranty which can protect the developer.
The GPL does not allow you to sell per domain copies of the software once someone has purchased or is given a copy; they can use it on as many websites as they like. Many developers get round this by charging a per site support fee, and some only provide updates for the purchased number of domains. There is nothing stopping someone purchasing a single site support and then using this same software on multiple domains.
You cannot use encoding or encryption such as ionCube, which many developers used in the past prior to the JED enforcing GPL. In the early days of Joomla!, there were no licensing restrictions and Joomla! extension developers used a wide range of open source and commercial proprietary licenses for their extensions. From July 1, 2009, the JED only listed extensions licensed under the GNU GPL, and at the time of the change, there were a lot of extension developers resistant to it, but more recently developers are seeing the advantages of GPL and are embracing it.
The legal opinion received by Open Source Matters (OSM) is that the PHP code in an extension of Joomla! is considered derivative work and thus must be licensed by GPL. This is why the JED insists on GPL licensing. The requirement for GPL licensing does not apply to JavaScript code, CSS, LESS, images, and documentation.
You can use whatever business model you can think of. One of the great things about Joomla! is that you have a complete freedom of choice. Here are a few popular business models used in the Joomla! community that you may consider when developing extensions:
A variation on the freemium model is where a component is given away for free, but you need to pay for the add-on plugins and modules. One good example is the Joomla! Content Editor (JCE).
Once-off purchase model: This model is sometimes used where a user purchases an extension, then receives updates for free for the lifetime of that product. This can be attractive to the end user that doesn't want ongoing subscription costs, particularly those that just want the software for a single website or a small once-off project. From a developer's perspective, using this model makes it easier to support as you only really need to support the current version. If someone is having an issue and they are still using an older version, you can just send them a copy of the latest version and in many cases, this resolves their issue. It also takes the pressure off the developer to release new versions regularly and add significant new features just to justify ongoing subscription costs of other models.Subscription model: By far, the most popular business model in the Joomla! community is the subscription model, where the user pays a subscription fee which then gives them access to one or more extensions and updates for the duration of the subscription. The subscription typically could be six months or twelve months. This is popular with developers as it gives them an ongoing revenue stream, however from an end user perspective, the total cost of ownership of the software can be more expensive than some of the other approaches, particularly if the extension is only used on a small number of sites. However many subscriptions also include free support, which can decrease the total cost of ownership for end users should they run into issues, as some of the other business models charge a separate fee for support, which in some cases can exceed the initial purchase price. If a user is paying a subscription, they expect to get more frequent updates, and to get something for their ongoing fee, otherwise some users may choose to discontinue their subscription.There are many more business models you can consider, however your individual circumstances and business goals will help you determine which approach is most suitable for you.
Obviously you need a computer to develop Joomla! extensions, but the type of computer you choose is completely up to you. There are free open source software for all the major operating systems, but the most popular operating system in the Joomla! community from my observations at Joomla!Day events seems to be Mac, although personally I use Windows, and there are those that use Linux too. When it comes to Joomla! development
