Skip to content

Commit cfe143d

Browse files
authored
Merge pull request #2315 from WordPress/feature/prefixallglobals-update-constants-lists
NamingConventions/PrefixAllGlobals: update the constants list
2 parents 0a5905e + 3fe65af commit cfe143d

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -145,54 +145,57 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff {
145145
* A list of core constants that are allowed to be defined by plugins and themes.
146146
*
147147
* Source: {@link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/default-constants.php#L0}
148-
* The constants are listed in the order they are found in the source file
149-
* to make life easier for future updates.
148+
* The constants are listed in alphabetic order.
150149
* Only overrulable constants are listed, i.e. those defined within core within
151150
* a `if ( ! defined() ) {}` wrapper.
152151
*
152+
* Last update: July 2023 for WP 6.3 at https://github.com/WordPress/wordpress-develop/commit/6281ce432c50345a57768bf53854d9b65b6cdd52
153+
*
153154
* @since 1.0.0
154155
* @since 3.0.0 Renamed from `$whitelisted_core_constants` to `$allowed_core_constants`.
155156
*
156157
* @var array<string, bool>
157158
*/
158159
protected $allowed_core_constants = array(
159-
'WP_MEMORY_LIMIT' => true,
160-
'WP_MAX_MEMORY_LIMIT' => true,
160+
'ADMIN_COOKIE_PATH' => true,
161+
'AUTH_COOKIE' => true,
162+
'AUTOSAVE_INTERVAL' => true,
163+
'COOKIEHASH' => true,
164+
'COOKIEPATH' => true,
165+
'COOKIE_DOMAIN' => true,
166+
'EMPTY_TRASH_DAYS' => true,
167+
'FORCE_SSL_ADMIN' => true,
168+
'FORCE_SSL_LOGIN' => true, // Deprecated.
169+
'LOGGED_IN_COOKIE' => true,
170+
'MEDIA_TRASH' => true,
171+
'MUPLUGINDIR' => true, // Deprecated.
172+
'PASS_COOKIE' => true,
173+
'PLUGINDIR' => true, // Deprecated.
174+
'PLUGINS_COOKIE_PATH' => true,
175+
'RECOVERY_MODE_COOKIE' => true,
176+
'SCRIPT_DEBUG' => true,
177+
'SECURE_AUTH_COOKIE' => true,
178+
'SHORTINIT' => true,
179+
'SITECOOKIEPATH' => true,
180+
'TEST_COOKIE' => true,
181+
'USER_COOKIE' => true,
182+
'WPMU_PLUGIN_DIR' => true,
183+
'WPMU_PLUGIN_URL' => true,
184+
'WP_CACHE' => true,
161185
'WP_CONTENT_DIR' => true,
186+
'WP_CONTENT_URL' => true,
187+
'WP_CRON_LOCK_TIMEOUT' => true,
162188
'WP_DEBUG' => true,
163189
'WP_DEBUG_DISPLAY' => true,
164190
'WP_DEBUG_LOG' => true,
165-
'WP_CACHE' => true,
166-
'SCRIPT_DEBUG' => true,
167-
'MEDIA_TRASH' => true,
168-
'SHORTINIT' => true,
169-
'WP_CONTENT_URL' => true,
191+
'WP_DEFAULT_THEME' => true,
192+
'WP_DEVELOPMENT_MODE' => true,
193+
'WP_MAX_MEMORY_LIMIT' => true,
194+
'WP_MEMORY_LIMIT' => true,
170195
'WP_PLUGIN_DIR' => true,
171196
'WP_PLUGIN_URL' => true,
172-
'PLUGINDIR' => true,
173-
'WPMU_PLUGIN_DIR' => true,
174-
'WPMU_PLUGIN_URL' => true,
175-
'MUPLUGINDIR' => true,
176-
'COOKIEHASH' => true,
177-
'USER_COOKIE' => true,
178-
'PASS_COOKIE' => true,
179-
'AUTH_COOKIE' => true,
180-
'SECURE_AUTH_COOKIE' => true,
181-
'LOGGED_IN_COOKIE' => true,
182-
'TEST_COOKIE' => true,
183-
'COOKIEPATH' => true,
184-
'SITECOOKIEPATH' => true,
185-
'ADMIN_COOKIE_PATH' => true,
186-
'PLUGINS_COOKIE_PATH' => true,
187-
'COOKIE_DOMAIN' => true,
188-
'RECOVERY_MODE_COOKIE' => true,
189-
'FORCE_SSL_ADMIN' => true,
190-
'FORCE_SSL_LOGIN' => true,
191-
'AUTOSAVE_INTERVAL' => true,
192-
'EMPTY_TRASH_DAYS' => true,
193197
'WP_POST_REVISIONS' => true,
194-
'WP_CRON_LOCK_TIMEOUT' => true,
195-
'WP_DEFAULT_THEME' => true,
198+
'WP_START_TIMESTAMP' => true,
196199
);
197200

198201
/**

0 commit comments

Comments
 (0)