The attached plugin lets you put your own custom WordPress update package in the root folder (aptly named wordpress-with-requests-2.zip
).
Creating a custom package:
- Create a new directory called wordpress.
- Download a fresh copy of 6.1.1 into the wordpress directory.
- Replace the
wp-includes
directory andwp-admin/includes/update_core.php
file with the ones from the PR- Note: It's not just
wp-includes/Requests/
that's changed by the PR, so it's easier to just replace the wholewp-includes
directory.
- Note: It's not just
- Zip the wordpress directory to
wordpress-with-requests-2.zip
and put it in the root directory of your test site.
Testing:
- Navigate to Plugins > Installed plugins and activate Fake WordPress update.
- Navigate to Dashboard > Updates and update the site.
Expected results:
- No errors
wp-includes/Requests
should now have a single folder,src
, containing 17 files, 7 sub-directories (in total: 64 files, 9 folders).- General browsing of the test site, the Site Editor, etc should all work.
If you want, you can add this to line 1575 of the PR's wp-admin/includes/update_core.php
:
if ( str_ends_with( $old_file, 'Exception.php' ) ) {
error_log( class_exists( 'Requests_Exception' ) ? 'Requests_Exception was preloaded.' : 'Requests_Exception was not preloaded.' );
}
Adding a link here to the optional patch for logging when each old interface/class is preloaded. Thanks, @costdev!
Optional logging patch gist: https://gist.github.com/ironprogrammer/35a762d0100a7a01f4eadc37ee6b16cd