PluginProbe
Plugin Detective – Troubleshooting Conflicts / 1.1.2
Plugin Detective – Troubleshooting Conflicts v1.1.2
1.2.33 1.2.32 1.2.31 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2 1.2.1 1.2.10 1.2.12 1.2.13 1.2.14 1.2.16 1.2.19 1.2.20 1.2.22 1.2.23 1.2.24 1.2.25 All 53 releases
plugin-detective / troubleshoot / includes / class-settings.php

class-settings.php in Plugin Detective – Troubleshooting Conflicts 1.1.2, at troubleshoot/includes/class-settings.php

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