Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
321 commits
Select commit Hold shift + click to select a range
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
cf355f0
Merge branch 'trunk' into autoload
aristath Jul 22, 2024
87fb7b6
Merge branch 'trunk' into autoload
aristath Jul 24, 2024
6fee23f
Merge branch 'trunk' into autoload
aristath Jul 26, 2024
8bfc64e
Merge branch 'trunk' into autoload
aristath Jul 29, 2024
4694360
Update src/wp-admin/includes/class-wp-site-health.php
aristath Jul 30, 2024
536d703
Update src/index.php
aristath Jul 30, 2024
14843e7
Merge branch 'trunk' into autoload
aristath Jul 30, 2024
fbc90ef
Add comment in plugin.php explaining the inclusion of the autoloader
aristath Jul 30, 2024
f8d0bf8
Update src/wp-includes/class-wp-autoload.php
aristath Jul 31, 2024
88bed17
Update src/wp-includes/class-wp-autoload.php
aristath Jul 31, 2024
deaae87
Update src/wp-includes/class-wp-autoload.php
aristath Jul 31, 2024
3c2ad1d
Update src/wp-admin/includes/class-wp-site-health.php
aristath Jul 31, 2024
31b7939
Update src/wp-admin/includes/update-core.php
aristath Jul 31, 2024
bed770e
Update src/wp-admin/includes/class-wp-site-health.php
aristath Jul 31, 2024
85a3df5
Typo (overriden -> overridden)
aristath Jul 31, 2024
829dd9b
Merge branch 'trunk' into autoload
aristath Jul 31, 2024
9d3ed0a
Test that `class-*` files exist in the classMap. Props @peterwilsoncc
aristath Jul 31, 2024
a9598ad
Update src/wp-settings.php
aristath Jul 31, 2024
e90d3a1
Update src/wp-includes/plugin.php
aristath Jul 31, 2024
73fe7e7
Cleanup
aristath Jul 31, 2024
5168218
Nitpick
aristath Jul 31, 2024
54ac453
Improve the tests
aristath Aug 1, 2024
bdbbabc
Improve data providers in tests
aristath Aug 1, 2024
cd079bd
Update tests/phpunit/tests/autoloader-classmap.php
aristath Aug 1, 2024
3ff323f
Fix docs language
aristath Aug 1, 2024
82c8531
Update src/wp-includes/class-wp-autoload.php
aristath Aug 1, 2024
6808f2b
Improve docs language
aristath Aug 1, 2024
76293de
Add `since` in class members
aristath Aug 1, 2024
262b110
Update src/wp-admin/includes/class-wp-site-health.php
aristath Aug 1, 2024
4c07440
Add missing `tr` closing tag
aristath Aug 1, 2024
040e3f2
Merge branch 'autoload' of https://github.com/aristath/wordpress-deve…
aristath Aug 1, 2024
c663dff
Merge branch 'trunk' into autoload
aristath Aug 1, 2024
a53256c
Update src/wp-admin/includes/class-wp-site-health.php
aristath Aug 1, 2024
dad3023
Update src/wp-includes/class-wp-autoload.php
aristath Aug 1, 2024
656690b
Fix comment styles
aristath Aug 1, 2024
8b741ce
Remove `return void` annotations
aristath Aug 1, 2024
e28567e
Fix comment styles
aristath Aug 1, 2024
0934844
Method doesn't need to be static
aristath Aug 1, 2024
3b7ca69
Add @covers annotation
aristath Aug 1, 2024
282387b
Remove duplicate check
aristath Aug 1, 2024
0372798
Use WP_INC
aristath Aug 2, 2024
2f0b1f7
Merge branch 'trunk' into autoload
aristath Aug 2, 2024
b63ce76
a bit more verbose
aristath Aug 2, 2024
5ca7e36
Use WP_INC again :shrug:
aristath Aug 2, 2024
811470d
Merge branch 'trunk' into autoload
aristath Aug 5, 2024
2bbc328
Merge branch 'trunk' into autoload
aristath Aug 7, 2024
16fe142
Merge branch 'trunk' into autoload
aristath Aug 9, 2024
eec637b
Merge branch 'trunk' into autoload
aristath Aug 21, 2024
fa69f69
Merge branch 'trunk' into autoload
aristath Sep 6, 2024
f85236d
Merge branch 'trunk' into autoload
aristath Sep 6, 2024
c014fd6
Add WP_HTML_Doctype_Info class to the autoloader
aristath Sep 6, 2024
7d97e22
Merge branch 'trunk' into autoload
aristath Sep 6, 2024
423eb74
Merge branch 'trunk' into autoload
aristath Sep 26, 2024
855ace3
Merge branch 'trunk' into autoload
aristath Sep 26, 2024
5ac7dfc
Merge branch 'trunk' into autoload
aristath Sep 26, 2024
9356648
Merge branch 'trunk' into autoload
aristath Sep 26, 2024
7ab16a4
Add WP_Block_Templates_Registry to autoloader
aristath Sep 26, 2024
1a326a9
Merge branch 'trunk' into autoload
aristath Sep 26, 2024
637ab9c
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
54f55fb
Remove explicit Text_Exception test include
aristath Jun 8, 2026
ea70ed5
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
0999909
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
8eb2e03
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
e63ad16
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
d36e81c
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
f9c7bea
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
429b565
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
e87f907
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
011e089
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
45e194e
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
2157d66
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
77b5556
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
9b23e90
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
d066fa7
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
9fb8964
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
0b1b710
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
efeda40
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
afe704a
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
eb4520e
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
2f3fb20
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
c867d28
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
c30932b
Add WP_PHPMailer to the class map
aristath Jun 8, 2026
704751d
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
ecb21e6
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
27c86d8
Remove PasswordHash test include
aristath Jun 8, 2026
b3b3ecf
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
b2b33e2
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
02eca1f
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
8ff10aa
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
8bfb96a
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
afc9e91
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
4efcb57
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
d63c862
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
1d12c3e
Remove phpass test includes
aristath Jun 8, 2026
eb01ffd
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
5ef2a46
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
faedf1a
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
a299754
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
0eccad7
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
cd258bb
Merge branch 'wp-trunk-current' into autoload
aristath Jun 8, 2026
f79ffd9
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
f5c4495
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
ce2a7d9
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
7120806
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
8629025
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
67564db
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
9a7d3c3
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
5e449b3
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
de3beb3
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
7dcc783
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
a00e379
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
7468514
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
12ada4a
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
dbb0764
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
6e9d011
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
9a8f882
Update autoloader classmap test for interfaces
aristath Jun 9, 2026
fbbb667
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
1e18804
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
c57ffb4
Merge branch 'wp-trunk-current' into autoload
aristath Jun 9, 2026
18b4beb
Merge branch 'trunk' into autoload
aristath Jun 9, 2026
aad16ed
fix for updates
aristath Jun 9, 2026
a89b5e5
Address CoPilot review findings
aristath Jun 9, 2026
a21701b
Remove simplepie from the autoloader - already lazy-loaded
aristath Jun 9, 2026
d91e232
obviously....
aristath Jun 9, 2026
0555450
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
1d5391e
Add WP_Email_Address to the autoloader
aristath Jun 19, 2026
1bf6474
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
aa6d1bf
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
22c5bdf
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
b757ca7
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
0475def
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
a2b930b
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
eaf2e80
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
d994ca7
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
0495d2e
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
76c92cf
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
4848005
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
0a48af4
Merge branch 'wp-trunk-current' into autoload
aristath Jun 19, 2026
d7f92fa
Merge branch 'wp-trunk-current' into autoload
aristath Jun 22, 2026
21f289f
Merge branch 'wp-trunk-current' into autoload
aristath Jun 22, 2026
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
10 changes: 7 additions & 3 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';

Comment thread
aristath marked this conversation as 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/jquery/jquery.js' ) && is_dir( ABSPATH . 'wp-includes/build' ) ) {
if ( file_exists( ABSPATH . WPINC . '/js/jquery/jquery.js' ) && is_dir( ABSPATH . WPINC . '/build' ) ) {
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 @@ -15,6 +15,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 @@ -15,6 +15,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 @@ -1944,10 +1942,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 @@ -4035,7 +4029,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 @@ -4186,7 +4179,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 @@ -4318,8 +4310,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 @@ -4479,7 +4469,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 @@ -4651,8 +4640,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 @@ -5380,10 +5367,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 @@ -5413,10 +5396,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 @@ -5446,10 +5425,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 @@ -5496,10 +5471,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 @@ -913,8 +913,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 @@ -144,10 +135,6 @@ public function test_filters_automatic_updater_disabled() {
* @return array|false The test results if auto-updates are disabled, false otherwise.
*/
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
98 changes: 94 additions & 4 deletions src/wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -1753,10 +1753,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 Expand Up @@ -2386,6 +2382,94 @@ public function get_test_file_uploads() {
return $result;
}

/**
* Tests if any of the WordPress Core classes are overridden.
*
* @since 6.6.0
*
* @return array
*/
public static function get_test_core_classes_paths() {
$overridden_classes = array();
/*
* Bypass check for WP_Object_Cache.
*
* It is intended that persistent caching plugins replace the core version
* of WP_Object_Cache with their own version so it shouldn't be reported
* as an error in site health.
*/
$wp_core_classes = WP_Autoload::CLASSES_PATHS;
unset( $wp_core_classes['wp_object_cache'] );
foreach ( $wp_core_classes as $class_name => $class_path ) {
$default_path = wp_normalize_path( ABSPATH . $class_path );

/*
* Skip classes that cannot be loaded. A class that is missing or
* otherwise not loadable should not be reported as overridden, and
* must not be allowed to fatal this test.
*/
if ( ! class_exists( $class_name ) ) {
continue;
}

/*
* Init a Reflection class to get the real path of the class.
* This is performed inside an output buffer to avoid any errors
* that might be thrown by the ReflectionClass constructor.
*/
try {
ob_start();
$reflection = new \ReflectionClass( $class_name );
ob_end_clean();
} catch ( \ReflectionException $e ) {
ob_end_clean();
continue;
}

// Normalize both paths so symlinks and directory separators do not cause false positives.
$reflection_path = wp_normalize_path( $reflection->getFileName() );

if ( $default_path !== $reflection_path ) {
$overridden_classes[ $reflection->getName() ] = $reflection->getFileName();
}
}

$result = array(
'label' => __( 'All WordPress Core classes can be properly loaded' ),
'status' => 'good',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'Plugins and Themes should not override the default WordPress Core classes, as that might lead to unexpected side-effects on your site.' )
),
'actions' => '',
'test' => 'core_classes_paths',
);

if ( ! empty( $overridden_classes ) ) {
$result['status'] = 'critical';
$result['label'] = __( 'WordPress Core classes are being overridden' );
$result['description'] .= sprintf(
'<p>%s</p>',
__( 'The following WordPress Core classes are being overridden:' )
);

$result['description'] .= '<table class="widefat striped health-check-table">';
foreach ( $overridden_classes as $class_name => $class_path ) {
$result['description'] .= '<tr>';
Comment thread
aristath marked this conversation as resolved.
$result['description'] .= '<th><code>' . esc_html( $class_name ) . '</code></th>';
$result['description'] .= '<td><code>' . esc_html( $class_path ) . '</code></td>';
$result['description'] .= '</tr>';
}
$result['description'] .= '</table>';
}

return $result;
}

/**
* Tests if the Authorization header has the expected values.
*
Expand Down Expand Up @@ -3002,6 +3086,12 @@ public static function get_tests() {
);
}

// Check for Core classes being overridden.
$tests['direct']['core_classes_paths'] = array(
'label' => __( 'Core classes paths' ),
'test' => 'core_classes_paths',
);

/**
* Filters which site status tests are run on a site.
*
Expand Down
Loading
Loading