r/ProWordPress • • 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.

10 Upvotes

13 comments sorted by

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.

1

u/Logical-Audience-100 20d ago

Seems like this would fix one issue I have with paid plugins. I thought about hosting them in private GitLab repos and pointing Composer to them, but maintaining a separate repo for each plugin would kill me. I might give it a go, thanks for the suggestion!

2

u/2ndkauboy 20d ago

Having them in GitLab would also mean that you need to update them manually, which is the most time consuming part. That's where SatisPress can help.

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.

1

u/Logical-Audience-100 20d ago

Agreed. I do back up prod just in case, but I don't test the updates on a separate environment. Unfortunately, my agency only has a develop environment, so there's no staging where I could restore a prod backup to test changes.

2

u/PeepSoWP 20d ago

A disposable local environment can cover that gap without maintaining another hosted server. Restore a sanitized production database into it, disable outgoing mail, payment calls and webhooks before starting WordPress, then apply the proposed release. That exercises migrations against the production data shape rather than only the dev database.

For Bedrock, build from the committed composer.lock with composer install and promote that same tested artifact to production. Running composer update during deployment would resolve a different dependency set. The Composer docs explain the distinction. Files-only rollback also needs a plan for any schema changes the release has already made.

1

u/NakanoNoNeko 18d ago

PeepSoWP's local-copy suggestion covers that gap without another hosted environment. One thing to ask your agency for: time to test a restore, not just make the backup. A backup you haven't restored is still an unknown when prod breaks.

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/Logical-Audience-100 20d ago

I'd prefer to keep the discussion here so others can benefit from it too, but I'd rather not share more than I already described in the post. Thanks for the interest!

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?