Skip to content

Use wp_filesize instead of filesize if available #344

@felixarntz

Description

@felixarntz

WordPress 6.0 introduced the wp_filesize() function which should be used in favor of PHP's filesize() going forward. We should use it in this plugin where available.

Since we currently support WordPress 5.8 and 5.9 as well, it's probably not worth bumping up the requirement just for that. I suggest we instead create a backward compatibility layer. Maybe the easiest approach would be to implement a "polyfill", where we re-implement wp_filesize() in the main plugin file if the function does not exist (yet).

We can then update all module code that calls filesize() to instead unconditionally call wp_filesize().

Metadata

Metadata

Assignees

Labels

Good First IssueIssue particularly suitable to be worked on by new contributorsInfrastructureIssues for the overall performance plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions