Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes 41: 3.19 preconnect to external domains beacon processing part #43

Conversation

jeawhanlee
Copy link
Contributor

@jeawhanlee jeawhanlee commented Feb 21, 2025

Description

Closes wp-media/wp-rocket#7247

Collates all the external domains on a page.

Type of change

  • New feature (non-breaking change which adds functionality).

Detailed scenario

N/A

Technical description

Documentation

The BeaconPreconnectExternalDomain class is designed to identify and manage external domains referenced in specific HTML elements (like <script>, , etc.) based on a configuration that specifies which elements to consider and which patterns to exclude. It processes these elements to determine if they belong to external domains, logs matched and excluded items, and provides methods to retrieve the results of the matching process. The class utilizes URL parsing and pattern matching to filter out unwanted domains and attributes, ensuring that only relevant external domains are captured.

New dependencies

N/A

Risks

N/A

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Unticked items justification

If some mandatory items are not relevant, explain why in this section.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

Copy link

codacy-production bot commented Feb 21, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for f1737f01 96.53% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f1737f0) Report Missing Report Missing Report Missing
Head commit (4ca2cbc) 1377 1052 76.40%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#43) 173 167 96.53%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@jeawhanlee jeawhanlee linked an issue Feb 21, 2025 that may be closed by this pull request
@jeawhanlee jeawhanlee self-assigned this Feb 21, 2025
@jeawhanlee jeawhanlee linked an issue Feb 21, 2025 that may be closed by this pull request
@jeawhanlee jeawhanlee requested a review from a team February 21, 2025 14:38
@jeawhanlee jeawhanlee merged commit e20092d into feature/3.19-beacons Feb 21, 2025
5 of 6 checks passed
@jeawhanlee jeawhanlee deleted the feature/41-3.19-preconnect-to-external-domains-beacon-processing-part branch February 21, 2025 20:28
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.19 - Preconnect to external domains - Beacon processing part
1 participant