WordPress / WordPress/Requests
Add new class to improving handling of URLs
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 500
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Description
Both the Curl as well as the Fsockopen class contain a format_get() method which build a URL from parts.
These methods are inconsistent and handle the URL building slightly differently.
If I remember correctly, there are also other places in the Requests code where URLs are split/rebuild in various ways.
We should look into creating a class to handle this properly and consistently for all places this kind of functionality is needed in Requests.
That class should make use of the Iri class for splitting URLs and should contain a consistent way to (re)build a URL.
Separating this type of logic out to a separate class will reduce code duplication, reduce technical debt and improve the testability of the logic involved.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the Curl and Fsockopen classes, especially their format_get() methods, and then inspect the Iri class and other places in Requests where URLs are split or rebuilt. Done means URL handling is centralized in a consistent class using Iri, with the duplicated logic removed and the behavior made testable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- networking
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100