· 5 years ago · Mar 04, 2020, 06:10 PM
1root@83c426aa11ed:/var/www/html# cat wp-settings.php
2<?php
3/**
4 * Used to set up and fix common variables and include
5 * the WordPress procedural and class library.
6 *
7 * Allows for some configuration in wp-config.php (see default-constants.php)
8 *
9 * @package WordPress
10 */
11
12/**
13 * Stores the location of the WordPress directory of functions, classes, and core content.
14 *
15 * @since 1.0.0
16 */
17define( 'WPINC', 'wp-includes' );
18
19/*
20 * These can't be directly globalized in version.php. When updating,
21 * we're including version.php from another installation and don't want
22 * these values to be overridden if already set.
23 */
24global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package;
25require( ABSPATH . WPINC . '/version.php' );
26require( ABSPATH . WPINC . '/load.php' );
27
28// Check for the required PHP version and for the MySQL extension or a database drop-in.
29wp_check_php_mysql_versions();
30
31// Include files required for initialization.
32require( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' );
33require( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' );
34require( ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php' );
35require( ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php' );
36require( ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php' );
37require( ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php' );
38require( ABSPATH . WPINC . '/class-wp-recovery-mode.php' );
39require( ABSPATH . WPINC . '/error-protection.php' );
40require( ABSPATH . WPINC . '/default-constants.php' );
41require_once( ABSPATH . WPINC . '/plugin.php' );
42
43/**
44 * If not already configured, `$blog_id` will default to 1 in a single site
45 * configuration. In multisite, it will be overridden by default in ms-settings.php.
46 *
47 * @global int $blog_id
48 * @since 2.0.0
49 */
50global $blog_id;
51
52// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE.
53wp_initial_constants();
54
55// Make sure we register the shutdown handler for fatal errors as soon as possible.
56wp_register_fatal_error_handler();
57
58// WordPress calculates offsets from UTC.
59date_default_timezone_set( 'UTC' );
60
61// Turn register_globals off.
62wp_unregister_GLOBALS();
63
64// Standardize $_SERVER variables across setups.
65wp_fix_server_vars();
66
67// Check if we have received a request due to missing favicon.ico
68wp_favicon_request();
69
70// Check if we're in maintenance mode.
71wp_maintenance();
72
73// Start loading timer.
74timer_start();
75
76// Check if we're in WP_DEBUG mode.
77wp_debug_mode();
78
79/**
80 * Filters whether to enable loading of the advanced-cache.php drop-in.
81 *
82 * This filter runs before it can be used by plugins. It is designed for non-web
83 * run-times. If false is returned, advanced-cache.php will never be loaded.
84 *
85 * @since 4.6.0
86 *
87 * @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present).
88 * Default true.
89 */
90if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
91 // For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
92 include( WP_CONTENT_DIR . '/advanced-cache.php' );
93
94 // Re-initialize any hooks added manually by advanced-cache.php
95 if ( $wp_filter ) {
96 $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter );
97 }
98}
99
100// Define WP_LANG_DIR if not set.
101wp_set_lang_dir();
102
103// Load early WordPress files.
104require( ABSPATH . WPINC . '/compat.php' );
105require( ABSPATH . WPINC . '/class-wp-list-util.php' );
106require( ABSPATH . WPINC . '/formatting.php' );
107require( ABSPATH . WPINC . '/meta.php' );
108require( ABSPATH . WPINC . '/functions.php' );
109require( ABSPATH . WPINC . '/class-wp-meta-query.php' );
110require( ABSPATH . WPINC . '/class-wp-matchesmapregex.php' );
111require( ABSPATH . WPINC . '/class-wp.php' );
112require( ABSPATH . WPINC . '/class-wp-error.php' );
113require( ABSPATH . WPINC . '/pomo/mo.php' );
114
115// Include the wpdb class and, if present, a db.php database drop-in.
116global $wpdb;
117require_wp_db();
118
119// Set the database table prefix and the format specifiers for database table columns.
120$GLOBALS['table_prefix'] = $table_prefix;
121wp_set_wpdb_vars();
122
123// Start the WordPress object cache, or an external object cache if the drop-in is present.
124wp_start_object_cache();
125
126// Attach the default filters.
127require( ABSPATH . WPINC . '/default-filters.php' );
128
129// Initialize multisite if enabled.
130if ( is_multisite() ) {
131 require( ABSPATH . WPINC . '/class-wp-site-query.php' );
132 require( ABSPATH . WPINC . '/class-wp-network-query.php' );
133 require( ABSPATH . WPINC . '/ms-blogs.php' );
134 require( ABSPATH . WPINC . '/ms-settings.php' );
135} elseif ( ! defined( 'MULTISITE' ) ) {
136 define( 'MULTISITE', false );
137}
138
139register_shutdown_function( 'shutdown_action_hook' );
140
141// Stop most of WordPress from being loaded if we just want the basics.
142if ( SHORTINIT ) {
143 return false;
144}
145
146// Load the L10n library.
147require_once( ABSPATH . WPINC . '/l10n.php' );
148require_once( ABSPATH . WPINC . '/class-wp-locale.php' );
149require_once( ABSPATH . WPINC . '/class-wp-locale-switcher.php' );
150
151// Run the installer if WordPress is not installed.
152wp_not_installed();
153
154// Load most of WordPress.
155require( ABSPATH . WPINC . '/class-wp-walker.php' );
156require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
157require( ABSPATH . WPINC . '/capabilities.php' );
158require( ABSPATH . WPINC . '/class-wp-roles.php' );
159require( ABSPATH . WPINC . '/class-wp-role.php' );
160require( ABSPATH . WPINC . '/class-wp-user.php' );
161require( ABSPATH . WPINC . '/class-wp-query.php' );
162require( ABSPATH . WPINC . '/query.php' );
163require( ABSPATH . WPINC . '/class-wp-date-query.php' );
164require( ABSPATH . WPINC . '/theme.php' );
165require( ABSPATH . WPINC . '/class-wp-theme.php' );
166require( ABSPATH . WPINC . '/template.php' );
167require( ABSPATH . WPINC . '/class-wp-user-request.php' );
168require( ABSPATH . WPINC . '/user.php' );
169require( ABSPATH . WPINC . '/class-wp-user-query.php' );
170require( ABSPATH . WPINC . '/class-wp-session-tokens.php' );
171require( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' );
172require( ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php' );
173require( ABSPATH . WPINC . '/general-template.php' );
174require( ABSPATH . WPINC . '/link-template.php' );
175require( ABSPATH . WPINC . '/author-template.php' );
176require( ABSPATH . WPINC . '/post.php' );
177require( ABSPATH . WPINC . '/class-walker-page.php' );
178require( ABSPATH . WPINC . '/class-walker-page-dropdown.php' );
179require( ABSPATH . WPINC . '/class-wp-post-type.php' );
180require( ABSPATH . WPINC . '/class-wp-post.php' );
181require( ABSPATH . WPINC . '/post-template.php' );
182require( ABSPATH . WPINC . '/revision.php' );
183require( ABSPATH . WPINC . '/post-formats.php' );
184require( ABSPATH . WPINC . '/post-thumbnail-template.php' );
185require( ABSPATH . WPINC . '/category.php' );
186require( ABSPATH . WPINC . '/class-walker-category.php' );
187require( ABSPATH . WPINC . '/class-walker-category-dropdown.php' );
188require( ABSPATH . WPINC . '/category-template.php' );
189require( ABSPATH . WPINC . '/comment.php' );
190require( ABSPATH . WPINC . '/class-wp-comment.php' );
191require( ABSPATH . WPINC . '/class-wp-comment-query.php' );
192require( ABSPATH . WPINC . '/class-walker-comment.php' );
193require( ABSPATH . WPINC . '/comment-template.php' );
194require( ABSPATH . WPINC . '/rewrite.php' );
195require( ABSPATH . WPINC . '/class-wp-rewrite.php' );
196require( ABSPATH . WPINC . '/feed.php' );
197require( ABSPATH . WPINC . '/bookmark.php' );
198require( ABSPATH . WPINC . '/bookmark-template.php' );
199require( ABSPATH . WPINC . '/kses.php' );
200require( ABSPATH . WPINC . '/cron.php' );
201require( ABSPATH . WPINC . '/deprecated.php' );
202require( ABSPATH . WPINC . '/script-loader.php' );
203require( ABSPATH . WPINC . '/taxonomy.php' );
204require( ABSPATH . WPINC . '/class-wp-taxonomy.php' );
205require( ABSPATH . WPINC . '/class-wp-term.php' );
206require( ABSPATH . WPINC . '/class-wp-term-query.php' );
207require( ABSPATH . WPINC . '/class-wp-tax-query.php' );
208require( ABSPATH . WPINC . '/update.php' );
209require( ABSPATH . WPINC . '/canonical.php' );
210require( ABSPATH . WPINC . '/shortcodes.php' );
211require( ABSPATH . WPINC . '/embed.php' );
212require( ABSPATH . WPINC . '/class-wp-embed.php' );
213require( ABSPATH . WPINC . '/class-wp-oembed.php' );
214require( ABSPATH . WPINC . '/class-wp-oembed-controller.php' );
215require( ABSPATH . WPINC . '/media.php' );
216require( ABSPATH . WPINC . '/http.php' );
217require( ABSPATH . WPINC . '/class-http.php' );
218require( ABSPATH . WPINC . '/class-wp-http-streams.php' );
219require( ABSPATH . WPINC . '/class-wp-http-curl.php' );
220require( ABSPATH . WPINC . '/class-wp-http-proxy.php' );
221require( ABSPATH . WPINC . '/class-wp-http-cookie.php' );
222require( ABSPATH . WPINC . '/class-wp-http-encoding.php' );
223require( ABSPATH . WPINC . '/class-wp-http-response.php' );
224require( ABSPATH . WPINC . '/class-wp-http-requests-response.php' );
225require( ABSPATH . WPINC . '/class-wp-http-requests-hooks.php' );
226require( ABSPATH . WPINC . '/widgets.php' );
227require( ABSPATH . WPINC . '/class-wp-widget.php' );
228require( ABSPATH . WPINC . '/class-wp-widget-factory.php' );
229require( ABSPATH . WPINC . '/nav-menu.php' );
230require( ABSPATH . WPINC . '/nav-menu-template.php' );
231require( ABSPATH . WPINC . '/admin-bar.php' );
232require( ABSPATH . WPINC . '/rest-api.php' );
233require( ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' );
234require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' );
235require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' );
236require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php' );
237require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php' );
238require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php' );
239require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php' );
240require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php' );
241require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php' );
242require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php' );
243require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php' );
244require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php' );
245require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' );
246require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' );
247require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' );
248require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php' );
249require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php' );
250require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' );
251require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' );
252require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php' );
253require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php' );
254require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php' );
255require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' );
256require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' );
257require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' );
258require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' );
259require( ABSPATH . WPINC . '/class-wp-block-type.php' );
260require( ABSPATH . WPINC . '/class-wp-block-styles-registry.php' );
261require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' );
262require( ABSPATH . WPINC . '/class-wp-block-parser.php' );
263require( ABSPATH . WPINC . '/blocks.php' );
264require( ABSPATH . WPINC . '/blocks/archives.php' );
265require( ABSPATH . WPINC . '/blocks/block.php' );
266require( ABSPATH . WPINC . '/blocks/calendar.php' );
267require( ABSPATH . WPINC . '/blocks/categories.php' );
268require( ABSPATH . WPINC . '/blocks/latest-comments.php' );
269require( ABSPATH . WPINC . '/blocks/latest-posts.php' );
270require( ABSPATH . WPINC . '/blocks/rss.php' );
271require( ABSPATH . WPINC . '/blocks/search.php' );
272require( ABSPATH . WPINC . '/blocks/shortcode.php' );
273require( ABSPATH . WPINC . '/blocks/tag-cloud.php' );
274
275$GLOBALS['wp_embed'] = new WP_Embed();
276
277// Load multisite-specific files.
278if ( is_multisite() ) {
279 require( ABSPATH . WPINC . '/ms-functions.php' );
280 require( ABSPATH . WPINC . '/ms-default-filters.php' );
281 require( ABSPATH . WPINC . '/ms-deprecated.php' );
282}
283
284// Define constants that rely on the API to obtain the default value.
285// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
286wp_plugin_directory_constants();
287
288$GLOBALS['wp_plugin_paths'] = array();
289
290// Load must-use plugins.
291foreach ( wp_get_mu_plugins() as $mu_plugin ) {
292 include_once( $mu_plugin );
293
294 /**
295 * Fires once a single must-use plugin has loaded.
296 *
297 * @since 5.1.0
298 *
299 * @param string $mu_plugin Full path to the plugin's main file.
300 */
301 do_action( 'mu_plugin_loaded', $mu_plugin );
302}
303unset( $mu_plugin );
304
305// Load network activated plugins.
306if ( is_multisite() ) {
307 foreach ( wp_get_active_network_plugins() as $network_plugin ) {
308 wp_register_plugin_realpath( $network_plugin );
309 include_once( $network_plugin );
310
311 /**
312 * Fires once a single network-activated plugin has loaded.
313 *
314 * @since 5.1.0
315 *
316 * @param string $network_plugin Full path to the plugin's main file.
317 */
318 do_action( 'network_plugin_loaded', $network_plugin );
319 }
320 unset( $network_plugin );
321}
322
323/**
324 * Fires once all must-use and network-activated plugins have loaded.
325 *
326 * @since 2.8.0
327 */
328do_action( 'muplugins_loaded' );
329
330if ( is_multisite() ) {
331 ms_cookie_constants();
332}
333
334// Define constants after multisite is loaded.
335wp_cookie_constants();
336
337// Define and enforce our SSL constants
338wp_ssl_constants();
339
340// Create common globals.
341require( ABSPATH . WPINC . '/vars.php' );
342
343// Make taxonomies and posts available to plugins and themes.
344// @plugin authors: warning: these get registered again on the init hook.
345create_initial_taxonomies();
346create_initial_post_types();
347
348wp_start_scraping_edited_file_errors();
349
350// Register the default theme directory root
351register_theme_directory( get_theme_root() );
352
353if ( ! is_multisite() ) {
354 // Handle users requesting a recovery mode link and initiating recovery mode.
355 wp_recovery_mode()->initialize();
356}
357
358// Load active plugins.
359foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
360 wp_register_plugin_realpath( $plugin );
361 include_once( $plugin );
362
363 /**
364 * Fires once a single activated plugin has loaded.
365 *
366 * @since 5.1.0
367 *
368 * @param string $plugin Full path to the plugin's main file.
369 */
370 do_action( 'plugin_loaded', $plugin );
371}
372unset( $plugin );
373
374// Load pluggable functions.
375require( ABSPATH . WPINC . '/pluggable.php' );
376require( ABSPATH . WPINC . '/pluggable-deprecated.php' );
377
378// Set internal encoding.
379wp_set_internal_encoding();
380
381// Run wp_cache_postload() if object cache is enabled and the function exists.
382if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) {
383 wp_cache_postload();
384}
385
386/**
387 * Fires once activated plugins have loaded.
388 *
389 * Pluggable functions are also available at this point in the loading order.
390 *
391 * @since 1.5.0
392 */
393do_action( 'plugins_loaded' );
394
395// Define constants which affect functionality if not already defined.
396wp_functionality_constants();
397
398// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
399wp_magic_quotes();
400
401/**
402 * Fires when comment cookies are sanitized.
403 *
404 * @since 2.0.11
405 */
406do_action( 'sanitize_comment_cookies' );
407
408/**
409 * WordPress Query object
410 *
411 * @global WP_Query $wp_the_query WordPress Query object.
412 * @since 2.0.0
413 */
414$GLOBALS['wp_the_query'] = new WP_Query();
415
416/**
417 * Holds the reference to @see $wp_the_query
418 * Use this global for WordPress queries
419 *
420 * @global WP_Query $wp_query WordPress Query object.
421 * @since 1.5.0
422 */
423$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
424
425/**
426 * Holds the WordPress Rewrite object for creating pretty URLs
427 *
428 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
429 * @since 1.5.0
430 */
431$GLOBALS['wp_rewrite'] = new WP_Rewrite();
432
433/**
434 * WordPress Object
435 *
436 * @global WP $wp Current WordPress environment instance.
437 * @since 2.0.0
438 */
439$GLOBALS['wp'] = new WP();
440
441/**
442 * WordPress Widget Factory Object
443 *
444 * @global WP_Widget_Factory $wp_widget_factory
445 * @since 2.8.0
446 */
447$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
448
449/**
450 * WordPress User Roles
451 *
452 * @global WP_Roles $wp_roles WordPress role management object.
453 * @since 2.0.0
454 */
455$GLOBALS['wp_roles'] = new WP_Roles();
456
457/**
458 * Fires before the theme is loaded.
459 *
460 * @since 2.6.0
461 */
462do_action( 'setup_theme' );
463
464// Define the template related constants.
465wp_templating_constants();
466
467// Load the default text localization domain.
468load_default_textdomain();
469
470$locale = get_locale();
471$locale_file = WP_LANG_DIR . "/$locale.php";
472if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) {
473 require( $locale_file );
474}
475unset( $locale_file );
476
477/**
478 * WordPress Locale object for loading locale domain date and various strings.
479 *
480 * @global WP_Locale $wp_locale WordPress date and time locale object.
481 * @since 2.1.0
482 */
483$GLOBALS['wp_locale'] = new WP_Locale();
484
485/**
486 * WordPress Locale Switcher object for switching locales.
487 *
488 * @since 4.7.0
489 *
490 * @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
491 */
492$GLOBALS['wp_locale_switcher'] = new WP_Locale_Switcher();
493$GLOBALS['wp_locale_switcher']->init();
494
495// Load the functions for the active theme, for both parent and child theme if applicable.
496foreach ( wp_get_active_and_valid_themes() as $theme ) {
497 if ( file_exists( $theme . '/functions.php' ) ) {
498 include $theme . '/functions.php';
499 }
500}
501unset( $theme );
502
503/**
504 * Fires after the theme is loaded.
505 *
506 * @since 3.0.0
507 */
508do_action( 'after_setup_theme' );
509
510// Set up current user.
511$GLOBALS['wp']->init();
512
513/**
514 * Fires after WordPress has finished loading but before any headers are sent.
515 *
516 * Most of WP is loaded at this stage, and the user is authenticated. WP continues
517 * to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate
518 * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
519 *
520 * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below.
521 *
522 * @since 1.5.0
523 */
524do_action( 'init' );
525
526// Check site status
527if ( is_multisite() ) {
528 $file = ms_site_check();
529 if ( true !== $file ) {
530 require( $file );
531 die();
532 }
533 unset( $file );
534}
535
536/**
537 * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
538 *
539 * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for
540 * users not logged in.
541 *
542 * @link https://codex.wordpress.org/AJAX_in_Plugins
543 *
544 * @since 3.0.0
545 */
546do_action( 'wp_loaded' );
547root@83c426aa11ed:/var/www/html#