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 #6760: E_ERROR in 3.16.2: Argument #1 ($microseconds) must be of type int. In line 164 of PreloadUrl.php #6766

Merged

Conversation

jeawhanlee
Copy link
Contributor

Description

Fixes #6760

Documentation

User documentation

Fixes error thrown about unexpected argument type parsed.

Technical documentation

Guards the filter value from unexpected type other than int

Type of change

  • Bug fix (non-breaking change which fixes an issue).

New dependencies

None

Risks

None

Checklists

Feature validation

  • I validated all the Acceptance Criteria. If possible, provide sreenshots 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.

Documentation

  • I prepared the user documentation for the feature/enhancement and shared it in the PR or the GitHub issue.
  • The user documentation covers new/changed entry points (endpoints, WP hooks, configuration files, ...).
  • I prepared the technical documentation if needed, and shared it in the PR or the GitHub issue.

Code style

  • I wrote self-explanatory code about what it does.
  • I wrote comments to explain why it does it.
  • I named variables and functions explicitely.
  • I protected entry points against unexpected inputs.
  • I did not introduce unecessary complexity.
  • I listed the introduced external dependencies explicitely on the PR.
  • I validated the repo-specific guidelines from CONTRIBUTING.md.

Observability

  • I handled errors when needed.
  •  I wrote user-facing messages that are understandable and provide actionable feedbacks.
  • I prepared ways to observe the implemented system (logs, data, etc.).

Risks

  •  I explicitely mentioned performance risks in the PR.
  • I explicitely mentioned security risks in the PR.

@jeawhanlee jeawhanlee added the type: bug Indicates an unexpected problem or unintended behavior label Jul 8, 2024
@jeawhanlee jeawhanlee self-assigned this Jul 8, 2024
Copy link

codacy-production bot commented Jul 8, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 45ac1fd1 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (45ac1fd) Report Missing Report Missing Report Missing
Head commit (25ed769) 37362 14544 38.93%

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 (#6766) 5 5 100.00%

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


🚀 Don’t miss a bit, follow what’s new on Codacy.

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
Copy link
Contributor Author

I have proactively tested this filter with the steps below to show that the fatal error is no more thrown:

  • Use snippet:
    add_filter( 'rocket_preload_delay_between_requests', function() {
        return 5.2;
    } );
    
  • Activate WP Rocket or Clear cache and Preload

@jeawhanlee jeawhanlee marked this pull request as ready for review July 8, 2024 09:45
@MathieuLamiot
Copy link
Contributor

Nice! Thanks @jeawhanlee
It could be good to have a unit or integration test for the filter safeguard 🤔 WDYT?
image

@jeawhanlee jeawhanlee requested a review from a team July 8, 2024 09:49
Copy link
Contributor

@Khadreal Khadreal left a comment

Choose a reason for hiding this comment

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

LGTM other than the test missing as mentioned by @MathieuLamiot

@jeawhanlee jeawhanlee changed the title Fix/6760 error expected argument int float parsed Closes #6760: E_ERROR in 3.16.2: Argument #1 ($microseconds) must be of type int. In line 164 of PreloadUrl.php Jul 8, 2024
@jeawhanlee jeawhanlee added this pull request to the merge queue Jul 8, 2024
Merged via the queue into develop with commit 3734e33 Jul 8, 2024
13 checks passed
@jeawhanlee jeawhanlee deleted the fix/6760-error-expected-argument-int-float-parsed branch July 8, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E_ERROR in 3.16.2: Argument #1 ($microseconds) must be of type int. In line 164 of PreloadUrl.php
5 participants