A plugin framework system for Zencart
|
It has been over 4 years since I have started working with Zencart and the system still doesn’t have a good system in place to support plugins. There is almost no standard, no rules, plugin/module developers have to place files all over the places, sometimes even overwrite core files and clean un-installation of plugins is too time consuming that it’s never done on most clients’ sites we have seen. After using the system for a while, most stores will be “blessed” with a mess of old and codes all over the place which makes upgrading more difficult than it’s already is.
While we have switched to Zenmagick on some projects (which is a powerful and modern system built on top of new technologies), Zenmagick still needs a few more months to reach its mature state, and also many of our clients are still with Zencart. In the past few weeks I have been working on a mini plugin framework system for Zencart which hopefully will help us make our future works on Zencart much easier and faster, my goals for the system are:
- A Plugin should be able to contain every (or at least 99%) of its files in a single package, which should make un-installation much easier and cleaner.
- Plugin should be be loaded upon request only, so on a page that does not use a certain plugin, no extra files should be loaded.
I could have use Zenmagick for my purpose (Zenmagick was designed so that it could be plugged into Zencart) but I felt that:
- Using Zenmagick for this simple purpose seems like an over-kill
- I wouldn’t have been able to learn at much as I did if I use a solution out of the box like that
This plugin system was aimed to be used internally for our clients’ projects only, but I feel like this can help others as well, in developing modules for their own purposes, and so here it is on git, please feel free to report any issue or fork and develop it: Github
PS: the system lacks documents now, but I will soon add lots of comments into the code itself, and I will also add a test plugin.
Nice one.
Just like to point out that the system *is* using at least some code from the ZenMagick project – the class loader
mano
Yes it does use ZM and lots of SF2 components. I’m still adding more stuffs and cleaning things up, but soon I should be able to provide support for twig template on Zencart as well, and after I can figure out a way to work with asset manager and such, then all plugins using this framework can really pack almost everything in its own package (we will still have to have the modules/pages/… and the main templates/… files unless want to overwrite ZC cores, but I think I dont want to go that far)
The sad thing is that we rely on php5.3 and many are not ready for that, but perhaps will soon? For now we will use this internally for our own clients only.
In agreement with you that ZC has been missed the facility for plug’n'play modules for a long time now.
Not too concerned about ZM/SF2 or PHP 5.2 (those should be provided by the ZC host providers), the real decision point is how many existing ZC developers buy into this framework. After all it is thanks to the ZC developers, who produce great modules that makes the ZC plateform so good. Without their buy in, rework of their existing modules to this new Framework, then it wont go very far.
@Raine – how many ZC developers have you spoke to yet? Have you brought this framework to the attention of the ZC core team (they may well be interested, especially to help make v2 a success) ?
Hi Jamie,
Thank you for your interest, this framework is mainly for those who do not want to switch to another framework or those who can’t wait for v2 (who knows when it will come out?).
I haven’t talked to too many developers for several reasons: the framework is still in it’s alpha state, code is being worked on quite often, and document is still lacking. But it’s reaching a mature state right now, and documents are being written to detail the process of creating a plugin with this framework, it’s a real life saver. For example, with the new menu system of ZC 1.50, things have gone hectic for many, but now with this framework it will automatically register/deregister the plugin’s menu for you as you active/deactivate the plugin via the plugin manager in the backend.
It’s certainly true that other ZC devs must buy in this first, otherwise it will still be something only we use in house; and I hope this is not the case as we have seen huge improvement in our recent work regarding the time we spend on each project. Also, many of our plugins will require ZePLUF to work with, those include the “css javascript loader“, “simple seo url” and such. Hope that will also encourage more users to move to PHP 5.3 which is a huge improvement in term of performance, security and usability.
Note;
- “Not too concerned about ZM/SF2 or PHP 5.2 (those should be provided by the ZC host providers),”
should be
- Not interested in ZM (fork of zencart) and more Hosters should be moving to 5.3 for security anyway.