TGMPA / TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
http://tgmpluginactivation.com/
GNU General Public License v2.0
1.75k stars 431 forks source link

Is PHP version Required handled? #745

Open joyously opened 6 years ago

joyously commented 6 years ago

Has this been updated to check the new plugin header field for Requires PHP? See Trac tickets: https://core.trac.wordpress.org/ticket/43986 https://core.trac.wordpress.org/ticket/43987 https://core.trac.wordpress.org/ticket/44350

jrfnl commented 6 years ago

@joyously How do you mean ? For the installing/activating, TGMPA defers to the WP core code to handle that, so if core won't install/activate a plugin because of a PHP requirement, TGMPA won't either.

Or do you mean the user interface of TGMPA ?

joyously commented 6 years ago

Yeah, I didn't read all the code, so I didn't know if TGMPA was doing the actual install or not. But if not, there is still the message to display. The tickets I mention are just doing user interface, not preventing installation. I still think the block should be at activation, not installation, but nobody else seems to agree.

jrfnl commented 6 years ago

Ok, I understand and yes, we would certainly accept a patch for that.

I still think the block should be at activation, not installation, but nobody else seems to agree.

Not nobody ;-) I think the block should be on both, i.e. prevent people installing a plugin they won't be able to activate and also - if people have uploaded a plugin via FTP or something - prevent it from being activated if it wouldn't work anyway.

joyously commented 6 years ago

prevent people installing a plugin they won't be able to activate

That's the part nobody seems to agree with me on. If you are preparing to upgrade PHP, you would want to install plugins ahead of the upgrade so there is less down time. And the way they are showing the compatibility warnings, after the upgrade you won't be able to distinguish which plugins are incompatible. It needs the range of versions from Tide, instead of just the minimum PHP version from the plugin header. So it makes more sense to only block activation, not installation (or update).

jrfnl commented 6 years ago

@joyously I think some serious discussion should be had about blocking updates too as a plugin may change the required PHP version at some point during its lifetime and upgrading the plugin when not on the right PHP may bring the whole website down.

joyously commented 6 years ago

Yes, there is a ticket for it. In my mind, it would behave differently it it's activated or not. I think it's OK to update if it's not activated, because it's the same scenario as installing before a PHP upgrade (get the latest update before upgrade). If it's activated, then it's a case of "Do you go through the manual steps of deactivate, update, activate?", because that brings you back to catching it on activation. So, a warning ahead of time is good, but let the user decide what to do.