Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a plugin with a nag message to update PHP #11498

Closed
wants to merge 12 commits into from

Conversation

@mbabker
Copy link
Contributor

mbabker commented Aug 6, 2016

Summary of Changes

Far too many people run Joomla on outdated PHP versions (per the stats only 37% of Joomla! 3.5+ installs are on a currently supported PHP version). To help alleviate this, I propose a nag message to tell people to upgrade.

This plugin checks three conditions: whether the PHP version is still fully supported, whether it has entered security support only, or whether it is unsupported by the PHP project. I don't particularly care whether the user is running a PHP version custom compiled by some Linux distro that claims they are still supporting it; if PHP isn't supporting the branch anymore they need to update.

Testing Instructions

Apply the pull request; discover, install, and enable the plugin. For PHP 5.3 thru 5.5 you should get a red error message telling you the PHP version is unsupported and you should upgrade yesterday. PHP 5.6 and 7.0 won't emit anything because neither has reached a security only state, however if you want to test that aspect of things go into the plugin and change the date for when security support ends in the data array to a date before today (today being whatever day you test this).

Documentation Changes Required

None. No new API is introduced.

Maintenance Efforts Added

As the support dates for PHP branches change (new versions added, dates postponed), the data array in this plugin will need to be updated. Generally this is a once a year requirement when a new version is added only.

Joomla, Stop Nagging Me!!!

Upgrade, plain and simple. Oh, not an option? As long as you understand you are running unsupported software, you can disable the plugin and stop being nagged. But you should still upgrade yesterday.

; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_PHPVERSIONCHECK="System - PHP Version Check"
PLG_SYSTEM_PHPVERSIONCHECK_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Please contact your host for upgrade instructions."

This comment has been minimized.

Copy link
@brianteeman

brianteeman Aug 6, 2016

Member

i am concerned that non technical users dont know what php is. in the other message you say "by the PHP project."
Can you change this message to
"s only receiving security fixes at this time from the PHP project."

@brianteeman
Copy link
Member

brianteeman commented Aug 6, 2016

i am concerned that non technical users dont know what php is.

@brianteeman
Copy link
Member

brianteeman commented Aug 6, 2016

It would be beneficial if this explained the benefits of upgrading the php version and how easy it usually is

@mbabker
Copy link
Contributor Author

mbabker commented Aug 6, 2016

i am concerned that non technical users dont know what php is.

Well without turning this into a full screen notification, hard to really explain it. Totally valid concern, but not easy to deal with. Unlike other projects who encourage users to not need to be technical, I think it's borderline irresponsible to not at least know what platform(s) your site is running on.

@brianteeman
Copy link
Member

brianteeman commented Aug 6, 2016

I live in the real world not the technical world. ;)

If you dont explain the benefits or how easy it usually is to upgrade we will lose users who just assume their hosting doesnt support joomla.

I am not against this concept just the implementation

@mbabker
Copy link
Contributor Author

mbabker commented Aug 6, 2016

Suggestions welcome. I'm just trying to keep this from becoming a full screen notification.

@brianteeman
Copy link
Member

brianteeman commented Aug 6, 2016

We highly recommend upgrading your server to a newer PHP version. Please contact your host for upgrade instructions."

==>

Joomla will be faster and more secure if you upgrade to a newer PHP version (preferably 7.x). Contact your host - they can usually do this for you very easily.

@brianteeman
Copy link
Member

brianteeman commented Aug 6, 2016

For reference our previous message was

COM_CPANEL_MSG_PHPVERSION_BODY="Beginning with Joomla! 3.3, the version of PHP this site is using will no longer be supported. Joomla! 3.3 will require at least <a href="QQ"http://community.joomla.org/blogs/leadership/1798-raising-the-bar-on-security.html"_QQ_">PHP version 5.3.10 in order to provide enhanced security features to its users."

; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_PHPVERSIONCHECK="System - PHP Version Check"
PLG_SYSTEM_PHPVERSIONCHECK_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time from the PHP project. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Please contact your host for upgrade instructions."

This comment has been minimized.

Copy link
@brianteeman

brianteeman Aug 6, 2016

Member

can you add this sentence to this string as well

Joomla will be faster and more secure if you upgrade to a newer PHP version (PHP 7.x is recommended).

@zero-24
Copy link
Member

zero-24 commented Aug 6, 2016

The new language files needs to be added to the install.xml ;)

@zero-24
Copy link
Member

zero-24 commented Aug 6, 2016

And the update sql ;P

@mbabker
Copy link
Contributor Author

mbabker commented Aug 6, 2016

And the update sql ;P

What update SQL?

@zero-24
Copy link
Member

zero-24 commented Aug 6, 2016

That it get enabled on update. The update sql in com_admin :)

@zero-24
Copy link
Member

zero-24 commented Aug 6, 2016

Ignore that i have just not saw it. Sorry

@roland-d
Copy link
Contributor

roland-d commented Aug 6, 2016

Should this message be shown to super users/administrators only perhaps? We may assume they know what PHP is.

@mbabker
Copy link
Contributor Author

mbabker commented Aug 6, 2016

Should this message be shown to super users/administrators only perhaps? We may assume they know what PHP is.

Even that's an overly broad assumption.

@brianteeman
Copy link
Member

brianteeman commented Aug 6, 2016

@roland-d
Copy link
Contributor

roland-d commented Aug 6, 2016

In that case just show it to everyone and they can google what PHP is.

@brianteeman
Copy link
Member

brianteeman commented Aug 6, 2016

@mbabker
Copy link
Contributor Author

mbabker commented Aug 6, 2016

Right now it shows on the backend to everyone similarly to the 2.5 EOS plugin.

@andrepereiradasilva
Copy link
Contributor

andrepereiradasilva commented Aug 6, 2016

i don't have any server to test this since my servers php version are all 7.x ... ok. that it's probably good news 😄

@infograf768
Copy link
Member

infograf768 commented Aug 7, 2016

Should be tagged to New Feature I guess.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11498.

@alikon
Copy link
Contributor

alikon commented Aug 7, 2016

its a little bit too much nag in this way
toomuch

@AlexRed
Copy link
Contributor

AlexRed commented Aug 7, 2016

I have tested this item successfully on 866376b


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11498.

@mbabker
Copy link
Contributor Author

mbabker commented Aug 7, 2016

I will change it to be consistent with the 2.5 EOS plugin to only show on the control panel.

I will NOT add a session counter.
I will NOT change the error type. I will add how the 2.5 EOS plugin is rendered as an error message as additional justification for this stance.

If that will preclude this being merged I'll just close this. I'm taking a stand on what I believe is the correct approach to this.

@nikosdion
Copy link
Contributor

nikosdion commented Aug 7, 2016

@PhilETaylor
Copy link
Contributor

PhilETaylor commented Aug 7, 2016

Just have balls and commit this without watering it down - listen to those of us that have to deal with the idiots on PHP 5.3 on a daily basis...

It should be in your face, in red and bold, on every page and un-dismissable.

@ggppdk
Copy link
Contributor

ggppdk commented Aug 7, 2016

If that will preclude this being merged I'll just close this.

this plugin / message is needed for reasons already discussed, nobody said not to add this

I will NOT add a session counter.

Only a suggestion if this is to be displayed in non-control panel pages

  • why i suggested it , because imagine that a website is upgraded to newer PHP e.g. after 2 days or 2 weeks, people will see it for 2days or 2 weeks in all backend pages ? while working in site's backend for hours everyday ? or did you say to only show it at control panel area ?
@andrepereiradasilva
Copy link
Contributor

andrepereiradasilva commented Aug 7, 2016

Ok, i see you all prefer the error aproach. since this is the current practice (2.5 EOL, joomla update notification, extension updates notification) is consistent, so fine by me.

@mbabker i have just one question, what happens when php 7.1 is released/used.

@@ -135,6 +135,7 @@ private function getPhpSupport()

// Check the PHP version's support status using the minor version
$activePhpVersion = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;
$activePhpVersion = '5.3';

