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

Use wp_filesize instead of filesize if available #376

Merged
merged 7 commits into from Jun 15, 2022

Conversation

mehulkaklotar
Copy link
Member

Summary

WordPress 6.0 introduced the wp_filesize() function which should be used in favor of PHP's filesize() going forward.

Fixes #344

Relevant technical choices

This PR changes filesize function to wp_filesize everywhere it was used in the plugin. Code and test cases.

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

@mehulkaklotar mehulkaklotar added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure labels Jun 15, 2022
@mehulkaklotar mehulkaklotar added this to the 1.2.0 milestone Jun 15, 2022
@mehulkaklotar mehulkaklotar self-assigned this Jun 15, 2022
@mehulkaklotar mehulkaklotar added the Needs Review Anything that requires code review label Jun 15, 2022
load.php Outdated Show resolved Hide resolved
Copy link
Member

@mitogh mitogh left a comment

Choose a reason for hiding this comment

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

Small suggestion on the doc block since 6.0 was already released.

Looking good overall.

polyfills.php Outdated Show resolved Hide resolved
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@mehulkaklotar Thank you, that looks solid. Just one tiny documentation follow-up comment.

Co-authored-by: Crisoforo Gaspar Hernández <hello@crisoforo.com>
Copy link
Contributor

@akshitsethi akshitsethi left a comment

Choose a reason for hiding this comment

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

LGTM 💯

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

Great work, thank you @mehulkaklotar!

@felixarntz felixarntz merged commit 2f477ea into trunk Jun 15, 2022
@felixarntz felixarntz deleted the add/wp_filesize-fuction branch June 15, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Issues for the overall performance plugin infrastructure Needs Review Anything that requires code review [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use wp_filesize instead of filesize if available
5 participants