WordPress.org

Make WordPress Core

Opened 8 years ago

Last modified 7 months ago

#5235 accepted enhancement

Add Pre-flight checks to install

Reported by: westi Owned by: pishmishy
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: needs-patch dev-feedback
Focuses: Cc:

Description (last modified by westi)

It would be nice for the installer to do some pre-flight checks and warn the users of things that will stop WordPress working (either completely or partially)

Candidates for the pre-flight checks:

  • Functions which may be disabled - See #3014
  • Memory limit #5235

Attachments (3)

5235-functions.php.patch (1.7 KB) - added by pishmishy 8 years ago.
A rough draft
5235.2.patch (3.6 KB) - added by pishmishy 7 years ago.
Improved, extendable pre-flight checks
5235.patch (5.6 KB) - added by pishmishy 7 years ago.
Final draft of pre-flight checks

Download all attachments as: .zip

Change History (27)

comment:1 @westi8 years ago

  • Description modified (diff)

comment:2 follow-up: @DD328 years ago

AFAIK WordPress still uses mail() by default unless a plugin is loaded to replace it.

One check which would be good is to check if mail() is disabled.

if( null === @mail('','','') )

false will be raised if mail() is available, as the email is incorrect.
null will be raised if mail() is disabled.

comment:3 @pishmishy8 years ago

  • Owner changed from anonymous to pishmishy
  • Status changed from new to assigned

@pishmishy8 years ago

A rough draft

comment:4 @pishmishy8 years ago

I've added a rough draft of a potential preflight check. I don't know if this is the sort of direction people would like to see it take, so I'd appreciate any feedback.

comment:5 @pishmishy8 years ago

  • Keywords has-patch added; needs-patch removed

comment:6 @santosj8 years ago

There should be more logic to make sure they have Allow_Fopen_URL or the PHP configuration to get URLs. That is important, but not required.

I was thinking about perhaps having levels (green, yellow, red) that the other installers have (OpenAds). Instead of displaying all of them, just display the yellow and halt on red (ask to continue with message saying "Hey, yo some parts of WordPress won't function correctly. Get bettre [intentionally misspelled] host."

Since I don't have any involvement, I would rather like anything that is done. The above just suggestion, if I had a chance to do something.

comment:7 in reply to: ↑ 2 @darkfate8 years ago

@DD32: Yes, there should also be check for mail()

I don't think WP should recommend a different host, but do like what's in the patch already. There should obviously be a check again button so that a person who operates their own server can change it and just hit check again and have the next button turn into a link if everything is good to go.

comment:8 @pishmishy8 years ago

I've taken some of the suggestions into consideration and I've attached a new patch. Checks can throw warnings or stop the installation completely if necessary. I've had to alter install.php too.

I've deliberately avoided adding new, more thorough checks for now and concentrated on the larger view.

comment:9 @pishmishy7 years ago

I think I need to be doing this in a more 'pluggable' style - the current patch isn't easily extended with new checks.

@pishmishy7 years ago

Improved, extendable pre-flight checks

comment:10 @pishmishy7 years ago

  • Keywords dev-feedback added

New draft of preflight check system - using hooks and functions to make it easily extensible. Note overloading of error code to distinguish between fatal problems and warnings.

To do:

  • Highlighting of errors using fade box
  • MySQL version check

I'd appreciate some feed back on this.

@pishmishy7 years ago

Final draft of pre-flight checks

comment:11 @pishmishy7 years ago

I've added my final draft for the pre-flight checks. Someone could probably do a better interface and I'm sure there are more checks we can perform, but the ground work is here.

Feedback welcomed :-)

comment:12 @Denis-de-Bernardy6 years ago

  • Component changed from General to Upgrade/Install

there are at least 2 other tickets related to similar things as I write.

comment:14 @Denis-de-Bernardy6 years ago

  • Keywords needs-patch added; has-patch dev-feedback removed
  • Milestone changed from 2.9 to Future Release

comment:15 @dd326 years ago

see also #9474

comment:17 @hakre6 years ago

cross-referenced: #11466

comment:18 @hakre6 years ago

Nice patch. Worth to get more attention.

comment:19 @hakre6 years ago

  • Keywords dev-feedback added

Close as wontfix because in the lack of interest by multiple devs? Plugin material (dd32?)

comment:20 @nacin6 years ago

A health check has been discussed for 3.0 for some time. I imagine that will be a topic in this week's dev chat when planning out the 3.0 features.

comment:21 @dd326 years ago

Plugin material (dd32?)

This would be best in Core, Cant have a plugin run before WordPress is installed :)

comment:22 @chriscct710 months ago

The health check plugin this was supposed to be replaced with never got off the ground. Part of the problem is it didn't solve the issue of needing the error messages to show during install. I think someone from core should take a look at this. What could be done is if an error is detected then show page letting people know in the view after they select the language pack (so we can localize the error messages), unless the error involves something to do with downloading or showing those, in which case we'd need to do it before then.

comment:23 @ericlewis7 months ago

Does anybody care? I sorta like the idea of letting users know that their hosting sucks or the weird decisions they've made about php configuration are gonna mess them up down the road. However, it goes against our philosophy of supporting the lowest common denominator of hardware / software configurations.

comment:24 @chriscct77 months ago

Supporting the lowest common denominator doesn't mean we support all hosting installs, just the lowest powered ones that are still common in theory. That being said, there will always be environments that are lower than the lowest common denominator. WordPress should have alerts for those who aren't compliant with the WordPress minimum standards as defined on https://wordpress.org/about/requirements/

Note: See TracTickets for help on using tickets.