A Workflow for Modern WordPress Plugin Development

Originally published at: https://roots.io/a-workflow-for-modern-wordpress-plugin-development/

:shamrock: Clover is a new project we’ve been working on since last summer. It is a goal of Roots to empower developers; this goal is infused into everything that we do and Clover project is no different. When looking for ways to contribute to the WordPress development community we found a need for a modern…

15 Likes

Hell yeah, this is awesome. Looking forward to more.

3 Likes

Thanks for do this. Very excited to get involved!

1 Like

I had previously worked on a WP plugin framework that was intended to support PHP5.3+ and thus be usable by most WP developers. I never really completed it, getting hung up on the ORM, which I wanted to be an abstraction over the combination of WP objects + meta as well as potentially backed by regular DB tables.

Anyway, the reason I bring this up is I did have one idea in there that I thought was pretty good. I had a Loader which would loop through all of the services registered with the application container. For any service that has a HasActions or HasFilters interface implemented, it would automatically bind those services methods to WordPress’s actions & filters. Long-term, I wanted to add support for managing said bindings via annotations, so you could declare a class, annotate the methods on the class with the relevant actions and filters, register it with the container, and it would automatically be bound to the WordPress filters, making it easy to implement object-oriented services without having random closures around and binding to actions in constructors or whatever, making it easier to test these services.

I bring this up cuz I always thought it would be a cool idea, but because I wanted to support PHP5.3, I couldn’t implement the annotations, as it would probably rely on doctrine/annotations and require some newer PHP features to make work. However, it might fit in quite well with the approach Acorn / Clover is taking.

Is this something you might be interested in adopting? I could extract the Loader & related interfaces and implement the annotations-based binding I was considering.

2 Likes

Looks great! the next plugin I’ll make will be over Clover :slight_smile: That’s very soon…

1 Like

What’s the status on clover? I’m currently developing a rather large sized plugin to deploy and use in all our client websites. Would be great to port my plugin to clover and I’d rather do this sooner than later as there still is a long way to go…

It’s taken a bit of a backseat as the team works on Sage 10 and Acorn. I expect we’ll turn our focus back to it once those stabilize a bit (soon).

Backers have access to Clover if they reach out over Slack. It’s use at your own risk, since the most up-to-date PR/branch is undocumented and a little stale. (We’ve put this on hold.)

2 Likes

Hey, i would LOOVE to get access to your clover alpha version. Have you recently worked on it a bit? Im very curious about the current status!

P.s. you guys at roots are awesome! thanks for taking wordpress development to the next level!

Hey, is this still an active project?

1 Like