Prior to PHP 5.x the language lent itself to writing terrible code that got the job done but little else. Consequently lots of very, very bad (unmaintainable, unreadable, overly complex, spaghetti code, untestable, and generally slow) PHP apps exist (I say that as a PHP coder with more than 10 years experience in it). The thing is though, as bad as the language is, the problems are really down to the developers - you
can write good PHP code and you have been able for a few years. Some frameworks (CodeIgnitor, Laravel, etc) actually push you towards writing reasonable decent code - as much as Rails (Ruby) or Express (Node) at least.
I suspect if there were as many Ruby devs as there are PHP devs you'd have just as many articles decrying Ruby, when they really ought to be decrying bad developers regardless of language.