Replace abandoned URLResolver library with WordPress HTTP API implementation #1236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
mattwright/urlresolverlibrary is abandoned and throws PHP deprecation notices. Replace with a lightweight implementation using WordPress's native HTTP API.Changes
New
Libraries/PF_URL_Resolver.php: ImplementsresolveURL()->getURL()interface usingwp_remote_head()to manually follow redirects (301, 302, 303, 307, 308)Core/Providers/LibrariesProvider.php: InstantiatePF_URL_Resolverinstead ofURLResolverControllers/HTTPTools.php: Update type hints and remove curl extension check (WordPress HTTP API supports multiple transports)Core/API/MetaCheckEndpoint.php: Remove unused$url_resolverdependencycomposer.json: Removemattwright/urlresolverdependencyImplementation
The new resolver manually tracks the final URL by following redirects rather than relying on WordPress's auto-redirect:
Maintains full backward compatibility with the existing
resolveURL($url)->getURL()interface used inHTTPTools::resolve_a_url().Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/DaveChild/Text-Statistics/zipball/e83d5f82726db80e662ae305fce3b3c41299b4f5/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Fe7ga7 /usr/bin/composer install --no-interaction cal/bin/grep(http block)https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/2d1b63db139c3c6ea0c927698e5160f8b3b8d630/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Fe7ga7 /usr/bin/composer install --no-interaction cal/bin/grep(http block)https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Fe7ga7 /usr/bin/composer install --no-interaction cal/bin/grep(http block)https://api.github.com/repos/firebase/php-jwt/zipball/8f718f4dfc9c5d5f0c994cdfd103921b43592712/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Fe7ga7 /usr/bin/composer install --no-interaction cal/bin/grep(http block)https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Fe7ga7 /usr/bin/composer install --no-interaction cal/bin/grep(http block)https://api.github.com/repos/phpstan/phpstan/zipball/29201e7a743a6ab36f91394eab51889a82631428/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Fe7ga7 /usr/bin/composer install --no-interaction cal/bin/grep(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.