BracketSpace Releases Library of Reusable Code for Plugin and Theme Development

BracketSpace, a WordPress-centric software development company based, released Micropackage a few weeks ago. The project is a collection of open-source repositories with reusable code for inclusion in WordPress plugins and themes. The library currently has 13 packages, including a filesystem wrapper, a template system, an Advanced Custom Fields block creator, and more.

The company out of Poland specializes in project outsourcing and plugin development. Some of their more popular plugins include Advanced Cron Manager Pro and Notification, a custom notification plugin in which the BracketSpace sells pro extensions for various services.

The Micropackage project was driven by the needs of the team and its projects. “We started the Micropackage project to scratch our own itch,” said Jakub Mikita, CEO of BracketSpace. “During the past few years of active plugin and website development, we noticed that keeping the code standard was very important for maintainability.” The BracketSpace team had been copying and pasting code between projects. Eventually, the team asked themselves the inevitable question that most development teams come to — why not break all of this code up into small packages and maintain them in a single place? Thus, the Micropackage project was born.

BracketSpace is using all of the packages in many of its current plugins and themes because the code was originally taken from those projects. “We are now rewriting one of our flagship plugins, Notification, using the micropackages and intend to create every new plugin and theme using them,” said Mikita. “And, because they are loosely coupled, there can be a lot of configuration variations.

Package and dependency management is a standard part of development within the larger PHP development world. The use of packages has become more and more standard as WordPress has begun using modern JavaScript tooling. However, the ecosystem mostly falls short when dealing with PHP packages. While many plugin developers make use of such dependencies, the practice is not common. WordPress also has no built-in method of handling dependencies. The situation makes it hard for projects such as Micropackage to gain any real traction within the overall WordPress developer community.

The Available Packages

The project includes 13 repositories that can be included in WordPress plugins or themes via Composer. Most of the packages are currently available on the Micropackage page on Packagist. Several of the packages are essentially wrappers for various WordPress APIs for simpler usage. However, some of the packages offer new developer features.

Mikita said the following are the most important packages for the team:

  • DocHooks – PHP comment annotations repo that supports filters, actions, and shortcodes.
  • Requirements – Environment requirement checker for plugins.
  • Filesystem – Simplified wrapper around the WordPress Filesystem API.
  • Templates – Basic PHP templating solution that supports passing data to templates.
  • Responsive Embeds – JavaScript package for automatically making any embed responsive.

The repositories don’t stop there. They have built other wrappers for WordPress APIs, such as caching, scripts, and internationalization. The team also has a block creator for ACF that allows developers to create blocks from templates.

BracketSpace has at least five more packages planned for the project. At the moment, the packages have primarily targeted WordPress developers. However, Mikita said the team will also create platform-agnostic repositories whenever possible. That way, they will be useful for developers beyond the WordPress ecosystem.


9 responses to “BracketSpace Releases Library of Reusable Code for Plugin and Theme Development”

  1. Looked at the repos briefly – perhaps too briefly? – but if these are used in individual plugins, that is individual instances of Composer, how are conflicts prevented? Especially across version of the same class?

    For example, I believe WebDev Studio’s CMB2 had something to prevent conflicts across plugins integrating CMB2. But I don’t see any reference to something like that here.

  2. p.s. For bespoke dev, I put my library in mu-plugins. With an autoloader, that code – to anything “down stream” – effectively becomes an extension of core. That is, “stuff” that’s just there. Always.

    If WP were to develop a dependency manager of some sort, mu-plugins would be the ideal home.

  3. I LOVE this approach and am going to use some of these packages in my plugin boilerplate, which has caused me to think more along these lines as well for my own custom code.

    Thanks for making the WP dev world a better place. Expect me in your GitHub Issues/PRs in the future ;)

  4. This is really cool and I think this should be encouraged in the WordPress community. We are lacking good packages and a central package management for WordPress. Using Composer and packages like this will improve the productivity, development speed and product quality.

    Hopefully, more packages are released in the future! Good work!


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: