Last active
July 6, 2019 20:43
-
-
Save kilatepro/e23d5044e1af9e8ef782bc2de355cde1 to your computer and use it in GitHub Desktop.
Setup do Wordpress #WP #basic
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
# protect wpconfig.php | |
<files wp-config.php> | |
order allow,deny | |
deny from all | |
</files> | |
# begin betabrandao | |
# compress text files – with WP Fastest Cache | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE text/javascript | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE image/x-icon | |
AddOutputFilterByType DEFLATE image/svg+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/x-font | |
AddOutputFilterByType DEFLATE application/x-font-truetype | |
AddOutputFilterByType DEFLATE application/x-font-ttf | |
AddOutputFilterByType DEFLATE application/x-font-otf | |
AddOutputFilterByType DEFLATE application/x-font-opentype | |
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
AddOutputFilterByType DEFLATE font/ttf | |
AddOutputFilterByType DEFLATE font/otf | |
AddOutputFilterByType DEFLATE font/opentype | |
# For Older Browsers Which Can't Handle Compression | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | |
</IfModule> | |
#end betabrandao |
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
https://code.tutsplus.com/tutorials/conquering-the-wp-configphp-file-11-good-practices--wp-26338 | |
https://gist.github.com/DavidV-WPCK/7313339 | |
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 | |
/** | |
* As configurações básicas do WordPress | |
* | |
* O script de criação wp-config.php usa esse arquivo durante a instalação. | |
* Você não precisa usar o site, você pode copiar este arquivo | |
* para "wp-config.php" e preencher os valores. | |
* | |
* Este arquivo contém as seguintes configurações: | |
* | |
* * Configurações do MySQL | |
* * Chaves secretas | |
* * Prefixo do banco de dados | |
* * ABSPATH | |
* | |
* @link https://codex.wordpress.org/pt-br:Editando_wp-config.php | |
* | |
* @package WordPress | |
*/ | |
// ** Configurações do MySQL - Você pode pegar estas informações com o serviço de hospedagem ** // | |
/** O nome do banco de dados do WordPress */ | |
define('DB_NAME', 'nome-do-banco-de-dados'); | |
/** Usuário do banco de dados MySQL */ | |
define('DB_USER', 'usuário'); | |
/** Senha do banco de dados MySQL */ | |
define('DB_PASSWORD', 'senha'); | |
/** Nome do host do MySQL */ | |
define('DB_HOST', 'localhost'); | |
/** Charset do banco de dados a ser usado na criação das tabelas. */ | |
define('DB_CHARSET', 'utf8'); | |
/** O tipo de Collate do banco de dados. Não altere isso se tiver dúvidas. */ | |
define('DB_COLLATE', ''); | |
/**#@+ | |
* Chaves únicas de autenticação e salts. | |
* | |
* Altere cada chave para um frase única! | |
* Você pode gerá-las | |
* usando o {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org | |
* secret-key service} | |
* Você pode alterá-las a qualquer momento para invalidar quaisquer | |
* cookies existentes. Isto irá forçar todos os | |
* usuários a fazerem login novamente. | |
* | |
* @since 2.6.0 | |
*/ | |
define('AUTH_KEY', 'coloque a sua frase única aqui'); | |
define('SECURE_AUTH_KEY', 'coloque a sua frase única aqui'); | |
define('LOGGED_IN_KEY', 'coloque a sua frase única aqui'); | |
define('NONCE_KEY', 'coloque a sua frase única aqui'); | |
define('AUTH_SALT', 'coloque a sua frase única aqui'); | |
define('SECURE_AUTH_SALT', 'coloque a sua frase única aqui'); | |
define('LOGGED_IN_SALT', 'coloque a sua frase única aqui'); | |
define('NONCE_SALT', 'coloque a sua frase única aqui'); | |
/**#@-*/ | |
/** | |
* Prefixo da tabela do banco de dados do WordPress. | |
* | |
* Você pode ter várias instalações em um único banco de dados se você der | |
* um prefixo único para cada um. Somente números, letras e sublinhados! | |
*/ | |
$table_prefix = 'wp_'; | |
/** | |
* Para desenvolvedores: Modo de debug do WordPress. | |
* | |
* Altere isto para true para ativar a exibição de avisos | |
* durante o desenvolvimento. É altamente recomendável que os | |
* desenvolvedores de plugins e temas usem o WP_DEBUG | |
* em seus ambientes de desenvolvimento. | |
* | |
* Para informações sobre outras constantes que podem ser utilizadas | |
* para depuração, visite o Codex. | |
* | |
* @link https://codex.wordpress.org/pt-br:Depura%C3%A7%C3%A3o_no_WordPress | |
*/ | |
/* WordPress debug mode for developers. */ | |
define( 'WP_DEBUG', false ); | |
define( 'WP_DEBUG_LOG', false ); | |
define( 'WP_DEBUG_DISPLAY', false ); | |
define( 'SCRIPT_DEBUG', false ); | |
define( 'SAVEQUERIES', false ); | |
/* Configura permissão para lidar com os arquivos */ | |
define('FS_METHOD', 'direct'); | |
/* Setting a Default Theme for New WordPress Installations */ | |
define( 'WP_DEFAULT_THEME', 'default-theme-folder-name' ); | |
/* WordPress Localized Language */ | |
define( 'WPLANG', 'pt-BR' ); | |
/* Custom WordPress URL */ | |
define( 'WP_SITEURL', 'http://thesite.com' ); | |
define( 'WP_HOME', 'http://thesite.com/srp' ); | |
define( 'WP_CONTENT_URL', 'http://thesite.com/srpt/wp-content' ); | |
/* AutoSave Interval. */ | |
define( 'AUTOSAVE_INTERVAL', '180' ); | |
/* Specify maximum number of Revisions. */ | |
define( 'WP_POST_REVISIONS', '4' ); | |
/* Media Trash. */ | |
define( 'MEDIA_TRASH', true ); | |
/* Trash Days. */ | |
define( 'EMPTY_TRASH_DAYS', '7' ); | |
/* Multisite. */ | |
define( 'WP_ALLOW_MULTISITE', false ); | |
/* Force SSL on the Admin Panel */ | |
define('FORCE_SSL_LOGIN', true); | |
define('FORCE_SSL_ADMIN', true); | |
/* Allowing Unfiltered WordPress Uploads for Administrators */ | |
define( 'ALLOW_UNFILTERED_UPLOADS', true ); | |
/* Defining Your WordPress.com API Key as a Constant */ | |
define( 'WPCOM_API_KEY', 'YourKeyHere' ); | |
/* Setting WPLANG Dynamically in Multilingual Websites !!! Put the wp-lang.php file in the same directory as wp-congig file and replace the line where WPLANG is defined with the line below: */ | |
require_once( dirname( __FILE__ ) . '/wp-lang.php' ); | |
/* PHP Memory */ | |
define( 'WP_MEMORY_LIMIT', '180M' ); | |
/* WordPress Cache */ | |
define( 'WP_CACHE', true ); | |
/* Disabling WordPress' Automatic Update Feature */ | |
define( 'AUTOMATIC_UPDATER_DISABLED', true ); | |
/* Updates */ | |
define( 'WP_AUTO_UPDATE_CORE', 'minor' ); | |
define( 'DISALLOW_FILE_MODS', false ); | |
define( 'DISALLOW_FILE_EDIT', true ); | |
/* Letting WordPress Skip the wp-content Directory While Updating */ | |
define( 'CORE_UPGRADE_SKIP_NEW_BUNDLED', true ); | |
/* Isto é tudo, pode parar de editar! :) */ | |
/** Caminho absoluto para o diretório WordPress. */ | |
if ( !defined('ABSPATH') ) | |
define('ABSPATH', dirname(__FILE__) . '/'); | |
/** Configura as variáveis e arquivos do WordPress. */ | |
require_once(ABSPATH . 'wp-settings.php'); |
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 | |
// start the session | |
session_start(); | |
// if there's a "lang" parameter in the URL... | |
if( isset( $_GET[ 'lang' ] ) ) { | |
// ...set a session variable named WPLANG based on the URL parameter... | |
$_SESSION[ 'WPLANG' ] = $_GET[ 'lang' ]; | |
// ...and define the WPLANG constant with the WPLANG session variable | |
define( 'WPLANG', $_SESSION[ 'WPLANG' ] ); | |
// if there isn't a "lang" parameter in the URL... | |
} else { | |
// if the WPLANG session variable is already set... | |
if( isset( $_SESSION[ 'WPLANG' ] ) ) { | |
// ...define the WPLANG constant with the WPLANG session variable | |
define( 'WPLANG', $_SESSION[ 'WPLANG' ] ); | |
// if the WPLANG session variable isn't set... | |
} else { | |
// set the WPLANG constant to your default language code is (or empty, if you don't need it) | |
define( 'WPLANG', 'tr_TR' ); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment