r/ProWordPress • u/Logical-Audience-100 • 20d ago
Opinions on my WordPress git workflow?
Context: The agency I work for has many clients with different setups, many of them very specific. Some use deployments and some don't, so I always need to find a middle ground.
Projects are hosted in GitLab:
- Bedrock: core and plugins managed via Composer, only paid plugins pushed to the repo
- Regular WP: both core and plugins pushed to the repo
CI/CD pipelines with a build step for Deployer, a static build step for JS/CSS, and a test step for Pest tests (if running a Sage theme).
And last step for deployment
- Deploy to develop environment (on develop branch): automatic
- Deploy to production (on master branch): manual
DISALLOW_FILE_MODS is set to true on production so the client can't screw things up by updating anything. The downside is that the client can't upload plugins or make any changes to files through the WP panel.
Wordfence is installed with alerts on high/critical vulnerabilities.
When vulnerabilities are discovered, I update core and/or plugins: first I check locally that nothing broke, then on dev, and finally push to prod.
Once a month I bump everything to the latest version as part of the SLA.
---
Some hosts don't allow a symlink as the root dir, or are missing binaries that Deployer needs, so sometimes the flow is different. Everything stays the same, but when it's time to deploy to prod, I use UpdraftPlus Premium to back up core, plugins and themes (without the DB) on develop and restore them on prod. I don't think it's perfect, since updates can make changes to the DB and that's not part of the backup.
What do you think of this? Do you have any recommendations?
I don't really like that it relies heavily on Wordfence emailing me about what's wrong with the website. If something breaks with SMTP, I might miss something important. (In some projects, clients use their main account for sending mail instead of a separate forms email, and they keep changing the password.)
I can't really think of how to improve this flow. Since everything has to go through git, this seems like the only sensible option.
I think it would be great to have one shared panel to see everything that's happening on the websites. I'm working on one, since services like ManageWP, MainWP, etc. always have something that doesn't fit my needs. But that's a separate issue.
4
u/2ndkauboy 20d ago
Many things sound reasonable and similar to things we do. Too much to mention what could be done differently, not necessarily better, but one thing I would like to recommend: I'd suggest to take a look at SatisPress to manage the premium plugins via Composer.
2
u/NakanoNoNeko 20d ago
I think the weakest part is the UpdraftPlus fallback: restoring files from dev to prod doesn't test the database changes those updates may trigger. Back up prod's database immediately before that deployment and run the update path on a copy first. For alerts, add an external uptime check that notifies you outside WordPress email.
4
u/LoveEnvironmental252 19d ago
Ditch WordFence. Use y oh r host firewall and Cloudflare to stop problems before they hit your server. Move the fight so you don’t waste server resources fighting attackers.
2
u/mystique0712 14d ago
You could add a simple monitoring tool that checks site health directly, not just relying on Wordfence emails which can fail with SMTP issues.
Then, have it trigger alerts to an alternative channel like Slack or a dedicated monitoring dashboard.
This bypasses potential email delivery problems for critical updates.
0
u/TheGoodOne777 20d ago
Hello! What is the size of your team you are working with? On the security part I am not convinced at all. If the hosts are different, I'd document all carefully. I'd be intressted in the backup configurations on your productive environments. Though, for more infos and professional opinion on optimization, contact (PM) me.
1
u/taicv 17d ago
Solid setup, honestly more disciplined than most agencies I've seen. The UpdraftPlus fallback is the part I'd worry about too, so on those hosts I'd at least dump the prod DB right before the push, then you can roll back if an update touched the tables. For alerts I stopped trusting mail sent from inside WordPress. I keep a small bash script per server that checks every site (plugin versions, site health, any new admin users compared to the last report) and sends the report outside the site's own SMTP, so a client changing their mail password can't hide anything. How many sites are you running this flow on?