WordPress.org

Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#22334 closed enhancement (wontfix)

Fix: change default WP_DEBUG on localhost

Reported by: 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)

comment:1 follow-up: azaozz18 months ago

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

comment:2 in reply to: ↑ 1 rmccue18 months 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.

comment:3 follow-up: DavidAnderson18 months 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.

comment:4 SergeyBiryukov18 months 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.

comment:5 in reply to: ↑ 3 helenyhou18 months 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.

comment:6 ocean9018 months ago

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

A real developer doesn't use localhost anymore.

comment:7 DavidAnderson18 months 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.