Index: wp-config-sample.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-config-sample.php	(revision 52897df8cdb2ab97f3ebd4c4704e38c1fd684f15)
+++ wp-config-sample.php	(revision )
@@ -79,7 +79,12 @@
  */
 define('WP_DEBUG', false);
 
-/* That's all, stop editing! Happy blogging. */
+/*
+ * That's all, stop editing! Happy blogging.
+ *
+ * NOTHING PLACED BELOW THIS LINE WILL HAVE AN EFFECT ON YOUR SITE.
+ *
+ */
 
 /** Absolute path to the WordPress directory. */
 if ( !defined('ABSPATH') )
Index: wp-load.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-load.php	(revision 52897df8cdb2ab97f3ebd4c4704e38c1fd684f15)
+++ wp-load.php	(revision )
@@ -23,6 +23,7 @@
 
 error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
 
+$_wp_config_file = '';
 /*
  * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
  * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
@@ -33,13 +34,27 @@
  */
 if ( file_exists( ABSPATH . 'wp-config.php') ) {
 
-	/** The config file resides in ABSPATH */
-	require_once( ABSPATH . 'wp-config.php' );
+    /** The config file resides in ABSPATH */
+    $_wp_config_file = ABSPATH . 'wp-config.php';
 
 } elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
 
-	/** The config file resides one level above ABSPATH but is not part of another install */
-	require_once( dirname( ABSPATH ) . '/wp-config.php' );
+    /** The config file resides one level above ABSPATH but is not part of another install */
+    $_wp_config_file = dirname( ABSPATH ) . '/wp-config.php';
+
+}
+
+if ( '' !== $_wp_config_file ) {
+
+    require_once( $_wp_config_file );
+
+    /**
+     * Prove we're loaded correctly.
+     */
+    if ( ! isset( $wp_did_header ) ) {
+        require_once( ABSPATH . WPINC . '/functions.php' );
+        _doing_it_wrong( 'wp-load.php', __( 'Do not load wp-load.php directly.' ) ); // @todo: insert WordPress version number
+    }
 
 } else {
 
Index: wp-settings.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-settings.php	(revision 52897df8cdb2ab97f3ebd4c4704e38c1fd684f15)
+++ wp-settings.php	(revision )
@@ -102,6 +102,13 @@
 require( ABSPATH . WPINC . '/pomo/mo.php' );
 require( ABSPATH . WPINC . '/class-phpass.php' );
 
+/**
+ * Prove we're loaded correctly. Executed soon-after functions.php is loaded, which is the earliest we can run _doing_it_wrong().
+ */
+if ( ! isset( $wp_did_header ) ) {
+    _doing_it_wrong( 'wp-settings.php', __( 'Do not load wp-settings.php or wp-config.php directly.' ) ); // @todo: insert WordPress version number
+}
+
 // Include the wpdb class and, if present, a db.php database drop-in.
 global $wpdb;
 require_wp_db();
