Why I felt there was a need for Mozart

Now that Mozart is gaining more momentum and Composer is more commonly being used by WordPress plugin developers, I get asked this question more often. With popular tools like PHP-Scoper also being used in the WordPress ecosystem, I figured it was time to explain why I felt there was a need for another tool that does a similar job.

Continue reading “Why I felt there was a need for Mozart”

Mozart now rewrites a full dependency tree to your own namespace

It’s been a while since I’ve written about what I personally find the single most annoying thing in WordPress, the issues around dependency management. When I started thinking about the project that eventually turned into the Mozart package, I knew that it eventually had to support processing of a full dependency tree. Today is the day that I can proudly announce that Mozart is able to do that!

Version 0.3.0 is now available and introduces full dependency tree processing as the number one new feature. Mozart now automatically detects the full dependency tree of the packages you specify and processes the entire dependency tree.

Even though I know that a couple plugins already use Mozart in production code (mind you, Mozart doesn’t run in production, it’s a development tool), I’d still like some more testing feedback before I tag the first production ready version. So if you have a plugin that requires an external package as a dependency, that you’d like to be rewritten to your own namespace in order to prevent version conflicts, give it a go!

Embracing Gutenberg

Wow, this is actually my first post written with the new Gutenberg editor that recently shipped with WordPress 5.0. I have done some testing with the betas and release candidates and have often criticised the lack of opt-in for users and eventually the seemingly rushed release schedule to get it out the door before WordCamp US… That was all about the logistics though, I do like the new editor.

Yes, this post was actually written in the new Gutenberg editor…

Now that WordPress 5.0 is released and Gutenberg is the new default editor, it’s time to embrace the new editor. I’m sure there are a lot of reasons why people shouldn’t immediately upgrade just yet. This can be either because of plugins or themes not being compatible yet, or the people working on the site aren’t ready to start using a whole new editor. That just takes time and we should give everyone time.

Continue reading “Embracing Gutenberg”

Use a global .gitignore file to ignore commonly ignored files

Accidentally committing sensitive information to a GitHub repository can have costly effects. This tweet of someone committing their AWS private keys in an .env file by accident, surfaced only a couple days ago. I’m sure something like this has happened to so many people already. It’s easy to commit a file that you do wish to remain private, simply forgetting to add it to your .gitignore file. Continue reading “Use a global .gitignore file to ignore commonly ignored files”

Decouple from WordPress databases by using repositories

A quick and easy way to decouple your code from WordPress logic, is by using repositories. Repositories are standardized ways to get and put data in a data store, usually databases. WordPress introduces a couple functions to interact with various database tables (get_post_meta(), get_option(), etc.) that are commonly used inside plugin and theme files, that are cumbersome to mock while testing. Repositories on the other hand are very easy to mock in unit tests. Continue reading “Decouple from WordPress databases by using repositories”

Class constructors should only setup the object

It’s common practice in the larger PHP world, but something the WordPress ecosystem has yet to catch up on. All too often, I see WordPress plugins and themes setup actions, filters and use other WordPress specific functions in class constructors. This leads to a class that is directly coupled to WordPress logic. Continue reading “Class constructors should only setup the object”

Gutenberg is progress

Over on the Mindsize blog, I have published my thoughts on why I think Gutenberg is just the progress WordPress needs:

A lot has been already said about Gutenberg and whether it should be included in WordPress core. How should it behave once it is included? Should it be the new editor for new sites only? Should it be an option that users can enable, or should it be on by default and give the option to disable it?

A new adventure awaits

Exciting news! I have joined Mindsize as Director of Products. The past two weeks have been filled with getting to know the team and the projects that are currently in the works. I’m being tasked with pushing our line of products to the next level.

Our leadership team consists of three fine, bearded gentlemen, who all have a passion for creating amazing web projects. Patrick, Zach and Scott have made me feel welcome from the very first minute we started talking. I’ve known Patrick from our time at WooThemes and have stayed in touch ever since. As soon as we started talking about me working for Mindsize, it didn’t take long until the deal was sealed. Continue reading “A new adventure awaits”

Learning what is most important in life

When times are tough, you learn what is important in life. The past couple months have been a bit of a disaster for me on a personal level. I’m not going to explain details on any of it in this post, as most of it is in the past now, where it belongs.

The British have a saying that goes “When it rains, it pours“. Let’s just say we’ve had a bit of rain in the first half of this year. Continue reading “Learning what is most important in life”

Mozart monkey patches WordPress’ lack of dependency management

A first proof of concept version of Mozart is now available for public testing. Mozart is a command line tool for wrapping PHP packages inside your own namespace. This is the least bad solution for solving most dependency management issues inside the WordPress ecosystem.

The fundamental lack of dependency management support inside the WordPress ecosystem has lead to a number of issues. Wrapping (third party) PHP packages inside your own namespace is something some developers already started doing on their own. Mozart simplifies and automates this process.

Say you want to use the Pimple package in your WordPress plugin. This package runs from the Pimple namespace. What Mozart does, is convert the files from the Pimple package, to use your own namespace, CoenJacobs\TestPlugin\Pimple for example. Your plugin can then use this package, inside your own namespace, so you always use the exact version you want.
Continue reading “Mozart monkey patches WordPress’ lack of dependency management”