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-includesdirectory andwp-admin/includes/update_core.phpfile 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-includesdirectory.
- Note: It's not just
- Zip the wordpress directory to
wordpress-with-requests-2.zipand 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/Requestsshould 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.' );
}
To test auto updates, the following changes can be applied to the plugin above:
$fake_update->responsefromupgradetoautoupdate:6.1.1(you could also use6.1.2or something similar):To run auto updates,
wp_version_check()can be triggered in cron (e.g. using WP Crontrol). Theoption_auto_updater.lockfilter above allows updates to be manually triggered every minute.