WordPress Bumps PHP Maximum for Plugin Directory to Version 7.2

PHP Maximum for Plugin Directory

PHP Maximum for Plugin Directory

The WordPress.org SVN framework got an adaptation knock to 7.2 on October 3. This change means that plugin authors can now use newer PHP syntax in plugins they submit to the official plugin directory. In the future, the version maximum will match what’s running on WordPress.org.

This should be good news for any plugin developers who are using newer PHP syntax. Previously, authors were able to submit code using newer PHP functions if they had a compatibility check in the same file. However, newer syntax wasn’t allowed.

“The issue was that the Linter (being stuck on 7.0) prevented anyone from checking in code via SVN that used 7.1+ standards,” said Mika Epstein from the plugin review team. “So things like the Spaceship operator would fail on commit and you’d be told the syntax was invalid. This was holding back certain plugins from committing code into the directory.”

Epstein first opened a ticket to address the issue 13 months ago but said she’d been quietly asking for a fix for a while longer.

The maximum PHP rendition isn’t recorded anyplace in the module rules. Technically, it’s an SVN limitation on WordPress.org and not something the plugin team chose. However, for plugin authors, they may not have known about the issue until their plugin was rejected by the system. They would then message the plugin team about the problem. “I may end up putting something in the docs, but it’s a somewhat uncommon occurrence,” said Epstein.

This has been an issue for some module creators since PHP 7.1 was discharged, which was December 1, 2016. “It was a once a year issue, then twice, and then it inched up to every couple months,” said Epstein. “As of September, at least once a month someone would hit this and complain to plugins.”

One potential problem with blocking newer PHP code is with plugins that rely on third-party libraries, which may only have security patches in more recent versions. However, Epstein said that she was not aware of any security issues that resulted from the version limitation.

Andrey “Rarst” Savchenko pointed out in the ticket that “7.2 was released almost two years ago.” While he says it’s an improvement over the previous 7.0 limitation, version 7.2 should not be a hard roof for modules in the archive.

PHP 7.3 was discharged on December 16, 2018, and PHP 7.4 will be discharged on November 28, 2019.

“Given PHP’s poor adoption curves,” responded Dion Hulse, “all that this means is that you can’t release a plugin through WordPress.org that only works on 15% of WordPress sites. “You can even use newer functions in PHP if including compat code, just not newer syntax.”

Plugin creator Josh Pollock called attention to the issue on Twitter in February. “Hours later, I’m downgrading a dependency, because it requires another dependency, which requires PHP 7.1.”

“I think we got lucky and there were no bugs,” Pollock said of downgrading to an earlier version of the dependency. “I don’t think I’ve used SVN since. I’m really fortunate that’s not a part of my life anymore.”

“I agree with Rarst,” said Pollock. “We ought to take into account PHP 7 and making it simpler for modules not to help destinations on outdated variants of PHP.” This echoes the assessment of other developers who are pushing for WordPress to adopt newer standards or at least allow them to do so in their own plugins in the official directory.

For most of the module creators, this ought to be a non-issue as long as the SVN framework remains refreshed to coordinate the form of PHP utilized on WordPress.og.

Leave a Reply

Your email address will not be published. Required fields are marked *