@@ -24,64 +24,64 @@ |
||
24 | 24 | $dotenv->required( [ 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'WP_HOME', 'WP_SITEURL' ] )->notEmpty(); |
25 | 25 | |
26 | 26 | // ** Authentication Unique Keys and Salts ** // |
27 | -define( 'AUTH_KEY', getenv( 'AUTH_KEY' ) ); |
|
28 | -define( 'SECURE_AUTH_KEY', getenv( 'SECURE_AUTH_KEY' ) ); |
|
29 | -define( 'LOGGED_IN_KEY', getenv( 'LOGGED_IN_KEY' ) ); |
|
30 | -define( 'NONCE_KEY', getenv( 'NONCE_KEY' ) ); |
|
31 | -define( 'AUTH_SALT', getenv( 'AUTH_SALT' ) ); |
|
32 | -define( 'SECURE_AUTH_SALT', getenv( 'SECURE_AUTH_SALT' ) ); |
|
33 | -define( 'LOGGED_IN_SALT', getenv( 'LOGGED_IN_SALT' ) ); |
|
34 | -define( 'NONCE_SALT', getenv( 'NONCE_SALT' ) ); |
|
27 | +define( 'AUTH_KEY', getenv( 'AUTH_KEY' ) ); |
|
28 | +define( 'SECURE_AUTH_KEY', getenv( 'SECURE_AUTH_KEY' ) ); |
|
29 | +define( 'LOGGED_IN_KEY', getenv( 'LOGGED_IN_KEY' ) ); |
|
30 | +define( 'NONCE_KEY', getenv( 'NONCE_KEY' ) ); |
|
31 | +define( 'AUTH_SALT', getenv( 'AUTH_SALT' ) ); |
|
32 | +define( 'SECURE_AUTH_SALT', getenv( 'SECURE_AUTH_SALT' ) ); |
|
33 | +define( 'LOGGED_IN_SALT', getenv( 'LOGGED_IN_SALT' ) ); |
|
34 | +define( 'NONCE_SALT', getenv( 'NONCE_SALT' ) ); |
|
35 | 35 | |
36 | 36 | // ** Load additional settings & tweaks conditionnaly, using current WordPress environment ** // |
37 | -define( 'WP_ENV', getenv( 'WP_ENV' ) ?: 'development' ); |
|
37 | +define( 'WP_ENV', getenv( 'WP_ENV' ) ?: 'development' ); |
|
38 | 38 | $dotenv_file = sprintf( '%s/environments/%s.php', __DIR__, WP_ENV ); |
39 | 39 | if ( file_exists( $dotenv_file ) ) { |
40 | 40 | require_once $dotenv_file; |
41 | 41 | } |
42 | 42 | |
43 | 43 | // ** URLs ** // |
44 | -define( 'WP_HOME', getenv( 'WP_HOME' ) ); |
|
45 | -define( 'WP_SITEURL', getenv( 'WP_SITEURL' ) ); |
|
44 | +define( 'WP_HOME', getenv( 'WP_HOME' ) ); |
|
45 | +define( 'WP_SITEURL', getenv( 'WP_SITEURL' ) ); |
|
46 | 46 | |
47 | 47 | // ** Primary language ** // |
48 | 48 | if ( empty( getenv( 'WPLANG' ) ) ) { |
49 | - define( 'WPLANG', $locale ); |
|
49 | + define( 'WPLANG', $locale ); |
|
50 | 50 | } else { |
51 | - define( 'WPLANG', getenv( 'WPLANG' ) ); |
|
51 | + define( 'WPLANG', getenv( 'WPLANG' ) ); |
|
52 | 52 | $locale = WPLANG; |
53 | 53 | } |
54 | 54 | |
55 | 55 | // ** If true, includes the wp-content/advanced-cache.php script ** // |
56 | -define( 'WP_CACHE', getenv( 'WP_CACHE' ) ); |
|
56 | +define( 'WP_CACHE', getenv( 'WP_CACHE' ) ); |
|
57 | 57 | |
58 | 58 | // ** MariaDB / MySQL server settings ** // |
59 | -define( 'DB_HOST', getenv( 'DB_HOST' ) ?: 'localhost' ); |
|
60 | -define( 'DB_NAME', getenv( 'DB_NAME' ) ); |
|
61 | -define( 'DB_USER', getenv( 'DB_USER' ) ); |
|
62 | -define( 'DB_PASSWORD', getenv( 'DB_PASSWORD' ) ); |
|
63 | -define( 'DB_CHARSET', getenv( 'DB_CHARSET' ) ?: 'utf8mb4' ); |
|
64 | -define( 'DB_COLLATE', '' ); |
|
59 | +define( 'DB_HOST', getenv( 'DB_HOST' ) ?: 'localhost' ); |
|
60 | +define( 'DB_NAME', getenv( 'DB_NAME' ) ); |
|
61 | +define( 'DB_USER', getenv( 'DB_USER' ) ); |
|
62 | +define( 'DB_PASSWORD', getenv( 'DB_PASSWORD' ) ); |
|
63 | +define( 'DB_CHARSET', getenv( 'DB_CHARSET' ) ?: 'utf8mb4' ); |
|
64 | +define( 'DB_COLLATE', '' ); |
|
65 | 65 | |
66 | 66 | $table_prefix = getenv( 'DB_PREFIX' ) ?: 'wp_'; |
67 | 67 | |
68 | 68 | // ** Defines a default theme for new sites, also used as fallback for a broken theme. ** // |
69 | -define( 'WP_DEFAULT_THEME', getenv( 'WP_DEFAULT_THEME' ) ?: 'mr-press-child-theme' ); |
|
69 | +define( 'WP_DEFAULT_THEME', getenv( 'WP_DEFAULT_THEME' ) ?: 'mr-press-child-theme' ); |
|
70 | 70 | |
71 | 71 | // ** Performance tweaks ** // |
72 | -define( 'WP_MEMORY_LIMIT', getenv( 'WP_MEMORY_LIMIT' ) ); |
|
73 | -define( 'WP_MAX_MEMORY_LIMIT', getenv( 'WP_MAX_MEMORY_LIMIT' ) ); |
|
72 | +define( 'WP_MEMORY_LIMIT', getenv( 'WP_MEMORY_LIMIT' ) ); |
|
73 | +define( 'WP_MAX_MEMORY_LIMIT', getenv( 'WP_MAX_MEMORY_LIMIT' ) ); |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Disable WP_CRON unless running thtough WordPress cron job |
77 | 77 | * For further details read this article: https://www.lucasrolff.com/wordpress/why-wp-cron-sucks |
78 | 78 | */ |
79 | -define( 'DISABLE_WP_CRON', getenv( 'DISABLE_WP_CRON' ) ?: ( ! isset( $argv[1] ) || 'DOING_CRON' !== $argv[1] ) ); |
|
79 | +define( 'DISABLE_WP_CRON', getenv( 'DISABLE_WP_CRON' ) ?: ( ! isset( $argv[ 1 ] ) || 'DOING_CRON' !== $argv[ 1 ] ) ); |
|
80 | 80 | |
81 | 81 | // ** Additional settings ** // |
82 | -define( 'DISALLOW_FILE_EDIT', getenv( 'DISALLOW_FILE_EDIT' ) ?: true ); |
|
83 | -define( 'WP_ALLOW_REPAIR', getenv( 'WP_ALLOW_REPAIR' ) ?: false ); |
|
82 | +define( 'DISALLOW_FILE_EDIT', getenv( 'DISALLOW_FILE_EDIT' ) ?: true ); |
|
83 | +define( 'WP_ALLOW_REPAIR', getenv( 'WP_ALLOW_REPAIR' ) ?: false ); |
|
84 | 84 | define( 'AUTOMATIC_UPDATER_DISABLED', getenv( 'AUTOMATIC_UPDATER_DISABLED' ) ?: true ); |
85 | 85 | |
86 | 86 | // ** Redefine default WordPress content (themes, plugins etc) folder location ** // |
87 | -define( 'WP_CONTENT_DIR', sprintf( '%s/%s', $root_dir, 'wp-content' ) ); |
|
87 | +define( 'WP_CONTENT_DIR', sprintf( '%s/%s', $root_dir, 'wp-content' ) ); |
@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | // ** PHP error settings ** // |
4 | 4 | error_reporting( E_ERROR | E_PARSE ); |
5 | -ini_set( 'display_errors', 0 ); |
|
5 | +ini_set( 'display_errors', 0 ); |
|
6 | 6 | |
7 | 7 | // ** Wordpress debug settings ** // |
8 | -define( 'WP_DEBUG', getenv( 'WP_DEBUG' ) ?: true ); |
|
9 | -define( 'WP_DEBUG_DISPLAY', getenv( 'WP_DEBUG_DISPLAY' ) ?: false ); |
|
10 | -define( 'WP_DEBUG_LOG', getenv( 'WP_DEBUG_LOG' ) ?: true ); |
|
11 | -define( 'SAVEQUERIES', getenv( 'SAVEQUERIES' ) ?: false ); |
|
12 | -define( 'SCRIPT_DEBUG', getenv( 'SCRIPT_DEBUG' ) ?: false ); |
|
8 | +define( 'WP_DEBUG', getenv( 'WP_DEBUG' ) ?: true ); |
|
9 | +define( 'WP_DEBUG_DISPLAY', getenv( 'WP_DEBUG_DISPLAY' ) ?: false ); |
|
10 | +define( 'WP_DEBUG_LOG', getenv( 'WP_DEBUG_LOG' ) ?: true ); |
|
11 | +define( 'SAVEQUERIES', getenv( 'SAVEQUERIES' ) ?: false ); |
|
12 | +define( 'SCRIPT_DEBUG', getenv( 'SCRIPT_DEBUG' ) ?: false ); |
|
13 | 13 | |
14 | -define( 'FS_CHMOD_DIR', (0775 & ~ umask() ) ); |
|
15 | -define( 'FS_CHMOD_FILE', (0664 & ~ umask() ) ); |
|
14 | +define( 'FS_CHMOD_DIR', ( 0775 & ~ umask() ) ); |
|
15 | +define( 'FS_CHMOD_FILE', ( 0664 & ~ umask() ) ); |
|
16 | 16 | define( 'FS_METHOD', 'direct' ); |
@@ -2,21 +2,21 @@ |
||
2 | 2 | |
3 | 3 | // ** Allow switching on onscreen error reporting ** // |
4 | 4 | // ** by using 'DEBUG' GET/POST variable ** // |
5 | -$debug_mode = isset( $_REQUEST['DEBUG'] ) |
|
6 | - ? ( intval( $_REQUEST['DEBUG'] ) ?: 1 ) |
|
5 | +$debug_mode = isset( $_REQUEST[ 'DEBUG' ] ) |
|
6 | + ? ( intval( $_REQUEST[ 'DEBUG' ] ) ?: 1 ) |
|
7 | 7 | : 0; |
8 | 8 | |
9 | 9 | // ** PHP error settings ** // |
10 | 10 | error_reporting( E_ERROR | E_WARNING | E_PARSE | E_NOTICE ); |
11 | -ini_set( 'display_errors', $debug_mode > 0 ); |
|
11 | +ini_set( 'display_errors', $debug_mode > 0 ); |
|
12 | 12 | |
13 | 13 | // ** Wordpress debug settings ** // |
14 | -define( 'WP_DEBUG', getenv( 'WP_DEBUG_DISPLAY' ) ?: true ); |
|
15 | -define( 'WP_DEBUG_DISPLAY', $debug_mode > 0 || getenv( 'WP_DEBUG_DISPLAY' ) ); |
|
16 | -define( 'WP_DEBUG_LOG', $debug_mode < 1 || getenv( 'WP_DEBUG_LOG' ) ); |
|
17 | -define( 'SAVEQUERIES', 3 === $debug_mode || getenv( 'SAVEQUERIES' ) ); |
|
18 | -define( 'SCRIPT_DEBUG', 2 === $debug_mode || getenv( 'SCRIPT_DEBUG' ) ); |
|
14 | +define( 'WP_DEBUG', getenv( 'WP_DEBUG_DISPLAY' ) ?: true ); |
|
15 | +define( 'WP_DEBUG_DISPLAY', $debug_mode > 0 || getenv( 'WP_DEBUG_DISPLAY' ) ); |
|
16 | +define( 'WP_DEBUG_LOG', $debug_mode < 1 || getenv( 'WP_DEBUG_LOG' ) ); |
|
17 | +define( 'SAVEQUERIES', 3 === $debug_mode || getenv( 'SAVEQUERIES' ) ); |
|
18 | +define( 'SCRIPT_DEBUG', 2 === $debug_mode || getenv( 'SCRIPT_DEBUG' ) ); |
|
19 | 19 | |
20 | -define( 'FS_CHMOD_DIR', (0775 & ~ umask() ) ); |
|
21 | -define( 'FS_CHMOD_FILE', (0664 & ~ umask() ) ); |
|
20 | +define( 'FS_CHMOD_DIR', ( 0775 & ~ umask() ) ); |
|
21 | +define( 'FS_CHMOD_FILE', ( 0664 & ~ umask() ) ); |
|
22 | 22 | define( 'FS_METHOD', 'direct' ); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | // ini_set( 'display_errors', 1 ); ini_set( 'error_reporting', -1 ); |
4 | 4 | |
5 | 5 | // Make sure there is an action first |
6 | -if ( ! isset( $_REQUEST['action'] ) ) { |
|
6 | +if ( ! isset( $_REQUEST[ 'action' ] ) ) { |
|
7 | 7 | die( '0' ); |
8 | 8 | } |
9 | 9 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * This is just an example of a secrept WordPress feature called "fast ajax" |
30 | 30 | */ |
31 | -add_action( 'wp_ajax_example', function () { |
|
31 | +add_action( 'wp_ajax_example', function() { |
|
32 | 32 | // Include the now instantiated global $wpdb Class for use |
33 | 33 | global $wpdb; |
34 | 34 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // ========= ! DO NOT EDIT THE CODE BELOW ! ========= // |
46 | 46 | |
47 | 47 | try { |
48 | - $action_name = sprintf( 'wp_ajax_%s', $_REQUEST['action'] ); |
|
48 | + $action_name = sprintf( 'wp_ajax_%s', $_REQUEST[ 'action' ] ); |
|
49 | 49 | do_action( $action_name ); |
50 | 50 | die( '0' ); |
51 | 51 | } catch ( \Exception $ex ) { |