I am new to Wordpress and I study Wordpress through Udemy course and read some articles which are not up to date.
Currently I am using
- No git
- Local by flywheel to create WP project locally
- All in one wp migration to deploy (it will override all things)
- WP Migrate db to update database
- Ftp or Wordpress file manager plugin to update WP content
However, I realize that this stack is quite old and I have to do lots of work manually. I want to ask you guys about wordpress workflow in 2019
I am familiar with git but I am not sure how to use it in WP.
- Should I init git in root of project and use WP gitignore or I init git in wp-content directory?
- Should I ignore plugins
I try to init git in root of project and add gitignore but there are many weird files are tracked by the git and I am not sure if I should ignore them
I am familiar with Webpack since I worked with React. I can easily set up Webpack and Babel to bundle my projects (I set up it in the custom theme). However I am not sure how to optimize WP images. I can see WP has many plugins, wp-smushit, for that, should I use them or there is a better option. Should I use webpack instead of gulf since I can see that there are many gulp tutorial?
3. Upload WP content to staging and production
Currently I use Ftp for that but I know it is the old way. I have to remember which files have been changed then upload them. How can I upload these changed files automatically (when I merge to dev branch for staging and master branch for prodction)? Does it depend on host service because I can see the price is extremely expensive to have that (WPengine ,...)
4. Push local database to staging and production database
Since the production database changes constantly (I intend to build Woocommerce web), I cannot use WP migrate pro or All in one migration because it will override the whole db.
Currently, after uploading the wp-content to staging and production, I have to go to production and add page, advanced custom field manually. I can see Advaned custom field has export/import tool, should I use that to push new advaned custom field to production?
If I add a page locally, or add a Advanced custom field. How I push it to production and staging?
5. Sync productionDB, stagingDB with local
In order to keep my local to sync with production, I use WP migrate pro for that because it is no harm to override local DB
6. What is the difference between wp-sync-db and wp-migrate-pro?
Thank you guys very much. Could you suggest your development workflow?