Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoloading WordPress classes #3470

Open
wants to merge 181 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 95 commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
5502082
WIP - building the array
aristath Oct 13, 2022
fe7b866
Added more files to the array
aristath Oct 13, 2022
9285636
Moved functions
aristath Oct 13, 2022
239cf2d
Moved more functions
aristath Oct 13, 2022
8bf9e63
remove includes/requires for defined files
aristath Oct 13, 2022
b0f9ee4
fix wrong paths in array
aristath Oct 13, 2022
90b0bda
fix includes
aristath Oct 13, 2022
2f3e444
We only need to use ABSPATH once
aristath Oct 13, 2022
134431d
define a _wp_autoload_classes function
aristath Oct 13, 2022
c29c9ff
WIP - convert autoloader to a basic class
aristath Oct 14, 2022
e28468d
Move definition of WPINC and check if it's defined before redefining it
aristath Oct 14, 2022
7141a60
Register autoloaders for 3rd-party libraries
aristath Oct 14, 2022
a64cf56
const instead of static vars
aristath Oct 14, 2022
6c0ce24
fix tests
aristath Oct 14, 2022
c9b5be7
Only load the autoloader once
aristath Oct 14, 2022
11e0904
meh
aristath Oct 14, 2022
7b45b02
Move WP_Autoload::register() to the file containing the class
aristath Nov 10, 2022
ba223ce
Account for classes written with incorrect cases
aristath Nov 10, 2022
c25ba52
Simplify the autoloader a bit
aristath Nov 14, 2022
fb4191a
Always check for lowercased classnames
aristath Nov 28, 2022
2b7dbdf
Simplify registration for external/bundled libraries
aristath Nov 28, 2022
b15d143
fix return type
aristath Nov 28, 2022
3b2bafa
Split method to 2
aristath Nov 28, 2022
beffa9a
Update src/wp-includes/class-wp-autoload.php
aristath Nov 28, 2022
ea294c2
Use a constant to improve performance
aristath Feb 28, 2023
de96b88
fix for the Requests library update
aristath Feb 28, 2023
12e6bee
Add classes in wp-includes/html-api
aristath Feb 28, 2023
9cb2192
use the autoloader in tests files
aristath Feb 28, 2023
beb4d91
fix PHP error in tests
aristath Feb 28, 2023
e203887
better fix
aristath Feb 28, 2023
dc08f22
forgot to push this line
aristath Feb 28, 2023
b4b5202
Update src/index.php
aristath Mar 1, 2023
a894547
WPINC is now defined
aristath Mar 1, 2023
932362c
class-IXR.php doesn't need to be included anymore
aristath Mar 1, 2023
cb902f0
default-widgets.php no longer needed
aristath Mar 1, 2023
7957071
remove more includes
aristath Mar 2, 2023
7240bdb
Add files in wp-includes/Text
aristath Mar 2, 2023
ff1e590
autoload class-phpass.php
aristath Mar 2, 2023
0ed392d
autoload class-pop3.php
aristath Mar 2, 2023
3646160
autoload pclzip
aristath Mar 2, 2023
1e5e109
autoload ftp
aristath Mar 2, 2023
a5460ba
remove more includes
aristath Mar 2, 2023
1dd88d2
added more classes to the classmap & removed some more includes
aristath Mar 24, 2023
4f513e9
cleanup tests
aristath Mar 29, 2023
c8deeed
Deleted this one by mistake
aristath Mar 29, 2023
148a186
revert changes in multisite.xml
aristath Mar 29, 2023
080ecff
use parentheses
aristath Mar 30, 2023
1ffb58c
include autoloader
aristath Mar 30, 2023
165050c
try to autoload SimplePie
aristath Mar 30, 2023
1db08b3
Add SimplePie classes to the classmap
aristath Mar 30, 2023
03cb9b0
remove duplicate
aristath Mar 30, 2023
6e5f9d5
yet another fix for simplepie
aristath Mar 30, 2023
db12934
Revert "include autoloader"
aristath Mar 30, 2023
b952526
move classes to be alphabetically ordered
aristath Mar 30, 2023
72e7036
resolve conflicts from merge
aristath Jul 7, 2023
7a36f26
Remove duplicate compat.php requirement
aristath Jul 7, 2023
aae6d00
performance improvement
aristath Jul 28, 2023
894826a
Add more HTML API classes
aristath Jul 28, 2023
18d137d
remove more hardcoded requires
aristath Jul 28, 2023
d2ba016
add another comment for deprecated classes
aristath Sep 28, 2023
f5ed732
resolve rebase conflicts
aristath Sep 28, 2023
4d438d3
fix another rebase conflict
aristath Sep 28, 2023
19dbec0
use the WPINC const :shrug:
aristath Sep 28, 2023
d7fc1d4
Add classes in the wp-includes/fonts folder
aristath Sep 28, 2023
38ee411
yet another rebase conflict
aristath Sep 28, 2023
e96c4c8
fix a couple of tests
aristath Sep 28, 2023
dde3bfb
lowercase classnames
aristath Sep 28, 2023
8183289
include the autoloader in tests
aristath Sep 28, 2023
b63bc57
fix files load order
aristath Oct 2, 2023
c1d66a8
Revert some changes resulting from rebase conflicts
aristath Oct 2, 2023
3a46630
Added 2 new classes to the autoloader (rebase conflict resolution)
aristath Oct 11, 2023
aaadf0f
partial revert
aristath Oct 11, 2023
447b983
set_up() no longer needed
aristath Oct 11, 2023
885a92a
remove another set_up() which is no longer needed
aristath Oct 11, 2023
386562c
more cleanup
aristath Oct 11, 2023
802deb6
set_up_before_class no longer necessary
aristath Oct 11, 2023
f3c4b56
Merge branch 'trunk' into autoload
aristath Oct 26, 2023
c6c190d
cleanup - set_up_before_class no longer necessary
aristath Oct 26, 2023
38b6a53
Merge branch 'trunk' into autoload
aristath Oct 31, 2023
6254961
Merge branch 'trunk' into autoload
aristath Dec 1, 2023
974a979
Merge branch 'trunk' into autoload
aristath Dec 27, 2023
f5f4627
Merge branch 'trunk' into autoload
aristath Jan 4, 2024
1b4c44a
Merge branch 'trunk' into autoload
aristath Jan 8, 2024
a3e6dd3
Revert changes to class-wp-block-parser.php
aristath Jan 8, 2024
f82b6b7
Merge branch 'trunk' into autoload
aristath Jan 9, 2024
dd0d90f
Merge branch 'trunk' into autoload
aristath Jan 24, 2024
dc6210c
Add new classes to the autoloader
aristath Jan 24, 2024
f78565e
Merge branch 'trunk' into autoload
aristath Jan 25, 2024
485a5ca
Merge branch 'trunk' into autoload
aristath Jan 29, 2024
a44e76e
Add the `WP_Block_Bindings_Registry` to the autoloader
aristath Jan 29, 2024
a8b45ef
Merge branch 'trunk' into autoload
aristath Jan 29, 2024
6317cb7
Merge branch 'trunk' into autoload
aristath Jan 30, 2024
7a4904a
Merge branch 'trunk' into autoload
aristath Jan 30, 2024
553a68c
Merge branch 'trunk' into autoload
aristath Jan 31, 2024
d444ae6
Merge branch 'trunk' into autoload
aristath Feb 1, 2024
1bfac8c
Use str_starts_with()
aristath Feb 2, 2024
fc1747e
Merge branch 'trunk' into autoload
aristath Feb 2, 2024
4aade49
Use empty() instead of !isset()
aristath Feb 2, 2024
be9c6cd
Use require instead of require_once where possible
aristath Feb 2, 2024
bd5bb87
Revert "Use require instead of require_once where possible"
aristath Feb 2, 2024
9e181d6
Add PHPunit tests for the autoloader classmap
aristath Feb 2, 2024
bfa7a18
fix lowecase in classMap
aristath Feb 2, 2024
7188eb8
Use `self` instead of `static`
aristath Feb 2, 2024
ba7f830
WIP: preload necessary Core classes for Core upgrades
aristath Feb 2, 2024
6ea039d
Update src/wp-admin/includes/update-core.php
aristath Feb 2, 2024
839cded
Update src/wp-admin/includes/update-core.php
aristath Feb 2, 2024
55f6a5b
Update class-wp-autoload.php
aristath Feb 2, 2024
55d2f04
Update class-wp-autoload.php
aristath Feb 2, 2024
c8632e9
Merge branch 'trunk' into autoload
aristath Feb 5, 2024
dde6611
Move simplepie autoloading to external scripts
aristath Feb 5, 2024
50d4fbd
add avifinfo to the autoloader
aristath Feb 5, 2024
f184323
SimplePie should be conditionally loaded
aristath Feb 5, 2024
296e797
Use `require` instead of `require_once` for SimplePie
aristath Feb 5, 2024
c0769f4
require_once will be better than a static var
aristath Feb 5, 2024
6baf195
Update src/wp-includes/class-wp-autoload.php
aristath Feb 7, 2024
cf7813c
Update src/wp-includes/class-wp-autoload.php
aristath Feb 7, 2024
e0ab4ff
Update src/wp-includes/class-wp-autoload.php
aristath Feb 7, 2024
044d2a2
Update src/wp-includes/class-wp-autoload.php
aristath Feb 7, 2024
39ddcd4
Update src/wp-includes/class-wp-autoload.php
aristath Feb 7, 2024
e75e265
Update src/wp-includes/class-wp-autoload.php
aristath Feb 7, 2024
5c806e0
Merge branch 'trunk' into autoload
aristath Feb 7, 2024
f0106f3
Add new classes to the autoloader
aristath Feb 7, 2024
4d1a977
Revert previous change
aristath Feb 7, 2024
550bc5e
Add back the type
aristath Feb 7, 2024
d3e8303
Merge branch 'trunk' into autoload
aristath Feb 8, 2024
028d9a1
Merge branch 'trunk' into autoload
aristath Feb 8, 2024
7fa3a8f
Add new classes to the autoloader
aristath Feb 8, 2024
cbc39c5
Merge branch 'trunk' into autoload
aristath Feb 13, 2024
c601018
Merge branch 'trunk' into autoload
aristath Feb 16, 2024
cc4d72e
Merge branch 'trunk' into autoload
aristath Mar 13, 2024
9b81b58
Merge branch 'trunk' into autoload
aristath Mar 13, 2024
f98b101
no need to require the class
aristath Mar 13, 2024
96b08cf
Merge branch 'trunk' into autoload
aristath Mar 13, 2024
cbb61c1
Merge branch 'trunk' into autoload
aristath Mar 13, 2024
f4aa7b4
Merge branch 'trunk' into autoload
aristath Mar 13, 2024
e503d43
Merge branch 'trunk' into autoload
aristath Mar 13, 2024
a44145f
Merge branch 'trunk' into autoload
aristath Mar 21, 2024
992086a
Merge branch 'trunk' into autoload
aristath Mar 26, 2024
aaba7b5
Merge branch 'trunk' into autoload
aristath Apr 2, 2024
e5e94d1
Merge branch 'trunk' into autoload
aristath Apr 3, 2024
b0620d3
Merge branch 'trunk' into autoload
aristath Apr 4, 2024
2311749
Merge branch 'trunk' into autoload
aristath Apr 8, 2024
a64d90a
Use data providers for the PHPUnit tests
aristath Apr 9, 2024
8ea4dad
Merge branch 'trunk' into autoload
aristath Apr 9, 2024
d364fc0
Merge branch 'trunk' into autoload
aristath Apr 17, 2024
1645848
Merge branch 'trunk' into autoload
aristath Apr 18, 2024
393acc5
Add a check for overriden Core classes
aristath Apr 22, 2024
59d76c0
Merge branch 'trunk' into autoload
aristath Apr 22, 2024
8cc3731
Merge branch 'trunk' into autoload
aristath Apr 24, 2024
df81cf6
Merge branch 'trunk' into autoload
aristath Apr 25, 2024
e7f21cb
Merge branch 'trunk' into autoload
aristath Apr 30, 2024
ca99575
Merge branch 'trunk' into autoload
aristath May 8, 2024
5d10ef5
Merge branch 'trunk' into autoload
aristath May 9, 2024
5aaf8cc
Merge branch 'trunk' into autoload
aristath May 14, 2024
32f7c7c
Merge branch 'trunk' into autoload
aristath May 15, 2024
3f38052
Merge branch 'trunk' into autoload
aristath May 16, 2024
25851ef
Merge branch 'trunk' into autoload
aristath May 17, 2024
59e878e
Merge branch 'trunk' into autoload
aristath Jun 5, 2024
8a7f037
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
4df7a9e
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
a4276a7
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
c14af69
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
67badb6
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
fea3685
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
5961c64
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
6e5df39
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
80bf9f2
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
53b5f7b
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
ebaf97f
Merge branch 'trunk' into autoload
aristath Jun 19, 2024
0a6687b
Merge branch 'trunk' into autoload
aristath Jun 20, 2024
8855e6d
Merge branch 'trunk' into autoload
aristath Jun 24, 2024
d078a48
Merge branch 'trunk' into autoload
aristath Jun 25, 2024
982f563
Merge branch 'trunk' into autoload
aristath Jun 27, 2024
6c57ef8
Merge branch 'trunk' into autoload
aristath Jul 2, 2024
6020065
Merge branch 'trunk' into autoload
aristath Jul 8, 2024
668a7af
Merge branch 'trunk' into autoload
aristath Jul 9, 2024
5ac6b6d
remove another require_once call
aristath Jul 9, 2024
d2b56dd
Merge branch 'trunk' into autoload
aristath Jul 12, 2024
4c1d503
Merge branch 'trunk' into autoload
aristath Jul 15, 2024
8fbc046
Merge branch 'trunk' into autoload
aristath Jul 16, 2024
72d2371
Merge branch 'trunk' into autoload
aristath Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
define( 'ABSPATH', __DIR__ . '/' );
}

if ( ! defined( 'WPINC' ) ) {
define( 'WPINC', 'wp-includes' );
}

require_once ABSPATH . WPINC . '/class-wp-autoload.php';

aristath marked this conversation as resolved.
Show resolved Hide resolved
/*
* Load the actual index.php file if the assets were already built.
* Note: WPINC is not defined yet, it is defined later in wp-settings.php.
*/
if ( file_exists( ABSPATH . 'wp-includes/js/dist/edit-post.js' ) ) {
require_once ABSPATH . '_index.php';
return;
}

define( 'WPINC', 'wp-includes' );
require_once ABSPATH . WPINC . '/version.php';
require_once ABSPATH . WPINC . '/compat.php';
require_once ABSPATH . WPINC . '/load.php';
Expand Down
3 changes: 0 additions & 3 deletions src/wp-admin/custom-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@
*/

_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-background.php' );

/** Custom_Background class */
require_once ABSPATH . 'wp-admin/includes/class-custom-background.php';
3 changes: 0 additions & 3 deletions src/wp-admin/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@
*/

_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-image-header.php' );

/** Custom_Image_Header class */
require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
15 changes: 0 additions & 15 deletions src/wp-admin/includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
/** WordPress Misc Administration API */
require_once ABSPATH . 'wp-admin/includes/misc.php';

