Make WordPress Core

Opened 7 weeks ago

Last modified 5 weeks ago

#65986 new defect (bug)

wp-config-sample.php is not usable as a live config without filling placeholders

Reported by: alijah06 Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version:
Severity: normal Keywords:
Cc: Focuses:

Description (last modified by sabernhardt)

This is the standard WordPress wp-config.php template, mostly unmodified — but there are a few real issues:

  1. Placeholder credentials never filled in
    define( 'DB_NAME', 'database_name_here' );
    define( 'DB_USER', 'username_here' );
    define( 'DB_PASSWORD', 'password_here' );
    

These are still the sample values. As-is, this file will fail to connect to any real database. This needs to be replaced with actual credentials before the site will work.

  1. Placeholder secret keys/salts — a real security problem
    define( 'AUTH_KEY',         'put your unique phrase here' );
    ...
    define( 'NONCE_SALT',       'put your unique phrase here' );
    

These are meant to be long, random, unique strings. Leaving them as literal placeholder text means:

  • Session/auth cookies are far more predictable/forgeable.
  • If this exact file is ever reused across sites (or checked into a public repo), all sites share the same "secret," making cookie forgery trivial.

Generate real values from the ​WordPress.org secret-key service or via wp config shuffle-salts (WP-CLI).

  1. CONCATENATE_SCRIPTS defined too early, and questionable value
    define( 'CONCATENATE_SCRIPTS', false );
    

This is placed *before* the file's docblock/header and before ABSPATH is even set up — it works functionally since define() doesn't care about surrounding comments, but it's an unusual/fragile spot to put a custom constant (normally these go in the "Add any custom values" section below). Setting it to false also disables JS/CSS concatenation in the admin, which hurts admin dashboard performance — this is usually a temporary debugging aid, not something you want permanently in production.

  1. WP_DEBUG is false with no companion debug-logging setup

Not a bug per se, but worth noting: if this is a dev/staging environment, you'd typically want:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

so errors are logged to a file instead of either being silently swallowed or (worse) displayed on a live site.

  1. No DISALLOW_FILE_EDIT / hardening constants

Not a "bug," but commonly paired with this file for production security (e.g., disabling the plugin/theme file editor, forcing SSL for admin/login).

Summary: The file is structurally correct WordPress boilerplate, but it is not safe to deploy as-is — the unfilled DB_* credentials will break the DB connection, and the unfilled AUTH_KEY/*_SALT placeholders are a genuine security weakness, not just a style nit.

Attachments (2)

wp-config.php​ (3.9 KB ) - added by alijah06 7 weeks ago.
wp-config (original).php​ (3.2 KB ) - added by alijah06 7 weeks ago.

Download all attachments as: .zip

Change History (4)

@alijah06
7 weeks ago

#1 @sabernhardt
6 weeks ago

  • Description modified (diff)

#2 @haritpanchal
5 weeks ago

  • Summary Bug Report → wp-config-sample.php is not usable as a live config without filling placeholders
Note: See TracTickets for help on using tickets.