Skip to content

Use wp_filesize instead of filesize if available #344

Closed

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().

Activity

  1. added
    [Type] EnhancementA suggestion for improvement of an existing feature
    Needs DevAnything that requires development (e.g. a pull request)
    Good First IssueIssue particularly suitable to be worked on by new contributors
    on Jun 1, 2022
  2. added this to the 1.2.0 milestone on Jun 1, 2022
  3. added
    InfrastructureIssues for the overall performance plugin infrastructure
    on Jun 13, 2022
  4. removed
    Needs DevAnything that requires development (e.g. a pull request)
    on Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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