This comment has been minimized.

Copy link
@wilsonge

wilsonge Aug 7, 2016

Contributor

Nope?

@mbabker
Copy link
Contributor Author

mbabker commented Aug 7, 2016

@mbabker i have just one question, what happens when php 7.1 is lanched/used.

The checks default to the PHP version being supported so messages aren't rendered for unknown versions. When a PHP version isn't found in the array, then it takes no action (we don't have data on the PHP version so we err on the side of caution and do nothing), specifically this line.

@mbabker
Copy link
Contributor Author

mbabker commented Aug 7, 2016

because imagine that a website is upgraded to newer PHP e.g. after 2 weeks, people will see it for 2 weeks in all backend pages ?

It's a plugin, disable it if you're tired of Joomla nagging. At least I'm giving you that option and not hardcoding it directly into JApplicationAdministrator's constructor.

@andrepereiradasilva
Copy link
Contributor

andrepereiradasilva commented Aug 7, 2016

ok thanks, will test faking the php versions.

@andrepereiradasilva
Copy link
Contributor

andrepereiradasilva commented Aug 7, 2016

I have tested this item successfully on 3681966

works as described


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11498.

@ggppdk
Copy link
Contributor

ggppdk commented Aug 7, 2016

It's a plugin, disable it if you're tired of Joomla nagging. At least I'm giving you that option and not hardcoding it directly into JApplicationAdministrator's constructor.

yes, after googling
"how i disable annoying message about php version in joomla",

they will find a web page with instructions to disable the plugin,
and then they will forget about it,
and that will defeat the purpose of upgrading the PHP

Too annoying messages are usually turned off and then forgotten

but i looked at the code you have already limitted the display to control panel,
which is very good, because

  • people will see it once at every login
  • now it is unlikely that they will disable the plugin !

in fact i think it is great now !!, i ll test

@mbabker
Copy link
Contributor Author

mbabker commented Aug 7, 2016

but i looked at the code you have already limitted the display to control panel,

Which I think is the wrong move but politics seems to dictate that we can't be excessively annoying in telling users they should be responsible and update their stuff. ¯\_(ツ)_/¯

@wilsonge wilsonge added this to the Joomla 3.7.0 milestone Aug 7, 2016
*
* @since __DEPLOY_VERSION__
*/
private function displayMessage()

This comment has been minimized.

Copy link
@elkuku

elkuku Aug 7, 2016

Contributor

It looks strange that a display* method returns a boolean, I'd call it getDisplayStatus() maybe 😉

Otherwise: Great idea 100👍

@elkuku
Copy link
Contributor

elkuku commented Aug 7, 2016

I have tested this item successfully on 3681966


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11498.

1 similar comment
@dgrammatiko
Copy link
Contributor

dgrammatiko commented Aug 7, 2016

I have tested this item successfully on 3681966


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11498.

@jeckodevelopment
Copy link
Member

jeckodevelopment commented Aug 8, 2016

I have tested this item successfully on 3681966

RTC Please


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11498.

@joomla-cms-bot joomla-cms-bot added the RTC label Aug 8, 2016
@mbabker
Copy link
Contributor Author

mbabker commented Aug 8, 2016

The only thing that last commit does is change the method name per @elkuku suggestion. Shouldn't need re-testing.

@andrepereiradasilva
Copy link
Contributor

andrepereiradasilva commented Aug 8, 2016

I have tested this item successfully on f236d70

only method name changed.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11498.

wilsonge added a commit that referenced this pull request Aug 8, 2016
@wilsonge
Copy link
Contributor

wilsonge commented Aug 8, 2016

Merged to 3.7.x with e4894d2 Thanks Michael!

@wilsonge wilsonge closed this Aug 8, 2016
@brianteeman
Copy link
Member

brianteeman commented Aug 11, 2016

Doing the job of the lazy bot and removing the rtc flag

@joomla-cms-bot joomla-cms-bot removed the RTC label Aug 11, 2016
@mbabker mbabker deleted the mbabker:php-version-check branch Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

You can’t perform that action at this time.