Skip to content

Instantly share code, notes, and snippets.

@mralaminahamed
Last active September 26, 2024 03:52
Show Gist options
  • Select an option

  • Save mralaminahamed/39d88eb8ce17a328dc04cdd0fde21d83 to your computer and use it in GitHub Desktop.

Select an option

Save mralaminahamed/39d88eb8ce17a328dc04cdd0fde21d83 to your computer and use it in GitHub Desktop.
Debugging PHP code is part of any project for wordpress (including plugin or theme), but WordPress comes with specific debug systems designed to simplify the process as well as standardize code across the core, plugins, and themes. This page describes the various debugging tools on WordPress and how to be more productive in your coding, as well …
<?php
// ** Database settings - You can get this info from your web host ** //
define( 'DB_NAME', 'database_name_here' );
define( 'DB_USER', 'username_here' );
define( 'DB_PASSWORD', 'password_here' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
/**#@+
* Authentication unique keys and salts.
*/
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' );
/**#@-*/
$table_prefix = 'wp_';
// ** WordPress Constants ** //
// Development Mode
define( 'WP_DEVELOPMENT_MODE', 'all' ); // Options: 'core', 'plugin', 'theme', 'all', or ''
// Debug Mode
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// Environment Type
define( 'WP_ENVIRONMENT_TYPE', 'development' ); // Options: 'local', 'development', 'staging', 'production'
// Memory Limits
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
// Caching
define( 'WP_CACHE', false );
// Updates
define( 'AUTOMATIC_UPDATER_DISABLED', true );
define( 'WP_AUTO_UPDATE_CORE', false );
// File Editing
define( 'DISALLOW_FILE_EDIT', true );
define( 'DISALLOW_FILE_MODS', true );
// Debugging
define( 'SCRIPT_DEBUG', true );
define( 'SAVEQUERIES', true );
// Performance
define( 'CONCATENATE_SCRIPTS', false );
define( 'COMPRESS_SCRIPTS', false );
define( 'COMPRESS_CSS', false );
// Content Directory
define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/wp-content' );
define( 'WP_CONTENT_URL', 'http://example.com/wp-content' );
// Plugin Directory
define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/wp-content/plugins' );
define( 'WP_PLUGIN_URL', 'http://example.com/wp-content/plugins' );
// Language
define( 'WPLANG', '' );
// Security
define( 'FORCE_SSL_ADMIN', true );
define( 'FORCE_SSL_LOGIN', true );
// Post Revisions
define( 'WP_POST_REVISIONS', 50 );
// Autosave
define( 'AUTOSAVE_INTERVAL', 300 ); // seconds
// Trash
define( 'EMPTY_TRASH_DAYS', 7 );
// Cron
define( 'DISABLE_WP_CRON', true );
// FTP
define( 'FTP_HOST', 'ftp.example.com' );
define( 'FTP_USER', 'your_ftp_username' );
define( 'FTP_PASS', 'your_ftp_password' );
// Multisite
// define( 'WP_ALLOW_MULTISITE', true );
// define( 'MULTISITE', true );
// define( 'SUBDOMAIN_INSTALL', false );
// define( 'DOMAIN_CURRENT_SITE', 'example.com' );
// define( 'PATH_CURRENT_SITE', '/' );
// define( 'SITE_ID_CURRENT_SITE', 1 );
// define( 'BLOG_ID_CURRENT_SITE', 1 );
// Miscellaneous
define( 'WP_ALLOW_REPAIR', true );
define( 'ALLOW_UNFILTERED_UPLOADS', true );
define( 'IMAGE_EDIT_OVERWRITE', true );
// Block External HTTP Requests
// define( 'WP_HTTP_BLOCK_EXTERNAL', true );
// define( 'WP_ACCESSIBLE_HOSTS', 'api.wordpress.org,*.github.com' );
// Custom Upload Directory
// define( 'UPLOADS', 'wp-content/uploads' );
// Custom Upgrade Directory
// define( 'WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/upgrade/' );
// Default Theme
define( 'WP_DEFAULT_THEME', 'twentytwentythree' );
/* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** 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