WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#9751 closed task (blessed) (wontfix)

Add notice for users running PHP 4

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: General Keywords: has-patch needs-testing dev-feedback health-check
Focuses: Cc:

Description

As said: let's do not rush this. I just learned by an upgrading ticket for a depending library that more and more of the wp codebase will become outdated because php 4 support will be dropped on the dependencies.

so it seems reasonable to me, to make up ones minds about the general questions that would encounter when raising the requirements for wordpress to PHP 5.x.y.

even though it might not be within the next 3 to 24 month that this might happen we should take care of the wordpress userbase that is truly based on php 4 setups. and our userbase has been trained now since many month that there is no need to quit a php 4 setup.

therefore i had the idea to start displaying a calm and nice message within the admin if the blog is a php 4 setup. that message can tell the user that sometime in the future she might be confronted with the case, that her php setup is not supported any longer.

only because of precautions she should evaluate with all the technical partners if it would be possible to have a php 5 based setup in the future.


if this idea is totally bogus, i have some somehow reltated questions, so i put them in here:

1.) is it known which php minimum version there will be needed sometime then?

2.) will that requirements change be done with a major or a minor version change?

Attachments (2)

php4.nag.patch (3.8 KB) - added by jorbin 6 years ago.
9751.patch (4.9 KB) - added by hakre 6 years ago.

Download all attachments as: .zip

Change History (25)

comment:1 @DD326 years ago

  • Milestone Unassigned deleted
  • Resolution set to wontfix
  • Status changed from new to closed

WordPress's minimum PHP level will always remain at the lowest common denominator of current PHP usage.

It has been said that WordPress will not consider making PHP4.4 the minumum until less than < 10% of installs are running on 4.3, Thats the point of consideration and warning that PHP 4.4+ is coming..

WordPress reports the PHP version in use on core update requests, so the statistics are known. (Just not to the public, to the server devs they are if they're interested in collating them)

PHP 4.3 is going to remain as the target minimum for awhile. PHP 4.4 doesnt introduce too many new functions, and is the next likely step.

For reference, here's the total number of new functions of PHP 4.2~5:

4.2.0 (234 new functions)
4.2.3 (8 new functions)
4.3.0 (156 new functions)
4.3.2 (11 new functions)
4.3.3 (24 new functions)
4.3.9 (34 new functions)
4.4.0 (1 new functions)
4.4.3 (1 new functions)

WordPress only started requiring PHP4.3+ in 2.5: #5416 & [6662] (16months ago)

comment:2 follow-up: @DD326 years ago

(I know total functions cant be used as the only differentiator, but for most purposes, it serves well enough)

Heres the final part of that list:

4.2.0 (234 new functions)
4.2.3 (8 new functions)
4.3.0 (156 new functions)
4.3.2 (11 new functions)
4.3.3 (24 new functions)
4.3.9 (34 new functions)
4.4.0 (1 new functions)
4.4.3 (1 new functions)
5.0.0 (304 new functions)
5.0.2 (1 new functions)
5.0.4 (1 new functions)
5.0.5 (18 new functions)
5.1.0 (66 new functions)
5.1.2 (20 new functions)
5.1.3 (7 new functions)
5.2.0 (28 new functions)
5.2.1 (3 new functions)
5.2.2 (5 new functions)
5.2.3 (1 new functions)

comment:3 @jacobsantos6 years ago

That isn't the complete list of features. You are leaving out new classes, PDO (which is kick ass), SPL (which is sweet, you get Iterator, Directory_Iterator (which is really, really useful), Countable, Serializable (not sure if that is the correct interface name), etc), filter extension (meh, not as useful as I thought, but pretty cool, because you can use hooks and stuff).

I forget, did I mention PDO, mysqli, OCI8.

PHP 5.2 is faster than PHP4, by a small degree. PHP 5.3 is faster than PHP4 by a very large margin.

I fear that when WordPress does go PHP 5. It is going to be PHP 5.1.6, which will suck, but I mean, you can still use PHP5.2 features, if they are available and just code for PHP5.1.x.

It also sucks that PHP5.3 is going to take around two or more years before it is the standard for PHP5.

comment:4 @DD326 years ago

Yes, You're right i've missed the Classes stuff and interfaces. But the point still stands, Quite a lot of the "extras" introduced in general, do not allow many more WordPress things to happen than current, Sure, It'll run faster, You've got Iterator's (A fancy object loop..) and a couple of extensions.. - But Is there anything that cant be done under PHP 4.3 right now, which WordPress *needs*?

I'm not saying PHP5 is useless. I'm just saying, That on the whole, Theres no immediate requirement for WordPress to become PHP4.4+ or 5.1+ or whatever else. (Thats ignoring the fact it'd be crazy to do so given host support)

When all the hosters have moved to PHP 5.2+ feel free to re-open a ticket, but until then, I think its better left to the realm of wp-hacker endless discussion. (Thats the reason i've closed this off so fast, I dont think we need to get into a PHP5 argument/discussion on trac, Its better left to a discussion place, and leave trac alone to get on with dealing with bugs)

comment:5 @jacobsantos6 years ago

DD32, while I would counter your points, I'll agree that it is better left on wp-hackers.

comment:6 in reply to: ↑ 2 @bravenewcode6 years ago

Replying to DD32:

Just curious -- is there a URL somewhere that shows which functions were added in each PHP version? I hunted around tonight but came up dry.

comment:7 @DD326 years ago

Just curious -- is there a URL somewhere that shows which functions were added in each PHP version? I hunted around tonight but came up dry.

I came up dry too when i needed such a list, Here's what i put together when 5.2.3 was current: http://dd32.id.au/php-functions-by-version.htm

comment:8 @hakre6 years ago

  • Keywords needs-patch added
  • Milestone set to 2.8.3
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Type changed from defect (bug) to task (blessed)
  • Version set to 2.8.1

As of yesterdays discussion, this will be reopened. Status Quo per discussion is:

  • display a message to admin users (actual members of the admin role) that php requirements change to php 5 in the future.
  • the message is displayed like the password change reminder message
  • a codex page is created where additional info is displayed regarding changing the php version on a user's host.
  • that codex page is linked in the message.

comment:9 @mrmist6 years ago

  • Milestone changed from 2.8.3 to 2.9

Codex page created as
http://codex.wordpress.org/Switching_to_PHP5[[BR]]
I've not yet linked it from the main TOC awaiting further editing/refinement/addition/removal/approvals.

comment:10 @hakre6 years ago

the page already looks pretty good. I think it will get all needed improvements if the admin-message and link is built in the core.

comment:11 @jorbin6 years ago

  • Cc jorbin added
  • Keywords patch-added needs-testing dev-feedback added; needs-patch removed

I've uploaded a basic patch that does a few things.

  1. adds a veriable to version.php that allows for the definition of a php min before nagging begins.
  1. Adds a function that checks to see if the webserver is running a php version below the recommended version and adds a piece of usermeta if it is to all admin users
  1. If the user has this peice of usermeta, they recieve a nag until they tell it to go away

I'm assuming someone may have some better ideas for how to word the nag, but I wanted to get it started.

comment:12 @jorbin6 years ago

So you don't have to read the patch, the nag is:

"Notice: Your Webserver is currently using PHP version 4, which is no longer recieving security updates and will no longer be supported by WordPress in an upcoming version<br />
<a href='%s'>Learn more about this issue</a> | <a href='%s'>I understand the issue and want you to stop informing me</a>"), 'http://codex.wordpress.org/Switching_to_PHP5', '?php_below_min_nag=0');

comment:13 @westi6 years ago

Patch looks good.

One point - use numbered replacements in printf call so as to allow translators to change the order easily - e.g. for RTL languages.

@jorbin6 years ago

comment:14 @jorbin6 years ago

Thanks Westi, I've updated it accordingly.

comment:15 @hakre6 years ago

  • Keywords has-patch added; patch-added removed
  • Version changed from 2.8.1 to 2.8.4

I've updated and modified the patch because of variaous resons:

  1. It didn't apply to trunk any longer
  2. I do not see any need to modfiy version.php which only adds another global while this is not needed for the one comparison function.
  3. The case of the php update after displaying a message was not reflected.
  4. The message did not reflect the actual php version. E.g. a php 3 user would get the php 4 message as well a php 5 user if php 5.2 becomes a requirement in the future.
  5. Dependencies (version to compare from/against) have been made injectable sothat it's possible to create tests w/o actually updating php within the test.

@hakre6 years ago

comment:16 @scribu5 years ago

  • Summary changed from Let's do not rush things for upcomming PHP minimum version PHP 5.x.y to Add notice for users running PHP 4

comment:17 @hakre5 years ago

I think this is pretty much important if I imagine all the unfixed holes in PHP 4 that might render wordpress as a web-drone. Matt's motto of the month is "keep current", so therefore we should really higher the presure on the userbase that they keep current with php as well. Keep in mind PHP 5.2.11 / 5.3.0 are the current stable versions.

I know that such messages frighten the users very much. In those cases they do not know how to update they will literally go crazy. But at least we should place a message so that we can say (as well as matt did it): hey, we (ever) said, update your PHP version.

comment:18 follow-up: @westi5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [12006]) Remove the php-gettext library as we don't use it anymore. Fixes #9751.

comment:19 in reply to: ↑ 18 @westi5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to westi:

(In [12006]) Remove the php-gettext library as we don't use it anymore. Fixes #9751.

Wrong ticket number :-(

comment:20 @westi5 years ago

I have thought long and hard about this and I don't think that this is the correct thing to do in the core.

I think the community would be much better served by a canonical plugin which provides a WordPress Health Check - this would be one of the many things that the plugin would check.

Others could include: File Permissions, PHP config, webserver config etc.

We should not be putting code into the core which has a small target audience - it is necessary bloat for the rest of the users.

comment:21 @westi5 years ago

  • Keywords health-check added

comment:22 @ryan5 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from reopened to closed

comment:23 @hakre5 years ago

Related: #14656

Note: See TracTickets for help on using tickets.