Skip to content

Remove unneeded URL validation - #1011

Merged
dkotter merged 5 commits into
WordPress:developfrom
dkotter:remove/ip-range-list
Sep 14, 2026
Merged

dkotter merged 5 commits into
WordPress:developfrom
dkotter:remove/ip-range-list

Conversation

@dkotter

@dkotter dkotter commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

What?

Remove some URL validation code that is no longer needed as we can rely on changes introduced in WP 7.0.3

Why?

We recently updated the validation we run on URLs when someone passes an image URL into our Alt Text Generation Ability. Some of the validation introduced there is no longer needed as WordPress added the same changes in v7.0.3 so this PR simplifies things a bit to rely on Core as much as possible.

How?

  • Rely more on wp_http_validate_url and remove code that we no longer need
  • Bump our minimum WordPress version to 7.0.3 which is where those additional fixes were added
  • Remove some IPv6 checks that were dead code

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5
Used for: Evaluating our current code against WordPress Core to determine what could be cleaned up. All changes tested and reviewed by me

Testing Instructions

Ensure the Alt Text Generation feature still works as expected.

If desired, directly invoke the Alt Text Generation Ability with a custom image_url passed in to ensure that works

Changelog Entry

Changed - Bump our minimum WordPress version to 7.0.3.
Removed - Unnecessary URL validation that is now handled by WordPress core.

Open WordPress Playground Preview

… duplicating some functionality. Remove some IPv6 checks that were never actually run
@dkotter dkotter added this to the 1.4.0 milestone Sep 8, 2026
@dkotter dkotter self-assigned this Sep 8, 2026
@dkotter
dkotter requested a review from a team September 8, 2026 15:56
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: justlevine <justlevine@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.47%. Comparing base (eca57d2) to head (286dd11).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1011      +/-   ##
=============================================
- Coverage      81.50%   81.47%   -0.04%     
+ Complexity      2923     2907      -16     
=============================================
  Files            122      122              
  Lines          11653    11638      -15     
=============================================
- Hits            9498     9482      -16     
- Misses          2155     2156       +1     
Flag Coverage Δ
unit 81.47% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkotter
dkotter requested a review from jeffpaul as a code owner September 8, 2026 19:14
@dkotter

dkotter commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Note there's currently an issue in wp-env where the PHP package it loads for PHP 7.4 and 8.0 has been shutdown and so any environment that uses those versions won't start up. This causes 6 failing workflows here (and on all other PRs). Ideally this is fixed upstream in Gutenberg but in the meantime, we could drop PHP 7.4 and 8.0 from our test matrix if we want green tests across the board.

@justlevine

justlevine commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Note there's currently an issue in wp-env where the PHP package it loads for PHP 7.4 and 8.0 has been shutdown and so any environment that uses those versions won't start up. This causes 6 failing workflows here (and on all other PRs). Ideally this is fixed upstream in Gutenberg but in the meantime, we could drop PHP 7.4 and 8.0 from our test matrix if we want green tests across the board.

PS: @dkotter this how @galatanovidiu is handling it in WordPress/mcp-adapter

@dkotter
dkotter merged commit 0095b72 into WordPress:develop Sep 14, 2026
33 checks passed
@dkotter
dkotter deleted the remove/ip-range-list branch September 14, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants