Standardize Workflow from Development to Pipeline to Testsite #17
Replies: 5 comments 1 reply
-
Curious to hear more about this, if they have any recommended tools or workflows.
For WordPress sites I use Docker, wp-env, and WP-CLI to install plugins, create users, etc. Everything is self-contained, independent of the local system, and reproducible every time on any host platform. With no/minimal dependecies on external services or manual setup outside the project. These tools are scriptable/programmable, so you can define the entire dev/test/production environment as code, or configuration like YAML. For third-party plugins, what comes to mind is the current setup for Fields Pro and Blocks Pro, for example:
They install ACF, LearnDash, WooCommerce, etc., needed for tests and local development. There's room for improvement, such as what to do about proprietary plugins like LearnDash add-ons with no public URL. This is one way to solve it, there are various other possible solutions.
It'd be useful if projects could provide demo/test data to optionally install for local dev purpose. It can be generated, for example, from JSON or WXR (WordPress eXtended RSS) file, with a Bash, Node, or PHP script.
I'd say this is actually a good thing, it's best practice to have an automated solution for test setup starting from an empty site. Perhaps some steps can be useful for local site setup also.
So you're seeking a unified solution for:
The first two can (and often do) share steps, scripts, demo data. To make it useful for the third context, where the user may not have access to the server directly, an admin screen for this purpose may be practical, like one-click install of demo data to get started.
Production sites that are difficult to run locally are problematic in itself already, I think. Similar to servers and services, sites should be treated like a commodity, easy to copy, clone, set up new ones on different machines. Ideally it'd be a single command to export its database ( But I understand in reality sites get bigger, older, and tend to become unique snowflakes that are hard to replicate; or as exotic orchids require sensitive conditions and delicate care to transplant; or as complex behemoths that everyone is afraid to move. To prevent this situation, it's best to regularly create and run copies on other machines, and to automate the environment setup in code as much as possible. From a UX/DX perspective, the ideal is to git clone a project, run a command or two and have everything set up. git clone https://github.com/TangibleInc/example-project
cd example-project
npm install
npm run start # or testThat would start an empty WordPress site. We could add a command before start, like |
Beta Was this translation helpful? Give feedback.
-
|
The WordCamp Video is here: https://wordpress.tv/2025/11/10/automating-quality-inside-an-agencys-devops-pipeline-for-wordpress/ This video and another one from the same WordCamp about testing using Cypress both used Ddev. Ddev seems to be somewhere in between your the GUI WordPress set up tools that do all the docker things for you behind the scenes, and doing the docker things yourself. Because it has commands you can run that will just let you get started right away, but it also exposes it's docker files and config.yaml so you can easily configure things differently as you choose. The company in the video then controls everything in Composer. They install WordPress through composer using this repo: https://github.com/johnpbloch/wordpress-core Then they use WPackagist for public WordPress plugins https://wpackagist.org/. Now to me the trade off here, is I see two different repos emerging. One for your plugin environment and another for your actual plugin. I'm not a big fan of that, but I do think it makes sense to handle the environment and creation somewhere outside of your plugin repo so maybe it makes sense. I get the impression the people in the video are handling the site from end-to-end so they can have their pipeline and re-use whatever they want from composer in their pipeline tests and then deploy straight from their repo. This isn't really the same direction we'd want as we rarely git deploy sites, and often build plugins that we want to make widely available. I think most of the things you've suggested above sound good, it's just about finding a way people can use them easily and/or creating examples people can follow.
Yea, no one really likes to take charge on making decisions for the whole development team. So now I've collected the senior developers to meet once a week so we can try to standardize practices. When we create tools or documentation standardizing things it really helps the more junior developers to be feel more empowered. I'll try to keep you updated on the conversations here, and hopefully I'll get others to chime in as well. Also I'm working on a ddev setup with the environment in composer, so hopefully I'll commit that to Github one day soon and let you know my thoughts and feelings after trying it out. |
Beta Was this translation helpful? Give feedback.
-
Curious, how is it done currently? I'd guess through plugin/theme updates, or UI to update from staging to production. Git or SSH for deploying a site is a nice workflow though, a single command to push changes; or better yet, Git push through a CI pipeline so the site goes through tests before being deployed.
Well, the choice of tools and setup is not only a technical decision but a subjective one where developers often have strong opinions/emotions for and against. What's important is that everyone agrees on a set of decisions as a group concensus and compromise. That said, in my opinion:
I've tried but failed to get any traction with: create, docs, example-plugin. These were made for my own workflow, so people are free to take it or leave it - including this framework. The team can develop or decide on equivalent tools for:
Also establish a consistent standard across projects, such as:
What's needed for consistency is an opinionated set of decisions that everyone can agree to follow, even if they may disagree on some details. Best if the tooling enforces those decisions, such as linter, formatter, build tool, Git commit hooks, etc. It'd be useful to refer to what is the most common workflow in the WordPress/PHP ecosystem. What's popular may not always be the best technically, but it would have social authority and validation of the majority, for which people are usually willing to set aside their personal preferences for the greater good. |
Beta Was this translation helpful? Give feedback.
-
Currently you're right, when a new feature is done the updated plugin is uploaded and any necessary set-up is done on the site. In theory a project manager or a QA (we have one person who does QA sometimes for some things) has tested it first. Also in theory PHP Tests have been written and been passed, but this seems to be less and less common which is a bit of a worry. I agree with you that there should be flexibility in the specific tools and setup used, but I think there should be a recommended core set of tools that work on all platforms. Most new developers who join us are looking for these recommendations and are greatly sped up when we can give them some. It also lets us document the workflow completely, but your right it requires being opinionated. This is why I'm gathering all the senior developers to try to come to a consensus of what opinionated I think many of the tools you've chosen and the docs you've made have been largely useful. The framework especially as it's used in every project, and tangible\log() is probably the most used debugging tool in the company. It also enforces decent file structure out of the box which has been really great. I was asking about Playwright, (which I have no problem using over Cypress), but it seems like no one in the company uses it. I don't know if that's because they don't know how/when or they just find it as overkill for their projects. One thing that's always hard, is that backend developers are somewhat lone wolves by nature, so they tend to be a little shy and not very talkative. So sometimes it's hard to know which things they prefer and not. We have been trying to lean into what the larger WP community is doing more and more. I know in my projects I've started to adopt more and more the WP way of coding even if it's not my favorite (I prefer a syntax closer to what Laravel uses). I feel like OOP is often favored for the same reason, it tends to be what people already know and what the wider community uses. I know it was a struggle for many devs when they first joined because we were not very object oriented. Now I see projects slowly becoming more object oriented with lots of classes emerging (possibly too many). This tends to be how they've learned to organize/design their code, and what they'll find if they look in other plugins for guidance. I think people don't like WordPress because it doesn't follow the MVC model which also tends to be what people know. For that reason I was wondering if we could adopt an MVC approach like this company did: https://wordpress.tv/2024/11/25/leveraging-the-mvc-pattern-for-enterprise-wordpress-development/ Anyhow as I said, we're going to be starting talks to slowly standardize some things to hopefully make everyone's live easier. I think we're starting with UI as that seems to be the biggest bottleneck for projects currently. More and more I feel like which decisions we take are less important than that we actually take them. I'll keep you in the loop with the conversations and of course you're more than welcome to join them. Although my understanding is you'd prefer not to, which is fine, you are still very much appreciated. |
Beta Was this translation helpful? Give feedback.
-
Thank you kindly, your appreciation is much appreciated. As mentioned in #18, this framework is being deprecated in favor of a new base/core module designed and developed by the team. Here's the project repository with temporary name. So far it contains @zinigor's proposal of data object model. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@eliot-akira I wasn't sure where to chat about this. I posted this in our slack dev channel recently:
Unfortunately no one from the team responded. I was wondering what our current workflow looks like when dealing with these issues. I've been looking for a unified solution after getting inspired watching some WordCamp videos. I suppose there is also a use case where you are building a specific customization for a specific client in which case you may want to just port over as much of that site as possible to your local.
Any thoughts or information would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions