Header.php Erased ???

G03

Regular Member
Joined
Mar 19, 2017
Messages
441
Reaction score
125
I hav a dead niche site (SEO + ogads), however its still makes a little change. I went to check the the traffic on GA and there was nothing.

I then went on to check my header.php to update the GA tracker after I hit save, the whole header.php erased itself.

This site was making at one point 500$ a month now down to less than 100$ which i find strange because, I have keywords on page 1.

Any advice would be appreciated.
 
What advice do you want? I don't get your thread do you want help recovering your header or recovering your site lol
 
If you did not change too much of the header.php code in the first place, try replacing the header.php with the original theme it came with. By the way, your post is an example of quite a few mistakes that the web developers/webmasters do

1) They don't backup their code.
2) They don't use a sub versioning software e.g. git.
3) They don't use a proper editor, and/or try modifying the templates directly from browser.
4) They do not have development & production environment separated (e.g. nobody touches the production, it's only synced by git/svn. The only place where code changes are allowed is the dev).
 
  • Like
Reactions: G03
If you did not change too much of the header.php code at this first place, try replacing the header.php with the original theme it came with. By the way, your post is an example of quite a few mistakes that the web developers/webmasters do

1) They don't backup their code.
2) They don't use a sub versioning software e.g. git.
3) They don't use a proper editor, and/or try modifying the templates directly from browser.
4) They do not have development & production environment separated (e.g. nobody touches the production, it's only synced by git/svn. The only place where code changes are allowed is the dev).


1) They don't backup their code.
Ok.

2) They don't use a sub versioning software e.g. git.
Ok

3) They don't use a proper editor, and/or try modifying the templates directly from browser.
Like notepad++ or sublime then upload back?

4) They do not have development & production environment separated (e.g. nobody touches the production, it's only synced by git/svn. The only place where code changes are allowed is the dev).

Can you elaborate a bit more on this?
 
Like notepad++ or sublime then upload back?
Yepp. Those two are 100 times better. For my office I use notepad++ with it's sftp plugin which works perfectly for me. For my own projects which involve php ( code completion stuffs) I use Netbeans for php. I have used sublime before and it is an awesome piece of editor too.
Can you elaborate a bit more on this?
Sure. We actually have 3 separate environments for our project. Development, Staging and production . We only make changes to the development environment. It has separate database which we use with test data. Once we test out everything is working in the development server, we commit the changes ( we use git, but svn could work too..).

The commit gets pulled by the staging server, which by the way has a db having the same data as in the production ( it gets pulled time to time, so it's not live db. It still has data that is more realistic). We do another set of test in the staging and if we don't have any failed cases, we pull the changes to production. Also remember, NOBODY TOUCHES either staging or production.

I am not saying your setup needs to be this complicated, but having separate environments for development and production prevents a lot of potential woos and ahhs. Your development environment could just be your local machine while the production could be your actual server, no matter if you are working alone or in team. If you are working in team you could use branches (if everybody is working with the same code, and there can be a potential conflict) for making changes to different parts of the project and then merge those branches together when the total changes are done.


Bonus Tips:
bitbucket.com offers private git repo hosting for free! You don't actually need to pay a penny to get a repo, if your project isn't huge.


Hope it helps :)
 
Last edited:
Back
Top