From 47ed56f38ff85423c82642fa3a19b0948bf5b6a4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 6 Feb 2020 06:33:11 +0000 Subject: [PATCH] Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant. This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`. This commit also includes: * Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls. * Replacing `include` statements for several files with `require_once`, for consistency: * `wp-admin/admin-header.php` * `wp-admin/admin-footer.php` * `wp-includes/version.php` Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb. Fixes #48082. Built from https://develop.svn.wordpress.org/trunk@47198 git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- index.php | 2 +- wp-activate.php | 4 +- wp-admin/about.php | 6 +- wp-admin/admin-ajax.php | 6 +- wp-admin/admin-functions.php | 2 +- wp-admin/admin-header.php | 6 +- wp-admin/admin-post.php | 6 +- wp-admin/admin.php | 28 +- wp-admin/async-upload.php | 8 +- wp-admin/comment.php | 10 +- wp-admin/credits.php | 10 +- wp-admin/custom-background.php | 2 +- wp-admin/custom-header.php | 2 +- wp-admin/customize.php | 2 +- wp-admin/edit-comments.php | 6 +- wp-admin/edit-form-advanced.php | 4 +- wp-admin/edit-form-blocks.php | 4 +- wp-admin/edit-link-form.php | 4 +- wp-admin/edit-tag-form.php | 2 +- wp-admin/edit-tags.php | 8 +- wp-admin/edit.php | 6 +- wp-admin/erase-personal-data.php | 6 +- wp-admin/export-personal-data.php | 6 +- wp-admin/export.php | 8 +- wp-admin/freedoms.php | 6 +- wp-admin/import.php | 6 +- wp-admin/includes/admin.php | 62 ++-- wp-admin/includes/ajax-actions.php | 34 +- wp-admin/includes/class-core-upgrader.php | 6 +- wp-admin/includes/class-ftp.php | 2 +- .../includes/class-wp-community-events.php | 2 +- .../class-wp-filesystem-ftpsockets.php | 2 +- .../class-wp-plugin-install-list-table.php | 2 +- ...rivacy-data-export-requests-list-table.php | 2 +- ...ivacy-data-removal-requests-list-table.php | 2 +- .../class-wp-site-health-auto-updates.php | 8 +- wp-admin/includes/class-wp-site-health.php | 4 +- .../class-wp-theme-install-list-table.php | 2 +- wp-admin/includes/comment.php | 2 +- wp-admin/includes/credits.php | 2 +- wp-admin/includes/dashboard.php | 4 +- wp-admin/includes/deprecated.php | 8 +- wp-admin/includes/file.php | 6 +- wp-admin/includes/import.php | 2 +- wp-admin/includes/list-table.php | 2 +- wp-admin/includes/media.php | 4 +- wp-admin/includes/misc.php | 4 +- wp-admin/includes/nav-menu.php | 4 +- wp-admin/includes/network.php | 6 +- wp-admin/includes/plugin-install.php | 2 +- wp-admin/includes/plugin.php | 18 +- wp-admin/includes/template.php | 4 +- wp-admin/includes/theme.php | 10 +- wp-admin/includes/translation-install.php | 4 +- wp-admin/includes/update-core.php | 4 +- wp-admin/includes/update.php | 4 +- wp-admin/includes/upgrade.php | 8 +- wp-admin/index.php | 8 +- wp-admin/install-helper.php | 4 +- wp-admin/install.php | 8 +- wp-admin/link-add.php | 6 +- wp-admin/link-manager.php | 6 +- wp-admin/link.php | 6 +- wp-admin/load-scripts.php | 8 +- wp-admin/load-styles.php | 8 +- wp-admin/maint/repair.php | 2 +- wp-admin/media-new.php | 6 +- wp-admin/media-upload.php | 2 +- wp-admin/media.php | 6 +- wp-admin/menu.php | 2 +- wp-admin/moderation.php | 2 +- wp-admin/ms-admin.php | 2 +- wp-admin/ms-delete-site.php | 6 +- wp-admin/ms-edit.php | 2 +- wp-admin/ms-options.php | 2 +- wp-admin/ms-sites.php | 2 +- wp-admin/ms-themes.php | 2 +- wp-admin/ms-upgrade-network.php | 2 +- wp-admin/ms-users.php | 2 +- wp-admin/my-sites.php | 6 +- wp-admin/nav-menus.php | 8 +- wp-admin/network.php | 10 +- wp-admin/network/about.php | 4 +- wp-admin/network/admin.php | 2 +- wp-admin/network/credits.php | 4 +- wp-admin/network/edit.php | 2 +- wp-admin/network/freedoms.php | 4 +- wp-admin/network/index.php | 8 +- wp-admin/network/menu.php | 2 +- wp-admin/network/plugin-editor.php | 4 +- wp-admin/network/plugin-install.php | 4 +- wp-admin/network/plugins.php | 4 +- wp-admin/network/privacy.php | 4 +- wp-admin/network/profile.php | 4 +- wp-admin/network/settings.php | 8 +- wp-admin/network/setup.php | 4 +- wp-admin/network/site-info.php | 6 +- wp-admin/network/site-new.php | 8 +- wp-admin/network/site-settings.php | 6 +- wp-admin/network/site-themes.php | 6 +- wp-admin/network/site-users.php | 6 +- wp-admin/network/sites.php | 14 +- wp-admin/network/theme-editor.php | 4 +- wp-admin/network/theme-install.php | 4 +- wp-admin/network/themes.php | 16 +- wp-admin/network/update-core.php | 4 +- wp-admin/network/update.php | 4 +- wp-admin/network/upgrade.php | 8 +- wp-admin/network/user-edit.php | 4 +- wp-admin/network/user-new.php | 6 +- wp-admin/network/users.php | 14 +- wp-admin/options-discussion.php | 6 +- wp-admin/options-general.php | 8 +- wp-admin/options-media.php | 6 +- wp-admin/options-permalink.php | 6 +- wp-admin/options-privacy.php | 8 +- wp-admin/options-reading.php | 6 +- wp-admin/options-writing.php | 6 +- wp-admin/options.php | 8 +- wp-admin/plugin-editor.php | 10 +- wp-admin/plugin-install.php | 6 +- wp-admin/plugins.php | 16 +- wp-admin/post-new.php | 8 +- wp-admin/post.php | 9 +- wp-admin/press-this.php | 4 +- wp-admin/privacy-policy-guide.php | 8 +- wp-admin/privacy.php | 6 +- wp-admin/profile.php | 2 +- wp-admin/revision.php | 6 +- wp-admin/setup-config.php | 8 +- wp-admin/site-health-info.php | 10 +- wp-admin/site-health.php | 10 +- wp-admin/term.php | 8 +- wp-admin/theme-editor.php | 6 +- wp-admin/theme-install.php | 8 +- wp-admin/themes.php | 6 +- wp-admin/tools.php | 10 +- wp-admin/update-core.php | 28 +- wp-admin/update.php | 34 +- wp-admin/upgrade-functions.php | 2 +- wp-admin/upgrade.php | 4 +- wp-admin/upload.php | 10 +- wp-admin/user-edit.php | 6 +- wp-admin/user-new.php | 6 +- wp-admin/user/about.php | 4 +- wp-admin/user/admin.php | 2 +- wp-admin/user/credits.php | 4 +- wp-admin/user/freedoms.php | 4 +- wp-admin/user/index.php | 4 +- wp-admin/user/menu.php | 2 +- wp-admin/user/privacy.php | 4 +- wp-admin/user/profile.php | 4 +- wp-admin/user/user-edit.php | 4 +- wp-admin/users.php | 10 +- wp-admin/widgets.php | 12 +- wp-blog-header.php | 4 +- wp-comments-post.php | 2 +- wp-config-sample.php | 4 +- wp-content/themes/twentyeleven/functions.php | 4 +- .../themes/twentyseventeen/functions.php | 2 +- .../twentyseventeen/inc/icon-functions.php | 2 +- wp-content/themes/twentytwelve/functions.php | 2 +- wp-cron.php | 2 +- wp-includes/admin-bar.php | 2 +- wp-includes/class-IXR.php | 20 +- wp-includes/class-feed.php | 10 +- wp-includes/class-http.php | 2 +- wp-includes/class-oembed.php | 2 +- wp-includes/class-phpmailer.php | 2 +- wp-includes/class-simplepie.php | 2 +- wp-includes/class-wp-customize-control.php | 40 +-- wp-includes/class-wp-customize-manager.php | 80 ++--- wp-includes/class-wp-customize-panel.php | 2 +- wp-includes/class-wp-customize-section.php | 6 +- wp-includes/class-wp-customize-setting.php | 10 +- wp-includes/class-wp-editor.php | 4 +- wp-includes/comment-template.php | 6 +- wp-includes/comment.php | 8 +- wp-includes/cron.php | 2 +- ...lass-wp-customize-header-image-setting.php | 2 +- .../class-wp-customize-selective-refresh.php | 2 +- wp-includes/date.php | 2 +- wp-includes/default-widgets.php | 38 +- wp-includes/deprecated.php | 4 +- wp-includes/embed-template.php | 2 +- wp-includes/feed.php | 10 +- wp-includes/functions.php | 10 +- wp-includes/general-template.php | 6 +- wp-includes/js/tinymce/wp-tinymce.php | 2 +- wp-includes/l10n.php | 2 +- wp-includes/load.php | 20 +- wp-includes/ms-blogs.php | 4 +- wp-includes/ms-deprecated.php | 4 +- wp-includes/ms-files.php | 2 +- wp-includes/ms-settings.php | 10 +- wp-includes/ms-site.php | 2 +- wp-includes/pluggable.php | 6 +- wp-includes/plugin.php | 2 +- wp-includes/pomo/mo.php | 4 +- wp-includes/pomo/po.php | 2 +- wp-includes/pomo/translations.php | 4 +- wp-includes/rss-functions.php | 2 +- wp-includes/script-loader.php | 21 +- wp-includes/session.php | 4 +- wp-includes/template-loader.php | 4 +- wp-includes/template.php | 4 +- wp-includes/theme.php | 6 +- wp-includes/update.php | 14 +- wp-includes/version.php | 2 +- wp-includes/widgets/class-wp-widget-text.php | 2 +- wp-includes/wp-db.php | 2 +- wp-includes/wp-diff.php | 10 +- wp-links-opml.php | 2 +- wp-load.php | 12 +- wp-login.php | 2 +- wp-mail.php | 4 +- wp-settings.php | 326 +++++++++--------- wp-signup.php | 4 +- wp-trackback.php | 2 +- xmlrpc.php | 8 +- 220 files changed, 901 insertions(+), 901 deletions(-) diff --git a/index.php b/index.php index 86334797d6..cc2a532abe 100644 --- a/index.php +++ b/index.php @@ -14,4 +14,4 @@ define( 'WP_USE_THEMES', true ); /** Loads the WordPress Environment and Template */ -require( dirname( __FILE__ ) . '/wp-blog-header.php' ); +require __DIR__ . '/wp-blog-header.php'; diff --git a/wp-activate.php b/wp-activate.php index 5949372fe7..446cb7382c 100644 --- a/wp-activate.php +++ b/wp-activate.php @@ -9,9 +9,9 @@ define( 'WP_INSTALLING', true ); /** Sets up the WordPress Environment. */ -require( dirname( __FILE__ ) . '/wp-load.php' ); +require __DIR__ . '/wp-load.php'; -require( dirname( __FILE__ ) . '/wp-blog-header.php' ); +require __DIR__ . '/wp-blog-header.php'; if ( ! is_multisite() ) { wp_redirect( wp_registration_url() ); diff --git a/wp-admin/about.php b/wp-admin/about.php index 3a7865a9fe..3cdd964a4c 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -7,14 +7,14 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; /* translators: Page title of the About WordPress page in the admin. */ $title = _x( 'About', 'page title' ); list( $display_version ) = explode( '-', get_bloginfo( 'version' ) ); -include( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -202,7 +202,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
- +
50 && mt_rand( 0, (int) ( $c / 50 ) ) == 1 ) ) { - require_once( ABSPATH . WPINC . '/http.php' ); + require_once ABSPATH . WPINC . '/http.php'; $response = wp_remote_get( admin_url( 'upgrade.php?step=1' ), array( @@ -89,7 +89,7 @@ if ( get_option( 'db_upgraded' ) ) { } } -require_once( ABSPATH . 'wp-admin/includes/admin.php' ); +require_once ABSPATH . 'wp-admin/includes/admin.php'; auth_redirect(); @@ -146,11 +146,11 @@ if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) } if ( WP_NETWORK_ADMIN ) { - require( ABSPATH . 'wp-admin/network/menu.php' ); + require ABSPATH . 'wp-admin/network/menu.php'; } elseif ( WP_USER_ADMIN ) { - require( ABSPATH . 'wp-admin/user/menu.php' ); + require ABSPATH . 'wp-admin/user/menu.php'; } else { - require( ABSPATH . 'wp-admin/menu.php' ); + require ABSPATH . 'wp-admin/menu.php'; } if ( current_user_can( 'manage_options' ) ) { @@ -231,7 +231,7 @@ if ( isset( $plugin_page ) ) { */ do_action( "load-{$page_hook}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores if ( ! isset( $_GET['noheader'] ) ) { - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; } /** @@ -277,17 +277,17 @@ if ( isset( $plugin_page ) ) { do_action( "load-{$plugin_page}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores if ( ! isset( $_GET['noheader'] ) ) { - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; } if ( file_exists( WPMU_PLUGIN_DIR . "/$plugin_page" ) ) { - include( WPMU_PLUGIN_DIR . "/$plugin_page" ); + include WPMU_PLUGIN_DIR . "/$plugin_page"; } else { - include( WP_PLUGIN_DIR . "/$plugin_page" ); + include WP_PLUGIN_DIR . "/$plugin_page"; } } - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; exit(); } elseif ( isset( $_GET['import'] ) ) { @@ -322,10 +322,10 @@ if ( isset( $plugin_page ) ) { $title = __( 'Import' ); if ( ! isset( $_GET['noheader'] ) ) { - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; } - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; define( 'WP_IMPORTING', true ); @@ -345,7 +345,7 @@ if ( isset( $plugin_page ) ) { call_user_func( $wp_importers[ $importer ][2] ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; // Make sure rules are flushed. flush_rewrite_rules( false ); diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php index 349335ec0a..0419e71a1a 100644 --- a/wp-admin/async-upload.php +++ b/wp-admin/async-upload.php @@ -15,17 +15,17 @@ if ( ! defined( 'WP_ADMIN' ) ) { } if ( defined( 'ABSPATH' ) ) { - require_once( ABSPATH . 'wp-load.php' ); + require_once ABSPATH . 'wp-load.php'; } else { - require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); + require_once dirname( __DIR__ ) . '/wp-load.php'; } -require_once( ABSPATH . 'wp-admin/admin.php' ); +require_once ABSPATH . 'wp-admin/admin.php'; header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) ); if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { - include( ABSPATH . 'wp-admin/includes/ajax-actions.php' ); + require ABSPATH . 'wp-admin/includes/ajax-actions.php'; send_nosniff_header(); nocache_headers(); diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 7678a83d92..ecf56917ff 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -7,7 +7,7 @@ */ /** Load WordPress Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; $parent_file = 'edit-comments.php'; $submenu_file = 'edit-comments.php'; @@ -58,7 +58,7 @@ switch ( $action ) { ); wp_enqueue_script( 'comment' ); - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; $comment_id = absint( $_GET['c'] ); @@ -77,7 +77,7 @@ switch ( $action ) { $comment = get_comment_to_edit( $comment_id ); - include( ABSPATH . 'wp-admin/edit-form-comment.php' ); + require ABSPATH . 'wp-admin/edit-form-comment.php'; break; @@ -106,7 +106,7 @@ switch ( $action ) { die(); } - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; $formaction = $action . 'comment'; $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_'; @@ -357,4 +357,4 @@ switch ( $action ) { } // End switch. -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/credits.php b/wp-admin/credits.php index e6e66564ed..6dad50bdce 100644 --- a/wp-admin/credits.php +++ b/wp-admin/credits.php @@ -7,14 +7,14 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); -require_once( dirname( __FILE__ ) . '/includes/credits.php' ); +require_once __DIR__ . '/admin.php'; +require_once __DIR__ . '/includes/credits.php'; $title = __( 'Credits' ); list( $display_version ) = explode( '-', get_bloginfo( 'version' ) ); -include( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; $credits = wp_credits(); ?> @@ -82,7 +82,7 @@ $credits = wp_credits(); '; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } ?> @@ -129,7 +129,7 @@ if ( ! $credits ) {
' . __( 'You need a higher level of permission.' ) . '' . @@ -205,7 +205,7 @@ get_current_screen()->set_screen_reader_content( ) ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -351,4 +351,4 @@ if ( isset( $_REQUEST['approved'] ) || isset( $_REQUEST['deleted'] ) || isset( $ +require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 4a41ab6659..a061e9b899 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -264,7 +264,7 @@ if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql $post_type_object = get_post_type_object( $post_type ); // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). -require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); +require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; register_and_do_post_meta_boxes( $post ); @@ -416,7 +416,7 @@ if ( 'post' == $post_type ) { ); } -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
diff --git a/wp-admin/edit-form-blocks.php b/wp-admin/edit-form-blocks.php index 274325ae74..3be4e8797a 100644 --- a/wp-admin/edit-form-blocks.php +++ b/wp-admin/edit-form-blocks.php @@ -363,7 +363,7 @@ wp_enqueue_style( 'wp-format-library' ); do_action( 'enqueue_block_editor_assets' ); // In order to duplicate classic meta box behaviour, we need to run the classic meta box actions. -require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); +require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; register_and_do_post_meta_boxes( $post ); // Check if the Custom Fields meta box has been removed at some point. @@ -401,7 +401,7 @@ $script = sprintf( ); wp_add_inline_script( 'wp-edit-post', $script ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 13cc68ae05..f71684de63 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -25,7 +25,7 @@ if ( ! empty( $link_id ) ) { $nonce_action = 'add-bookmark'; } -require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); +require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; add_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' ); add_meta_box( 'linkcategorydiv', __( 'Categories' ), 'link_categories_meta_box', null, 'normal', 'core' ); @@ -77,7 +77,7 @@ get_current_screen()->set_help_sidebar( '

' . __( 'Support' ) . '

' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php index 42350b709a..f50595e3c3 100644 --- a/wp-admin/edit-tag-form.php +++ b/wp-admin/edit-tag-form.php @@ -52,7 +52,7 @@ wp_reset_vars( array( 'wp_http_referer' ) ); $wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer ); /** Also used by Edit Tags */ -require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' ); +require_once ABSPATH . 'wp-admin/includes/edit-tag-messages.php'; /** * Fires before the Edit Term form for all taxonomies. diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index de1dc624c9..aedd70c1c5 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! $taxnow ) { wp_die( __( 'Invalid taxonomy.' ) ); @@ -318,10 +318,10 @@ if ( 'category' === $taxonomy || 'link_category' === $taxonomy || 'post_tag' === unset( $help ); } -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; /** Also used by the Edit Tag form */ -require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' ); +require_once ABSPATH . 'wp-admin/includes/edit-tag-messages.php'; $class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated'; @@ -658,4 +658,4 @@ endif; $wp_list_table->inline_edit(); -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 0584e7fe6d..b6ea9e8d94 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! $typenow ) { wp_die( __( 'Invalid post type.' ) ); @@ -383,7 +383,7 @@ $bulk_messages['wp_block'] = array( $bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts ); $bulk_counts = array_filter( $bulk_counts ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

@@ -461,4 +461,4 @@ if ( $wp_list_table->has_items() ) {

screen->set_screen_reader_content( $requests_table->process_bulk_action(); $requests_table->prepare_items(); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -89,4 +89,4 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
screen->set_screen_reader_content( $requests_table->process_bulk_action(); $requests_table->prepare_items(); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -89,4 +89,4 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
- + diff --git a/wp-admin/freedoms.php b/wp-admin/freedoms.php index dcb2eeb794..5f072da9dc 100644 --- a/wp-admin/freedoms.php +++ b/wp-admin/freedoms.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; // This file was used to also display the Privacy tab on the About screen from 4.9.6 until 5.3.0. if ( isset( $_GET['privacy-notice'] ) ) { @@ -19,7 +19,7 @@ $title = __( 'Freedoms' ); list( $display_version ) = explode( '-', get_bloginfo( 'version' ) ); -include( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -123,4 +123,4 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
- + diff --git a/wp-admin/import.php b/wp-admin/import.php index 7931126458..b5d09a1c76 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -9,7 +9,7 @@ define( 'WP_LOAD_IMPORTERS', true ); /** Load WordPress Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'import' ) ) { wp_die( __( 'Sorry, you are not allowed to import content into this site.' ) ); @@ -53,7 +53,7 @@ add_thickbox(); wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; $parent_file = 'tools.php'; ?> @@ -237,4 +237,4 @@ if ( current_user_can( 'install_plugins' ) ) { wp_print_request_filesystem_credentials_modal(); wp_print_admin_notice_templates(); -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/includes/admin.php b/wp-admin/includes/admin.php index 43f0014eb2..c2c1890ec8 100644 --- a/wp-admin/includes/admin.php +++ b/wp-admin/includes/admin.php @@ -17,83 +17,83 @@ if ( ! defined( 'WP_ADMIN' ) ) { } /** WordPress Administration Hooks */ -require_once( ABSPATH . 'wp-admin/includes/admin-filters.php' ); +require_once ABSPATH . 'wp-admin/includes/admin-filters.php'; /** WordPress Bookmark Administration API */ -require_once( ABSPATH . 'wp-admin/includes/bookmark.php' ); +require_once ABSPATH . 'wp-admin/includes/bookmark.php'; /** WordPress Comment Administration API */ -require_once( ABSPATH . 'wp-admin/includes/comment.php' ); +require_once ABSPATH . 'wp-admin/includes/comment.php'; /** WordPress Administration File API */ -require_once( ABSPATH . 'wp-admin/includes/file.php' ); +require_once ABSPATH . 'wp-admin/includes/file.php'; /** WordPress Image Administration API */ -require_once( ABSPATH . 'wp-admin/includes/image.php' ); +require_once ABSPATH . 'wp-admin/includes/image.php'; /** WordPress Media Administration API */ -require_once( ABSPATH . 'wp-admin/includes/media.php' ); +require_once ABSPATH . 'wp-admin/includes/media.php'; /** WordPress Import Administration API */ -require_once( ABSPATH . 'wp-admin/includes/import.php' ); +require_once ABSPATH . 'wp-admin/includes/import.php'; /** WordPress Misc Administration API */ -require_once( ABSPATH . 'wp-admin/includes/misc.php' ); +require_once ABSPATH . 'wp-admin/includes/misc.php'; /** WordPress Misc Administration API */ -require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' ); +require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; /** WordPress Options Administration API */ -require_once( ABSPATH . 'wp-admin/includes/options.php' ); +require_once ABSPATH . 'wp-admin/includes/options.php'; /** WordPress Plugin Administration API */ -require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); +require_once ABSPATH . 'wp-admin/includes/plugin.php'; /** WordPress Post Administration API */ -require_once( ABSPATH . 'wp-admin/includes/post.php' ); +require_once ABSPATH . 'wp-admin/includes/post.php'; /** WordPress Administration Screen API */ -require_once( ABSPATH . 'wp-admin/includes/class-wp-screen.php' ); -require_once( ABSPATH . 'wp-admin/includes/screen.php' ); +require_once ABSPATH . 'wp-admin/includes/class-wp-screen.php'; +require_once ABSPATH . 'wp-admin/includes/screen.php'; /** WordPress Taxonomy Administration API */ -require_once( ABSPATH . 'wp-admin/includes/taxonomy.php' ); +require_once ABSPATH . 'wp-admin/includes/taxonomy.php'; /** WordPress Template Administration API */ -require_once( ABSPATH . 'wp-admin/includes/template.php' ); +require_once ABSPATH . 'wp-admin/includes/template.php'; /** WordPress List Table Administration API and base class */ -require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); -require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table-compat.php' ); -require_once( ABSPATH . 'wp-admin/includes/list-table.php' ); +require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; +require_once ABSPATH . 'wp-admin/includes/class-wp-list-table-compat.php'; +require_once ABSPATH . 'wp-admin/includes/list-table.php'; /** WordPress Theme Administration API */ -require_once( ABSPATH . 'wp-admin/includes/theme.php' ); +require_once ABSPATH . 'wp-admin/includes/theme.php'; /** WordPress Privacy Functions */ -require_once( ABSPATH . 'wp-admin/includes/privacy-tools.php' ); +require_once ABSPATH . 'wp-admin/includes/privacy-tools.php'; /** WordPress Privacy List Table classes. */ // Previously in wp-admin/includes/user.php. Need to be loaded for backward compatibility. -require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php' ); -require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php' ); -require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php' ); +require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php'; +require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php'; +require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php'; /** WordPress User Administration API */ -require_once( ABSPATH . 'wp-admin/includes/user.php' ); +require_once ABSPATH . 'wp-admin/includes/user.php'; /** WordPress Site Icon API */ -require_once( ABSPATH . 'wp-admin/includes/class-wp-site-icon.php' ); +require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php'; /** WordPress Update Administration API */ -require_once( ABSPATH . 'wp-admin/includes/update.php' ); +require_once ABSPATH . 'wp-admin/includes/update.php'; /** WordPress Deprecated Administration API */ -require_once( ABSPATH . 'wp-admin/includes/deprecated.php' ); +require_once ABSPATH . 'wp-admin/includes/deprecated.php'; /** WordPress Multisite support API */ if ( is_multisite() ) { - require_once( ABSPATH . 'wp-admin/includes/ms-admin-filters.php' ); - require_once( ABSPATH . 'wp-admin/includes/ms.php' ); - require_once( ABSPATH . 'wp-admin/includes/ms-deprecated.php' ); + require_once ABSPATH . 'wp-admin/includes/ms-admin-filters.php'; + require_once ABSPATH . 'wp-admin/includes/ms.php'; + require_once ABSPATH . 'wp-admin/includes/ms-deprecated.php'; } diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index b8716377b9..a0fa7cbf88 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -234,7 +234,7 @@ function wp_ajax_imgedit_preview() { check_ajax_referer( "image_editor-$post_id" ); - include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); + include_once ABSPATH . 'wp-admin/includes/image-edit.php'; if ( ! stream_preview_image( $post_id ) ) { wp_die( -1 ); @@ -336,7 +336,7 @@ function wp_ajax_autocomplete_user() { * @since 4.8.0 */ function wp_ajax_get_community_events() { - require_once( ABSPATH . 'wp-admin/includes/class-wp-community-events.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php'; check_ajax_referer( 'community_events' ); @@ -1345,7 +1345,7 @@ function wp_ajax_replyto_comment( $action ) { ob_start(); if ( isset( $_REQUEST['mode'] ) && 'dashboard' == $_REQUEST['mode'] ) { - require_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); + require_once ABSPATH . 'wp-admin/includes/dashboard.php'; _wp_dashboard_recent_comments_row( $comment ); } else { if ( isset( $_REQUEST['mode'] ) && 'single' == $_REQUEST['mode'] ) { @@ -1855,7 +1855,7 @@ function wp_ajax_wp_link_ajax() { $args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1; if ( ! class_exists( '_WP_Editors', false ) ) { - require( ABSPATH . WPINC . '/class-wp-editor.php' ); + require ABSPATH . WPINC . '/class-wp-editor.php'; } $results = _WP_Editors::wp_link_query( $args ); @@ -2597,7 +2597,7 @@ function wp_ajax_image_editor() { } check_ajax_referer( "image_editor-$attachment_id" ); - include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); + include_once ABSPATH . 'wp-admin/includes/image-edit.php'; $msg = false; switch ( $_POST['do'] ) { @@ -4004,8 +4004,8 @@ function wp_ajax_install_theme() { wp_send_json_error( $status ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); - include_once( ABSPATH . 'wp-admin/includes/theme.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + include_once ABSPATH . 'wp-admin/includes/theme.php'; $api = themes_api( 'theme_information', @@ -4133,7 +4133,7 @@ function wp_ajax_update_theme() { $status['oldVersion'] = $theme->get( 'Version' ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $current = get_site_transient( 'update_themes' ); if ( empty( $current ) ) { @@ -4247,7 +4247,7 @@ function wp_ajax_delete_theme() { wp_send_json_error( $status ); } - include_once( ABSPATH . 'wp-admin/includes/theme.php' ); + include_once ABSPATH . 'wp-admin/includes/theme.php'; $result = delete_theme( $stylesheet ); @@ -4294,8 +4294,8 @@ function wp_ajax_install_plugin() { wp_send_json_error( $status ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); - include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $api = plugins_api( 'plugin_information', @@ -4416,7 +4416,7 @@ function wp_ajax_update_plugin() { $status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; wp_update_plugins(); @@ -5119,7 +5119,7 @@ function wp_ajax_health_check_dotorg_communication() { } if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } $site_health = WP_Site_Health::get_instance(); @@ -5139,7 +5139,7 @@ function wp_ajax_health_check_is_in_debug_mode() { } if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } $site_health = WP_Site_Health::get_instance(); @@ -5159,7 +5159,7 @@ function wp_ajax_health_check_background_updates() { } if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } $site_health = WP_Site_Health::get_instance(); @@ -5180,7 +5180,7 @@ function wp_ajax_health_check_loopback_requests() { } if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } $site_health = WP_Site_Health::get_instance(); @@ -5217,7 +5217,7 @@ function wp_ajax_health_check_get_sizes() { } if ( ! class_exists( 'WP_Debug_Data' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-debug-data.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php'; } $sizes_data = WP_Debug_Data::get_sizes(); diff --git a/wp-admin/includes/class-core-upgrader.php b/wp-admin/includes/class-core-upgrader.php index 328c91de15..95c6c82f76 100644 --- a/wp-admin/includes/class-core-upgrader.php +++ b/wp-admin/includes/class-core-upgrader.php @@ -62,7 +62,7 @@ class Core_Upgrader extends WP_Upgrader { public function upgrade( $current, $args = array() ) { global $wp_filesystem; - include( ABSPATH . WPINC . '/version.php' ); // $wp_version; + require ABSPATH . WPINC . '/version.php'; // $wp_version; $start_time = time(); @@ -161,7 +161,7 @@ class Core_Upgrader extends WP_Upgrader { } $wp_filesystem->chmod( $wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE ); - require_once( ABSPATH . 'wp-admin/includes/update-core.php' ); + require_once ABSPATH . 'wp-admin/includes/update-core.php'; if ( ! function_exists( 'update_core' ) ) { WP_Upgrader::release_lock( 'core_updater' ); @@ -270,7 +270,7 @@ class Core_Upgrader extends WP_Upgrader { * @return bool True if we should update to the offered version, otherwise false. */ public static function should_update_to_version( $offered_ver ) { - include( ABSPATH . WPINC . '/version.php' ); // $wp_version; // x.y.z + require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z $current_branch = implode( '.', array_slice( preg_split( '/[.-]/', $wp_version ), 0, 2 ) ); // x.y $new_branch = implode( '.', array_slice( preg_split( '/[.-]/', $offered_ver ), 0, 2 ) ); // x.y diff --git a/wp-admin/includes/class-ftp.php b/wp-admin/includes/class-ftp.php index a377640c65..8e2624cedc 100644 --- a/wp-admin/includes/class-ftp.php +++ b/wp-admin/includes/class-ftp.php @@ -903,7 +903,7 @@ if ( ! $mod_sockets && function_exists( 'dl' ) && is_callable( 'dl' ) ) { $mod_sockets = extension_loaded( 'sockets' ); } -require_once dirname( __FILE__ ) . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php"; +require_once __DIR__ . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php"; if ( $mod_sockets ) { class ftp extends ftp_sockets {} diff --git a/wp-admin/includes/class-wp-community-events.php b/wp-admin/includes/class-wp-community-events.php index 43a9218e8d..443968f4d7 100644 --- a/wp-admin/includes/class-wp-community-events.php +++ b/wp-admin/includes/class-wp-community-events.php @@ -93,7 +93,7 @@ class WP_Community_Events { } // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $api_url = 'http://api.wordpress.org/events/1.0/'; $request_args = $this->get_request_args( $location_search, $timezone ); diff --git a/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/wp-admin/includes/class-wp-filesystem-ftpsockets.php index 01cbc9ceac..e78b467473 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -33,7 +33,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { $this->errors = new WP_Error(); // Check if possible to use ftp functions. - if ( ! include_once( ABSPATH . 'wp-admin/includes/class-ftp.php' ) ) { + if ( ! include_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) { return; } $this->ftp = new ftp(); diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php index 2a0e004b6b..fe3f6af9f0 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -85,7 +85,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { * @global string $term */ public function prepare_items() { - include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); + include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; global $tabs, $tab, $paged, $type, $term; diff --git a/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php b/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php index 683ea69697..880af8cd04 100644 --- a/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php +++ b/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php @@ -8,7 +8,7 @@ */ if ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php'; } /** diff --git a/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php b/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php index 8e2efa0379..b894865064 100644 --- a/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php +++ b/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php @@ -8,7 +8,7 @@ */ if ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php'; } /** diff --git a/wp-admin/includes/class-wp-site-health-auto-updates.php b/wp-admin/includes/class-wp-site-health-auto-updates.php index 299744968c..f69f9540c2 100644 --- a/wp-admin/includes/class-wp-site-health-auto-updates.php +++ b/wp-admin/includes/class-wp-site-health-auto-updates.php @@ -13,7 +13,7 @@ class WP_Site_Health_Auto_Updates { * @since 5.2.0 */ public function __construct() { - include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; } @@ -166,7 +166,7 @@ class WP_Site_Health_Auto_Updates { */ public function test_wp_automatic_updates_disabled() { if ( ! class_exists( 'WP_Automatic_Updater' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-automatic-updates.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updates.php'; } $auto_updates = new WP_Automatic_Updater(); @@ -336,7 +336,7 @@ class WP_Site_Health_Auto_Updates { function test_all_files_writable() { global $wp_filesystem; - include ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z + require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z $skin = new Automatic_Upgrader_Skin; $success = $skin->request_filesystem_credentials( false, ABSPATH ); @@ -414,7 +414,7 @@ class WP_Site_Health_Auto_Updates { * @return array|bool The test results. False if it isn't a development version. */ function test_accepts_dev_updates() { - include ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z + require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z // Only for dev versions. if ( false === strpos( $wp_version, '-' ) ) { return false; diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 8afe9a8aa4..bbf38dce62 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -1632,7 +1632,7 @@ class WP_Site_Health { ); if ( ! class_exists( 'WP_Site_Health_Auto_Updates' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health-auto-updates.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health-auto-updates.php'; } // Run the auto-update tests in a separate class, @@ -2223,7 +2223,7 @@ class WP_Site_Health { */ public function wp_cron_scheduled_check() { // Bootstrap wp-admin, as WP_Cron doesn't do this for us. - require_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/admin.php' ); + require_once trailingslashit( ABSPATH ) . 'wp-admin/includes/admin.php'; $tests = WP_Site_Health::get_tests(); diff --git a/wp-admin/includes/class-wp-theme-install-list-table.php b/wp-admin/includes/class-wp-theme-install-list-table.php index 3edabf6d30..04594edaa0 100644 --- a/wp-admin/includes/class-wp-theme-install-list-table.php +++ b/wp-admin/includes/class-wp-theme-install-list-table.php @@ -34,7 +34,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { * @global array $theme_field_defaults */ public function prepare_items() { - include( ABSPATH . 'wp-admin/includes/theme-install.php' ); + require ABSPATH . 'wp-admin/includes/theme-install.php'; global $tabs, $tab, $paged, $type, $theme_field_defaults; wp_reset_vars( array( 'tab' ) ); diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index afe38fa3cd..4000fe7a36 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -209,6 +209,6 @@ function enqueue_comment_hotkeys_js() { */ function comment_footer_die( $msg ) { echo "

$msg

"; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; die; } diff --git a/wp-admin/includes/credits.php b/wp-admin/includes/credits.php index 59ccc28c2e..ed6071b1d5 100644 --- a/wp-admin/includes/credits.php +++ b/wp-admin/includes/credits.php @@ -16,7 +16,7 @@ */ function wp_credits() { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $locale = get_user_locale(); diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 919af94c0b..25005d0c92 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -45,7 +45,7 @@ function wp_dashboard_setup() { // Site Health. if ( current_user_can( 'view_site_health_checks' ) ) { if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } WP_Site_Health::get_instance(); @@ -1665,7 +1665,7 @@ function wp_check_browser_version() { $response = get_site_transient( 'browser_' . $key ); if ( false === $response ) { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $url = 'http://api.wordpress.org/core/browse-happy/1.1/'; $options = array( diff --git a/wp-admin/includes/deprecated.php b/wp-admin/includes/deprecated.php index 9d30abcf80..c37d7f5537 100644 --- a/wp-admin/includes/deprecated.php +++ b/wp-admin/includes/deprecated.php @@ -763,7 +763,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) { static $num = 1; if ( ! class_exists( '_WP_Editors', false ) ) - require_once( ABSPATH . WPINC . '/class-wp-editor.php' ); + require_once ABSPATH . WPINC . '/class-wp-editor.php'; $editor_id = 'content' . $num++; @@ -1157,7 +1157,7 @@ function wp_update_core($current, $feedback = '') { if ( !empty($feedback) ) add_filter('update_feedback', $feedback); - include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $upgrader = new Core_Upgrader(); return $upgrader->upgrade($current); @@ -1180,7 +1180,7 @@ function wp_update_plugin($plugin, $feedback = '') { if ( !empty($feedback) ) add_filter('update_feedback', $feedback); - include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $upgrader = new Plugin_Upgrader(); return $upgrader->upgrade($plugin); } @@ -1202,7 +1202,7 @@ function wp_update_theme($theme, $feedback = '') { if ( !empty($feedback) ) add_filter('update_feedback', $feedback); - include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $upgrader = new Theme_Upgrader(); return $upgrader->upgrade($theme); } diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index bbf1368844..f9603ba35f 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -1597,7 +1597,7 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) { mbstring_binary_safe_encoding(); - require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' ); + require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; $archive = new PclZip( $file ); @@ -1769,7 +1769,7 @@ function copy_dir( $from, $to, $skip_list = array() ) { function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid global $wp_filesystem; - require_once( ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; $method = get_filesystem_method( $args, $context, $allow_relaxed_file_ownership ); @@ -1795,7 +1795,7 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own return; } - require_once( $abstraction_file ); + require_once $abstraction_file; } $method = "WP_Filesystem_$method"; diff --git a/wp-admin/includes/import.php b/wp-admin/includes/import.php index 1b36d6a4d9..e15faef1d2 100644 --- a/wp-admin/includes/import.php +++ b/wp-admin/includes/import.php @@ -137,7 +137,7 @@ function wp_import_handle_upload() { */ function wp_get_popular_importers() { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $locale = get_user_locale(); $cache_key = 'popular_importers_' . md5( $locale . $wp_version ); diff --git a/wp-admin/includes/list-table.php b/wp-admin/includes/list-table.php index 881bb37388..dce5eef702 100644 --- a/wp-admin/includes/list-table.php +++ b/wp-admin/includes/list-table.php @@ -46,7 +46,7 @@ function _get_list_table( $class, $args = array() ) { if ( isset( $core_classes[ $class ] ) ) { foreach ( (array) $core_classes[ $class ] as $required ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php'; } if ( isset( $args['screen'] ) ) { diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 72dbf2aeda..5d45569860 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -3458,7 +3458,7 @@ function wp_read_video_metadata( $file ) { } if ( ! class_exists( 'getID3', false ) ) { - require( ABSPATH . WPINC . '/ID3/getid3.php' ); + require ABSPATH . WPINC . '/ID3/getid3.php'; } $id3 = new getID3(); @@ -3569,7 +3569,7 @@ function wp_read_audio_metadata( $file ) { } if ( ! class_exists( 'getID3', false ) ) { - require( ABSPATH . WPINC . '/ID3/getid3.php' ); + require ABSPATH . WPINC . '/ID3/getid3.php'; } $id3 = new getID3(); diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 6cbef809a7..e965efa35e 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -254,7 +254,7 @@ function save_mod_rewrite_rules() { global $wp_rewrite; // Ensure get_home_path() is declared. - require_once( ABSPATH . 'wp-admin/includes/file.php' ); + require_once ABSPATH . 'wp-admin/includes/file.php'; $home_path = get_home_path(); $htaccess_file = $home_path . '.htaccess'; @@ -291,7 +291,7 @@ function iis7_save_url_rewrite_rules() { global $wp_rewrite; // Ensure get_home_path() is declared. - require_once( ABSPATH . 'wp-admin/includes/file.php' ); + require_once ABSPATH . 'wp-admin/includes/file.php'; $home_path = get_home_path(); $web_config_file = $home_path . 'web.config'; diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index 185e659677..d4d7d01a69 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -8,10 +8,10 @@ */ /** Walker_Nav_Menu_Edit class */ -require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php' ); +require_once ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php'; /** Walker_Nav_Menu_Checklist class */ -require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-checklist.php' ); +require_once ABSPATH . 'wp-admin/includes/class-walker-nav-menu-checklist.php'; /** * Prints the appropriate response to a menu quick search. diff --git a/wp-admin/includes/network.php b/wp-admin/includes/network.php index 9dc665eda8..f2a51347fe 100644 --- a/wp-admin/includes/network.php +++ b/wp-admin/includes/network.php @@ -116,7 +116,7 @@ function network_step1( $errors = false ) { 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) . '

'; echo '
'; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; die(); } @@ -129,7 +129,7 @@ function network_step1( $errors = false ) { ) . '

'; echo '

' . __( 'Once the network is created, you may reactivate your plugins.' ) . '

'; echo ''; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; die(); } @@ -144,7 +144,7 @@ function network_step1( $errors = false ) { ) . '

'; echo '' . __( 'Return to Dashboard' ) . ''; echo ''; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; die(); } diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index d15a9aaf32..9f90f84cb5 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -101,7 +101,7 @@ */ function plugins_api( $action, $args = array() ) { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; if ( is_array( $args ) ) { $args = (object) $args; diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index ca8bb51e8b..9cd11e7a3b 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -656,7 +656,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) { define( 'WP_SANDBOX_SCRAPING', true ); } - include_once( WP_PLUGIN_DIR . '/' . $plugin ); + include_once WP_PLUGIN_DIR . '/' . $plugin; $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin. if ( ! $silent ) { @@ -907,9 +907,9 @@ function delete_plugins( $plugins, $deprecated = '' ) { if ( false === $credentials ) { if ( ! empty( $data ) ) { - include_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; echo $data; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } return; @@ -922,9 +922,9 @@ function delete_plugins( $plugins, $deprecated = '' ) { $data = ob_get_clean(); if ( ! empty( $data ) ) { - include_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; echo $data; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } return; @@ -1219,7 +1219,7 @@ function uninstall_plugin( $plugin ) { define( 'WP_UNINSTALL_PLUGIN', $file ); wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file ); - include( WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php' ); + include WP_PLUGIN_DIR . '/' . dirname( $file ) . '/uninstall.php'; return true; } @@ -1231,7 +1231,7 @@ function uninstall_plugin( $plugin ) { unset( $uninstallable_plugins ); wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $file ); - include( WP_PLUGIN_DIR . '/' . $file ); + include WP_PLUGIN_DIR . '/' . $file; add_action( "uninstall_{$file}", $callable ); @@ -2252,7 +2252,7 @@ function plugin_sandbox_scrape( $plugin ) { define( 'WP_SANDBOX_SCRAPING', true ); } wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); - include( WP_PLUGIN_DIR . '/' . $plugin ); + include WP_PLUGIN_DIR . '/' . $plugin; } /** @@ -2307,7 +2307,7 @@ function wp_add_privacy_policy_content( $plugin_name, $policy_text ) { } if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; } WP_Privacy_Policy_Content::add( $plugin_name, $policy_text ); diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 81e3d7d462..49718e8bd0 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -9,10 +9,10 @@ */ /** Walker_Category_Checklist class */ -require_once( ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php' ); +require_once ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php'; /** WP_Internal_Pointers class */ -require_once( ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php' ); +require_once ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php'; // // Category Checklists. diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 9f7a181553..47168057e0 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -35,9 +35,9 @@ function delete_theme( $stylesheet, $redirect = '' ) { if ( false === $credentials ) { if ( ! empty( $data ) ) { - include_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; echo $data; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } return; @@ -50,9 +50,9 @@ function delete_theme( $stylesheet, $redirect = '' ) { $data = ob_get_clean(); if ( ! empty( $data ) ) { - include_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; echo $data; - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } return; @@ -435,7 +435,7 @@ function get_theme_feature_list( $api = true ) { */ function themes_api( $action, $args = array() ) { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; if ( is_array( $args ) ) { $args = (object) $args; diff --git a/wp-admin/includes/translation-install.php b/wp-admin/includes/translation-install.php index 24983d01a4..76ad22bd81 100644 --- a/wp-admin/includes/translation-install.php +++ b/wp-admin/includes/translation-install.php @@ -18,7 +18,7 @@ */ function translations_api( $type, $args = null ) { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; if ( ! in_array( $type, array( 'plugins', 'themes', 'core' ) ) ) { return new WP_Error( 'invalid_type', __( 'Invalid translation type.' ) ); @@ -128,7 +128,7 @@ function wp_get_available_translations() { } // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $api = translations_api( 'core', array( 'version' => $wp_version ) ); diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 9a5906a2bd..fa5858ac41 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -936,7 +936,7 @@ function update_core( $from, $to ) { } $wp_filesystem->chmod( $versions_file, FS_CHMOD_FILE ); - require( WP_CONTENT_DIR . '/upgrade/version-current.php' ); + require WP_CONTENT_DIR . '/upgrade/version-current.php'; $wp_filesystem->delete( $versions_file ); $php_version = phpversion(); @@ -1433,7 +1433,7 @@ window.location = 'about.php?updated'; Gravatar.' $privacy_policy_content = get_site_option( 'default_privacy_policy_content' ); } else { if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { - include_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' ); + include_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; } $privacy_policy_content = WP_Privacy_Policy_Content::get_default_content(); diff --git a/wp-admin/index.php b/wp-admin/index.php index 7dcf45c481..9368c06966 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -7,10 +7,10 @@ */ /** Load WordPress Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; /** Load WordPress dashboard API */ -require_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); +require_once ABSPATH . 'wp-admin/includes/dashboard.php'; wp_dashboard_setup(); @@ -108,7 +108,7 @@ $screen->set_help_sidebar( '

' . __( 'Support' ) . '

' ); -include( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -153,4 +153,4 @@ if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) set_screen_reader_content( ) ); -include_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; if ( ! current_user_can( 'manage_links' ) ) { wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) ); @@ -134,4 +134,4 @@ if ( isset( $_REQUEST['deleted'] ) ) {
diff --git a/wp-admin/media-new.php b/wp-admin/media-new.php index 41e7db2f91..cb684c3079 100644 --- a/wp-admin/media-new.php +++ b/wp-admin/media-new.php @@ -10,7 +10,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'upload_files' ) ) { wp_die( __( 'Sorry, you are not allowed to upload files.' ) ); @@ -61,7 +61,7 @@ get_current_screen()->set_help_sidebar( '

' . __( 'Support' ) . '

' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; $form_class = 'media-upload-form type-form validate'; @@ -86,4 +86,4 @@ if ( get_user_setting( 'uploader' ) || isset( $_GET['browser-uploader'] ) ) { ' . __( 'Support' ) . '

' ); - require( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; $parent_file = 'upload.php'; $message = ''; @@ -166,7 +166,7 @@ switch ( $action ) { 'appearance', ); -require_once( ABSPATH . 'wp-admin/includes/menu.php' ); +require_once ABSPATH . 'wp-admin/includes/menu.php'; diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php index ae375df3e7..f52ff79475 100644 --- a/wp-admin/moderation.php +++ b/wp-admin/moderation.php @@ -7,6 +7,6 @@ * @package WordPress * @subpackage Administration */ -require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); +require_once dirname( __DIR__ ) . '/wp-load.php'; wp_redirect( admin_url( 'edit-comments.php?comment_status=moderated' ) ); exit; diff --git a/wp-admin/ms-admin.php b/wp-admin/ms-admin.php index 35e21e971a..24339eca28 100644 --- a/wp-admin/ms-admin.php +++ b/wp-admin/ms-admin.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url() ); exit; diff --git a/wp-admin/ms-delete-site.php b/wp-admin/ms-delete-site.php index 3cb1574356..3332f50e29 100644 --- a/wp-admin/ms-delete-site.php +++ b/wp-admin/ms-delete-site.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! is_multisite() ) { wp_die( __( 'Multisite support is not enabled.' ) ); @@ -37,7 +37,7 @@ $user = wp_get_current_user(); $title = __( 'Delete Site' ); $parent_file = 'tools.php'; -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; echo '
'; echo '

' . esc_html( $title ) . '

'; @@ -133,4 +133,4 @@ Webmaster } echo '
'; -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/ms-edit.php b/wp-admin/ms-edit.php index 5c405e6f73..c9503b358d 100644 --- a/wp-admin/ms-edit.php +++ b/wp-admin/ms-edit.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url() ); exit; diff --git a/wp-admin/ms-options.php b/wp-admin/ms-options.php index 6bf5eb6b1b..ebc8529624 100644 --- a/wp-admin/ms-options.php +++ b/wp-admin/ms-options.php @@ -7,6 +7,6 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url( 'settings.php' ) ); diff --git a/wp-admin/ms-sites.php b/wp-admin/ms-sites.php index 79602cb07f..f1f8fdcb58 100644 --- a/wp-admin/ms-sites.php +++ b/wp-admin/ms-sites.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url( 'sites.php' ) ); exit; diff --git a/wp-admin/ms-themes.php b/wp-admin/ms-themes.php index 4b86ac9684..f3d8a38352 100644 --- a/wp-admin/ms-themes.php +++ b/wp-admin/ms-themes.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url( 'themes.php' ) ); exit; diff --git a/wp-admin/ms-upgrade-network.php b/wp-admin/ms-upgrade-network.php index 892ab964c7..25c604631b 100644 --- a/wp-admin/ms-upgrade-network.php +++ b/wp-admin/ms-upgrade-network.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url( 'upgrade.php' ) ); exit; diff --git a/wp-admin/ms-users.php b/wp-admin/ms-users.php index 1b00514ec3..6771807157 100644 --- a/wp-admin/ms-users.php +++ b/wp-admin/ms-users.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url( 'users.php' ) ); exit; diff --git a/wp-admin/my-sites.php b/wp-admin/my-sites.php index a733cf25ed..6ee48eac55 100644 --- a/wp-admin/my-sites.php +++ b/wp-admin/my-sites.php @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! is_multisite() ) { wp_die( __( 'Multisite support is not enabled.' ) ); @@ -52,7 +52,7 @@ get_current_screen()->set_help_sidebar( '

' . __( 'Support' ) . '

' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; if ( $updated ) { ?>

@@ -157,4 +157,4 @@ else : set_help_sidebar( ); // Get the admin header. -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

@@ -1035,4 +1035,4 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
- + diff --git a/wp-admin/network.php b/wp-admin/network.php index a3409622a0..cc24b7f773 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -13,7 +13,7 @@ define( 'WP_INSTALLING_NETWORK', true ); /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'setup_network' ) ) { wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) ); @@ -30,7 +30,7 @@ if ( is_multisite() ) { } } -require_once( dirname( __FILE__ ) . '/includes/network.php' ); +require_once __DIR__ . '/includes/network.php'; // We need to create references to ms global tables to enable Network. foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) { @@ -81,7 +81,7 @@ get_current_screen()->set_help_sidebar( '

' . __( 'Support' ) . '

' ); -include( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

@@ -91,7 +91,7 @@ if ( $_POST ) { check_admin_referer( 'install-network-1' ); - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; // Create network tables. install_network(); $base = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH ); @@ -118,4 +118,4 @@ if ( $_POST ) { ?>
- + diff --git a/wp-admin/network/about.php b/wp-admin/network/about.php index 829fa1beef..35fde6858f 100644 --- a/wp-admin/network/about.php +++ b/wp-admin/network/about.php @@ -8,6 +8,6 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; -require( ABSPATH . 'wp-admin/about.php' ); +require ABSPATH . 'wp-admin/about.php'; diff --git a/wp-admin/network/admin.php b/wp-admin/network/admin.php index 2c7c04ed02..30332152ec 100644 --- a/wp-admin/network/admin.php +++ b/wp-admin/network/admin.php @@ -10,7 +10,7 @@ define( 'WP_NETWORK_ADMIN', true ); /** Load WordPress Administration Bootstrap */ -require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' ); +require_once dirname( __DIR__ ) . '/admin.php'; // Do not remove this check. It is required by individual network admin pages. if ( ! is_multisite() ) { diff --git a/wp-admin/network/credits.php b/wp-admin/network/credits.php index 75ee6e7337..6e6a0a9961 100644 --- a/wp-admin/network/credits.php +++ b/wp-admin/network/credits.php @@ -8,6 +8,6 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; -require( ABSPATH . 'wp-admin/credits.php' ); +require ABSPATH . 'wp-admin/credits.php'; diff --git a/wp-admin/network/edit.php b/wp-admin/network/edit.php index 51381e40bf..e33792debf 100644 --- a/wp-admin/network/edit.php +++ b/wp-admin/network/edit.php @@ -8,7 +8,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; $action = ( isset( $_GET['action'] ) ) ? $_GET['action'] : ''; diff --git a/wp-admin/network/freedoms.php b/wp-admin/network/freedoms.php index 9afbe82f34..b6319df607 100644 --- a/wp-admin/network/freedoms.php +++ b/wp-admin/network/freedoms.php @@ -8,6 +8,6 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; -require( ABSPATH . 'wp-admin/freedoms.php' ); +require ABSPATH . 'wp-admin/freedoms.php'; diff --git a/wp-admin/network/index.php b/wp-admin/network/index.php index fbc169bd21..352744430b 100644 --- a/wp-admin/network/index.php +++ b/wp-admin/network/index.php @@ -8,10 +8,10 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; /** Load WordPress dashboard API */ -require_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); +require_once ABSPATH . 'wp-admin/includes/dashboard.php'; if ( ! current_user_can( 'manage_network' ) ) { wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); @@ -62,7 +62,7 @@ wp_enqueue_script( 'dashboard' ); wp_enqueue_script( 'plugin-install' ); add_thickbox(); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?> @@ -80,4 +80,4 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );

@@ -486,4 +486,4 @@ if ( isset( $_GET['updated'] ) ) { - + diff --git a/wp-admin/network/setup.php b/wp-admin/network/setup.php index 9a642bbb92..4b1f5b1e59 100644 --- a/wp-admin/network/setup.php +++ b/wp-admin/network/setup.php @@ -8,6 +8,6 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; -require( ABSPATH . 'wp-admin/network.php' ); +require ABSPATH . 'wp-admin/network.php'; diff --git a/wp-admin/network/site-info.php b/wp-admin/network/site-info.php index 2bcc1c58a3..c6a69114f2 100644 --- a/wp-admin/network/site-info.php +++ b/wp-admin/network/site-info.php @@ -8,7 +8,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_sites' ) ) { wp_die( __( 'Sorry, you are not allowed to edit this site.' ) ); @@ -127,7 +127,7 @@ $title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); $parent_file = 'sites.php'; $submenu_file = 'sites.php'; -require( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?> @@ -206,4 +206,4 @@ if ( ! empty( $messages ) ) { @@ -300,4 +300,4 @@ printf( blogname ) ); $parent_file = 'sites.php'; $submenu_file = 'sites.php'; -require( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?> @@ -173,4 +173,4 @@ if ( ! empty( $messages ) ) { blogname ) ); $parent_file = 'sites.php'; $submenu_file = 'sites.php'; -require( ABSPATH . 'wp-admin/admin-header.php' ); ?> +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

@@ -226,4 +226,4 @@ if ( isset( $_GET['enabled'] ) ) {
- + diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index 5113025776..cb00cab973 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -8,7 +8,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_sites' ) ) { wp_die( __( 'Sorry, you are not allowed to edit this site.' ), 403 ); @@ -214,7 +214,7 @@ if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users wp_enqueue_script( 'user-suggest' ); } -require( ABSPATH . 'wp-admin/admin-header.php' ); ?> +require_once ABSPATH . 'wp-admin/admin-header.php'; ?> set_screen_reader_content( ) ); wp_enqueue_script( 'admin-tags' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); -include( ABSPATH . 'wp-admin/edit-tag-form.php' ); -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; +require ABSPATH . 'wp-admin/edit-tag-form.php'; +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 7e0d9ab870..31c82ec429 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( is_multisite() && ! is_network_admin() ) { wp_redirect( network_admin_url( 'theme-editor.php' ) ); @@ -147,7 +147,7 @@ wp_enqueue_script( 'wp-theme-plugin-editor' ); wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( "#template" ), %s ); } )', wp_json_encode( $settings ) ) ); wp_add_inline_script( 'wp-theme-plugin-editor', 'wp.themePluginEditor.themeOrPlugin = "theme";' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; update_recently_edited( $file ); @@ -384,4 +384,4 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) : set_help_sidebar( '

' . __( 'Support' ) . '

' ); -include( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -372,4 +372,4 @@ if ( $tab ) { wp_print_request_filesystem_credentials_modal(); wp_print_admin_notice_templates(); -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/themes.php b/wp-admin/themes.php index bf424e93ff..53bb1049a7 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { wp_die( @@ -182,7 +182,7 @@ add_thickbox(); wp_enqueue_script( 'theme' ); wp_enqueue_script( 'updates' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -622,4 +622,4 @@ wp_localize_script( ) ); -require( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/tools.php b/wp-admin/tools.php index 447d6738ac..f74362a172 100644 --- a/wp-admin/tools.php +++ b/wp-admin/tools.php @@ -10,16 +10,16 @@ if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) { // Ensure POST-ing to `tools.php?page=export_personal_data` and `tools.php?page=remove_personal_data` // continues to work after creating the new files for exporting and erasing of personal data. if ( $_GET['page'] === 'export_personal_data' ) { - require_once( ABSPATH . 'wp-admin/export-personal-data.php' ); + require_once ABSPATH . 'wp-admin/export-personal-data.php'; return; } elseif ( $_GET['page'] === 'remove_personal_data' ) { - require_once( ABSPATH . 'wp-admin/erase-personal-data.php' ); + require_once ABSPATH . 'wp-admin/erase-personal-data.php'; return; } } /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; // The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php. if ( isset( $_GET['wp-privacy-policy-guide'] ) ) { @@ -53,7 +53,7 @@ get_current_screen()->set_help_sidebar( '

' . __( 'Support' ) . '

' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -92,4 +92,4 @@ do_action( 'tool_box' );
' . __( 'Plugins' ) . ''; @@ -559,7 +559,7 @@ function list_translation_updates() { function do_core_upgrade( $reinstall = false ) { global $wp_filesystem; - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; if ( $reinstall ) { $url = 'update-core.php?action=do-core-reinstall'; @@ -736,7 +736,7 @@ if ( 'upgrade-core' == $action ) { $force_check = ! empty( $_GET['force-check'] ); wp_version_check( array(), $force_check ); - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

@@ -793,7 +793,7 @@ if ( 'upgrade-core' == $action ) { ) ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { @@ -810,7 +810,7 @@ if ( 'upgrade-core' == $action ) { do_undismiss_core_update(); } - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; if ( 'do-core-reinstall' == $action ) { $reinstall = true; } else { @@ -829,7 +829,7 @@ if ( 'upgrade-core' == $action ) { ) ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-plugin-upgrade' == $action ) { @@ -853,7 +853,7 @@ if ( 'upgrade-core' == $action ) { $title = __( 'Update Plugins' ); - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; echo '
'; echo '

' . __( 'Update Plugins' ) . '

'; echo ''; @@ -867,7 +867,7 @@ if ( 'upgrade-core' == $action ) { ) ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-theme-upgrade' == $action ) { @@ -891,7 +891,7 @@ if ( 'upgrade-core' == $action ) { $title = __( 'Update Themes' ); - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

@@ -907,7 +907,7 @@ if ( 'upgrade-core' == $action ) { ) ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-translation-upgrade' == $action ) { @@ -917,8 +917,8 @@ if ( 'upgrade-core' == $action ) { check_admin_referer( 'upgrade-translations' ); - require_once( ABSPATH . 'wp-admin/admin-header.php' ); - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $url = 'update-core.php?action=do-translation-upgrade'; $nonce = 'upgrade-translations'; @@ -936,7 +936,7 @@ if ( 'upgrade-core' == $action ) { ) ); - require_once( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } else { /** diff --git a/wp-admin/update.php b/wp-admin/update.php index 88b954bcb7..09c53075bd 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -11,9 +11,9 @@ if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['action'] ) && in_array( $_GE } /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; -include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); +require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; if ( isset( $_GET['action'] ) ) { $plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : ''; @@ -60,7 +60,7 @@ if ( isset( $_GET['action'] ) ) { $submenu_file = 'plugins.php'; wp_enqueue_script( 'updates' ); - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; $nonce = 'upgrade-plugin_' . $plugin; $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin ); @@ -68,7 +68,7 @@ if ( isset( $_GET['action'] ) ) { $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) ); $upgrader->upgrade( $plugin ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'activate-plugin' == $action ) { if ( ! current_user_can( 'update_plugins' ) ) { @@ -93,7 +93,7 @@ if ( isset( $_GET['action'] ) ) { error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed. wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); - include( WP_PLUGIN_DIR . '/' . $plugin ); + include WP_PLUGIN_DIR . '/' . $plugin; } iframe_footer(); } elseif ( 'install-plugin' == $action ) { @@ -102,7 +102,7 @@ if ( isset( $_GET['action'] ) ) { wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) ); } - include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); // For plugins_api(). + include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // For plugins_api(). check_admin_referer( 'install-plugin_' . $plugin ); $api = plugins_api( @@ -122,7 +122,7 @@ if ( isset( $_GET['action'] ) ) { $title = __( 'Plugin Installation' ); $parent_file = 'plugins.php'; $submenu_file = 'plugin-install.php'; - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; /* translators: %s: Plugin name and version. */ $title = sprintf( __( 'Installing Plugin: %s' ), $api->name . ' ' . $api->version ); @@ -137,7 +137,7 @@ if ( isset( $_GET['action'] ) ) { $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) ); $upgrader->install( $api->download_link ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'upload-plugin' == $action ) { @@ -152,7 +152,7 @@ if ( isset( $_GET['action'] ) ) { $title = __( 'Upload Plugin' ); $parent_file = 'plugins.php'; $submenu_file = 'plugin-install.php'; - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; /* translators: %s: File name. */ $title = sprintf( __( 'Installing Plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) ); @@ -167,7 +167,7 @@ if ( isset( $_GET['action'] ) ) { $file_upload->cleanup(); } - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'upgrade-theme' == $action ) { @@ -182,7 +182,7 @@ if ( isset( $_GET['action'] ) ) { $title = __( 'Update Theme' ); $parent_file = 'themes.php'; $submenu_file = 'themes.php'; - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; $nonce = 'upgrade-theme_' . $theme; $url = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme ); @@ -190,7 +190,7 @@ if ( isset( $_GET['action'] ) ) { $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'theme' ) ) ); $upgrader->upgrade( $theme ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'update-selected-themes' == $action ) { if ( ! current_user_can( 'update_themes' ) ) { wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) ); @@ -224,7 +224,7 @@ if ( isset( $_GET['action'] ) ) { wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); // For themes_api(). + include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // For themes_api(). check_admin_referer( 'install-theme_' . $theme ); $api = themes_api( @@ -245,7 +245,7 @@ if ( isset( $_GET['action'] ) ) { $title = __( 'Install Themes' ); $parent_file = 'themes.php'; $submenu_file = 'themes.php'; - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; /* translators: %s: Theme name and version. */ $title = sprintf( __( 'Installing Theme: %s' ), $api->name . ' ' . $api->version ); @@ -256,7 +256,7 @@ if ( isset( $_GET['action'] ) ) { $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) ); $upgrader->install( $api->download_link ); - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'upload-theme' == $action ) { @@ -272,7 +272,7 @@ if ( isset( $_GET['action'] ) ) { $parent_file = 'themes.php'; $submenu_file = 'theme-install.php'; - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; /* translators: %s: File name. */ $title = sprintf( __( 'Installing Theme from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) ); @@ -287,7 +287,7 @@ if ( isset( $_GET['action'] ) ) { $file_upload->cleanup(); } - include( ABSPATH . 'wp-admin/admin-footer.php' ); + require_once ABSPATH . 'wp-admin/admin-footer.php'; } else { /** diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index 0669ead7b0..0d1f499a00 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -9,4 +9,4 @@ */ _deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/upgrade.php' ); -require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); +require_once ABSPATH . 'wp-admin/includes/upgrade.php'; diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php index 67555f4fe9..88388ea60d 100644 --- a/wp-admin/upgrade.php +++ b/wp-admin/upgrade.php @@ -15,11 +15,11 @@ define( 'WP_INSTALLING', true ); /** Load WordPress Bootstrap */ -require( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); +require dirname( __DIR__ ) . '/wp-load.php'; nocache_headers(); -require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); +require_once ABSPATH . 'wp-admin/includes/upgrade.php'; delete_site_transient( 'update_core' ); diff --git a/wp-admin/upload.php b/wp-admin/upload.php index ac08bd38e3..b8207ecb98 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'upload_files' ) ) { wp_die( __( 'Sorry, you are not allowed to upload files.' ) ); @@ -79,7 +79,7 @@ if ( 'grid' === $mode ) { $title = __( 'Media Library' ); $parent_file = 'upload.php'; - require_once( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

@@ -107,7 +107,7 @@ if ( 'grid' === $mode ) {
set_screen_reader_content( ) ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -378,4 +378,4 @@ if ( ! empty( $message ) ) {
display_name ); $sessions = WP_Session_Tokens::get_instance( $profileuser->ID ); - include( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; ?> ID ) && current_user_can( 'manage_network_options' ) ) { ?> @@ -788,4 +788,4 @@ endif; }
current_action() ) { add_action( 'admin_head', 'delete_users_add_js' ); } - include( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; ?>
@@ -406,7 +406,7 @@ switch ( $wp_list_table->current_action() ) { $userids = $_REQUEST['users']; } - include( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; ?> @@ -475,7 +475,7 @@ switch ( $wp_list_table->current_action() ) { exit; } - include( ABSPATH . 'wp-admin/admin-header.php' ); + require_once ABSPATH . 'wp-admin/admin-header.php'; $messages = array(); if ( isset( $_GET['update'] ) ) : @@ -597,4 +597,4 @@ if ( strlen( $usersearch ) ) { } // End of the $doaction switch. -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index c364a45967..9667126b15 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -7,10 +7,10 @@ */ /** WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; /** WordPress Administration Widgets API */ -require_once( ABSPATH . 'wp-admin/includes/widgets.php' ); +require_once ABSPATH . 'wp-admin/includes/widgets.php'; if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( @@ -288,7 +288,7 @@ if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) { $width = ' style="width:' . max( $control['width'], 350 ) . 'px"'; $key = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0; - require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?> + require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

> @@ -366,7 +366,7 @@ if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
@@ -575,4 +575,4 @@ foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) { * @since 2.2.0 */ do_action( 'sidebar_admin_page' ); -require_once( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php'; diff --git a/wp-blog-header.php b/wp-blog-header.php index a8b1efc7b5..91e3b9daf4 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -10,12 +10,12 @@ if ( ! isset( $wp_did_header ) ) { $wp_did_header = true; // Load the WordPress library. - require_once( dirname( __FILE__ ) . '/wp-load.php' ); + require_once __DIR__ . '/wp-load.php'; // Set up the WordPress query. wp(); // Load the theme template. - require_once( ABSPATH . WPINC . '/template-loader.php' ); + require_once ABSPATH . WPINC . '/template-loader.php'; } diff --git a/wp-comments-post.php b/wp-comments-post.php index 86c758cc0a..ebf658603d 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -18,7 +18,7 @@ if ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) { } /** Sets up the WordPress Environment. */ -require( dirname( __FILE__ ) . '/wp-load.php' ); +require __DIR__ . '/wp-load.php'; nocache_headers(); diff --git a/wp-config-sample.php b/wp-config-sample.php index 1a4e59243b..bb04ed6986 100644 --- a/wp-config-sample.php +++ b/wp-config-sample.php @@ -83,8 +83,8 @@ define( 'WP_DEBUG', false ); /** Absolute path to the WordPress directory. */ if ( ! defined( 'ABSPATH' ) ) { - define( 'ABSPATH', dirname( __FILE__ ) . '/' ); + define( 'ABSPATH', __DIR__ . '/' ); } /** Sets up WordPress vars and included files. */ -require_once( ABSPATH . 'wp-settings.php' ); +require_once ABSPATH . 'wp-settings.php'; diff --git a/wp-content/themes/twentyeleven/functions.php b/wp-content/themes/twentyeleven/functions.php index 7835bbd1a2..2e5215e7a3 100644 --- a/wp-content/themes/twentyeleven/functions.php +++ b/wp-content/themes/twentyeleven/functions.php @@ -132,10 +132,10 @@ if ( ! function_exists( 'twentyeleven_setup' ) ) : ); // Load up our theme options page and related code. - require( get_template_directory() . '/inc/theme-options.php' ); + require get_template_directory() . '/inc/theme-options.php'; // Grab Twenty Eleven's Ephemera widget. - require( get_template_directory() . '/inc/widgets.php' ); + require get_template_directory() . '/inc/widgets.php'; // Add default posts and comments RSS feed links to . add_theme_support( 'automatic-feed-links' ); diff --git a/wp-content/themes/twentyseventeen/functions.php b/wp-content/themes/twentyseventeen/functions.php index 7e5cb84c0b..1ef1b570a7 100644 --- a/wp-content/themes/twentyseventeen/functions.php +++ b/wp-content/themes/twentyseventeen/functions.php @@ -425,7 +425,7 @@ function twentyseventeen_colors_css_wrap() { return; } - require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) ); + require_once get_parent_theme_file_path( '/inc/color-patterns.php' ); $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) ); $customize_preview_data_hue = ''; diff --git a/wp-content/themes/twentyseventeen/inc/icon-functions.php b/wp-content/themes/twentyseventeen/inc/icon-functions.php index c906762b58..11a1b0be16 100644 --- a/wp-content/themes/twentyseventeen/inc/icon-functions.php +++ b/wp-content/themes/twentyseventeen/inc/icon-functions.php @@ -16,7 +16,7 @@ function twentyseventeen_include_svg_icons() { // If it exists, include it. if ( file_exists( $svg_icons ) ) { - require_once( $svg_icons ); + require_once $svg_icons; } } add_action( 'wp_footer', 'twentyseventeen_include_svg_icons', 9999 ); diff --git a/wp-content/themes/twentytwelve/functions.php b/wp-content/themes/twentytwelve/functions.php index 86c5f1130f..ebb1e709d6 100644 --- a/wp-content/themes/twentytwelve/functions.php +++ b/wp-content/themes/twentytwelve/functions.php @@ -130,7 +130,7 @@ add_action( 'after_setup_theme', 'twentytwelve_setup' ); /** * Add support for a custom header image. */ -require( get_template_directory() . '/inc/custom-header.php' ); +require get_template_directory() . '/inc/custom-header.php'; /** * Return the Google font stylesheet URL if available. diff --git a/wp-cron.php b/wp-cron.php index 561ae96559..333625c069 100644 --- a/wp-cron.php +++ b/wp-cron.php @@ -41,7 +41,7 @@ define( 'DOING_CRON', true ); if ( ! defined( 'ABSPATH' ) ) { /** Set up WordPress environment */ - require_once( dirname( __FILE__ ) . '/wp-load.php' ); + require_once __DIR__ . '/wp-load.php'; } /** diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 2f52797141..8799583eb7 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -28,7 +28,7 @@ function _wp_admin_bar_init() { } /* Load the admin bar class code ready for instantiation */ - require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' ); + require_once ABSPATH . WPINC . '/class-wp-admin-bar.php'; /* Instantiate the admin bar */ diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index 706e5e320a..0cd72df20e 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -39,22 +39,22 @@ * @license http://www.opensource.org/licenses/bsd-license.php BSD */ -require_once( ABSPATH . WPINC . '/IXR/class-IXR-server.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-server.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-base64.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-base64.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-client.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-client.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-clientmulticall.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-clientmulticall.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-date.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-date.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-error.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-error.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-introspectionserver.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-introspectionserver.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-message.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-message.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-request.php' ); +require_once ABSPATH . WPINC . '/IXR/class-IXR-request.php'; -require_once( ABSPATH . WPINC . '/IXR/class-IXR-value.php' ); \ No newline at end of file +require_once ABSPATH . WPINC . '/IXR/class-IXR-value.php'; \ No newline at end of file diff --git a/wp-includes/class-feed.php b/wp-includes/class-feed.php index 5236170450..9a4772dc75 100644 --- a/wp-includes/class-feed.php +++ b/wp-includes/class-feed.php @@ -10,10 +10,10 @@ _deprecated_file( basename( __FILE__ ), '4.7.0', 'fetch_feed()' ); if ( ! class_exists( 'SimplePie', false ) ) { - require_once( ABSPATH . WPINC . '/class-simplepie.php' ); + require_once ABSPATH . WPINC . '/class-simplepie.php'; } -require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' ); -require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' ); -require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' ); -require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' ); +require_once ABSPATH . WPINC . '/class-wp-feed-cache.php'; +require_once ABSPATH . WPINC . '/class-wp-feed-cache-transient.php'; +require_once ABSPATH . WPINC . '/class-wp-simplepie-file.php'; +require_once ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php'; diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 4fe9d14de0..3db499f6c7 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -8,7 +8,7 @@ */ if ( ! class_exists( 'Requests' ) ) { - require( ABSPATH . WPINC . '/class-requests.php' ); + require ABSPATH . WPINC . '/class-requests.php'; Requests::register_autoloader(); Requests::set_certificate_path( ABSPATH . WPINC . '/certificates/ca-bundle.crt' ); diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php index 3b39e97df8..747fffa77a 100644 --- a/wp-includes/class-oembed.php +++ b/wp-includes/class-oembed.php @@ -12,4 +12,4 @@ _deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-includes/class-wp-oembed.php' ); /** WP_oEmbed class */ -require_once( ABSPATH . 'wp-includes/class-wp-oembed.php' ); +require_once ABSPATH . 'wp-includes/class-wp-oembed.php'; diff --git a/wp-includes/class-phpmailer.php b/wp-includes/class-phpmailer.php index 7aaa850532..30754a4e6c 100644 --- a/wp-includes/class-phpmailer.php +++ b/wp-includes/class-phpmailer.php @@ -1534,7 +1534,7 @@ class PHPMailer public function getSMTPInstance() { if (!is_object($this->smtp)) { - require_once( 'class-smtp.php' ); + require_once 'class-smtp.php'; $this->smtp = new SMTP; } return $this->smtp; diff --git a/wp-includes/class-simplepie.php b/wp-includes/class-simplepie.php index 6110413767..348657f5d9 100644 --- a/wp-includes/class-simplepie.php +++ b/wp-includes/class-simplepie.php @@ -26,7 +26,7 @@ function wp_simplepie_autoload( $class ) { return; $file = ABSPATH . WPINC . '/' . str_replace( '_', '/', $class ) . '.php'; - include( $file ); + include $file; } /** diff --git a/wp-includes/class-wp-customize-control.php b/wp-includes/class-wp-customize-control.php index 994ff90805..da6333183b 100644 --- a/wp-includes/class-wp-customize-control.php +++ b/wp-includes/class-wp-customize-control.php @@ -693,100 +693,100 @@ class WP_Customize_Control { /** * WP_Customize_Color_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php'; /** * WP_Customize_Media_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php'; /** * WP_Customize_Upload_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php'; /** * WP_Customize_Image_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php'; /** * WP_Customize_Background_Image_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php'; /** * WP_Customize_Background_Position_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php'; /** * WP_Customize_Cropped_Image_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php'; /** * WP_Customize_Site_Icon_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php'; /** * WP_Customize_Header_Image_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php'; /** * WP_Customize_Theme_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php'; /** * WP_Widget_Area_Customize_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php'; /** * WP_Widget_Form_Customize_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php'; /** * WP_Customize_Nav_Menu_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php'; /** * WP_Customize_Nav_Menu_Item_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php'; /** * WP_Customize_Nav_Menu_Location_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php'; /** * WP_Customize_Nav_Menu_Name_Control class. * * As this file is deprecated, it will trigger a deprecation notice if instantiated. In a subsequent - * release, the require_once() here will be removed and _deprecated_file() will be called if file is + * release, the require_once here will be removed and _deprecated_file() will be called if file is * required at all. * * @deprecated 4.9.0 This file is no longer used due to new menu creation UX. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php'; /** * WP_Customize_Nav_Menu_Locations_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php'; /** * WP_Customize_Nav_Menu_Auto_Add_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php'; /** * WP_Customize_Date_Time_Control class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-date-time-control.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-date-time-control.php'; diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index eb99381911..cdc5bd6b7e 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -294,44 +294,44 @@ final class WP_Customize_Manager { } } - require_once( ABSPATH . WPINC . '/class-wp-customize-setting.php' ); - require_once( ABSPATH . WPINC . '/class-wp-customize-panel.php' ); - require_once( ABSPATH . WPINC . '/class-wp-customize-section.php' ); - require_once( ABSPATH . WPINC . '/class-wp-customize-control.php' ); + require_once ABSPATH . WPINC . '/class-wp-customize-setting.php'; + require_once ABSPATH . WPINC . '/class-wp-customize-panel.php'; + require_once ABSPATH . WPINC . '/class-wp-customize-section.php'; + require_once ABSPATH . WPINC . '/class-wp-customize-control.php'; - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-code-editor-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' ); + require_once ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-code-editor-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php'; - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php' ); + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php'; - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-panel.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' ); + require_once ABSPATH . WPINC . '/customize/class-wp-customize-themes-panel.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php'; - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-custom-css-setting.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' ); + require_once ABSPATH . WPINC . '/customize/class-wp-customize-custom-css-setting.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php'; + require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php'; /** * Filters the core Customizer components to load. @@ -350,16 +350,16 @@ final class WP_Customize_Manager { */ $components = apply_filters( 'customize_loaded_components', $this->components, $this ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-selective-refresh.php' ); + require_once ABSPATH . WPINC . '/customize/class-wp-customize-selective-refresh.php'; $this->selective_refresh = new WP_Customize_Selective_Refresh( $this ); if ( in_array( 'widgets', $components, true ) ) { - require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' ); + require_once ABSPATH . WPINC . '/class-wp-customize-widgets.php'; $this->widgets = new WP_Customize_Widgets( $this ); } if ( in_array( 'nav_menus', $components, true ) ) { - require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' ); + require_once ABSPATH . WPINC . '/class-wp-customize-nav-menus.php'; $this->nav_menus = new WP_Customize_Nav_Menus( $this ); } @@ -1641,9 +1641,9 @@ final class WP_Customize_Manager { } // Such is The WordPress Way. - require_once( ABSPATH . 'wp-admin/includes/file.php' ); - require_once( ABSPATH . 'wp-admin/includes/media.php' ); - require_once( ABSPATH . 'wp-admin/includes/image.php' ); + require_once ABSPATH . 'wp-admin/includes/file.php'; + require_once ABSPATH . 'wp-admin/includes/media.php'; + require_once ABSPATH . 'wp-admin/includes/image.php'; foreach ( $attachments as $symbol => $attachment ) { diff --git a/wp-includes/class-wp-customize-panel.php b/wp-includes/class-wp-customize-panel.php index 82eda3a0f6..185908bea8 100644 --- a/wp-includes/class-wp-customize-panel.php +++ b/wp-includes/class-wp-customize-panel.php @@ -379,4 +379,4 @@ class WP_Customize_Panel { } /** WP_Customize_Nav_Menus_Panel class */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php'; diff --git a/wp-includes/class-wp-customize-section.php b/wp-includes/class-wp-customize-section.php index 57cc8d3bff..47ff0910ba 100644 --- a/wp-includes/class-wp-customize-section.php +++ b/wp-includes/class-wp-customize-section.php @@ -376,10 +376,10 @@ class WP_Customize_Section { } /** WP_Customize_Themes_Section class */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php'; /** WP_Customize_Sidebar_Section class */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php'; /** WP_Customize_Nav_Menu_Section class */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php'; diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index c98c28a44b..a457709fcf 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -943,24 +943,24 @@ class WP_Customize_Setting { /** * WP_Customize_Filter_Setting class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php'; /** * WP_Customize_Header_Image_Setting class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php'; /** * WP_Customize_Background_Image_Setting class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php'; /** * WP_Customize_Nav_Menu_Item_Setting class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php'; /** * WP_Customize_Nav_Menu_Setting class. */ -require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' ); +require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php'; diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index d61a459473..0913621f3c 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -218,7 +218,7 @@ final class _WP_Editors { self::$has_medialib = true; if ( ! function_exists( 'media_buttons' ) ) { - include( ABSPATH . 'wp-admin/includes/media.php' ); + require ABSPATH . 'wp-admin/includes/media.php'; } echo '
'; @@ -489,7 +489,7 @@ final class _WP_Editors { if ( ! empty( $mce_external_languages ) ) { foreach ( $mce_external_languages as $name => $path ) { if ( @is_file( $path ) && @is_readable( $path ) ) { - include_once( $path ); + include_once $path; $ext_plugins .= $strings . "\n"; $loaded_langs[] = $name; } diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 0ad73cad98..bb148478ce 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1523,11 +1523,11 @@ function comments_template( $file = '/comments.php', $separate_comments = false */ $include = apply_filters( 'comments_template', $theme_template ); if ( file_exists( $include ) ) { - require( $include ); + require $include; } elseif ( file_exists( TEMPLATEPATH . $file ) ) { - require( TEMPLATEPATH . $file ); + require TEMPLATEPATH . $file; } else { // Backward compat code will be removed in a future release. - require( ABSPATH . WPINC . '/theme-compat/comments.php' ); + require ABSPATH . WPINC . '/theme-compat/comments.php'; } } diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 924f6e7f70..a493802fe6 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -2801,8 +2801,8 @@ function generic_ping( $post_id = 0 ) { * @param int|WP_Post $post_id Post Object or ID. */ function pingback( $content, $post_id ) { - include_once( ABSPATH . WPINC . '/class-IXR.php' ); - include_once( ABSPATH . WPINC . '/class-wp-http-ixr-client.php' ); + include_once ABSPATH . WPINC . '/class-IXR.php'; + include_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php'; // Original code by Mort (http://mort.mine.nu:8080). $post_links = array(); @@ -2963,8 +2963,8 @@ function trackback( $trackback_url, $title, $excerpt, $ID ) { * @param string $path Path to send the ping. */ function weblog_ping( $server = '', $path = '' ) { - include_once( ABSPATH . WPINC . '/class-IXR.php' ); - include_once( ABSPATH . WPINC . '/class-wp-http-ixr-client.php' ); + include_once ABSPATH . WPINC . '/class-IXR.php'; + include_once ABSPATH . WPINC . '/class-wp-http-ixr-client.php'; // Using a timeout of 3 seconds should be enough to cover slow servers. $client = new WP_HTTP_IXR_Client( $server, ( ( ! strlen( trim( $path ) ) || ( '/' == $path ) ) ? false : $path ) ); diff --git a/wp-includes/cron.php b/wp-includes/cron.php index d1c7849063..e6957c35c3 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -682,7 +682,7 @@ function spawn_cron( $gmt_time = 0 ) { wp_ob_end_flush_all(); flush(); - include_once( ABSPATH . 'wp-cron.php' ); + include_once ABSPATH . 'wp-cron.php'; return true; } diff --git a/wp-includes/customize/class-wp-customize-header-image-setting.php b/wp-includes/customize/class-wp-customize-header-image-setting.php index 8aef690d93..e8328a991d 100644 --- a/wp-includes/customize/class-wp-customize-header-image-setting.php +++ b/wp-includes/customize/class-wp-customize-header-image-setting.php @@ -31,7 +31,7 @@ final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting { // If _custom_header_background_just_in_time() fails to initialize $custom_image_header when not is_admin(). if ( empty( $custom_image_header ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-custom-image-header.php' ); + require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php'; $args = get_theme_support( 'custom-header' ); $admin_head_callback = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null; $admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null; diff --git a/wp-includes/customize/class-wp-customize-selective-refresh.php b/wp-includes/customize/class-wp-customize-selective-refresh.php index 0b5c446131..be524bea19 100644 --- a/wp-includes/customize/class-wp-customize-selective-refresh.php +++ b/wp-includes/customize/class-wp-customize-selective-refresh.php @@ -62,7 +62,7 @@ final class WP_Customize_Selective_Refresh { */ public function __construct( WP_Customize_Manager $manager ) { $this->manager = $manager; - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-partial.php' ); + require_once ABSPATH . WPINC . '/customize/class-wp-customize-partial.php'; add_action( 'customize_preview_init', array( $this, 'init_preview' ) ); } diff --git a/wp-includes/date.php b/wp-includes/date.php index 3536e535b0..26ffcb4513 100644 --- a/wp-includes/date.php +++ b/wp-includes/date.php @@ -11,4 +11,4 @@ _deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-includes/class-wp-date-query.php' ); /** WP_Date_Query class */ -require_once( ABSPATH . 'wp-includes/class-wp-date-query.php' ); +require_once ABSPATH . 'wp-includes/class-wp-date-query.php'; diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 767002b642..173573a3dd 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -8,58 +8,58 @@ */ /** WP_Widget_Pages class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-pages.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-pages.php'; /** WP_Widget_Links class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-links.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-links.php'; /** WP_Widget_Search class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-search.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-search.php'; /** WP_Widget_Archives class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-archives.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-archives.php'; /** WP_Widget_Media class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-media.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-media.php'; /** WP_Widget_Media_Audio class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-media-audio.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-audio.php'; /** WP_Widget_Media_Image class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-media-image.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-image.php'; /** WP_Widget_Media_Video class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-media-video.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-video.php'; /** WP_Widget_Media_Gallery class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-media-gallery.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-media-gallery.php'; /** WP_Widget_Meta class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-meta.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-meta.php'; /** WP_Widget_Calendar class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-calendar.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-calendar.php'; /** WP_Widget_Text class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-text.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-text.php'; /** WP_Widget_Categories class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-categories.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-categories.php'; /** WP_Widget_Recent_Posts class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-recent-posts.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-recent-posts.php'; /** WP_Widget_Recent_Comments class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-recent-comments.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-recent-comments.php'; /** WP_Widget_RSS class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-rss.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-rss.php'; /** WP_Widget_Tag_Cloud class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-tag-cloud.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-tag-cloud.php'; /** WP_Nav_Menu_Widget class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-nav-menu-widget.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-nav-menu-widget.php'; /** WP_Widget_Custom_HTML class */ -require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-custom-html.php' ); +require_once ABSPATH . WPINC . '/widgets/class-wp-widget-custom-html.php'; diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index d8d32bb449..7804c8efcb 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -3926,7 +3926,7 @@ function get_shortcut_link() { function wp_ajax_press_this_save_post() { _deprecated_function( __FUNCTION__, '4.9.0' ); if ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) { - include( WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php' ); + include WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php'; $wp_press_this = new WP_Press_This_Plugin(); $wp_press_this->save_post(); } else { @@ -3943,7 +3943,7 @@ function wp_ajax_press_this_save_post() { function wp_ajax_press_this_add_category() { _deprecated_function( __FUNCTION__, '4.9.0' ); if ( is_plugin_active( 'press-this/press-this-plugin.php' ) ) { - include( WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php' ); + include WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php'; $wp_press_this = new WP_Press_This_Plugin(); $wp_press_this->add_category(); } else { diff --git a/wp-includes/embed-template.php b/wp-includes/embed-template.php index fb20991584..88b94bf5f7 100644 --- a/wp-includes/embed-template.php +++ b/wp-includes/embed-template.php @@ -10,4 +10,4 @@ _deprecated_file( basename( __FILE__ ), '4.5.0', 'wp-includes/theme-compat/embed.php' ); -include( ABSPATH . WPINC . '/theme-compat/embed.php' ); +require ABSPATH . WPINC . '/theme-compat/embed.php'; diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 813aea29ae..54beda6d44 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -751,13 +751,13 @@ function feed_content_type( $type = '' ) { */ function fetch_feed( $url ) { if ( ! class_exists( 'SimplePie', false ) ) { - require_once( ABSPATH . WPINC . '/class-simplepie.php' ); + require_once ABSPATH . WPINC . '/class-simplepie.php'; } - require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' ); - require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' ); - require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' ); - require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' ); + require_once ABSPATH . WPINC . '/class-wp-feed-cache.php'; + require_once ABSPATH . WPINC . '/class-wp-feed-cache-transient.php'; + require_once ABSPATH . WPINC . '/class-wp-simplepie-file.php'; + require_once ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php'; $feed = new SimplePie(); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2da63160fd..a48a09a03b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -5,7 +5,7 @@ * @package WordPress */ -require( ABSPATH . WPINC . '/option.php' ); +require ABSPATH . WPINC . '/option.php'; /** * Convert given MySQL date string into a different format. @@ -835,7 +835,7 @@ function do_enclose( $content = null, $post ) { global $wpdb; // @todo Tidy this code and make the debug code optional. - include_once( ABSPATH . WPINC . '/class-IXR.php' ); + include_once ABSPATH . WPINC . '/class-IXR.php'; $post = get_post( $post ); if ( ! $post ) { @@ -4572,7 +4572,7 @@ function wp_maybe_load_widgets() { return; } - require_once( ABSPATH . WPINC . '/default-widgets.php' ); + require_once ABSPATH . WPINC . '/default-widgets.php'; add_action( '_admin_menu', 'wp_widgets_add_menu' ); } @@ -4634,7 +4634,7 @@ function dead_db() { // Load custom DB error template, if present. if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { - require_once( WP_CONTENT_DIR . '/db-error.php' ); + require_once WP_CONTENT_DIR . '/db-error.php'; die(); } @@ -7259,7 +7259,7 @@ function wp_privacy_delete_old_export_files() { return; } - require_once( ABSPATH . 'wp-admin/includes/file.php' ); + require_once ABSPATH . 'wp-admin/includes/file.php'; $export_files = list_files( $exports_dir, 100, array( 'index.html' ) ); /** diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 344d9276fb..0e821ac744 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -255,7 +255,7 @@ function get_search_form( $args = array() ) { $search_form_template = locate_template( 'searchform.php' ); if ( '' != $search_form_template ) { ob_start(); - require( $search_form_template ); + require $search_form_template; $form = ob_get_clean(); } else { // Build a string containing an aria-label to use for the search form. @@ -3408,7 +3408,7 @@ function wp_default_editor() { */ function wp_editor( $content, $editor_id, $settings = array() ) { if ( ! class_exists( '_WP_Editors', false ) ) { - require( ABSPATH . WPINC . '/class-wp-editor.php' ); + require ABSPATH . WPINC . '/class-wp-editor.php'; } _WP_Editors::editor( $content, $editor_id, $settings ); } @@ -3424,7 +3424,7 @@ function wp_editor( $content, $editor_id, $settings = array() ) { */ function wp_enqueue_editor() { if ( ! class_exists( '_WP_Editors', false ) ) { - require( ABSPATH . WPINC . '/class-wp-editor.php' ); + require ABSPATH . WPINC . '/class-wp-editor.php'; } _WP_Editors::enqueue_default_editor(); diff --git a/wp-includes/js/tinymce/wp-tinymce.php b/wp-includes/js/tinymce/wp-tinymce.php index 213e9327b5..3b51ea266c 100644 --- a/wp-includes/js/tinymce/wp-tinymce.php +++ b/wp-includes/js/tinymce/wp-tinymce.php @@ -11,7 +11,7 @@ */ error_reporting( 0 ); -$basepath = dirname( __FILE__ ); +$basepath = __DIR__; function get_file( $path ) { diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 77099ffe6a..ef7c4b34e6 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -1462,7 +1462,7 @@ function wp_dropdown_languages( $args = array() ) { $translations = $parsed_args['translations']; if ( empty( $translations ) ) { - require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); + require_once ABSPATH . 'wp-admin/includes/translation-install.php'; $translations = wp_get_available_translations(); } diff --git a/wp-includes/load.php b/wp-includes/load.php index 3cd95a3d14..b661762417 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -139,7 +139,7 @@ function wp_check_php_mysql_versions() { } if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) { - require_once( ABSPATH . WPINC . '/functions.php' ); + require_once ABSPATH . WPINC . '/functions.php'; wp_load_translations_early(); $args = array( 'exit' => false, @@ -192,7 +192,7 @@ function wp_maintenance() { global $upgrading; - include( ABSPATH . '.maintenance' ); + require ABSPATH . '.maintenance'; // If the $upgrading timestamp is older than 10 minutes, don't die. if ( ( time() - $upgrading ) >= 600 ) { return; @@ -216,11 +216,11 @@ function wp_maintenance() { } if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { - require_once( WP_CONTENT_DIR . '/maintenance.php' ); + require_once WP_CONTENT_DIR . '/maintenance.php'; die(); } - require_once( ABSPATH . WPINC . '/functions.php' ); + require_once ABSPATH . WPINC . '/functions.php'; wp_load_translations_early(); header( 'Retry-After: 600' ); @@ -409,9 +409,9 @@ function wp_set_lang_dir() { function require_wp_db() { global $wpdb; - require_once( ABSPATH . WPINC . '/wp-db.php' ); + require_once ABSPATH . WPINC . '/wp-db.php'; if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) { - require_once( WP_CONTENT_DIR . '/db.php' ); + require_once WP_CONTENT_DIR . '/db.php'; } if ( isset( $wpdb ) ) { @@ -544,7 +544,7 @@ function wp_start_object_cache() { * that an external object cache is being used. */ if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { - require_once( WP_CONTENT_DIR . '/object-cache.php' ); + require_once WP_CONTENT_DIR . '/object-cache.php'; if ( function_exists( 'wp_cache_init' ) ) { wp_using_ext_object_cache( true ); } @@ -566,7 +566,7 @@ function wp_start_object_cache() { } if ( ! wp_using_ext_object_cache() ) { - require_once( ABSPATH . WPINC . '/cache.php' ); + require_once ABSPATH . WPINC . '/cache.php'; } /* @@ -606,8 +606,8 @@ function wp_not_installed() { } elseif ( ! is_blog_installed() && ! wp_installing() ) { nocache_headers(); - require( ABSPATH . WPINC . '/kses.php' ); - require( ABSPATH . WPINC . '/pluggable.php' ); + require ABSPATH . WPINC . '/kses.php'; + require ABSPATH . WPINC . '/pluggable.php'; $link = wp_guess_url() . '/wp-admin/install.php'; diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 184953b4a8..6bfbbc0c6d 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -8,8 +8,8 @@ * @since MU (3.0.0) */ -require_once( ABSPATH . WPINC . '/ms-site.php' ); -require_once( ABSPATH . WPINC . '/ms-network.php' ); +require_once ABSPATH . WPINC . '/ms-site.php'; +require_once ABSPATH . WPINC . '/ms-network.php'; /** * Update the last_updated field for the current site. diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index b7fa528e5c..cd30478811 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -610,7 +610,7 @@ function install_blog( $blog_id, $blog_title = '' ) { // Cast for security. $blog_id = (int) $blog_id; - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; $suppress = $wpdb->suppress_errors(); if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) ) { @@ -677,7 +677,7 @@ function install_blog_defaults( $blog_id, $user_id ) { _deprecated_function( __FUNCTION__, 'MU' ); - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; $suppress = $wpdb->suppress_errors(); diff --git a/wp-includes/ms-files.php b/wp-includes/ms-files.php index 260ece311c..fa41af5e31 100644 --- a/wp-includes/ms-files.php +++ b/wp-includes/ms-files.php @@ -9,7 +9,7 @@ */ define( 'SHORTINIT', true ); -require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); +require_once dirname( __DIR__ ) . '/wp-load.php'; if ( ! is_multisite() ) { die( 'Multisite support not enabled' ); diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php index 1a9874ad72..1aff91ac66 100644 --- a/wp-includes/ms-settings.php +++ b/wp-includes/ms-settings.php @@ -32,19 +32,19 @@ global $current_site, $current_blog, $domain, $path, $site_id, $public; /** WP_Network class */ -require_once( ABSPATH . WPINC . '/class-wp-network.php' ); +require_once ABSPATH . WPINC . '/class-wp-network.php'; /** WP_Site class */ -require_once( ABSPATH . WPINC . '/class-wp-site.php' ); +require_once ABSPATH . WPINC . '/class-wp-site.php'; /** Multisite loader */ -require_once( ABSPATH . WPINC . '/ms-load.php' ); +require_once ABSPATH . WPINC . '/ms-load.php'; /** Default Multisite constants */ -require_once( ABSPATH . WPINC . '/ms-default-constants.php' ); +require_once ABSPATH . WPINC . '/ms-default-constants.php'; if ( defined( 'SUNRISE' ) ) { - include_once( WP_CONTENT_DIR . '/sunrise.php' ); + include_once WP_CONTENT_DIR . '/sunrise.php'; } /** Check for and define SUBDOMAIN_INSTALL and the deprecated VHOST constant. */ diff --git a/wp-includes/ms-site.php b/wp-includes/ms-site.php index 947570a05c..186237430e 100644 --- a/wp-includes/ms-site.php +++ b/wp-includes/ms-site.php @@ -717,7 +717,7 @@ function wp_initialize_site( $site_id, array $args = array() ) { switch_to_blog( $site->id ); } - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; // Set up the database tables. make_db_current_silent( 'blog' ); diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 3646526d8f..81db29542b 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -2337,7 +2337,7 @@ if ( ! function_exists( 'wp_hash_password' ) ) : global $wp_hasher; if ( empty( $wp_hasher ) ) { - require_once( ABSPATH . WPINC . '/class-phpass.php' ); + require_once ABSPATH . WPINC . '/class-phpass.php'; // By default, use the portable hash from phpass. $wp_hasher = new PasswordHash( 8, true ); } @@ -2397,7 +2397,7 @@ if ( ! function_exists( 'wp_check_password' ) ) : // If the stored hash is longer than an MD5, // presume the new style phpass portable hash. if ( empty( $wp_hasher ) ) { - require_once( ABSPATH . WPINC . '/class-phpass.php' ); + require_once ABSPATH . WPINC . '/class-phpass.php'; // By default, use the portable hash from phpass. $wp_hasher = new PasswordHash( 8, true ); } @@ -2761,7 +2761,7 @@ if ( ! function_exists( 'wp_text_diff' ) ) : $args = wp_parse_args( $args, $defaults ); if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) { - require( ABSPATH . WPINC . '/wp-diff.php' ); + require ABSPATH . WPINC . '/wp-diff.php'; } $left_string = normalize_whitespace( $left_string ); diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index b893b90929..8e89d7c667 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -22,7 +22,7 @@ */ // Initialize the filter globals. -require( dirname( __FILE__ ) . '/class-wp-hook.php' ); +require __DIR__ . '/class-wp-hook.php'; /** @var WP_Hook[] $wp_filter */ global $wp_filter, $wp_actions, $wp_current_filter; diff --git a/wp-includes/pomo/mo.php b/wp-includes/pomo/mo.php index 623726f942..ed02d0aa0d 100644 --- a/wp-includes/pomo/mo.php +++ b/wp-includes/pomo/mo.php @@ -7,8 +7,8 @@ * @subpackage mo */ -require_once dirname( __FILE__ ) . '/translations.php'; -require_once dirname( __FILE__ ) . '/streams.php'; +require_once __DIR__ . '/translations.php'; +require_once __DIR__ . '/streams.php'; if ( ! class_exists( 'MO', false ) ) : class MO extends Gettext_Translations { diff --git a/wp-includes/pomo/po.php b/wp-includes/pomo/po.php index 4c2133612e..bcc4ee2860 100644 --- a/wp-includes/pomo/po.php +++ b/wp-includes/pomo/po.php @@ -7,7 +7,7 @@ * @subpackage po */ -require_once dirname( __FILE__ ) . '/translations.php'; +require_once __DIR__ . '/translations.php'; if ( ! defined( 'PO_MAX_LINE_LEN' ) ) { define( 'PO_MAX_LINE_LEN', 79 ); diff --git a/wp-includes/pomo/translations.php b/wp-includes/pomo/translations.php index cb186e841d..7211b52441 100644 --- a/wp-includes/pomo/translations.php +++ b/wp-includes/pomo/translations.php @@ -7,8 +7,8 @@ * @subpackage translations */ -require_once dirname( __FILE__ ) . '/plural-forms.php'; -require_once dirname( __FILE__ ) . '/entry.php'; +require_once __DIR__ . '/plural-forms.php'; +require_once __DIR__ . '/entry.php'; if ( ! class_exists( 'Translations', false ) ) : class Translations { diff --git a/wp-includes/rss-functions.php b/wp-includes/rss-functions.php index 07b0aefb81..40749db8bf 100644 --- a/wp-includes/rss-functions.php +++ b/wp-includes/rss-functions.php @@ -7,4 +7,4 @@ */ _deprecated_file( basename( __FILE__ ), '2.1.0', WPINC . '/rss.php' ); -require_once( ABSPATH . WPINC . '/rss.php' ); +require_once ABSPATH . WPINC . '/rss.php'; diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 668ffee456..02a3091c50 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -17,22 +17,22 @@ */ /** WordPress Dependency Class */ -require( ABSPATH . WPINC . '/class-wp-dependency.php' ); +require ABSPATH . WPINC . '/class-wp-dependency.php'; /** WordPress Dependencies Class */ -require( ABSPATH . WPINC . '/class.wp-dependencies.php' ); +require ABSPATH . WPINC . '/class.wp-dependencies.php'; /** WordPress Scripts Class */ -require( ABSPATH . WPINC . '/class.wp-scripts.php' ); +require ABSPATH . WPINC . '/class.wp-scripts.php'; /** WordPress Scripts Functions */ -require( ABSPATH . WPINC . '/functions.wp-scripts.php' ); +require ABSPATH . WPINC . '/functions.wp-scripts.php'; /** WordPress Styles Class */ -require( ABSPATH . WPINC . '/class.wp-styles.php' ); +require ABSPATH . WPINC . '/class.wp-styles.php'; /** WordPress Styles Functions */ -require( ABSPATH . WPINC . '/functions.wp-styles.php' ); +require ABSPATH . WPINC . '/functions.wp-styles.php'; /** * Registers TinyMCE scripts. @@ -254,7 +254,6 @@ function wp_default_packages_scripts( &$scripts ) { 'html-entities', 'i18n', 'is-shallow-equal', - 'keyboard-shortcuts', 'keycodes', 'list-reusable-blocks', 'media-utils', @@ -295,7 +294,7 @@ function wp_default_packages_scripts( &$scripts ) { continue; } - $asset_file = include ABSPATH . WPINC . "/assets/dist/$package$suffix.asset.php"; + $asset_file = require ABSPATH . WPINC . "/assets/dist/$package$suffix.asset.php"; $dependencies = $asset_file['dependencies']; // Add dependencies that cannot be detected and generated by build tools. @@ -596,7 +595,7 @@ function wp_scripts_get_suffix( $type = '' ) { if ( $suffixes === null ) { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $develop_src = false !== strpos( $wp_version, '-src' ); @@ -1666,7 +1665,7 @@ function wp_default_scripts( &$scripts ) { */ function wp_default_styles( &$styles ) { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; if ( ! defined( 'SCRIPT_DEBUG' ) ) { define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) ); @@ -2042,7 +2041,7 @@ function wp_localize_community_events() { return; } - require_once( ABSPATH . 'wp-admin/includes/class-wp-community-events.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php'; $user_id = get_current_user_id(); $saved_location = get_user_option( 'community-events-location', $user_id ); diff --git a/wp-includes/session.php b/wp-includes/session.php index 8e9918ad4c..df2a042ca6 100644 --- a/wp-includes/session.php +++ b/wp-includes/session.php @@ -8,5 +8,5 @@ _deprecated_file( basename( __FILE__ ), '4.7.0' ); -require_once( ABSPATH . WPINC . '/class-wp-session-tokens.php' ); -require_once( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' ); +require_once ABSPATH . WPINC . '/class-wp-session-tokens.php'; +require_once ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php'; diff --git a/wp-includes/template-loader.php b/wp-includes/template-loader.php index 8aa1ebeb67..4234f5572d 100644 --- a/wp-includes/template-loader.php +++ b/wp-includes/template-loader.php @@ -48,7 +48,7 @@ if ( is_robots() ) { do_feed(); return; } elseif ( is_trackback() ) { - include( ABSPATH . 'wp-trackback.php' ); + require ABSPATH . 'wp-trackback.php'; return; } @@ -103,7 +103,7 @@ if ( wp_using_themes() ) { */ $template = apply_filters( 'template_include', $template ); if ( $template ) { - include( $template ); + include $template; } elseif ( current_user_can( 'switch_themes' ) ) { $theme = wp_get_theme(); if ( $theme->errors() ) { diff --git a/wp-includes/template.php b/wp-includes/template.php index ffaa336e69..447e76bc7a 100644 --- a/wp-includes/template.php +++ b/wp-includes/template.php @@ -720,8 +720,8 @@ function load_template( $_template_file, $require_once = true ) { } if ( $require_once ) { - require_once( $_template_file ); + require_once $_template_file; } else { - require( $_template_file ); + require $_template_file; } } diff --git a/wp-includes/theme.php b/wp-includes/theme.php index fd1b93fbaa..dc18db9913 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -2638,7 +2638,7 @@ function _custom_header_background_just_in_time() { } if ( is_admin() ) { - require_once( ABSPATH . 'wp-admin/includes/class-custom-image-header.php' ); + require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php'; $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); } } @@ -2651,7 +2651,7 @@ function _custom_header_background_just_in_time() { add_action( 'wp_head', $args[0]['wp-head-callback'] ); if ( is_admin() ) { - require_once( ABSPATH . 'wp-admin/includes/class-custom-background.php' ); + require_once ABSPATH . 'wp-admin/includes/class-custom-background.php'; $custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); } } @@ -2897,7 +2897,7 @@ function current_theme_supports( $feature, ...$args ) { */ function require_if_theme_supports( $feature, $include ) { if ( current_theme_supports( $feature ) ) { - require( $include ); + require $include; return true; } return false; diff --git a/wp-includes/update.php b/wp-includes/update.php index 125a6e3084..09000c794c 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -28,7 +28,7 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) { global $wpdb, $wp_local_package; // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $php_version = phpversion(); $current = get_site_transient( 'update_core' ); @@ -261,11 +261,11 @@ function wp_update_plugins( $extra_stats = array() ) { } // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; // If running blog-side, bail unless we've not checked in the last 12 hours. if ( ! function_exists( 'get_plugins' ) ) { - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugins = get_plugins(); @@ -441,7 +441,7 @@ function wp_update_themes( $extra_stats = array() ) { } // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $installed_themes = wp_get_themes(); $translations = wp_get_installed_translations( 'themes' ); @@ -603,8 +603,8 @@ function wp_update_themes( $extra_stats = array() ) { * @since 3.7.0 */ function wp_maybe_auto_update() { - include_once( ABSPATH . 'wp-admin/includes/admin.php' ); - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + include_once ABSPATH . 'wp-admin/includes/admin.php'; + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $upgrader = new WP_Automatic_Updater; $upgrader->run(); @@ -729,7 +729,7 @@ function wp_get_update_data() { */ function _maybe_update_core() { // Include an unmodified $wp_version. - include( ABSPATH . WPINC . '/version.php' ); + require ABSPATH . WPINC . '/version.php'; $current = get_site_transient( 'update_core' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index cc1d055659..84dc8414cf 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-47197'; +$wp_version = '5.4-alpha-47198'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-text.php b/wp-includes/widgets/class-wp-widget-text.php index 0aa320f025..bd9c1df230 100644 --- a/wp-includes/widgets/class-wp-widget-text.php +++ b/wp-includes/widgets/class-wp-widget-text.php @@ -420,7 +420,7 @@ class WP_Widget_Text extends WP_Widget { * @since 4.9.3 */ public function enqueue_preview_scripts() { - require_once dirname( dirname( __FILE__ ) ) . '/media.php'; + require_once dirname( __DIR__ ) . '/media.php'; wp_playlist_scripts( 'audio' ); wp_playlist_scripts( 'video' ); diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 0298e20569..400888e61e 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1667,7 +1667,7 @@ class wpdb { // Load custom DB error template, if present. if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { - require_once( WP_CONTENT_DIR . '/db-error.php' ); + require_once WP_CONTENT_DIR . '/db-error.php'; die(); } diff --git a/wp-includes/wp-diff.php b/wp-includes/wp-diff.php index deae25081d..235b04b4be 100644 --- a/wp-includes/wp-diff.php +++ b/wp-includes/wp-diff.php @@ -10,12 +10,12 @@ if ( ! class_exists( 'Text_Diff', false ) ) { /** Text_Diff class */ - require( ABSPATH . WPINC . '/Text/Diff.php' ); + require ABSPATH . WPINC . '/Text/Diff.php'; /** Text_Diff_Renderer class */ - require( ABSPATH . WPINC . '/Text/Diff/Renderer.php' ); + require ABSPATH . WPINC . '/Text/Diff/Renderer.php'; /** Text_Diff_Renderer_inline class */ - require( ABSPATH . WPINC . '/Text/Diff/Renderer/inline.php' ); + require ABSPATH . WPINC . '/Text/Diff/Renderer/inline.php'; } -require( ABSPATH . WPINC . '/class-wp-text-diff-renderer-table.php' ); -require( ABSPATH . WPINC . '/class-wp-text-diff-renderer-inline.php' ); +require ABSPATH . WPINC . '/class-wp-text-diff-renderer-table.php'; +require ABSPATH . WPINC . '/class-wp-text-diff-renderer-inline.php'; diff --git a/wp-links-opml.php b/wp-links-opml.php index c5b1729aea..9739a9a767 100644 --- a/wp-links-opml.php +++ b/wp-links-opml.php @@ -12,7 +12,7 @@ * @package WordPress */ -require_once( dirname( __FILE__ ) . '/wp-load.php' ); +require_once __DIR__ . '/wp-load.php'; header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); $link_cat = ''; diff --git a/wp-load.php b/wp-load.php index 97e1aa908e..3f4d764bfc 100644 --- a/wp-load.php +++ b/wp-load.php @@ -18,7 +18,7 @@ /** Define ABSPATH as this file's directory */ if ( ! defined( 'ABSPATH' ) ) { - define( 'ABSPATH', dirname( __FILE__ ) . '/' ); + define( 'ABSPATH', __DIR__ . '/' ); } error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); @@ -34,24 +34,24 @@ error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_W if ( file_exists( ABSPATH . 'wp-config.php' ) ) { /** The config file resides in ABSPATH */ - require_once( ABSPATH . 'wp-config.php' ); + require_once ABSPATH . 'wp-config.php'; } elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) { /** The config file resides one level above ABSPATH but is not part of another installation */ - require_once( dirname( ABSPATH ) . '/wp-config.php' ); + require_once dirname( ABSPATH ) . '/wp-config.php'; } else { // A config file doesn't exist. define( 'WPINC', 'wp-includes' ); - require_once( ABSPATH . WPINC . '/load.php' ); + require_once ABSPATH . WPINC . '/load.php'; // Standardize $_SERVER variables across setups. wp_fix_server_vars(); - require_once( ABSPATH . WPINC . '/functions.php' ); + require_once ABSPATH . WPINC . '/functions.php'; $path = wp_guess_url() . '/wp-admin/setup-config.php'; @@ -66,7 +66,7 @@ if ( file_exists( ABSPATH . 'wp-config.php' ) ) { } define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); - require_once( ABSPATH . WPINC . '/version.php' ); + require_once ABSPATH . WPINC . '/version.php'; wp_check_php_mysql_versions(); wp_load_translations_early(); diff --git a/wp-login.php b/wp-login.php index cc7a53d014..597725e11d 100644 --- a/wp-login.php +++ b/wp-login.php @@ -9,7 +9,7 @@ */ /** Make sure that the WordPress bootstrap has run before continuing. */ -require( dirname( __FILE__ ) . '/wp-load.php' ); +require __DIR__ . '/wp-load.php'; // Redirect to HTTPS login if forced to use SSL. if ( force_ssl_admin() && ! is_ssl() ) { diff --git a/wp-mail.php b/wp-mail.php index 1faa685d3e..02635157c5 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -8,7 +8,7 @@ */ /** Make sure that the WordPress bootstrap has run before continuing. */ -require( dirname( __FILE__ ) . '/wp-load.php' ); +require __DIR__ . '/wp-load.php'; /** This filter is documented in wp-admin/options.php */ if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) { @@ -29,7 +29,7 @@ if ( 'mail.example.com' === $mailserver_url || empty( $mailserver_url ) ) { do_action( 'wp-mail.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** Get the POP3 class with which to access the mailbox. */ -require_once( ABSPATH . WPINC . '/class-pop3.php' ); +require_once ABSPATH . WPINC . '/class-pop3.php'; /** Only check at this interval for new messages. */ if ( ! defined( 'WP_MAIL_INTERVAL' ) ) { diff --git a/wp-settings.php b/wp-settings.php index 230b54010a..cfcdc8a3d8 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -21,23 +21,23 @@ define( 'WPINC', 'wp-includes' ); * these values to be overridden if already set. */ global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version, $wp_local_package; -require( ABSPATH . WPINC . '/version.php' ); -require( ABSPATH . WPINC . '/load.php' ); +require ABSPATH . WPINC . '/version.php'; +require ABSPATH . WPINC . '/load.php'; // Check for the required PHP version and for the MySQL extension or a database drop-in. wp_check_php_mysql_versions(); // Include files required for initialization. -require( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' ); -require( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' ); -require( ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php' ); -require( ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php' ); -require( ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php' ); -require( ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php' ); -require( ABSPATH . WPINC . '/class-wp-recovery-mode.php' ); -require( ABSPATH . WPINC . '/error-protection.php' ); -require( ABSPATH . WPINC . '/default-constants.php' ); -require_once( ABSPATH . WPINC . '/plugin.php' ); +require ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php'; +require ABSPATH . WPINC . '/class-wp-fatal-error-handler.php'; +require ABSPATH . WPINC . '/class-wp-recovery-mode-cookie-service.php'; +require ABSPATH . WPINC . '/class-wp-recovery-mode-key-service.php'; +require ABSPATH . WPINC . '/class-wp-recovery-mode-link-service.php'; +require ABSPATH . WPINC . '/class-wp-recovery-mode-email-service.php'; +require ABSPATH . WPINC . '/class-wp-recovery-mode.php'; +require ABSPATH . WPINC . '/error-protection.php'; +require ABSPATH . WPINC . '/default-constants.php'; +require_once ABSPATH . WPINC . '/plugin.php'; /** * If not already configured, `$blog_id` will default to 1 in a single site @@ -85,7 +85,7 @@ wp_debug_mode(); */ if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) { // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. - include( WP_CONTENT_DIR . '/advanced-cache.php' ); + include WP_CONTENT_DIR . '/advanced-cache.php'; // Re-initialize any hooks added manually by advanced-cache.php. if ( $wp_filter ) { @@ -97,16 +97,16 @@ if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) & wp_set_lang_dir(); // Load early WordPress files. -require( ABSPATH . WPINC . '/compat.php' ); -require( ABSPATH . WPINC . '/class-wp-list-util.php' ); -require( ABSPATH . WPINC . '/formatting.php' ); -require( ABSPATH . WPINC . '/meta.php' ); -require( ABSPATH . WPINC . '/functions.php' ); -require( ABSPATH . WPINC . '/class-wp-meta-query.php' ); -require( ABSPATH . WPINC . '/class-wp-matchesmapregex.php' ); -require( ABSPATH . WPINC . '/class-wp.php' ); -require( ABSPATH . WPINC . '/class-wp-error.php' ); -require( ABSPATH . WPINC . '/pomo/mo.php' ); +require ABSPATH . WPINC . '/compat.php'; +require ABSPATH . WPINC . '/class-wp-list-util.php'; +require ABSPATH . WPINC . '/formatting.php'; +require ABSPATH . WPINC . '/meta.php'; +require ABSPATH . WPINC . '/functions.php'; +require ABSPATH . WPINC . '/class-wp-meta-query.php'; +require ABSPATH . WPINC . '/class-wp-matchesmapregex.php'; +require ABSPATH . WPINC . '/class-wp.php'; +require ABSPATH . WPINC . '/class-wp-error.php'; +require ABSPATH . WPINC . '/pomo/mo.php'; // Include the wpdb class and, if present, a db.php database drop-in. global $wpdb; @@ -120,14 +120,14 @@ wp_set_wpdb_vars(); wp_start_object_cache(); // Attach the default filters. -require( ABSPATH . WPINC . '/default-filters.php' ); +require ABSPATH . WPINC . '/default-filters.php'; // Initialize multisite if enabled. if ( is_multisite() ) { - require( ABSPATH . WPINC . '/class-wp-site-query.php' ); - require( ABSPATH . WPINC . '/class-wp-network-query.php' ); - require( ABSPATH . WPINC . '/ms-blogs.php' ); - require( ABSPATH . WPINC . '/ms-settings.php' ); + require ABSPATH . WPINC . '/class-wp-site-query.php'; + require ABSPATH . WPINC . '/class-wp-network-query.php'; + require ABSPATH . WPINC . '/ms-blogs.php'; + require ABSPATH . WPINC . '/ms-settings.php'; } elseif ( ! defined( 'MULTISITE' ) ) { define( 'MULTISITE', false ); } @@ -140,142 +140,142 @@ if ( SHORTINIT ) { } // Load the L10n library. -require_once( ABSPATH . WPINC . '/l10n.php' ); -require_once( ABSPATH . WPINC . '/class-wp-locale.php' ); -require_once( ABSPATH . WPINC . '/class-wp-locale-switcher.php' ); +require_once ABSPATH . WPINC . '/l10n.php'; +require_once ABSPATH . WPINC . '/class-wp-locale.php'; +require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php'; // Run the installer if WordPress is not installed. wp_not_installed(); // Load most of WordPress. -require( ABSPATH . WPINC . '/class-wp-walker.php' ); -require( ABSPATH . WPINC . '/class-wp-ajax-response.php' ); -require( ABSPATH . WPINC . '/capabilities.php' ); -require( ABSPATH . WPINC . '/class-wp-roles.php' ); -require( ABSPATH . WPINC . '/class-wp-role.php' ); -require( ABSPATH . WPINC . '/class-wp-user.php' ); -require( ABSPATH . WPINC . '/class-wp-query.php' ); -require( ABSPATH . WPINC . '/query.php' ); -require( ABSPATH . WPINC . '/class-wp-date-query.php' ); -require( ABSPATH . WPINC . '/theme.php' ); -require( ABSPATH . WPINC . '/class-wp-theme.php' ); -require( ABSPATH . WPINC . '/template.php' ); -require( ABSPATH . WPINC . '/class-wp-user-request.php' ); -require( ABSPATH . WPINC . '/user.php' ); -require( ABSPATH . WPINC . '/class-wp-user-query.php' ); -require( ABSPATH . WPINC . '/class-wp-session-tokens.php' ); -require( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' ); -require( ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php' ); -require( ABSPATH . WPINC . '/general-template.php' ); -require( ABSPATH . WPINC . '/link-template.php' ); -require( ABSPATH . WPINC . '/author-template.php' ); -require( ABSPATH . WPINC . '/post.php' ); -require( ABSPATH . WPINC . '/class-walker-page.php' ); -require( ABSPATH . WPINC . '/class-walker-page-dropdown.php' ); -require( ABSPATH . WPINC . '/class-wp-post-type.php' ); -require( ABSPATH . WPINC . '/class-wp-post.php' ); -require( ABSPATH . WPINC . '/post-template.php' ); -require( ABSPATH . WPINC . '/revision.php' ); -require( ABSPATH . WPINC . '/post-formats.php' ); -require( ABSPATH . WPINC . '/post-thumbnail-template.php' ); -require( ABSPATH . WPINC . '/category.php' ); -require( ABSPATH . WPINC . '/class-walker-category.php' ); -require( ABSPATH . WPINC . '/class-walker-category-dropdown.php' ); -require( ABSPATH . WPINC . '/category-template.php' ); -require( ABSPATH . WPINC . '/comment.php' ); -require( ABSPATH . WPINC . '/class-wp-comment.php' ); -require( ABSPATH . WPINC . '/class-wp-comment-query.php' ); -require( ABSPATH . WPINC . '/class-walker-comment.php' ); -require( ABSPATH . WPINC . '/comment-template.php' ); -require( ABSPATH . WPINC . '/rewrite.php' ); -require( ABSPATH . WPINC . '/class-wp-rewrite.php' ); -require( ABSPATH . WPINC . '/feed.php' ); -require( ABSPATH . WPINC . '/bookmark.php' ); -require( ABSPATH . WPINC . '/bookmark-template.php' ); -require( ABSPATH . WPINC . '/kses.php' ); -require( ABSPATH . WPINC . '/cron.php' ); -require( ABSPATH . WPINC . '/deprecated.php' ); -require( ABSPATH . WPINC . '/script-loader.php' ); -require( ABSPATH . WPINC . '/taxonomy.php' ); -require( ABSPATH . WPINC . '/class-wp-taxonomy.php' ); -require( ABSPATH . WPINC . '/class-wp-term.php' ); -require( ABSPATH . WPINC . '/class-wp-term-query.php' ); -require( ABSPATH . WPINC . '/class-wp-tax-query.php' ); -require( ABSPATH . WPINC . '/update.php' ); -require( ABSPATH . WPINC . '/canonical.php' ); -require( ABSPATH . WPINC . '/shortcodes.php' ); -require( ABSPATH . WPINC . '/embed.php' ); -require( ABSPATH . WPINC . '/class-wp-embed.php' ); -require( ABSPATH . WPINC . '/class-wp-oembed.php' ); -require( ABSPATH . WPINC . '/class-wp-oembed-controller.php' ); -require( ABSPATH . WPINC . '/media.php' ); -require( ABSPATH . WPINC . '/http.php' ); -require( ABSPATH . WPINC . '/class-http.php' ); -require( ABSPATH . WPINC . '/class-wp-http-streams.php' ); -require( ABSPATH . WPINC . '/class-wp-http-curl.php' ); -require( ABSPATH . WPINC . '/class-wp-http-proxy.php' ); -require( ABSPATH . WPINC . '/class-wp-http-cookie.php' ); -require( ABSPATH . WPINC . '/class-wp-http-encoding.php' ); -require( ABSPATH . WPINC . '/class-wp-http-response.php' ); -require( ABSPATH . WPINC . '/class-wp-http-requests-response.php' ); -require( ABSPATH . WPINC . '/class-wp-http-requests-hooks.php' ); -require( ABSPATH . WPINC . '/widgets.php' ); -require( ABSPATH . WPINC . '/class-wp-widget.php' ); -require( ABSPATH . WPINC . '/class-wp-widget-factory.php' ); -require( ABSPATH . WPINC . '/nav-menu.php' ); -require( ABSPATH . WPINC . '/nav-menu-template.php' ); -require( ABSPATH . WPINC . '/admin-bar.php' ); -require( ABSPATH . WPINC . '/rest-api.php' ); -require( ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); -require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); -require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' ); -require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php' ); -require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php' ); -require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php' ); -require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php' ); -require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' ); -require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' ); -require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' ); -require( ABSPATH . WPINC . '/class-wp-block-type.php' ); -require( ABSPATH . WPINC . '/class-wp-block-styles-registry.php' ); -require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' ); -require( ABSPATH . WPINC . '/class-wp-block-parser.php' ); -require( ABSPATH . WPINC . '/blocks.php' ); -require( ABSPATH . WPINC . '/blocks/archives.php' ); -require( ABSPATH . WPINC . '/blocks/block.php' ); -require( ABSPATH . WPINC . '/blocks/calendar.php' ); -require( ABSPATH . WPINC . '/blocks/categories.php' ); -require( ABSPATH . WPINC . '/blocks/latest-comments.php' ); -require( ABSPATH . WPINC . '/blocks/latest-posts.php' ); -require( ABSPATH . WPINC . '/blocks/navigation.php' ); -require( ABSPATH . WPINC . '/blocks/rss.php' ); -require( ABSPATH . WPINC . '/blocks/search.php' ); -require( ABSPATH . WPINC . '/blocks/shortcode.php' ); -require( ABSPATH . WPINC . '/blocks/tag-cloud.php' ); +require ABSPATH . WPINC . '/class-wp-walker.php'; +require ABSPATH . WPINC . '/class-wp-ajax-response.php'; +require ABSPATH . WPINC . '/capabilities.php'; +require ABSPATH . WPINC . '/class-wp-roles.php'; +require ABSPATH . WPINC . '/class-wp-role.php'; +require ABSPATH . WPINC . '/class-wp-user.php'; +require ABSPATH . WPINC . '/class-wp-query.php'; +require ABSPATH . WPINC . '/query.php'; +require ABSPATH . WPINC . '/class-wp-date-query.php'; +require ABSPATH . WPINC . '/theme.php'; +require ABSPATH . WPINC . '/class-wp-theme.php'; +require ABSPATH . WPINC . '/template.php'; +require ABSPATH . WPINC . '/class-wp-user-request.php'; +require ABSPATH . WPINC . '/user.php'; +require ABSPATH . WPINC . '/class-wp-user-query.php'; +require ABSPATH . WPINC . '/class-wp-session-tokens.php'; +require ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php'; +require ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php'; +require ABSPATH . WPINC . '/general-template.php'; +require ABSPATH . WPINC . '/link-template.php'; +require ABSPATH . WPINC . '/author-template.php'; +require ABSPATH . WPINC . '/post.php'; +require ABSPATH . WPINC . '/class-walker-page.php'; +require ABSPATH . WPINC . '/class-walker-page-dropdown.php'; +require ABSPATH . WPINC . '/class-wp-post-type.php'; +require ABSPATH . WPINC . '/class-wp-post.php'; +require ABSPATH . WPINC . '/post-template.php'; +require ABSPATH . WPINC . '/revision.php'; +require ABSPATH . WPINC . '/post-formats.php'; +require ABSPATH . WPINC . '/post-thumbnail-template.php'; +require ABSPATH . WPINC . '/category.php'; +require ABSPATH . WPINC . '/class-walker-category.php'; +require ABSPATH . WPINC . '/class-walker-category-dropdown.php'; +require ABSPATH . WPINC . '/category-template.php'; +require ABSPATH . WPINC . '/comment.php'; +require ABSPATH . WPINC . '/class-wp-comment.php'; +require ABSPATH . WPINC . '/class-wp-comment-query.php'; +require ABSPATH . WPINC . '/class-walker-comment.php'; +require ABSPATH . WPINC . '/comment-template.php'; +require ABSPATH . WPINC . '/rewrite.php'; +require ABSPATH . WPINC . '/class-wp-rewrite.php'; +require ABSPATH . WPINC . '/feed.php'; +require ABSPATH . WPINC . '/bookmark.php'; +require ABSPATH . WPINC . '/bookmark-template.php'; +require ABSPATH . WPINC . '/kses.php'; +require ABSPATH . WPINC . '/cron.php'; +require ABSPATH . WPINC . '/deprecated.php'; +require ABSPATH . WPINC . '/script-loader.php'; +require ABSPATH . WPINC . '/taxonomy.php'; +require ABSPATH . WPINC . '/class-wp-taxonomy.php'; +require ABSPATH . WPINC . '/class-wp-term.php'; +require ABSPATH . WPINC . '/class-wp-term-query.php'; +require ABSPATH . WPINC . '/class-wp-tax-query.php'; +require ABSPATH . WPINC . '/update.php'; +require ABSPATH . WPINC . '/canonical.php'; +require ABSPATH . WPINC . '/shortcodes.php'; +require ABSPATH . WPINC . '/embed.php'; +require ABSPATH . WPINC . '/class-wp-embed.php'; +require ABSPATH . WPINC . '/class-wp-oembed.php'; +require ABSPATH . WPINC . '/class-wp-oembed-controller.php'; +require ABSPATH . WPINC . '/media.php'; +require ABSPATH . WPINC . '/http.php'; +require ABSPATH . WPINC . '/class-http.php'; +require ABSPATH . WPINC . '/class-wp-http-streams.php'; +require ABSPATH . WPINC . '/class-wp-http-curl.php'; +require ABSPATH . WPINC . '/class-wp-http-proxy.php'; +require ABSPATH . WPINC . '/class-wp-http-cookie.php'; +require ABSPATH . WPINC . '/class-wp-http-encoding.php'; +require ABSPATH . WPINC . '/class-wp-http-response.php'; +require ABSPATH . WPINC . '/class-wp-http-requests-response.php'; +require ABSPATH . WPINC . '/class-wp-http-requests-hooks.php'; +require ABSPATH . WPINC . '/widgets.php'; +require ABSPATH . WPINC . '/class-wp-widget.php'; +require ABSPATH . WPINC . '/class-wp-widget-factory.php'; +require ABSPATH . WPINC . '/nav-menu.php'; +require ABSPATH . WPINC . '/nav-menu-template.php'; +require ABSPATH . WPINC . '/admin-bar.php'; +require ABSPATH . WPINC . '/rest-api.php'; +require ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php'; +require ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php'; +require ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-posts-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-attachments-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-types-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-post-statuses-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-revisions-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-autosaves-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-taxonomies-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-terms-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-users-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php'; +require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php'; +require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php'; +require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php'; +require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-post-meta-fields.php'; +require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php'; +require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php'; +require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php'; +require ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php'; +require ABSPATH . WPINC . '/class-wp-block-type.php'; +require ABSPATH . WPINC . '/class-wp-block-styles-registry.php'; +require ABSPATH . WPINC . '/class-wp-block-type-registry.php'; +require ABSPATH . WPINC . '/class-wp-block-parser.php'; +require ABSPATH . WPINC . '/blocks.php'; +require ABSPATH . WPINC . '/blocks/archives.php'; +require ABSPATH . WPINC . '/blocks/block.php'; +require ABSPATH . WPINC . '/blocks/calendar.php'; +require ABSPATH . WPINC . '/blocks/categories.php'; +require ABSPATH . WPINC . '/blocks/latest-comments.php'; +require ABSPATH . WPINC . '/blocks/latest-posts.php'; +require ABSPATH . WPINC . '/blocks/navigation.php'; +require ABSPATH . WPINC . '/blocks/rss.php'; +require ABSPATH . WPINC . '/blocks/search.php'; +require ABSPATH . WPINC . '/blocks/shortcode.php'; +require ABSPATH . WPINC . '/blocks/tag-cloud.php'; $GLOBALS['wp_embed'] = new WP_Embed(); // Load multisite-specific files. if ( is_multisite() ) { - require( ABSPATH . WPINC . '/ms-functions.php' ); - require( ABSPATH . WPINC . '/ms-default-filters.php' ); - require( ABSPATH . WPINC . '/ms-deprecated.php' ); + require ABSPATH . WPINC . '/ms-functions.php'; + require ABSPATH . WPINC . '/ms-default-filters.php'; + require ABSPATH . WPINC . '/ms-deprecated.php'; } // Define constants that rely on the API to obtain the default value. @@ -286,7 +286,7 @@ $GLOBALS['wp_plugin_paths'] = array(); // Load must-use plugins. foreach ( wp_get_mu_plugins() as $mu_plugin ) { - include_once( $mu_plugin ); + include_once $mu_plugin; /** * Fires once a single must-use plugin has loaded. @@ -303,7 +303,7 @@ unset( $mu_plugin ); if ( is_multisite() ) { foreach ( wp_get_active_network_plugins() as $network_plugin ) { wp_register_plugin_realpath( $network_plugin ); - include_once( $network_plugin ); + include_once $network_plugin; /** * Fires once a single network-activated plugin has loaded. @@ -335,7 +335,7 @@ wp_cookie_constants(); wp_ssl_constants(); // Create common globals. -require( ABSPATH . WPINC . '/vars.php' ); +require ABSPATH . WPINC . '/vars.php'; // Make taxonomies and posts available to plugins and themes. // @plugin authors: warning: these get registered again on the init hook. @@ -354,14 +354,14 @@ if ( ! is_multisite() ) { // Create an instance of WP_Site_Health so that Cron events may fire. if ( ! class_exists( 'WP_Site_Health' ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' ); + require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } WP_Site_Health::get_instance(); // Load active plugins. foreach ( wp_get_active_and_valid_plugins() as $plugin ) { wp_register_plugin_realpath( $plugin ); - include_once( $plugin ); + include_once $plugin; /** * Fires once a single activated plugin has loaded. @@ -375,8 +375,8 @@ foreach ( wp_get_active_and_valid_plugins() as $plugin ) { unset( $plugin ); // Load pluggable functions. -require( ABSPATH . WPINC . '/pluggable.php' ); -require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); +require ABSPATH . WPINC . '/pluggable.php'; +require ABSPATH . WPINC . '/pluggable-deprecated.php'; // Set internal encoding. wp_set_internal_encoding(); @@ -473,7 +473,7 @@ load_default_textdomain(); $locale = get_locale(); $locale_file = WP_LANG_DIR . "/$locale.php"; if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) { - require( $locale_file ); + require $locale_file; } unset( $locale_file ); @@ -530,7 +530,7 @@ do_action( 'init' ); if ( is_multisite() ) { $file = ms_site_check(); if ( true !== $file ) { - require( $file ); + require $file; die(); } unset( $file ); diff --git a/wp-signup.php b/wp-signup.php index 97aee29d8e..4d01ca0bfe 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -1,11 +1,11 @@ '1' ) ); } diff --git a/xmlrpc.php b/xmlrpc.php index 885fc26bd1..00bd97e8df 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -27,7 +27,7 @@ if ( isset( $HTTP_RAW_POST_DATA ) ) { } /** Include the bootstrap for setting up WordPress environment */ -include( dirname( __FILE__ ) . '/wp-load.php' ); +require_once __DIR__ . '/wp-load.php'; if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); @@ -60,9 +60,9 @@ if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/r exit; } -include_once( ABSPATH . 'wp-admin/includes/admin.php' ); -include_once( ABSPATH . WPINC . '/class-IXR.php' ); -include_once( ABSPATH . WPINC . '/class-wp-xmlrpc-server.php' ); +require_once ABSPATH . 'wp-admin/includes/admin.php'; +require_once ABSPATH . WPINC . '/class-IXR.php'; +require_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php'; /** * Posts submitted via the XML-RPC interface get that title