Impressum Plus and Impressum 3.0.0 released
Published: – Leave a comment
After five months of work I’m happy to release the new versions 3.0.0 for Impressum Plus and Impressum, respectively. And even though there isn’t much visible on the surface, it’s the required step to take them to the next level.
Two notable improvements
Writing the headline, it shows me (again) what technical dept really is about. Usually, bad decisions in the past. In this case, aside of removing old deprecated code, there’s a new way of handling settings and using dependency injection. If you’re not familiar with plugin development, you probably won’t find this article that interesting. I’m sorry for that.
Settings registry
All settings are now handled via a registry for improved and more secure access. I was never a fan of making things more complicated. And usually, settings in WordPress are pretty straight forward. You register them once for the backend to have a UI and then can use add_option, get_option, update_option and delete_option to use them. And this is fine. However, if you want to have more control within your workflow, you need to build it yourself.
In this case, every setting has its own name, title and different attributes, e.g. for validation in the API. That means I needed to connect those data on different occasions. Having a single settings registry now means that I can connect those data once for each setting and use them later on wherever I want.
It also means that I can now prohibit setting data that is not registered via the API or WP-CLI, for instance (of course, update_option can always be used to overwrite that – that’s the nature of WordPress).
Dependency Injection
With dependency injection, each class does not create instances of other classes it is dependent on. Instead, these dependencies are passed to the class on initialization. This allows more flexibility and better testability within the development, while adding more complexity.
For Impressum 3.0.0, that means that dependencies had to be reimplemented throughout the whole project and Impressum Plus 3.0.0 had to made to adapt to it (while the latter itself does not make fully use of it).
It is the first iteration and definitely will evolve in future releases.
Bumped system requirements
Aside of the functional changes, the system requirements have been bumped to more recent versions. They are now:
- WordPress version 6.8 or later
- PHP version 8.1 or later
You can find out more details about all breaking changes in the migration guidelines.
All changes
That were the biggest changes for Impressum Plus and Impressum 3.0.0. For all changes, please visit the changelog for Impressum Plus in the documentation and the changelog for Impressum.
Likes
Reposts