Skip to content

performance improvement in Abstract_File_Check::get_files() #695

@pbiron

Description

@pbiron

Abstract_File_Check::get_files() has a call to $directories_to_ignore = Plugin_Request_Utility::get_directories_to_ignore(); inside the loop over all files in the plugin being checked.

I think that call should be moved outside the loop, but am wondering whether there was a specific reason it was included within the loop.
Plugin_Request_Utility::get_directories_to_ignore() does apply_filters( 'wp_plugin_check_ignore_directories' ) so, theoretically, it could return different values each time through the loop. But I think that is extremely unlikely and that moving the call outside the loop could improve performance for plugins that contain a lot of files.

Happy to do a PR if consensus is that it should be moved outside the loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature is broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions