Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Keeping WordPress/Woo/Avada files in source control

I asked a question last week and we got off topic in that thread and started talking about WP and source control.

https://www.experts-exchange.com/questions/29230345/WordPress-Avada-theme-is-based-on-Bootsrap.html#a43372145 


https://www.experts-exchange.com/questions/29230345/WordPress-Avada-theme-is-based-on-Bootsrap.html#a43372144 


https://www.experts-exchange.com/questions/29230345/WordPress-Avada-theme-is-based-on-Bootsrap.html#a43372143 



I'm revisiting the question because this is what my manager is saying/doing:


1. Checked in Avada theme child files and functions.php into SVN

2. Checked in apache config files (I'm not familiar with this) into SVN

3. He doesn't want to setup WAMP and the code locally

4. We're 2 or 3 developers who might be working on the site

5. I know the changes will happen in WP 


This is what he's saying:

He says if we want to work on functions.php or Avada theme child style.css, we will check it in SVN, should pull down the file locally , work on it locally (without setting up WAMP/Code), then upload to QA site, test and then move to prod. He says this is to prevent us from overwriting each other's changes. He says maybe we can even turn on SVN's file lock and only allow one dev at a time to make changes.


I explained that the changes are all done in WordPress on the server. Also, how can we just make changes in functions.php - for example - locally without being on the sever...in WP... and just upload the file and test in QA. We can make changes to files without having the entire code setup but doesn't make sense to me. 


My question is :  how can more than one developer work on files like functions.php or child theme (style.css) without overwriting each other's changes? How is source control done in Wordpress/Woo/Avada?



ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Camillia

ASKER

How about child theme style.css. My manager wants to redo most of the design and clean up the css..like removing the !important.

Updates to style.css is common, no? Maybe not functions.php but style.css will change more often?
Like I said, you could do the entire child theme folder and that is where the style.css typically is. 
 He doesn't want to setup WAMP and the code locally

I don't understand that. Where that come from?  You can work on code in your IDE and save it as you normally do. Saving your custom files would not have anything to do with WAMP.  WAMP is used to create a local web server.  

Whatever manner you use source control now could be the same thing. It is just that you only want to set it up for your child theme folder.  I think the point that whoever told you that was trying to get across that typically you work on wordpress in one spot where you mix up working on the custom files via your IDE and working in Wordpress directly with Pages and Posts and any custom settings in your Avada settings.

If you are going to be doing constant updates in the child theme folder, use whatever you are used to.
We're 2 or 3 developers who might be working on the site

That is not so big that you have to worry too much about bumping into each other. You could talk to each other and let the other know what you are working on, pull the file down and upload it to your staging server for testing before pushing it live.

The reason you wouldn't do this for the rest of the site is because 99% of what you do in Pages and Posts, updating fields in plug ins, updating Avada options is saved to the database. It is not good practice to keep over writing the live database from a back up on a regular basis. You do run the risk of messing some things up. I would only restore the live database from a live database back up.
>>I don't understand that. Where that come from?  You can work on code in your IDE and save it as you normally do. Saving your custom files would not have anything to do with WAMP.  WAMP is used to create a local web server.  

I suggested setting up the site on WAMP on our local machines and make changes to functions.php, style.css, whatever. Test, merge and then upload to QA. My manager wants single file - like functions.php- downloaded and worked on.

I doubt we'll be making a lot of changes to functions.php and I know we won't be developing custom plugins. He's worried about style.css and he has that in SVN.

Yes, small team. It will probably be mostly me working on changes and my manager working on style.css. 




I think I said I  set up two sites. One is staging/developing and the other is live. The staging site is set to not allow search engines and that is where I make my changes before going live.

With avada, any changes you make as far as formatting via avada you can export from one page/site and import to the other. This is what you should see at the bottom of any page or post you are edting.
User generated image
Yes, we have staging/QA and Live.

Search engines won't find staging.

I didn't know Avada has export/import. I think we'll be fine as far as not overwriting each other's changes. He'll be mostly doing CSS changes. I'm done with the dropdown that's in functions.php. He has the theme folder checked in. We can tell each other what we're working on.

I don't think the site needs a lot of changes. My manager doesn't like the design and wants to clean it up. 
FYI, The import/export is page settings only, not content. 
>>The reason is when the theme updates itself (and plugins) they will overwrite on the server

Theme updates automatically??

>> It is not good practice to keep over writing the live database from a back up on a regular basis.  
Not sure what you mean by this. Once we go Live, if we want to make changes, we should it right on the Live server?? Not do it in QA and move the changes to Prod?
Theme updates automatically??

They can, but you can also do it manually. However, you will need to do the updates.  Plugins will need to be updated. Every few months Avada may need to be updated. The updates fix bugs and security items. Always do them on staging first to see if anything breaks.
Yes, thanks. 
As @Scott Fell mentioned, backup the entire Child Theme directory.

Also be very careful, about database changes.

Best to make sure your Child Theme uses only WordPress APIs, so no create/update of custom database tables, because if this is done in Child Theme, this problem occurs...

1) Database table is updated.

2) Works with new Child Theme.

3) Reverting to old Child Theme... can crash site if #1 has changed something the Child Theme expects.

This normally occurs with complex plugins, rather than themes... and best to take a close look at your Child Theme to make sure.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> 5) Just like good government begins with good citizens, good Source Code Control begins with good development hygiene.

LOL, very funny.

>>4) Also organizing files into small libraries
This is a good idea. Similar to what Scott said about having "include" files if "functions.php" is getting large.

It's probably going to be me and my manager with him doing the  CSS.