/** WordPress Misc Administration API */
require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';

/** WordPress Options Administration API */
require_once ABSPATH . 'wp-admin/includes/options.php';

Expand All @@ -55,7 +52,6 @@
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';

/** WordPress Taxonomy Administration API */
Expand All @@ -65,8 +61,6 @@
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';

/** WordPress Theme Administration API */
Expand All @@ -75,18 +69,9 @@
/** WordPress Privacy Functions */
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';

/** WordPress User Administration API */
require_once ABSPATH . 'wp-admin/includes/user.php';

/** WordPress Site Icon API */
require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';

/** WordPress Update Administration API */
require_once ABSPATH . 'wp-admin/includes/update.php';

Expand Down
29 changes: 0 additions & 29 deletions src/wp-admin/includes/ajax-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ 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';

check_ajax_referer( 'community_events' );

$search = isset( $_POST['location'] ) ? wp_unslash( $_POST['location'] ) : '';
Expand Down Expand Up @@ -1931,10 +1929,6 @@ 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';
}

$results = _WP_Editors::wp_link_query( $args );

if ( ! isset( $results ) ) {
Expand Down Expand Up @@ -4020,7 +4014,6 @@ function wp_ajax_crop_image() {

switch ( $context ) {
case 'site-icon':
require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php';
$wp_site_icon = new WP_Site_Icon();

// Skip creating a new attachment if the attachment is a Site Icon.
Expand Down Expand Up @@ -4208,7 +4201,6 @@ function wp_ajax_install_theme() {
wp_send_json_error( $status );
}

require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
require_once ABSPATH . 'wp-admin/includes/theme.php';

$api = themes_api(
Expand Down Expand Up @@ -4340,8 +4332,6 @@ function wp_ajax_update_theme() {
$status['oldVersion'] = $theme->get( 'Version' );
}

require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';

$current = get_site_transient( 'update_themes' );
if ( empty( $current ) ) {
wp_update_themes();
Expand Down Expand Up @@ -4501,7 +4491,6 @@ function wp_ajax_install_plugin() {
wp_send_json_error( $status );
}

require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';

$api = plugins_api(
Expand Down Expand Up @@ -4623,8 +4612,6 @@ function wp_ajax_update_plugin() {
$status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
}

require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';

wp_update_plugins();

$skin = new WP_Ajax_Upgrader_Skin();
Expand Down Expand Up @@ -5350,10 +5337,6 @@ function wp_ajax_health_check_dotorg_communication() {
wp_send_json_error();
}

if ( ! class_exists( 'WP_Site_Health' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}

$site_health = WP_Site_Health::get_instance();
wp_send_json_success( $site_health->get_test_dotorg_communication() );
}
Expand Down Expand Up @@ -5383,10 +5366,6 @@ function wp_ajax_health_check_background_updates() {
wp_send_json_error();
}

if ( ! class_exists( 'WP_Site_Health' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}

$site_health = WP_Site_Health::get_instance();
wp_send_json_success( $site_health->get_test_background_updates() );
}
Expand Down Expand Up @@ -5416,10 +5395,6 @@ function wp_ajax_health_check_loopback_requests() {
wp_send_json_error();
}

if ( ! class_exists( 'WP_Site_Health' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}

$site_health = WP_Site_Health::get_instance();
wp_send_json_success( $site_health->get_test_loopback_requests() );
}
Expand Down Expand Up @@ -5466,10 +5441,6 @@ function wp_ajax_health_check_get_sizes() {
wp_send_json_error();
}

if ( ! class_exists( 'WP_Debug_Data' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php';
}

$sizes_data = WP_Debug_Data::get_sizes();
$all_sizes = array( 'raw' => 0 );

Expand Down
2 changes: 0 additions & 2 deletions src/wp-admin/includes/class-ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,6 @@ function PopError(){
$mod_sockets = extension_loaded( 'sockets' );
}

require_once __DIR__ . "/class-ftp-" . ( $mod_sockets ? "sockets" : "pure" ) . ".php";

if ( $mod_sockets ) {
class ftp extends ftp_sockets {}
} else {
Expand Down
5 changes: 0 additions & 5 deletions src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ public function __construct( $opt = '' ) {
$this->method = 'ftpsockets';
$this->errors = new WP_Error();

// Check if possible to use ftp functions.
if ( ! require_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) {
return;
}

$this->ftp = new ftp();

if ( empty( $opt['port'] ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
* @since 4.9.6
*/

if ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php';
}

/**
* WP_Privacy_Data_Export_Requests_Table class.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
* @since 4.9.6
*/

if ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php';
}

/**
* WP_Privacy_Data_Removal_Requests_List_Table class.
*
Expand Down
13 changes: 0 additions & 13 deletions src/wp-admin/includes/class-wp-site-health-auto-updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@

#[AllowDynamicProperties]
class WP_Site_Health_Auto_Updates {
/**
* WP_Site_Health_Auto_Updates constructor.
*
* @since 5.2.0
*/
public function __construct() {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
}


/**
* Runs tests to determine if auto-updates can run.
Expand Down Expand Up @@ -135,10 +126,6 @@ public function test_filters_automatic_updater_disabled() {
* @return array|false The test results. False if auto-updates are enabled.
*/
public function test_wp_automatic_updates_disabled() {
if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
}

$auto_updates = new WP_Automatic_Updater();

if ( ! $auto_updates->is_disabled() ) {
Expand Down
4 changes: 0 additions & 4 deletions src/wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -1832,10 +1832,6 @@ public function get_test_background_updates() {
'test' => 'background_updates',
);

if ( ! class_exists( 'WP_Site_Health_Auto_Updates' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health-auto-updates.php';
}

/*
* Run the auto-update tests in a separate class,
* as there are many considerations to be made.
Expand Down
33 changes: 0 additions & 33 deletions src/wp-admin/includes/class-wp-upgrader-skins.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,3 @@
*/

_deprecated_file( basename( __FILE__ ), '4.7.0', 'class-wp-upgrader.php' );

/** WP_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';

/** Plugin_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';

/** Theme_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';

/** Bulk_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';

/** Bulk_Plugin_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';

/** Bulk_Theme_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';

/** Plugin_Installer_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';

/** Theme_Installer_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';

/** Language_Pack_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';

/** Automatic_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';

/** WP_Ajax_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
51 changes: 0 additions & 51 deletions src/wp-admin/includes/class-wp-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,6 @@
* @since 2.8.0
*/

/** WP_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';

/** Plugin_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';

/** Theme_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';

/** Bulk_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';

/** Bulk_Plugin_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';

/** Bulk_Theme_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';

/** Plugin_Installer_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';

/** Theme_Installer_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';

/** Language_Pack_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';

/** Automatic_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';

/** WP_Ajax_Upgrader_Skin class */
require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';

/**
* Core class used for upgrading/installing a local set of files via
* the Filesystem Abstraction classes from a Zip file.
Expand Down Expand Up @@ -1216,21 +1183,3 @@ public function delete_temp_backup() {
return $errors->has_errors() ? $errors : true;
}
}

/** Plugin_Upgrader class */
require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';

/** Theme_Upgrader class */
require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader.php';

/** Language_Pack_Upgrader class */
require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader.php';

/** Core_Upgrader class */
require_once ABSPATH . 'wp-admin/includes/class-core-upgrader.php';

/** File_Upload_Upgrader class */
require_once ABSPATH . 'wp-admin/includes/class-file-upload-upgrader.php';

/** WP_Automatic_Updater class */
require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
3 changes: 0 additions & 3 deletions src/wp-admin/includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ function wp_dashboard_setup() {

// Site Health.
if ( current_user_can( 'view_site_health_checks' ) && ! is_network_admin() ) {
if ( ! class_exists( 'WP_Site_Health' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}

WP_Site_Health::get_instance();

Expand Down
Loading
Loading