Last active
November 16, 2020 23:00
-
-
Save fmtarif/11337216 to your computer and use it in GitHub Desktop.
#wp wordpress config file boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the | |
* installation. You don't have to use the web site, you can just copy this file | |
* to "wp-config.php" and fill in the values. | |
* | |
* @package WordPress | |
*/ | |
// ** MySQL settings - You can get this info from your web host ** // | |
/** The name of the database for WordPress */ | |
define('DB_NAME', 'database_name_here'); | |
/** MySQL database username */ | |
define('DB_USER', 'username_here'); | |
/** MySQL database password */ | |
define('DB_PASSWORD', 'password_here'); | |
/** MySQL hostname */ | |
define('DB_HOST', 'localhost'); | |
/** Database Charset to use in creating database tables. */ | |
define('DB_CHARSET', 'utf8'); | |
/** The Database Collate type. Don't change this if in doubt. */ | |
define('DB_COLLATE', ''); | |
/**#@+ | |
* Authentication Unique Keys and Salts. | |
* | |
* Change these to different unique phrases! | |
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} | |
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. | |
* | |
* @since 2.6.0 | |
*/ | |
define('AUTH_KEY', 'put your unique phrase here'); | |
define('SECURE_AUTH_KEY', 'put your unique phrase here'); | |
define('LOGGED_IN_KEY', 'put your unique phrase here'); | |
define('NONCE_KEY', 'put your unique phrase here'); | |
define('AUTH_SALT', 'put your unique phrase here'); | |
define('SECURE_AUTH_SALT', 'put your unique phrase here'); | |
define('LOGGED_IN_SALT', 'put your unique phrase here'); | |
define('NONCE_SALT', 'put your unique phrase here'); | |
/**#@-*/ | |
/** | |
* WordPress Database Table prefix. | |
* | |
* You can have multiple installations in one database if you give each a unique | |
* prefix. Only numbers, letters, and underscores please! | |
*/ | |
$table_prefix = 'wp_'; | |
/** | |
* WordPress Localized Language, defaults to English. | |
* | |
* Change this to localize WordPress. A corresponding MO file for the chosen | |
* language must be installed to wp-content/languages. For example, install | |
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German | |
* language support. | |
*/ | |
define('WPLANG', ''); | |
/** | |
* For developers: WordPress debugging mode. | |
* | |
* Change this to true to enable the display of notices during development. | |
* It is strongly recommended that plugin and theme developers use WP_DEBUG | |
* in their development environments. | |
*/ | |
define('WP_DEBUG', false); | |
/*------------------------------- | |
//keep a close eye on /wp-content/debug.log | |
// Turns WordPress debugging on | |
define('WP_DEBUG', true); | |
// Tells WordPress to log everything to the /wp-content/debug.log file | |
define('WP_DEBUG_LOG', true); | |
// Doesn't force the PHP 'display_errors' variable to be on | |
define('WP_DEBUG_DISPLAY', false); | |
// Hides errors from being displayed on-screen | |
@ini_set('display_errors', 0); | |
-------------------------------*/ | |
/** | |
* Custom added | |
* | |
*/ | |
//overrides the wp_options table value for siteurl | |
//and disables the WordPress address (URL) field in the Administration > Settings > General panel. | |
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/art'); | |
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/art'); | |
/* OR hard code the path | |
define('WP_HOME', 'http://www.wpbeginner.com'); | |
define('WP_SITEURL', 'http://www.wpbeginner.com'); | |
*/ | |
//set a default theme | |
//define( 'WP_DEFAULT_THEME', 'default-theme-folder-name' ); | |
//define(‘TEMPLATEPATH’, ‘/absolute/path/to/wp-content/themes/themefolder’); | |
//define(‘STYLESHEETPATH, ‘/absolute/path/to/wp-content/themes/themefolder’); | |
/* Override File Permissions | |
define('FS_CHMOD_FILE', 0755); | |
define('FS_CHMOD_DIR', 0644); | |
*/ | |
// Desactivate post revisions, | |
define('WP_POST_REVISIONS', false); | |
define('AUTOSAVE_INTERVAL', 86400); // in seconds, default 160 | |
define('EMPTY_TRASH_DAYS', 7 ); //Integer is the amount of days | |
define('EMPTY_TRASH_DAYS', 0 ); //disable | |
//define( 'AUTOMATIC_UPDATER_DISABLED', true ); | |
//define( 'MEDIA_TRASH', true ); //will not work if EMPTY_TRASH_DAYS is disabled (set to 0) | |
/** | |
* lift restrictions of mages, documents, audio or video files upload in media | |
*/ | |
//define( 'ALLOW_UNFILTERED_UPLOADS', true ); | |
define('SAVEQUERIES', true); //default false | |
/* put this probably in footer | |
<?php | |
if (current_user_can('administrator')){ | |
global $wpdb; | |
echo "<pre>"; | |
print_r($wpdb->queries); | |
echo "</pre>"; | |
} | |
?> | |
*/ | |
// Auto Database Optimization | |
define('WP_ALLOW_REPAIR', true); // settings found at http://www.yoursite.com/wp-admin/maint/repair.php | |
// The WP_CACHE setting, if true, includes the wp-content/advanced-cache.php script, when executing wp-settings.php. | |
define('WP_CACHE', true); | |
define('WP_ALLOW_MULTISITE', false); | |
/* prevent WordPress from making external requests | |
define('WP_HTTP_BLOCK_EXTERNAL', true); | |
define('WP_ACCESSIBLE_HOSTS', 'rpc.pingomatic.com'); // whitelist (allow access) | |
*/ | |
//Disabling the Plugin and Theme Editor: equivalent to removing the 'edit_themes', 'edit_plugins' and 'edit_files' capabilities of all users | |
define('DISALLOW_FILE_EDIT', true); | |
//disable theme plugin update | |
define('DISALLOW_FILE_MODS',true); | |
// change upload directory | |
define( 'UPLOADS', '/somewhere/I/want'); | |
//To result in a faster administration area, all Javascript files are concatenated into one URL | |
define('CONCATENATE_SCRIPTS', false); | |
/* | |
define('WP_MEMORY_LIMIT', '96M'); | |
define('WP_MAX_MEMORY_LIMIT', '256M'); | |
*/ | |
//Php has a function that returns an array of all the currently defined constants with their values | |
//print_r(@get_defined_constants()); | |
/*Block external URL requests by defining WP_HTTP_BLOCK_EXTERNAL as true and this will | |
only allow localhost and your blog to make requests. | |
The constant WP_ACCESSIBLE_HOSTS will allow additional hosts to go through for | |
requests. The format of the WP_ACCESSIBLE_HOSTS constant is a comma separated list | |
of hostnames to allow, wildcard domains are supported, eg *.wordpress.org will | |
allow for all subdomains of wordpress.org to be contacted. | |
*/ | |
//define( 'WP_HTTP_BLOCK_EXTERNAL', true ); | |
//define( 'WP_ACCESSIBLE_HOSTS', 'api.wordpress.org,*.github.com' ); | |
/*FORCE_SSL_LOGIN is for when you want to secure logins so that passwords are not sent in the clear, | |
but you still want to allow non-SSL admin sessions (since SSL can be slow).*/ | |
//define( 'FORCE_SSL_LOGIN', true ); | |
/* | |
FORCE_SSL_ADMIN is for when you want to secure logins and the admin area so that both passwords and cookies are never sent | |
in the clear. This is the most secure option. Administration_Over_SSL | |
*/ | |
//define( 'FORCE_SSL_ADMIN', true ); | |
/* That's all, stop editing! Happy blogging. */ | |
/** Absolute path to the WordPress directory. */ | |
if ( !defined('ABSPATH') ) | |
define('ABSPATH', dirname(__FILE__) . '/'); | |
/** Sets up WordPress vars and included files. */ | |
require_once(ABSPATH . 'wp-settings.php'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment