News for hackers. Stuff that matters.
Re:Whitehouse.gov Chooses WordPress, Again by nsomaru on Sunday January 24, 2021 @01:07AM (#25889755)
> I prefer to version sites with git and install updates locally, then git pull down on to the live server.

I’m working on my first WP project and am trying this approach. A question I have is how do you handle plugins that have hooks that only run once when installed? Those hooks don’t run if you pull in via git. Also if they make changes to the dB (migrations), how is that managed if the plug-in was installed on a different server?

Re:Whitehouse.gov Chooses WordPress, Again by ehnto on Sunday January 24, 2021 @03:13AM (#25890308)
That is all usually still triggered even when using git. Git doesn't manage the database, so when the files make it to production and the plugins are activated, they see a database they haven't been installed in and then correctly run their hooks. Same for migrations. Migrations are managed with database entries, so if your production database doesn't have those entries, it will still run the migrations.

You can check out WP CLI to automate some of this as well.

Re:Whitehouse.gov Chooses WordPress, Again by sleavey on Sunday January 24, 2021 @03:15AM (#25890315)
As far as I know there aren't any real hooks available for running code on plugin install, only activation. But I think OP is referring to core WordPress code and not plugins.