Skip to content

Remove unused is_domain_loopback helper - #1437

Merged
SteveJonesDev merged 5 commits into
developfrom
copilot/cache-domain-loopback-check
Jul 14, 2026
Merged

Remove unused is_domain_loopback helper#1437
SteveJonesDev merged 5 commits into
developfrom
copilot/cache-domain-loopback-check

Conversation

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

`Helpers::is_domain_loopback()` had no production call sites — it existed only alongside its own test file. Rather than cache the DNS lookup, the function and its tests are removed entirely.

Changes

  • Deleted is_domain_loopback() from admin/class-helpers.php
  • Deleted tests/phpunit/Admin/HelpersLoopbackTest.php
Original prompt

This section details on the original issue you should resolve

<issue_title>Look into if we can cache the is_domain_loopback check to avoid DNS lookup on each page scan</issue_title>
<issue_description>We check if we are using a loopback connection when scanning pages. In some situations, like with the pro plugin, we can scan the same domain for many pages fairly quickly. If we can avoid having to look up the domain each time, that would be good. We can perhaps, but it is a short-lived transient.</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add caching for is_domain_loopback check to reduce DNS lookups Cache is_domain_loopback DNS result in a short-lived transient Feb 20, 2026
Copilot AI requested a review from pattonwebz February 20, 2026 17:19
Copilot AI changed the title Cache is_domain_loopback DNS result in a short-lived transient Remove unused is_domain_loopback helper Feb 20, 2026
@pattonwebz

Copy link
Copy Markdown
Member

This is a good code cleanup, we should get this into the next release (1.40.0)

@pattonwebz
pattonwebz marked this pull request as ready for review March 17, 2026 16:49
Copilot AI review requested due to automatic review settings March 17, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes an unused loopback-domain helper from the admin Helpers utility and deletes the now-orphaned PHPUnit test that only exercised that helper.

Changes:

  • Removed EDAC\Admin\Helpers::is_domain_loopback() from admin/class-helpers.php.
  • Deleted tests/phpunit/Admin/HelpersLoopbackTest.php.
  • Updated package-lock.json (lockfile metadata churn).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
admin/class-helpers.php Deletes the unused loopback helper method.
tests/phpunit/Admin/HelpersLoopbackTest.php Removes the PHPUnit test class that only covered the deleted helper.
package-lock.json Contains lockfile-only changes unrelated to the helper/test removal.

@SteveJonesDev

Copy link
Copy Markdown
Member

Hey @pattonwebz — I checked the pro plugin to verify Copilot's finding before this gets reviewed.

Result: safe to merge.

is_domain_loopback() has no callers in the pro plugin either (grepped the full accessibility-checker-pro repo, zero results). Combined with no production call sites in the free plugin, this function is genuinely dead code. Removing it is the right call.

A couple of things to double-check before requesting human review:

  • The package-lock.json diff is unrelated lockfile churn — worth confirming that's expected or squashing it out to keep the PR clean.
  • Confirm no other plugins/extensions outside of pro call this function.

Linear: https://linear.app/equalize-digital/issue/PRO-594

Copilot AI and others added 3 commits June 1, 2026 10:20
Co-authored-by: pattonwebz <3902039+pattonwebz@users.noreply.github.com>
Co-authored-by: pattonwebz <3902039+pattonwebz@users.noreply.github.com>
…callers

Co-authored-by: pattonwebz <3902039+pattonwebz@users.noreply.github.com>
@SteveJonesDev
SteveJonesDev force-pushed the copilot/cache-domain-loopback-check branch from 5e30ebb to b757770 Compare June 1, 2026 14:21
@SteveJonesDev

Copy link
Copy Markdown
Member

@pattonwebz, I fixed the lock file issue and merged in develop. Please review and if it looks good, merge it in.

@SteveJonesDev
SteveJonesDev merged commit 2e5e557 into develop Jul 14, 2026
18 checks passed
@pattonwebz pattonwebz mentioned this pull request Jul 14, 2026
9 tasks
@github-actions github-actions Bot mentioned this pull request Jul 14, 2026
9 tasks
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.

Look into if we can cache the is_domain_loopback check to avoid DNS lookup on each page scan

4 participants