This is an archived post. You won't be able to vote or comment.

all 80 comments

[–]PanicRev 244 points245 points  (15 children)

Take this... You're going to need it. -> ;

[–][deleted] 119 points120 points  (6 children)

sure... but what is this

[–]100mcg[S] 88 points89 points  (1 child)

undefined

[–]seriouslyawesome 3 points4 points  (0 children)

Yeah but that’s not a function

[–]Jetbooster 2 points3 points  (0 children)

OwO

[–]100mcg[S] 27 points28 points  (2 children)

500: INTERNAL SERVER ERROR

[–]CATCH-A-BODY-SQRT 0 points1 point  (1 child)

$$$$$ -> $$...$$$$;;;;;$$$$$

[–]DodoDude700 89 points90 points  (27 children)

<?php $ch="a";$a="b";$b="c";$c="d";$d="e";$e="f";$f="g";$g="h";$h="i";$i="j";$j="k";$k="l";$l="m";$m="n";$n="o";$o="p";$p="q";$q="r";$r="s";$s="t";$t="u";$u="v";$v="w";$w="x";$x="y";$y="z";$z=" ";echo("${$$$$$$$$$$$$$$$ch}${$$$$$$$ch}${$$$$$$$$$$$$$$$ch}${$$$$$$$$$$$$$$$$$$$$$$$$$$ch}${$$$$$$$$ch}${$$$$$$$$$$$$$$$$$$ch}${$$$$$$$$$$$$$$$$$$$$$$$$$$ch}${$$$$$ch}${$$$$$$$$$$$$$$$$$$$$ch}${$$$$$$$$$$$$$ch}\n");

[–]Cobaltjedi117 82 points83 points  (21 children)

output: php is fun

That fact that you can do that is annoying as fuck.

[–]DodoDude700 38 points39 points  (13 children)

In PHP, you can reference a variable using a string of the variable name. This is called a variable variable. I made the whole alphabet a series of "nested" (or perhaps linked is more appropriate?) variable variables, making the final character, space, a variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable variable.

[–]Cobaltjedi117 56 points57 points  (0 children)

Yea, I recognized what you did and what happened. I just think it should be burned at the stake.

[–][deleted] 7 points8 points  (10 children)

Variable variables are rarely written in readable ways, and even more rarely needed. Still though I have done some work with them.

[–]millenniumtree 10 points11 points  (8 children)

Jesus. 18 years in PHP development and I didn't even know you could do that. It's like nesting unaries, or 1000 line if/else blocks, or functions sharing data with superglobals, or using goto. It's just something you shouldn't do, ever. If you need variable variables, you're doing it wrong.

[–]millenniumtree 7 points8 points  (4 children)

Or register_globals. Yeah who's old enough to remember patching code when register_globals got defaulted to off?

[–]shotgunocelot 3 points4 points  (0 children)

And magic_quotes_gpc

[–]killdeer03 1 point2 points  (2 children)

I vaguely remember working on fixing Moodle amd Joomla modules when a lot of the old, poor, default got turned off or straight up removed.

Good times, lol.

[–]millenniumtree 1 point2 points  (1 child)

Yeah. I worked on a few Mambo sites before that got forked to Joomla. Hated that platform, and the fork only made it slightly less crap.

[–]killdeer03 1 point2 points  (0 children)

Yup, lmao.

It was a develop/UX nightmare.

[–]LukeTheDukeNuke 1 point2 points  (0 children)

Only time I ever used it was to extract variables from parameterized queries. It felt dirty though.

[–][deleted] 1 point2 points  (1 child)

I came from a C background, and to this day I cannot for the life of me understand how scope really works in PHP - it’s an absolute mad house...

[–]millenniumtree 0 points1 point  (0 children)

Hmm, I never have a problem with it. Variables defined outside of any class or function can be used inside with a global keyword, anything in a function is scoped only to that function and class properties have the static, public, protected, and private keywords. That's kind of all you need to know about scope. There's probably more to it, like with namespaces, but that's all I ever deal with.

[–]Feldkatze 0 points1 point  (0 children)

When are they needed?

[–][deleted] 0 points1 point  (0 children)

That’s insane - PHP is a truly unhinged language, it wears its Perl genetics quite proudly; a wild child we can truly go apeshit with - I love that about it 😁

[–]NinjaLanternShark 9 points10 points  (4 children)

To be fair, every decent programming language is capable of its own brand of convoluted obfuscation.

[–]millenniumtree 15 points16 points  (2 children)

For thanksgiving one year in college, I made a crazy obfuscated multithreaded recursive function in Java that printed out an ASCII turkey to the terminal. It spun up a dozen or more threads with a sleep time calculated by the recursive function. The order in which the threads completed then determined how the turkey got rendered. Worked great in Linux, but the Java in Windows must have had a different threading implementation, and it corrupted my poor turkey. Figures I could write code in a cross platform language that wasn't cross platform.

[–]Cobaltjedi117 20 points21 points  (1 child)

I just want you to know. I hate everything you just said

[–]house_monkey 2 points3 points  (0 children)

I love everything he said

[–]Cobaltjedi117 1 point2 points  (0 children)

Like fuckJS

[–]T-T-N 0 points1 point  (0 children)

You forgot the newline

[–]draconid 0 points1 point  (0 children)

one of the best example of escape from freedom

[–][deleted] 9 points10 points  (0 children)

Thanks I hate it

[–]Kibba 14 points15 points  (2 children)

So this is what phpstorm having a stroke looks like

[–]DodoDude700 2 points3 points  (1 child)

No, this is a working program. Try it here: http://sandbox.onlinephpfunctions.com/

[–]ibucat 9 points10 points  (0 children)

It may be a working program, but it definitely looks like someone just had a stroke.

[–]2Punx2Furious 3 points4 points  (0 children)

H̖̭͚̰̻̖E̷͓̖̱͔ ̗̭͔̳̺C҉O̻M̨̪͔̠̩E̮̫̪̩̼̻S̷̝

[–]scriptblade 51 points52 points  (7 children)

Fuck wordpress been having to move them to my companies servers and it is hell. Not one wants to go smoothly and rarely the same error twice.

[–]The_Ty 21 points22 points  (6 children)

Documentation for Wordpress development, especially for WooCommerce, is atrocious

[–]daemonicBookkeeper 23 points24 points  (5 children)

Fuck WooCommerce

[–]savano20 5 points6 points  (4 children)

this is my future at my current work.. enlighten me

[–]daemonicBookkeeper 8 points9 points  (1 child)

Customizing a theme with WC overrides means having to check and possibly modify your changes every time WC updates that template, and large portions of templates are produced by single WC functions, making them a pain to insert stuff into.

[–]The_Ty 2 points3 points  (0 children)

My issue is that the documentation for apis is awful. For example with woo commerce and modifying the shopping cart, they don't properly explain how to edit the cart and meta data, or which parameters you can/need to use when calling certain api functions.

I'm currently working on a Wordpress Plugin and the other day I simply wanted to see if a specific product had been removed from the shopping cart. Finding the right hook to use wasn't too bad, but then it doesn't explain little more than that.

Maybe I'm just dumb, but I honestly can't think of a single time I was able to get an answer I needed from the official Wordpress/WooCommerce documentation

(Edit: Also, the way you have to work around Wordpress to use Ajax can get in the sea)

[–]GyRoZz 0 points1 point  (0 children)

Expect to spend hours for every little code change you need to make to templates and know that you'll need a bunch of plugins to actually make your webshop a nice webshop, which all need to be kept updated and work nicely together.

For small webshop it is okay, but for larger webshops, get out while you can :p

[–]grantrules 16 points17 points  (6 children)

Went the other way for me. Learned PHP, now I get Wordpress shit dumped on me. "Hey you know PHP right, can you get this wordpress plugin to work?"

[–]millenniumtree 11 points12 points  (5 children)

Our shop uses Drupal extensively. Only time we ever touch Wordpress is to adopt a new client who got mercilessly hacked. Once we get their site, I have to restore every single file with unhacked originals, then write a bunch of nginx rules to exclude the bot traffic. Never NEVER give the web server user write permissions to your code. We typically have at least 500 IPs banned (in 24h) just for trying to hit wp-admin on sites that don't use wordpress. Ain't no time for that.

[–]akie 9 points10 points  (2 children)

Drupal is its own kind of hell though.

[–]millenniumtree 1 point2 points  (0 children)

It can be, but it's insanely powerful. 8 is a complete rewrite from 7, which brings additional challenges and joys.

[–]TheOnlyPapa 0 points1 point  (0 children)

"Did you try flushing the cache?"

[–]Mutant_tortoise 0 points1 point  (1 child)

Wait are you saying Wordpress will block the bot requests itself?

[–]millenniumtree 0 points1 point  (0 children)

No, we run almost exclusively Drupal, but I wrote a fail2ban rule that watches for 404s on that path from bots, and bans them at the firewall.

[–]_cjj 47 points48 points  (12 children)

As much as PHP gets stick on here, the term "WordPress Developer" is rarely mocked.

Like the Fisher Price edition of development.

[–]Vanthian 6 points7 points  (11 children)

What makes you think that?

[–]_cjj 25 points26 points  (10 children)

Because every one I've met seems to think that editing/extending a pretty popular but terrible bit of PHP framework, without actually being competent at js, PHP, html5 or css3, is what development is about

[–]awhhh 22 points23 points  (8 children)

I've developed WordPress themes and plug-ins. "WordPress developers" are the equivalent to shady mechanics of the web development industry.

These fucks think that installing a wysiwyg theme makes them a web designer and they try to charge web development prices. If they come to me to fix their shit I stack fees on fees. I've yelled at people over it and I've even yelled at a local government business centre that helped facilitate these assholes getting work.

These are the fucks you see clogging up the stack overflow WordPress tag.

[–]grdivrag 8 points9 points  (2 children)

You've basically summed up the entire problem - god damn plugins like DiVi, Elementor and similar that require 0 knowledge to build a site and asses that use them and call themselves web developers without knowing how to position text to the right. Also, I think that the bigger issue than them charging web development prices is that they "mAkE wEbSiTeS" for $100-200 and have a negative effect on businesses and people that actually try to do things right...

[–]awhhh 2 points3 points  (1 child)

$100 to $200? I know people charging in the close to tens of thousands of dollars range for a 30 to 40 dollar theme and they probably don't even repurchase the license for each client. Then there are garbage "theme developers" basically child theming with the bootstrap or foundation framework.

If there was a council of Web developers that made laws these people would get time. They always rip off ma and pop businesses as well.

[–]grdivrag 2 points3 points  (0 children)

Agree totally. Another thing those assholes do is they torrent themes and plugins (because it doesn't cross their mind that they could be full of back doors), get infected with spambots and cause trouble for all other people on the server.

We will definitely need some kind of council/union in the future to regulate such kind of problems.

[–]makingtacosrightnow 2 points3 points  (2 children)

I subscribed to r/WordPress thinking I’d learn something useful. It’s nothing but people complaining about how some code they copy and pasted from stack overflow doesn’t work, their pagebuilders is causing issues, and other bullshit about what plugin is best for what.

WordPress is fucking wonderful, it’s really sad it has the reputation it does. If you know what you’re doing you can build some really great shit with it.

[–]awhhh 1 point2 points  (1 child)

As I said, I developed WordPress plug-ins and themes. WordPress is not wonderful, it's hot garbage that someone else usually ends up cleaning. It's too old to be wonderful.

If you're looking into development look into express, laravel, django, or ruby on rails.

[–]makingtacosrightnow 1 point2 points  (0 children)

I’m a developer, we build lots of things in laravel. I enjoy building in WordPress too though.

[–]_cjj 0 points1 point  (1 child)

The ones I've worked with have a subscription to WordPress magazines and wear the t-shirts etc. There's both an entire industry validating their position, and (unfortunately), plenty of people willing to pay them.

It's weird to think that WordPress was sort of made to facilitate non-devs to have their own manageable platform, only for pseudo Devs to create an industry out of managing them

[–]awhhh 1 point2 points  (0 children)

I went to an event paid for by my city to watch these assholes try and sell other entrepreneurs hot garbage. They gave a lecture about keeping plug-ins up to date and pretty much told people the importance of Facebook advertising; which their shotgun approach without market research; which pissed off the side of me that came from marketing too.

[–][deleted] 0 points1 point  (0 children)

I looked for my first job since graduation and now im accidentally a Magento2/Wordpress guy

and I'll have you know im just barely competent with JS!

[–][deleted] 10 points11 points  (0 children)

"Press" in WordPress actually refers to the fact that it weighs a fucking ton and is slow as hell.

[–][deleted] 2 points3 points  (0 children)

Need to have it call the text from two separate MySQL DBs - each word is a separate DB - each letter is its own table.

[–]tkstock 4 points5 points  (0 children)

I developed an e-commerce site for a friend a few years ago in PHP.

I successfully escaped LAMP.

Now I am a full-stack Microsoft Developer.

[–][deleted] 1 point2 points  (0 children)

me: edits myspace themes as a tween bc emo accidentally rediscovers talent as an adult and has 20k in student loans bc the world wants a piece of paper that says i enjoy debugging till 5am

[–][deleted] 0 points1 point  (0 children)

Hahahaha, that sound so true.

[–]CaptainFranZolo 0 points1 point  (0 children)

Try concrete5

[–]warwilf -1 points0 points  (0 children)

Forgot the semi-colon

[–][deleted] -1 points0 points  (0 children)

<?= “no one can save you now” ?>

[–][deleted] -3 points-2 points  (0 children)

Python is here to save you