[wp-trac] [WordPress Trac] #23880: Minimum PHP version in Plugins
WordPress Trac
noreply at wordpress.org
Sat Mar 30 16:22:06 UTC 2013
#23880: Minimum PHP version in Plugins
-----------------------------+------------------------------
Reporter: TJNowell | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version:
Severity: normal | Resolution:
Keywords: |
-----------------------------+------------------------------
Comment (by bpetty):
Replying to [comment:25 TJNowell]:
> Performance wise, doing it in Core would be better. Instead of every
plugin checking itself, repeating the check over and over again, Core
should do it all at once
This doesn't have to be in core to be efficient and optimized, you can
cache this in your plugin too. In fact, there's really nothing that needs
to be cached, just check the PHP version like you would anywhere else you
needed a fallback because a new PHP function wasn't available to you.
Besides, in reality, most plugins do support PHP 5.2. It's actually a rare
few that have decided they can't handle the same requirements that
WordPress has chosen to work with.
> * Nobody actually justified this
Nobody has to. WordPress has chosen to support PHP 5.2 because that's what
most people are still using, and it's not hard to support. That choice was
already made for you when you decided to write a plugin for WordPress. If
you want to call your plugin a "WordPress plugin", it should support the
same requirements WordPress supports. Core shouldn't have to go out of
it's way to ensure that plugins can implement additional server
requirements that WordPress doesn't require itself. That's the very
definition of an "extended" feature - which should be implemented in your
plugin.
No one is saying you have to support 5.2, just that WordPress does (and
would obviously recommend you do too), and as such, this isn't something
we actually want to implement in core because we don't want to encourage
plugin developers like yourself to write incompatible plugins if you don't
actually have to.
> * Not all WordPress installs run the latest version, and thus not all
installs have the 5.2 min req yet ( though this is a problem in its own
right )
That, on the other hand, is exactly why plugins do have "minimum WP
version required" and "tested up to" header fields. It should be enough
for users of your plugin to know that they have the correct version of
WordPress, and not have to look up anything else (since they should have
already done so when they installed or upgraded WordPress).
> * Not everyone is aware fo what PHP is capable of and which version
introduced what. We're not all experts, and developer X may have used
namespaces not knowing they required 5.3
On the contrary, all PHP developers are very aware of this, and if not,
they shouldn't be calling themselves a PHP developer. In fact, every
single feature and function in PHP very clearly states what version of PHP
it is available in from the documentation.
Besides, if they don't know, how are they supposed to know that they
should be marking their plugin as 5.3+ anyway?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23880#comment:27>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list