Custom Plugin – Package and Deployment Solutions

We are a very small company working with a specific customer base. In this, we often have to create small WP plugins specific to the customer. Typically, we re-use our own basic folder structure and files (base php file that lays out some standard variables, assets folder structure for css and js files, installation/settings features templates, etc.).

We don’t currently use anything that is “industry standard” or that will package, process, combine or minify our files for deployment (css, scss, js, etc.). Does such a thing exist? I’m familiar with the package/deployment of Vue/React and I’m curious is something similar exists for WP or if there are any standards for this?

I’ve done some research but can’t seem to find a clear solution.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Sounds like you are trying to find a way to “build” your public assets – this is commonly achieved using Task Runners – Grunt or Gulp are two well-known examples.

Grunt is part of Node.JS, so you would need to download and install the node.js app and then find the packages you want to use – such as dart-sass for scss or uglify for minification of JS

The last step would be to config the gruntfile.js for your project or sub modules – how this works is very specific to you needs, but there are good examples available on the https://gruntjs.com/ website.

As far as structure and distribution of your plugins, as these probably do not sit on wordpress.org – you need to find a way that works well for you – we use public and private repos on github, which gives us versioning via Git, a good CI pipeline, and also a good way to allow multiple developers to work on the same code base.

We create a new repo for each plugin or theme.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x