Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#22334 closed enhancement (wontfix)

Fix: change default WP_DEBUG on localhost

Reported by: davidanderson's profile DavidAnderson Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

I propose changing the default WP_DEBUG in wp-config-sample.php and in WordPress-generated config files to:

define('WP_DEBUG', ($_SERVER\['SERVER_NAME'\] == "localhost" ? true : false ));

This is surely a better default than at present:

  • Sites on localhost are usually development sites, where WP_DEBUG should be on
  • This will save some developers from having to change the setting as they move between live and development; it will work well in both

Change History (7)

#1 follow-up: @azaozz
12 years ago

-1. The keyword here is "...usually are development sites". Also not all developers use localhost for test/local installs.

#2 in reply to: ↑ 1 @rmccue
12 years ago

Replying to azaozz:

-1. The keyword here is "...usually are development sites". Also not all developers use localhost for test/local installs.

-1 as well, *.local is becoming more popular. If you want this, you can always add it to your own wp-config.php files.

#3 follow-up: @DavidAnderson
12 years ago

Of course. The aim of a default setting is to be a better default than any other - not to be always correct; otherwise they'd be hard-coded and not settings at all. And changing a default to help many developers is not bad just because it fails to help all of them.

You're both interpreting the significance of the change wrongly. The proposed change just means "if using localhost, then WP_DEBUG = true is a better default than WP_DEBUG = false". It's got no bearing on people NOT using localhost.

#4 @SergeyBiryukov
12 years ago

This doesn't seem like a worthwhile addition to me. It introduces an inconsistent behaviour which can potentially lead to confusion and increase the number of support requests.

WP_DEBUG is intended for developers. If someone just wants to try out WordPress on localhost for the first time, there's no reason to enforce debug mode for them.

#5 in reply to: ↑ 3 @helenyhou
12 years ago

Replying to DavidAnderson:

It's got no bearing on people NOT using localhost.

It does have bearing - it makes it just that much more difficult to switch it from false to true or vice versa. -1.

#6 @ocean90
12 years ago

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

A real developer doesn't use localhost anymore.

#7 @DavidAnderson
12 years ago

I think comment 4 is right - it may lead to confusion.

Comment 6 - real developers don't use PHP, so what's yer point? ;-)

Note: See TracTickets for help on using tickets.