News for hackers. Stuff that matters.
Re:A Crash-Course in PHP Namespaces for WordPress Developers by smacktoward on Monday May 07, 2018 @05:03PM (#17016472)
> if upgrading to PHP 7 is going to break the shitty old version, that's a problem too

The problem is that PHP 7 finally removed some legacy APIs that had already been deprecated for an eternity. The removal wasn't a bad decision in and of itself, but there's a non-trivial amount of code in the wild that still uses those ancient APIs, either because it was written more than a decade ago before they were deprecated, or because it was written by people who either didn't understand what "deprecated" means or didn't care. So when that code moves from 5 to 7, it breaks.

WordPress core is developed by smart people who stay on top of changes in the language they work in, so moving to 7 wasn't a problem for WP itself. It was a problem for lots of WP themes and plugins, however, since there's lots of those that were written and then abandoned before 7 was a thing, and even some that were written by people who knew 7 was coming and just didn't understand why they should care.

If I were going to suggest one thing WordPress itself could do/have done to make the transition less rocky, it would be to require PHP 7 compatibility for plugins and themes distributed through the official repositories at wordpress.org. Currently that's not a requirement -- there's not even a way to filter out PHP 7 compatible plugins and themes from the ones that are stuck on 5. So unsophisticated users are still getting recommended software by those repositories that will break if you run it in a modern PHP environment.

(You can avoid this problem somewhat by looking for other heuristics that correlate well with PHP 7 compatibility -- actively updated plugins will tend to be compatible, well-reviewed plugins will tend to be compatible, etc. But you can't just ask directly for plugins that will work with PHP 7, which is a shame.)

There are no comments on this comment yet.