Ad network site from hell



  • About four years ago I was working for a small company that did PHP based web sites. When I first started, I was a bit alarmed that the owner got most of his clients from sites like ELance, but I figured "If it works, why not". The first projects I worked on were fairly simple, a lot were fixing things other people messed up. Finally another programming team was fired, all of them (to save money the boss said, paying them $10/h was too much), and it came down to me and two other people (I managed to talk him up to $12/h). The other team had been working on an ad network site like AdSense, except without the Sense, and were already 2 weeks over the deadline.

    The boss man said that it "was almost done, there are just a few glitches to work out." One of the first things I had to do was turn off E_NOTICE and E_STRICT (which I always turn on when programming) because the script would simply not work under such conditions. I figured that the previous programmers were just super lazy, that is until I started looking over the code.

    No template

    The boss decided that he hated templates, and every file had all of the header/footer information for every single page, there by making it really difficult to change a menu item because you had to change it everywhere. At first I tried to fix this problem, but he basically went on a shit storm for a few hours about how he didn't "care about standards or 'what is proper' because that is all stupid and never works" (his exact words)

    Also, he wanted the site to be "cross browser compatible" and to him that actually meant "it has to work in IE6 and IE5 for Mac", so it looked and worked like shit.

    It was made to be in multiple (human) languages

    This idea isn't so bad until I saw how it was stored. Basically there was a table in the database with three fields "ID" (varchar 255), "Lang" (text), and "Data" (longtext), and without any indexes they had a random text ID that seemed to originally follow some kind of numbering system, but they must had forgotten about it. It was very hard to track down what a given page said because I had to find the ID and there were tens of thousands of rows, some I noticed weren't even used.

    Page load time with even one person looking at the site was ridiculous and took up to 2 minutes for basic content. Any text I wanted to add to the site I had to put in the database. I had to simply add an index to the ID field and one to Lang because Unique/Primary would not work; there were many, many doubles and LIMIT was used by the programmers to find the one they wanted to use.When I added text I tried to make something like "pagename-item", but he didn't like this and said I was wasting time.

    Why had I not quit yet? I really needed money and I couldn't find any other jobs, but this entire time I was looking.

    CAPTCHA was terrible

    Basically the CAPTCHA consisted of generating a random number (about 5 digits) and then loading images based on those digits. So if the number was 56789 it would load /images/5.gif; /images/6.gif; and so on. Basically really defeating the purpose. I fixed this by putting the images in variables stored in base64 (he HAD to use those images) and doing /captacha.php?id=somerandomid I would then grab from their session what their number was and load each image that way, so at least no addresses would show up. I could have loaded them from their individual files and then put them on the screen, but he kept changing the directory structure and file names, so I thought this would be less of a nightmare.

    The code was horribly formatted

    I'm not sure what text editor the previous team was using (nobody knew) but it would put about 10 line breaks between each line and the indents were random at best. That is, if those chose to format it at all, sometimes it was various functions and statements on a single line.

    Almost no limits

    Except for in cases with the language storage, they typically just did SELECT * FROM table; with no limits or fields on pretty much every query, and went through a loop to find what WHERE would have gotten for them. However, there was at least one programmer using WHERE clauses, I could tell when he was programming because he had a certain style, he seemed to be the least stupid person on the team.

    No CSS or JS files allowed

    All styles had to go in the tag itself and the JS on each page, even if it was being used on many pages. The boss' reasoning was that "we might want to change something for some single page, and standards are wasting time."

    Nearly all the math was broken

    When calculating prices, storing them, and so forth -- pretty much none of it worked properly and was calculated with some terrible and inexplicable math. If you wanted to add up how much you made/spent in a month, it would tend to be completely incorrect. Almost no testing went into any of the math.

    Security through idiocy

    Credit card and other banking information was stored in the database in TEXT fields, but luckily it was "encrypted":

    function encrypt($unencrypted, $key) {
    strrev("$unencrypted");
    for ($x=0; $x<strlen("$unencrypted"); $x++) {
        $encrypted .= base64_encode($encrypted);
    }
    return "$encrypted";
    }

    In case you were wondering, yes most of the variables were quoted when they didn't need to be. I'm not sure what $key was for, but the decrypt function which I no longer have (I only saved a few jewels from the project) sometimes didn't "decrypt" correctly - but the boss assured me "the customer can fix anything incorrect when it shows up and we will save it again."

    I should also mention that your CC info and other banking information showed in plaintext with no limitations on your account page, and no HTTPS was allowed, the client didn't want it.

    Other random things

    1. When saving clicks/views, no IP addresses were saved, so basically a person could click on an ad as much as they wanted and there was no limitations on how that was calculated
    2. He required that all of his sites, including this one, have built in systems for managing banner ads. In this one the banner ad system had to be completely separate from the one we were building, so we had to basically do the same thing twice. The second time 'round the old programmers did an even worse job.
    3. Tax calculation didn't work. It didn't matter what information the customer put in about taxes, it was simply never calculated.
    4. A shopping cart system was built for "buying" ads for your site. If you were a publisher that is, you would go through all ads that advertisers put on the site and selected which ones you wanted. No categories, no tags, nothing, just page after page of ads.
    5. He didn't allow customers to change any code, at all, or take suggestions from them. Zend encoder pretty much guaranteed that the average customer wouldn't be making any changes to the site. All member updates, price changes, etc were emailed to him.
    6. There was a file for each and every function in most cases. For example in the administration area the "FAQ's" manager as he called it (because apparently FAQ isn't already plural and it's taking ownership of something) there was a file for listing FAQ questions/answers and so forth: faq.php, faq_add.php, faq_delete.php, faq_edit.php, faq_update.php
    7. There was no version tracking or anything, there was an FTP server on the boss' computer, and everything had to be edited that way.

    The end came

    I fixed only about 25% of the things I listed above and most were minor things. For the most part all of these things went unfixed. Like I said the project was 2 weeks overdue and I only got work on it a week, and the first part of that week was just trying to figure out how the hell it even managed to work at all, much less incorrectly.

    He sold the project to the client at full price, and to about 20 other people. The price tag was around $8,000 for this. Customers started calling constantly about problems, but he ignored all calls, emails, and so forth. Originally I had asked him if we could just start over from scratch and he went on a tirade about how "No one else has a problem programming here but you, I think you are the worst programmer we have.

    He then gave me another project that was nearly 2 months overdue, and had been worked on some, and was equally horrific - it was a site for a small bank. I asked to start over from scratch or I was quitting. He told me to quit, basically calling my bluff, so I got ready to leave and he went on this long spiel about how he would sue me if I ever said anything to anyone about his projects or "sold [his] source code, because [he] has patents on ALL of it" (yeah, right).

    Well, I've told everyone I know about how terrible this guy was, and he's been out of business over a year now, and that makes me happy. I never made any money from his code, nor did I think I would. Quitting without any job prospects sucked, but I managed to score a job cleaning up human shit for a few months until I landed another programming job.



  •  Candidate for Best of the sidebar IMHO.



  • Front page worthy I'd say - well written for a sidebar post, thanks for making the effort!



  • You forgot the <joke> tags around that human shit thing, right?



  • @ounos said:

    You forgot the <joke> tags around that human shit thing, right?

    Yeah, it was actually a job cleaning up human foetuses.

     

    Zing! 



  • @morbiuswilters said:

    @ounos said:

    You forgot the <joke> tags around that human shit thing, right?

    Yeah, it was actually a job cleaning up human foetuses.

     

    Zing! 

     

    Actually it wasn't a joke. I got a job with this guy I knew who cleaned out port-o-potties. At the time I was living in Alabama, and they're about 10-15 years behind the rest of the country (except maybe Mississippi) and it was hard to find any computer related jobs. I picked the shit job instead of working for Geeksquad.



  • @helpfulcorn said:

    Actually it wasn't a joke. I got a job with this guy I knew who cleaned out port-o-potties.

    Right.  Like I said: a job cleaning up human foetuses.



  • @helpfulcorn said:

    I picked the shit job instead of working for Geeksquad.


    I just wanted to quote this. Huge line. Thanks for sharing!



  •  Gotta agree with the "best of the sidebar" assessment here.



  •  +1 for "best of the sidebar"



  • Baby Jesus has run out of tears and is now sobbing gently into his vodka glass.



  • Thanks for that. Your post was better than half of the articles 🙂

    I usually only take jobs at places where I've had some sort of exposure to the people there before hand, but then again I live in a fairly techy city so there's a lot more available...



  • Jesus... you should have spread this out over several posts. Like this it's in danger of collapsing under its own weight forming a WTF singularity that will destroy the world. 



  • @helpfulcorn said:

    Actually it wasn't a joke. I got a job with this guy I knew who cleaned out port-o-potties. At the time I was living in Alabama, and they're about 10-15 years behind the rest of the country (except maybe Mississippi) and it was hard to find any computer related jobs. I picked the shit job instead of working for Geeksquad.

     

    Oh man, I thought about posting the sewage truck WTF I saw the other day, but I thought it'd be off-topic. Sounds like I may have gotten some expert commentary!

     

    But seriously, how did you manage with that on your CV/resume?

     

     

     



  •  @Chuck Mango said:

    Oh man, I thought about posting the sewage truck WTF I saw the other day, but I thought it'd be off-topic. Sounds like I may have gotten some expert commentary!

    But seriously, how did you manage with that on your CV/resume?

    How did I manage to get another job with that on my resume or how did I manage to get that job with my resume? Well, regardless, I just don't have it on my resume and also a friend of mine's father owned a small business that did it, and I got a job through him.



  •  @helpfulcorn said:

     @Chuck Mango said:

    Oh man, I thought about posting the sewage truck WTF I saw the other day, but I thought it'd be off-topic. Sounds like I may have gotten some expert commentary!

    But seriously, how did you manage with that on your CV/resume?

    How did I manage to get another job with that on my resume or how did I manage to get that job with my resume? Well, regardless, I just don't have it on my resume and also a friend of mine's father owned a small business that did it, and I got a job through him.

     

    I was thinking 'poop pumper' on your resume would hurt your chances of getting another IT job, as would an employment gap if you omitted it. If you knew the guy I guess you could come to an agreement.

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.