88
ultrono
67d

So, rage time.

A few months ago I inherited a big Wordpress website, with around 750 pages.

The client has reported the main menu is broken.

Upon looking at the code it appears the previous "Wordpress Developer" (ahem ...) attempted to rewrite navigation system - no idea why.

As part of the 4000 class below is a screenshot of part of the file where he's determining if the current menu item is active, within a loop. Whilst the whole if statement spans 409 lines - the code basically continues exactly the same downwards.

Shameful :/

Comments
  • 35
    What - the - fuck
  • 14
    Kill it with fire.
  • 8
    My eyes are burning T_T
  • 4
    Why....?! :/
  • 12
    Does it really look like a suicidal letter or it's just me.
  • 7
    Beautiful! Absolutely elegant!
  • 5
    You inherited that page because the old dev commited suicide.
  • 21
    That's WordPress for you. Many of my clients had themes that where full of similar bullshit. The PHP code is awful, it's riddled with pointless jQuery crap, PHP and script tags everywhere, repeated markup that should go in templates, pointless nested loops, shitty bootstrap CSS overridden with even crappier 'custom' CSS, …

    After a week, seeing a harmless pencil lying around somewhere will make you randomly consider ramming it your eye, just so you don't have to see the abomination anymore.
  • 4
    lol you should add the wk104 tag to this flaming garbage can full of shit
  • 3
    shred -n 1000 -uxv *
  • 0
    What the fucking fuck?
  • 6
    Is something wrong with me? I really want to look at this entire codebase and see if I can fix it
  • 1
    Well it's broken, no doubt about that 😄
  • 0
    @stisch trust me, you don't :/
  • 5
    I wonder what takes more time: writing this expression or start over with a clean project?
  • 2
    srsly???

    I can not understand why people do something like that... ( besides to make fun of them )

    I am just starting to make first steps with JS, WebDevelopent etc thingy and as I am more used to Python/Bash and I am not used for example the way NodeJS works by design ( async ) I often end up with funny loop/if constructions.
    BUT more for a POC for myself, because there is noooo way at all in any universe that a ugly structure like this is needed to fulfill what I need.

    most of the time I figure out that it comes simply from lack of knowledge and the fact that I write "the way I think" which is not applicable in all situations while coding ...

    so seeing something like this should be a big fat slap in your face, telling you to read docs to make that work within probably 2 lines of code instead of 200
  • 1
    so uh

    they really like to "get the ID" huh?
  • 3
    @Rohr ofc no one should make fun of beginners. Instead we should help them. But point is that dev was paid(I'm assuming he was) so he's considered as a professional with some experience in writing code that's elegant and works. From a consumer POV I wouldn't want to pay someone to write my website that doesn't render/work
  • 2
    @silverstar I totaly agree and I am on your side with that! It was not my intention to insult or mock on/about someone. I am considering myself as a beginner ...
    So there I absolutelly no point in making fun of others !

    Sorry If that came out the wrong way!

    My point was, that when I am writing a statement like in this rant that spanns over 400 lines, my little duck should give me a doubtful look to remind me that there might be a better way of archiving this.

    Again, sorry that I did not make that clear right upfront.
  • 0
    It hurts
  • 1
    @Rohr possibly I understood your point wrong. Possibly the rubber duck killed itself even before it was able to give that doubtful look. :P
  • 2
    @silverstar unfortunately not a beginner. It was a freelancer that was paid upwards of £8k for the site.
  • 0
    Damn it suddenly came back to me, why I got out of WordPress dev...
  • 1
    Times like this that I don't wanna defend WordPress nor PHP. It's not the CMS, framework nor the language fault. However when the said tools have write-as-you-like freedom, what do we expect? Most of the times, it's just some advanced monkeys with monitor and keyboard using those tools.
  • 1
    @cursee the big problem with WordPress is the low entry barrier. Compare that to say magento where there is an initial learning curve and you suddenly get, in general, more experienced developers using and extending it.
Your Job Suck?
Get a Better Job
Add Comment